Skip to main contentSkip to FAQSkip to contact
Reading· 3 min

Core Concepts#

The Mental Model Behind TetraFi

This page covers the mental model behind TetraFi: how intents flow through the system, who the participants are, and the key primitives that make cross-chain DvP settlement possible.

Intent Execution Stack#

TetraFi separates what the user wants from how it gets done. Each layer is independently upgradeable.

Intent Execution Stack

@tetrafi/sdk (TypeScript)

Typed SDK with RFQ submission, WebSocket quote streaming, and settlement tracking.

Python SDK

Async Python client for institutional trading desks and algorithmic strategies.

SwapWidget

Embeddable React component for instant OTC swap integration.

REST API Client

Direct HTTP interface for any language - full endpoint coverage.

REST API (axum)

High-throughput Rust HTTP handlers for RFQ submission, quote retrieval, and order management.

WebSocket Server

Real-time quote streaming and event notifications to solvers and takers.

Auction Engine

UCCP-based quote ranking with compliance filtering and fair pricing guarantees.

Corridor Router

Maps token pairs to directed corridors and routes to qualified solver sets.

Order Manager

ERC-7683 StandardOrder parsing, validation, and lifecycle tracking.

Fill Engine

Executes fills on destination chain OutputSettler contracts.

Settlement Monitor

Watches for oracle proofs and triggers claim/refund on escrow.

Pricing Engine

Real-time price feeds with gas estimation for competitive quoting.

ComplianceRegistry

On-chain attestation storage. Per-chain deployment. Checked pre-trade.

KYC/KYB Adapters

Vendor adapters for Chainalysis, Elliptic, and other identity providers.

Travel Rule Engine

IVMS101 message construction and VASP-to-VASP transmission.

Evidence Ledger (WORM)

Append-only audit trail. Write-Once Read-Many for regulatory compliance.

InputSettler (Escrow)

Origin chain deposit locking. Two modes: Permit2Escrow and CompactEscrow (ResourceLock).

OutputSettler

Destination chain fill recording. Resolves limit, dutch auction, and exclusive order types.

Oracle Contracts

Cross-chain attestation verification via Hyperlane ISM integration.

Permit2 / Compact

Token approval infrastructure - gasless approvals and allocator-based locking.

Client SDK & UI
RFQ Aggregator
Solver Network
Compliance Layer
Smart Contracts
LayerConcernTetraFi Role
Intent Expression (WHAT)User declares desired outcome via StandardOrderDefines the format
Orderflow Auction (WHO)Solvers compete via RFQ or Dutch auctionRuns the auction
Settlement Primitive (HOW)ResourceLock, Permit2Escrow - orthogonal to intent formatProvides the contracts
Solver LiquidityHow the solver sources funds - inventory, DEX, OTCOut of scope (solver's problem)

How a Trade Works#

Settlement DvP Sequence

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

In plain language - taker submits RFQ → solvers bid → best quote wins (UCCP) → taker signs StandardOrder (EIP-712) → funds lock in escrow → solver fills on destination chain → oracle attests → escrow releases = DvP complete.

Full lifecycle with contract calls and state transitions: Settlement Flows.

Key Terminology#

ERC-7683 typed struct: user, nonce, inputs, outputs, deadlines, oracle references. Signed off-chain via EIP-712. The universal format for cross-chain settlement intents.

Output leg specifying destination chain requirements: oracle, settler, token, amount, recipient. Each StandardOrder has one or more MandateOutputs.

A directed route: origin_chain:token → destination_chain:token. The cross-chain analog of a trading pair. Each corridor has its own solver set and compliance requirements.

Solver - Liquidity provider competing on price. Fills orders with own capital on the destination chain.

Taker - Institutional client initiating a trade: asset managers, corporate treasuries, funds.

Atomic settlement where both legs execute or neither does. The solver delivers on the destination chain, the escrow releases on the origin chain - simultaneously via oracle attestation.

All orders in a batch receive the same effective bps rate. Prevents information leakage and ensures fair execution across simultaneous RFQs on the same corridor.

ResourceLock - Output-first lock via The Compact. Solver fills before user funds lock. Highest capital efficiency.

Permit2Escrow - Input-first lock. User deposits, then solver fills. Broader token coverage.

Traditional vs. TetraFi Settlement#

Manual Cross-Chain

Bridge + Swap + Wait

  • Find a bridge, approve tokens
  • Bridge to destination chain (15-45 min)
  • Swap on a DEX (slippage risk)
  • Manual compliance per jurisdiction
  • No atomic guarantee
TetraFi Intent

Submit Intent + Settle

  • Submit a single StandardOrder
  • Solvers compete to fill
  • Atomic DvP in under 10 min
  • On-chain compliance enforced
  • Both legs or neither - guaranteed

All terms above have inline tooltips throughout the docs. Hover any underlined term for a quick definition, or visit the Glossary for the full reference.

Next Steps#

I'm a TakerStep 1 of 7

Related topics