For the complete documentation index, see llms.txt. This page is also available as Markdown.

Open & close positions

Open at market or limit, then close fully or partially.

Prerequisite: a funded, delegated wallet — see Set up & fund a wallet.

Pick your entry

You want to…
Use

Enter now at market

open-position with orderType: "MARKET" (default)

Enter at a target price

open-position with orderType: "LIMIT" + limitPriceLimit orders

See the quote, commit nothing

open-position without owner (returns transactionBase64: null)

Open

curl -X POST $FLASH_API_URL/transaction-builder/open-position -d '{
  "inputTokenSymbol": "USDC", "outputTokenSymbol": "SOL",
  "inputAmountUi": "100.0", "leverage": 5.0, "tradeType": "LONG",
  "owner": "<WALLET>"
}'

Sign, submit to the v2 RPC, confirm. Attach exits in the same call with takeProfit / stopLossTake-profit & stop-loss.

→ Every field: API reference › Trading › Open position

Read the result

The trade response is a quote, not state. Read the position from the basket:

curl $FLASH_API_URL/owner/<WALLET>

Read positions & orders

Close

close-position does both full and partial closes. Set closeAll: true to force a full close regardless of rounding.

API reference › Trading › Close position

Last updated

Was this helpful?