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
Enter now at market
open-position with orderType: "MARKET" (default)
Enter at a target price
open-position with orderType: "LIMIT" + limitPrice → Limit 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 / stopLoss → Take-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>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
Related
Resize an open position → Increase, decrease & reverse
Lower your liquidation price → Manage collateral
Last updated
Was this helpful?

