BotRadixBotRadixDocumentation

Orders and positions

Market and limit orders, take profit and stop loss, partial closes, inversion and size limits.

Order types#

TypeHow it executes
MarketImmediately, at the oracle price, if it is within your maximum slippage. Otherwise it is rejected. Always immediate-or-cancel
LimitOnly at your price or better. If it can execute when created, it executes immediately; otherwise it rests until the price is reached
StopBecomes a market execution when the trigger price is reached

Time-in-force options are GTC (good till cancelled), IOC (immediate or cancel) and FOK (fill or kill). Post-only is available for limit orders. Stop-limit and trailing orders are not available.

Slippage#

Market orders require a maximum slippage. The terminal uses the saved slippage preference for opens and inversions: 8% by default, adjustable up to 10%. The inversion API permits up to 20% and uses 1% when omitted. Slippage limits the accepted price: a lower value protects your price but makes rejection more likely in fast markets; it does not ensure execution.

Size limits#

  • Minimum position size: 18 USDC on the markets of the v2.2 catalogue (per-market configuration; the code's technical minimum is 1 USDC).
  • Maximum size: limited by the market's leverage tiers and open-interest caps (see Leverage and margin).
  • Each market defines its own price tick and quantity step, read from the contracts.

Account limits#

To bound valuation and closing work, each wallet can have at most the following. These limits do not guarantee quick execution:

LimitValue
Markets with cross positions32
Open positions128
Open entry orders (resting limit and stop orders)256 (v2.2 reference value, adjustable between 32 and 1,000)

If you reach the limit of open orders, new orders are rejected until some execute or are cancelled; existing orders are not affected.

Resting orders#

A resting limit or stop order reserves its margin, its opening fee and a refundable bond of 0.025 USDC (v2.2 reference value; the code caps it at 1 USDC) until the order terminates, including cancellation or invalidation. Large resting orders execute in fills of up to 100,000 USDC each (v2.2 reference value; fill-or-kill orders are not clipped). Resting orders are executed by the protocol keeper; this requires a one-time execution permission, granted with a free signature, with a small per-execution fee (see Fees).

Positions#

A position is identified by its market, side, margin mode and leverage. You can hold a long and a short on the same market at the same time (for example, with different leverage or margin modes); orders with the same characteristics add to the same net position.

Reduce-only is not accepted when opening.

Take profit and stop loss#

  • For a long, take profit must be above the current price and stop loss below it; the opposite for a short.
  • When triggered, they close the whole position at market.
  • When you set a take profit, the vault tries to reserve capacity for its profit within the cap. While a backed take profit remains valid, its position is excluded from auto-deleveraging; backing is not a payment guarantee in every scenario. The confirmation window tells you whether your take profit is backed. See Backed take profit and auto-deleveraging.
  • Editing TP/SL with your trading key does not ask for a wallet signature, and up to 200 edits per day are free of gas (v2.2 reference value, adjustable between 1 and 2,000).

Closing#

  • Close at market or with a limit price, for any part of the position (from 0.01% to 100%). The terminal offers 5, 10, 20, 50, 75 and 100% shortcuts.
  • A limit close is a reduce-only order that rests until executed; one per position.
  • If a partial close would leave less than the market's minimum position size (18 USDC in the v2.2 catalogue; its market's current minimum applies), the whole position is closed. The confirmation window warns you before you sign.
  • Closing has no protocol fee today. The current code allows a closing fee of up to 0.10%; confirmation shows an estimate and a pending order pays the fee in force when it executes; auto-deleveraging, exits, emergencies and liquidations never pay it. Your realized result, minus funding, is settled into your collateral.

Inverting#

Invert closes a position (or part of it) and opens the opposite side in one atomic step, paying the opening fee (and the service fee) on the opened part. If you already hold an opposite-side position with the same key (market, margin mode and leverage), the inverted part joins that net position instead of opening another, and the leverage tier is checked on the resulting size; if it does not fit, the whole inversion is rejected. In that case the inversion returns the id of the existing net position: on chain there is no new DexPositionOpened, but a DexPositionChanged of that net position. On markets with V2 risk rules the opened part is executed committed to a price observed after your order, so the inversion goes through your trading key (or the API's delegated route with a protocol executor); without it, the terminal asks you to enable it (INVERT_NEEDS_AGENT).

Isolated margin#

For an isolated position you can:

  • Add margin (the "Margin +" button), moving its liquidation price further away. Only free USDC can be used: if your cross positions need that USDC, the action is rejected with a clear message.
  • Withdraw margin, as long as the margin left still covers size ÷ leverage plus the position's unrealized loss and the funding it owes (profits do not count). It needs a price no older than 10 seconds, and the DEX and that market must be open to new risk.
  • Change leverage. Lowering it adds the margin needed. Raising it is allowed up to the maximum of the tier for the position's current size, and returns only the margin left over under the same rule as a withdrawal.

Your trading key can do all of this without a wallet pop-up; the protocol pays the gas. Margin only moves between your account and your own isolated positions, never outside the DEX.

With a cross market in a closed session. If a market of your cross account has its session closed (for example, an index at the weekend), your DEX balance cannot be valued and cannot be used as isolated margin. The margin of an isolated open or of "Margin +" then comes from your wallet: the contract pulls the margin (for a market open, plus 0.30% of the size for the largest fees; for a limit or stop order, plus 0.31% of the size and the order bond, 0.025 USDC as the v2.2 reference value; whatever is not spent stays as DEX balance) and uses it in the same transaction. Your wallet signs that specific operation: it co-signs it together with your trading key, or signs it itself if you do not use a trading key; a trading session cannot do it. When BotRadix relays it, you also sign a USDC permit for that exact amount (free, no gas); the contract pulls only that amount and the permit is left at zero. The confirmation window explains the signatures before they open. If your wallet lacks enough USDC it is rejected (WALLET_MARGIN_BALANCE_REQUIRED); "Margin +" without a trading key, WALLET_MARGIN_NEEDS_AGENT. The money of your cross positions is never used while it cannot be valued, and when the session reopens your DEX balance is used again.

Cancel and replace#

Resting orders can be cancelled or replaced with your trading key, without a wallet signature.

Last updated: 2026-10-12