Skip to Content
PerpetualsPerpetuals Guide Using Supra CLI

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
ArgumentTypeDescription
address:<YOUR_WALLET_ADDRESS>AddressYour wallet address (e.g. 0x6271…878).
u64:<SIZE_DELTA>U64Position 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>U64Collateral 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>U64Entry price in 10 decimals for both testnet and mainnet (e.g. 1000000000000000 = USD 100000.0000000000).
bool:<IS_LONG>Boolis_long:   Set to true for a long trade. Set to false for short.
bool:<IS_INCREASE>Boolis_increase:   true to open or increase position; false to close or reduce position.
bool:<IS_MARKET>Boolis_market:   true for market orders; false for limit orders.
u64:<STOP_LOSS_TRIGGER_PRICE>U64Stop loss Trigger price (e.g. 1000000000000000 = USD 100000.0000000000).
u64:<TAKE_PROFIT_TRIGGER_PRICE>U64Take Profit Trigger Price (e.g. 1000000000000000 = USD 100000.0000000000).
bool:<CAN_EXECUTE_ABOVE_PRICE>Boolcan_execute_above_price:   If true, allows execution above target price but not below. If false, execute below target price but not above.
address:0x0AddressAlways pass 0x0.
Type Arguments
Type ArgumentDescription
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::TUSDCTestnet 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
Pair Types
MarketPair Type (for CLI)Available on TestnetAvailable on Mainnet
BTC-USDBTC_USD
ETH-USDETH_USD
SUPRA-USDTSUPRA_USDT
SOL-USDTSOL_USDT
XLM-USDTXLM_USDT
LINK-USDTLINK_USDT
DOGE-USDTDOGE_USDT
ARB-USDTARB_USDT
HYPE-USDTHYPE_USDT
AVAX-USDCAVAX_USDC
BNB-USDCBNB_USDC
OP–USDTOP_USDT
XRP–USDTXRP_USDT
ADA–USDTADA_USDT

⚖️ Deep Dive:    is_increase and can_execute_above_price

🔸 is_increase

This flag defines whether your trade increases or reduces your position.

Actionis_increaseDescription
Open new positiontrueOpens a position in direction of is_long
Add to existing positiontrueIncreases same-direction position size
Add collateral onlytruesize_delta = 0, collateral_delta > 0
Partial closefalseReduces position size
Full closefalseCloses 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?”

ContextWhat happens if trueWhat happens if false
Market or Limit OrderAllows execution above the target priceRestricts execution below the target price
Behavior Matrix
Trade Typeis_increaseis_longcan_execute_above_priceInterpretation
Open / Increase LongtruetruefalseExecute at or below target (buy cheaper = better)
Open / Increase LongtruetruetrueExecute even above target (accept higher price)
Open / Increase ShorttruefalsetrueExecute at or above target (sell higher = better)
Open / Increase ShorttruefalsefalseExecute below target (rare for shorts)
Close / Reduce LongfalsetruetrueExecute at or above target (sell higher = better)
Close / Reduce LongfalsetruefalseExecute below target (rare for longs)
Close / Reduce ShortfalsefalsefalseExecute at or below target (buy lower = better)
Close / Reduce ShortfalsefalsetrueExecute 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 decimals
  • COLLATERAL_DELTA → 6 decimals
  • PRICE → 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 position
  • can_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 position
  • can_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 → closing
  • can_execute_above_price=true → allows selling at or above price (good for longs)

🧠 Summary Table

Actionis_increaseis_marketcan_execute_above_pricesize_deltacollateral_deltaNotes
Open Longtruetruefalse>0>0Open position (buy long)
Add Collateraltruetruefalse0>0Add margin
Aggregate / Addtruefalsefalse>0≥0Add to existing (limit)
Partial Closefalsefalsetrue< position size0Limit close (sell higher)
Full Closefalsetruetrue= position size0Market close (sell higher)