NeapDocs
Launch app
Docs · Trading

Trading

Trading

How orders fill, what they cost, and how margin and leverage work.

Two-step orders

Every order is a request followed by an execution. You sign request_order, which records your order and the current block. A keeper then calls execute_order, and the contract only fills it against a price that was observed in a later block than your request.

This closes the stale-price problem: nobody, including you and the keeper, knows the fill price at the moment the order is signed. Execution is permissionless, so anyone can run a keeper.

PropertyValue
Typical time to fill2 to 4 seconds
Order lifetimeUp to 50 blocks, then it expires unfilled
FillsAll or nothing
CancelAny time before it fills, with cancel_order

Order types

TypeBehaviour
MarketFills at the next price. The app attaches a limit 0.5% away from the quote, so the order does not fill if the price moves further than that.
LimitRests on-chain until the mark price crosses your trigger, then fills within your limit. Supported by the contract through place_conditional.
Take-profitCloses your position when the mark reaches your target. Always reduce-only.
Stop-lossCloses your position when the mark moves against you to your stop. Always reduce-only.

Take-profit, stop-loss and limit orders can rest for up to 30 days. A keeper triggers them, and the same rule applies: the triggering price must be newer than the order. Reduce-only orders can only shrink a position, never flip or grow it.

Execution price and spread

There is no order book. You trade against the market's pool at the mark price plus or minus a spread. Buys fill slightly above the mark and sells slightly below. The spread is what pays the pool for taking your trade.

MajorLong-tail
Minimum spread5 bps20 bps
Added as the pool gets one-sidedup to 45 bpsup to 130 bps
Added for trade sizeup to 5 bpsup to 20 bps

The skew and size parts apply when a market has an open-interest cap set, and scale with how much of the cap is used. Without a cap the market charges its minimum spread. The exact price, spread and fee for your order come from the contract's quote view and are shown before you sign.

Fees

FeeAmountWhere it goes
Trading fee0.05% (5 bps) of trade value, on open and on close50% market lister · 30% liquidity pool · 10% insurance · 10% protocol
Liquidation fee5% of the closed value, capped at 50 USDC60% to whoever liquidates · 40% insurance

There are no maker or taker tiers, no deposit fee and no withdrawal fee. You pay NEAR network gas on each transaction.

Margin and leverage

Margin is isolated. Each market has its own margin account, and a loss in one market cannot draw on your margin in another. Collateral is USDC only.

MajorLong-tail
Maximum leverage10x4x
Initial margin10%25%
Maintenance margin8%15%
Largest price step per block10 bps30 bps
  • Initial margin is what you need to open. Maintenance margin is what you need to stay open.
  • If your equity falls below maintenance margin, the position can be liquidated. See Liquidations.
  • When a market has an open-interest cap, maximum leverage steps down as the pool gets more one-sided, never below 1x.
  • You can add margin at any time, and withdraw margin above the initial requirement.

Funding

Funding keeps a market balanced. The crowded side pays: if traders are net long, longs pay; if traders are net short, shorts pay. The payment goes to the other side, which is mostly the pool that is carrying the imbalance.

The rate grows with the size of the imbalance relative to open interest, and is capped at 0.00001% per block. Funding accrues continuously and is settled whenever your account is touched, so there is no funding timestamp to trade around.

Profit and loss

Losses are taken from your margin as the price moves. Profit matures over a short warm-up (5 to 50 blocks) before it becomes withdrawable USDC. This stops a flash price move from being withdrawn before the market can react. The app converts matured profit for you when you close.

If a pool cannot cover all winners, profit is paid pro rata and the shortfall is shown, never hidden. See Risks.