Appearance
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
| Piece | State | Location |
|---|---|---|
| iZiSwap limit-order SDK integration | Present | defi-dex/src/utils/trade.ts imports iziswap-sdk/lib/limitOrder/{view,types,limitOrder} |
limitOrder Mongo model | Present | bz-backend/models/limitOrder.js |
LIMIT_ORDER AI intent | Present | bz-agent/src/utils/constant.ts, template at src/template/limitOrder.ts |
| Perp limit + TP/SL endpoints | Live | POST /defi/orderly/limit-order, /tp-sl-order |
| Spot limit-order page | Not shipped | defi-dex/src/pages/defi/limit.tsx → <ComingSoon /> |
| Spot limit-order backend routes | Not present | No /defi/limit/* routes exist |
| On-chain spot order placement | Not wired | The 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
- Backend routes — create, list, cancel, backed by
models/limitOrder.jswith asourcediscriminator so perp and spot rows do not mix. - Chain scoping — iZiSwap pools exist on a subset of chains. Decide the supported list and fail fast elsewhere, the way
assertRelayerDeployeddoes for swaps. - Frontend page — replace
ComingSooninlimit.tsx, remove thenoindex. - Order lifecycle UI — open orders, partial fills, cancel. iZiSwap orders can partially fill, which the current model does not represent.
- AI handler — a
case 'LIMIT_ORDER'inv1/services/agent.service.js, alimit_orderaction inBLAZ_ACTIONS, and a card component. See add an AI intent. - 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
| Concern | Where |
|---|---|
| SDK imports | defi-dex/src/utils/trade.ts lines ~25–59 |
| Model | bz-backend/models/limitOrder.js |
| Placeholder page | defi-dex/src/pages/defi/limit.tsx |
| Product card copy | defi-dex/src/pages/defi/home/products.ts, slug limit |
| AI intent | bz-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.