Settlement

Atomic legs, strict TTL and slippage enforcement, standardized receipts.

State Machine

  • INIT → VALIDATE → PREP → EXECUTE → RECONCILE → EMIT → DONE
  • Errors: TTL_EXPIRED, SLIPPAGE_BREACH, LEG_REVERT, SIGNATURE_INVALID

Receipt

{
  "tx": "5f..ab", "blockTime": 1730793605,
  "filled": [{"leg":0,"out":"927.1"},{"leg":1,"out":"924.0"}],
  "totalOut": "1851.1", "fees": { "protocol":"0.37", "network":"0.01"}
}

Failure Handling

  • Rollback partial AMM legs; no custody at any point.
  • Emit structured error with failing leg and reason.
  • Retry policy: only for transient network errors before signing.