Skip to main contentSkip to FAQSkip to contact
Reference· 4 min

Settlement Flows#

TetraFi settles trades across chains using ERC-7683 intents. Three lock types, four settlement paths, and a cross-chain oracle network ensure atomic DvP regardless of the chains involved.

Settlement Lifecycle#

End-to-End Settlement

Mini Map
Actor
Engine
Contract
Network

DvP Settlement Sequence

Origin ChainDestination ChainTakerEscrowSolverOutputSettlerOracledeposit()1fill()2Fill recorded3submitProof()4finalise() → release5
0 / 5

Lock Types#

Lock Type Comparison

FeatureResourceLock
Permit2EscrowEIP-3009Escrow
Settlement Model4 features
Direction
Output-firstInput-firstInput-first
Byte Code
0xff0x000x01
Taker deposits first?
Solver fills first?
Properties4 features
Capital efficiency
Broad token support
Gasless approval
Non-revocable commitment
Best For3 features
Default choice
USDC/EURC corridors
Exotic tokens
  1. Taker pre-deposits into The Compact
  2. Allocator co-signs the commitment (prevents double-spend)
  3. Solver fills on destination chain with own capital
  4. Oracle attests fill → Arbiter processes batchClaim()
  5. Taker's allocation released to solver

Escape hatch: If the allocator is unresponsive, taker calls enableForcedWithdrawal() → waits the reset period → forcedWithdrawal(). Deterministic exit, no permission needed.

  1. Taker calls open() → funds locked → state = Deposited
  2. Solver fills on destination → oracle attests
  3. Solver calls finalise() with oracle proof → state = Claimed
  4. OR: deadline expires → taker calls refund() → state = Refunded

Equivocation Protection#

Without ResourceLock, a user can revoke token approval after the solver fills - leaving the solver with an unfillable claim.

ResourceLock solves this by converting token approval into a non-revocable credible commitment. Solvers can act on a signature (milliseconds) rather than waiting for source-chain finality (minutes). This is the primary reason ResourceLock is the default settlement mode.

Settlement Path Routing#

The system selects one of four paths based on compliance status and lock type:

Default path for regulated corridors. Both counterparties have valid ComplianceRegistry attestations. ResourceLock provides output-first settlement with maximum capital efficiency.

Pre-trade: 7 compliance checks (jurisdiction, tier, expiry, sanctions, PEP, Travel Rule, counterparty). Post-trade: evidence logged to WORM ledger.

Fill Deadlines#

Every StandardOrder has two deadlines:

DeadlinePurpose
fillDeadlineSolver must fill on destination chain before this time
expiresAfter this time, taker can call refund() to reclaim escrowed funds

expires is always after fillDeadline. Between the two, the oracle proof may still be in transit.

Order Types & Context Byte#

The context field in MandateOutput encodes the order type. The OutputSettler reads this to determine how to resolve the final output amount.

ValueTypeDescription
0x00LimitStatic output amount, no decay
0x01Dutch AuctionTime-decaying fee constraints (1bps → 3bps over 2–10 min)
0x02Exclusive LimitSingle-solver exclusive fill window, then open
0x03Exclusive DutchExclusive window with Dutch decay

For Dutch auction types (0x01, 0x03), the fee ramps linearly from 1 bps (SAFE tier, 0–2 min) to 3 bps (BALANCED tier, 2–10 min). After 10 minutes, the order enters the FAST tier or cancels.

Order State Machine#

Off-Chain Order Lifecycle

quotes receivedEIP-712 signsolver fillsproof verifiedtimeoutfill deadlineCreatedQuotedSignedFillingSettledExpired
initial
normal
success
error
Hover a state to explore

Path Selection Logic#

  1. Compliant? - Valid ComplianceRegistry attestation → Compliant path. None → Direct only
  2. ResourceLock? - Token/chain supports Compact → ResourceLock. Otherwise → Permit2Escrow fallback
  3. Corridor gated? - Compliance-required corridor + no attestation → rejected

Path Defaults by Persona#

PersonaDefault PathReason
Direct UserCompliant + ResourceLockFull on-chain compliance
CompanyCompliant + ResourceLockWorkspace-level, per-member
BrokerDirect + ResourceLockKYC delegated to integrator
LP/MakerDirect + ResourceLockCompliance at fill time

See Personas & Workspaces for the full persona model - including data-visibility rules and onboarding requirements per role.

Error Cases#

ScenarioErrorRecovery
Missing attestation403 COMPLIANCE_FAILEDComplete KYC, wait for sync
Expired attestation403 ATTESTATION_EXPIREDRenew verification
Lock unavailableAuto fallbackEngine uses Permit2Escrow
Corridor not configured400 CORRIDOR_UNAVAILABLEContact TetraFi ops

See Also#

I'm a SolverStep 4 of 7

Related topics