Skip to content

Limit orders

Target-price orders. The state of this product is genuinely split, and marketing copy has sometimes flattened it.

Two different things share this name

Perp limit orders are live. They are placed on Orderly Network and documented under perpetuals.

Spot limit orders are not shipped. /defi/limit renders a ComingSoon component and carries noindex. The plumbing exists but no UI does.

What is actually built

PieceStateLocation
iZiSwap limit-order SDK integrationPresentdefi-dex/src/utils/trade.ts imports iziswap-sdk/lib/limitOrder/{view,types,limitOrder}
limitOrder Mongo modelPresentbz-backend/models/limitOrder.js
LIMIT_ORDER AI intentPresentbz-agent/src/utils/constant.ts, template at src/template/limitOrder.ts
Perp limit + TP/SL endpointsLivePOST /defi/orderly/limit-order, /tp-sl-order
Spot limit-order pageNot shippeddefi-dex/src/pages/defi/limit.tsx<ComingSoon />
Spot limit-order backend routesNot presentNo /defi/limit/* routes exist
On-chain spot order placementNot wiredThe iZiSwap functions are imported but not called from a shipped path

The intended design

When the spot product ships, the shape is already decided by the imports in trade.ts: iZiSwap's on-chain limit-order book.

  • A limit order is a real on-chain position, not a backend watcher that fires a market order. The order sits in the book and fills when the market reaches it.
  • No monitoring service is needed, and no custody is taken — the order is the user's.
  • Cancellation is a user transaction against the iZiSwap contract.

The iZiSwap SDK surface already imported covers what is needed: limitOrder/view (read a user's orders), limitOrder/limitOrder (create, update, cancel), pool/funcs and base/price (tick and price conversion), and quoter for pre-trade estimates.

What the AI intent does today

The LIMIT_ORDER intent classifies correctly and extracts parameters — token pair, side, target price, amount. bz-agent's node returns them. But bz-backend's dispatcher has no handler that can place a spot order, so the practical outcome is a text or fallback reply rather than a signable card.

If you are asked "why did BlazAI say it would set a limit order and nothing happened", this is why.

What needs to happen to ship it

  1. Backend routes — create, list, cancel, backed by models/limitOrder.js with a source discriminator so perp and spot rows do not mix.
  2. Chain scoping — iZiSwap pools exist on a subset of chains. Decide the supported list and fail fast elsewhere, the way assertRelayerDeployed does for swaps.
  3. Frontend page — replace ComingSoon in limit.tsx, remove the noindex.
  4. Order lifecycle UI — open orders, partial fills, cancel. iZiSwap orders can partially fill, which the current model does not represent.
  5. AI handler — a case 'LIMIT_ORDER' in v1/services/agent.service.js, a limit_order action in BLAZ_ACTIONS, and a card component. See add an AI intent.
  6. Fee decision — spot limit orders currently have no fee mechanism. Whether they route through BlazpayRelayer (and therefore pay 0.1%) or go direct to iZiSwap is an open product question.

Under the hood

ConcernWhere
SDK importsdefi-dex/src/utils/trade.ts lines ~25–59
Modelbz-backend/models/limitOrder.js
Placeholder pagedefi-dex/src/pages/defi/limit.tsx
Product card copydefi-dex/src/pages/defi/home/products.ts, slug limit
AI intentbz-agent/src/template/limitOrder.ts

Known limits

Everything above. The one-line summary for a support conversation: spot limit orders are not available; perp limit orders are, inside the perpetuals product.

The home page presents Limit orders without a "Soon" badge

products.ts gives liquidity a badge: 'Soon' but not limit, even though both render ComingSoon. That is a copy bug worth fixing — see the products model.

Internal + developer documentation. Usage figures are point-in-time snapshots — re-verify before publishing them.