Perpetuals Guide — Using place_order_v3 via Supra CLI
This quick guide explains how to use the supra move tool run command to place a Perps Trade using the place_order_v3 entry function on Dexlyn to perform every type of position action:
✅ Open
✅ Add Collateral
✅ Aggregate (Increase)
✅ Partial Close
✅ Full Close
Background: What place_order_v3 Does
place_order_v3 is the universal function for all Perps order actions on Dexlyn. It handles:
- Opening new positions
- Increasing (adding to) existing positions
- Adding more collateral
- Closing partially
- Closing fully
All actions are controlled using combinations of:
- is_increase
- size_delta
- collateral_delta
- is_market
- is_long
- can_execute_above_price
Command Template
supra move tool run \
--function-id 0xae38541466939b577823389765d966ba206b19be954fc87011fa10dc91e2fe0f::managed_trading::place_order_v3 \
--args \
address:<YOUR_WALLET_ADDRESS> \
u64:<SIZE_DELTA> \
u64:<COLLATERAL_DELTA> \
u64:<PRICE> \
bool:<IS_LONG> \
bool:<IS_INCREASE> \
bool:<IS_MARKET> \
u64:<STOP_LOSS_TRIGGER_PRICE> \
u64:<TAKE_PROFIT_TRIGGER_PRICE> \
bool:<CAN_EXECUTE_ABOVE_PRICE> \
address:0x0 \
--type-args \
0xae38541466939b577823389765d966ba206b19be954fc87011fa10dc91e2fe0f::pair_types::<YOUR_PAIR_TYPE> \
0x4f316ce2960250e7ac1206a07d07b2cbef3897d3cb8c12369d30c08ecd39c61c::tusdc_coin::TUSDC \
--profile <YOUR_SUPRA_CLI_PROFILE_NAME>Explanation of Parameters
Function ID
-
Testnet:
0xae38541466939b577823389765d966ba206b19be954fc87011fa10dc91e2fe0f::managed_trading::place_order_v3 -
Mainnet:
0x215f242bec12c3d66b469668bc48b71e87fc1c7fd8e1764ac773423f0e2ba18b::managed_trading::place_order_v3
Arguments
| Argument | Type | Description |
|---|---|---|
address:<YOUR_WALLET_ADDRESS> | Address | Your wallet address (e.g. 0x6271…878). |
u64:<SIZE_DELTA> | U64 | Position size change in base units. For testnet, 6 decimals (e.g., 485436893 = USD 485.436). For mainnet, 8 decimals (485436893 = USD 4.85436). |
u64:<COLLATERAL_DELTA> | U64 | Collateral change amount in TUSDC base units. 6 decimals for testnet (e.g. 10000000 = USD 10), 8 decimals for mainnet (10000000 = USD 0.1). |
u64:<PRICE> | U64 | Entry price in 10 decimals for both testnet and mainnet (e.g. 1000000000000000 = USD 100000.0000000000). |
bool:<IS_LONG> | Bool | is_long: Set to true for a long trade. Set to false for short. |
bool:<IS_INCREASE> | Bool | is_increase: true to open or increase position; false to close or reduce position. |
bool:<IS_MARKET> | Bool | is_market: true for market orders; false for limit orders. |
u64:<STOP_LOSS_TRIGGER_PRICE> | U64 | Stop loss Trigger price (e.g. 1000000000000000 = USD 100000.0000000000). |
u64:<TAKE_PROFIT_TRIGGER_PRICE> | U64 | Take Profit Trigger Price (e.g. 1000000000000000 = USD 100000.0000000000). |
bool:<CAN_EXECUTE_ABOVE_PRICE> | Bool | can_execute_above_price: If true, allows execution above target price but not below. If false, execute below target price but not above. |
address:0x0 | Address | Always pass 0x0. |
Type Arguments
| Type Argument | Description |
|---|---|
0xae38541466939b577823389765d966ba206b19be954fc87011fa10dc91e2fe0f::pair_types::<YOUR_PAIR_TYPE> | Select your pair type options:0xae38541466939b577823389765d966ba206b19be954fc87011fa10dc91e2fe0f::pair_types::ETH_USD (complete list below) For mainnet, change the address to 0x215f242bec12c3d66b469668bc48b71e87fc1c7fd8e1764ac773423f0e2ba18b. |
0x4f316ce2960250e7ac1206a07d07b2cbef3897d3cb8c12369d30c08ecd39c61c::tusdc_coin::TUSDC | Testnet collateral type. For mainnet, replace this with 0x9176f70f125199a3e3d5549ce795a8e906eed75901d535ded623802f15ae3637::cdp_multi::CASH. |
Profile
-
Use
--profile <YOUR_SUPRA_CLI_PROFILE_NAME>to specify your Supra CLI account profile.- Example:
--profile accountA
- Example:
Pair Types
| Market | Pair Type (for CLI) | Available on Testnet | Available on Mainnet |
|---|---|---|---|
| BTC-USD | BTC_USD | ✅ | ✅ |
| ETH-USD | ETH_USD | ✅ | ✅ |
| SUPRA-USDT | SUPRA_USDT | ✅ | ✅ |
| SOL-USDT | SOL_USDT | ✅ | ✅ |
| XLM-USDT | XLM_USDT | ✅ | ❌ |
| LINK-USDT | LINK_USDT | ✅ | ❌ |
| DOGE-USDT | DOGE_USDT | ✅ | ❌ |
| ARB-USDT | ARB_USDT | ✅ | ❌ |
| HYPE-USDT | HYPE_USDT | ✅ | ❌ |
| AVAX-USDC | AVAX_USDC | ✅ | ❌ |
| BNB-USDC | BNB_USDC | ✅ | ❌ |
| OP–USDT | OP_USDT | ✅ | ❌ |
| XRP–USDT | XRP_USDT | ✅ | ❌ |
| ADA–USDT | ADA_USDT | ✅ | ❌ |
⚖️ Deep Dive: is_increase and can_execute_above_price
🔸 is_increase
This flag defines whether your trade increases or reduces your position.
| Action | is_increase | Description |
|---|---|---|
| Open new position | true | Opens a position in direction of is_long |
| Add to existing position | true | Increases same-direction position size |
| Add collateral only | true | size_delta = 0, collateral_delta > 0 |
| Partial close | false | Reduces position size |
| Full close | false | Closes position completely |
🔸 can_execute_above_price
It defines the acceptable execution direction around your PRICE input. You can think of it as a slippage direction guard.
General Definition
“Can this order execute above the specified price?”
| Context | What happens if true | What happens if false |
|---|---|---|
| Market or Limit Order | Allows execution above the target price | Restricts execution below the target price |
Behavior Matrix
| Trade Type | is_increase | is_long | can_execute_above_price | Interpretation |
|---|---|---|---|---|
| Open / Increase Long | true | true | false | Execute at or below target (buy cheaper = better) |
| Open / Increase Long | true | true | true | Execute even above target (accept higher price) |
| Open / Increase Short | true | false | true | Execute at or above target (sell higher = better) |
| Open / Increase Short | true | false | false | Execute below target (rare for shorts) |
| Close / Reduce Long | false | true | true | Execute at or above target (sell higher = better) |
| Close / Reduce Long | false | true | false | Execute below target (rare for longs) |
| Close / Reduce Short | false | false | false | Execute at or below target (buy lower = better) |
| Close / Reduce Short | false | false | true | Execute above target (rare for shorts) |
✅ Yes — even for is_market=true, Dexlyn respects this flag for slippage protection. So your PRICE still acts as a “soft limit” reference.
💡 Example Scenarios
Assume:
- Wallet:
0x6271abcd1234abcd5678ef90abcd1234abcd5678 - Pair: ETH–USD (
ETH_USD) - Profile:
accountA - Network: Testnet
Decimals:
SIZE_DELTA→ 6 decimalsCOLLATERAL_DELTA→ 6 decimalsPRICE→ 10 decimals
🟢 1. Open a New Long Position
supra move tool run \
--function-id 0xae38541466939b577823389765d966ba206b19be954fc87011fa10dc91e2fe0f::managed_trading::place_order_v3 \
--args \
address:0x6271abcd1234abcd5678ef90abcd1234abcd5678 \
u64:100000000 \
u64:50000000 \
u64:3500000000000000 \
bool:true \
bool:true \
bool:true \
u64:0 \
u64:0 \
bool:false \
address:0x0 \
--type-args \
0xae38541466939b577823389765d966ba206b19be954fc87011fa10dc91e2fe0f::pair_types::ETH_USD \
0x4f316ce2960250e7ac1206a07d07b2cbef3897d3cb8c12369d30c08ecd39c61c::tusdc_coin::TUSDC \
--profile accountA✅ Meaning:
- Open a long position
- Size = $100
- Collateral = $50
- Market order (
is_market=true) is_increase=true→ new positioncan_execute_above_price=false→ protect from buying higher than target
2. Add More Collateral (No Size Change)
--args \
address:0x6271abcd1234abcd5678ef90abcd1234abcd5678 \
u64:0 \
u64:20000000 \
u64:0 \
bool:true \
bool:true \
bool:true \
u64:0 \
u64:0 \
bool:false \
address:0x0✅ Meaning:
- Only add collateral ($20)
- Position size unchanged
is_increase=true→ same positioncan_execute_above_price=false→ irrelevant but safe for market execution
🟣 3. Aggregate / Add to Existing Long Position
--args \
address:0x6271abcd1234abcd5678ef90abcd1234abcd5678 \
u64:50000000 \
u64:20000000 \
u64:3600000000000000 \
bool:true \
bool:true \
bool:false \
u64:0 \
u64:0 \
bool:false \
address:0x0✅ Meaning:
- Add $50 to existing long
- Add $20 more collateral
- Limit order at $3600
can_execute_above_price=false→ only execute below or equal to 3600
🔵 4. Partial Close Position
--args \
address:0x6271abcd1234abcd5678ef90abcd1234abcd5678 \
u64:50000000 \
u64:0 \
u64:3700000000000000 \
bool:true \
bool:false \
bool:false \
u64:0 \
u64:0 \
bool:true \
address:0x0✅ Meaning:
- Close half ($50) of the long position
- Limit close order
can_execute_above_price=true→ allow execution above or equal to $3700 (better for closing longs higher)
🔴 5. Fully Close Position (Market)
--args \
address:0x6271abcd1234abcd5678ef90abcd1234abcd5678 \
u64:100000000 \
u64:0 \
u64:3500000000000000 \
bool:true \
bool:false \
bool:true \
u64:0 \
u64:0 \
bool:true \
address:0x0✅ Meaning:
- Fully close long position ($100)
- Market order
is_increase=false→ closingcan_execute_above_price=true→ allows selling at or above price (good for longs)
🧠 Summary Table
| Action | is_increase | is_market | can_execute_above_price | size_delta | collateral_delta | Notes |
|---|---|---|---|---|---|---|
| Open Long | true | true | false | >0 | >0 | Open position (buy long) |
| Add Collateral | true | true | false | 0 | >0 | Add margin |
| Aggregate / Add | true | false | false | >0 | ≥0 | Add to existing (limit) |
| Partial Close | false | false | true | < position size | 0 | Limit close (sell higher) |
| Full Close | false | true | true | = position size | 0 | Market close (sell higher) |