All trade executions transition through the strict state machine defined in ExecutionStateEnum (packages/shared-types/src/index.ts):
| State Identifier | Category | Description |
|---|---|---|
CREATED | Initialization | Trade opportunity detected and recorded in database. |
QUOTE_REQUESTED | Quoting | Outbound RFQ dispatched to Textile liquidity network. |
QUOTE_RECEIVED | Quoting | Firm quote returned with valid rateRay and accept deadline. |
POLICY_VALIDATED | Enforcement | All 18 deterministic rules evaluated and passed. |
APPROVAL_PENDING | Governance | Staged awaiting human owner signature (if in approval mode). |
EXECUTION_PENDING | Signing | Signed by restricted signer; preparing mempool broadcast. |
SUBMITTED | Onchain | Broadcast to Celo Mainnet mempool; awaiting block inclusion. |
CONFIRMED | Onchain | Included in a Celo block with confirmed receipt. |
SETTLED | Settlement | Textile LimitOrderReactor settled and verified onchain. |
RECONCILED | Ledger | Double-entry journal entries verified and balanced in ledger. |
REJECTED | Terminal | Policy engine rejected proposal due to rule violation. |
EXPIRED | Terminal | Quote accept deadline lapsed before onchain inclusion. |
FAILED | Terminal | Onchain transaction reverted or network error occurred. |
REQUIRES_RECONCILIATION | Exception | Onchain trade confirmed but ledger balance mismatch detected. |