Getting Started with TetraFi#
Institutional Stablecoin Settlement
TetraFi is a non-custodial settlement protocol for institutional stablecoin OTC trading. This documentation covers everything you need to integrate - from architecture concepts to SDK reference to deployment guides.
What is TetraFi?#
TetraFi routes institutional-grade stablecoin orders ($1M-$10M+) to competing solvers via sealed RFQ auctions. The protocol handles compliance verification, escrow, atomic DvP settlement, and immutable audit trails - all on-chain, all non-custodial.
Manual OTC Settlement
- Phone calls and chat negotiations
- Manual KYC per counterparty
- T+1 to T+3 settlement
- Counterparty risk exposure
- No audit trail
Automated TetraFi Settlement
- Sealed-bid RFQ auctions
- On-chain compliance attestation
- Under 10 minute atomic settlement
- Zero counterparty risk via DvP
- Immutable WORM audit trail
TetraFi never holds, controls, or has access to user funds. All settlements execute through smart contract escrow with atomic Delivery versus Payment (DvP).
Architecture at a Glance#
TetraFi Protocol Stack
Typed SDK with RFQ submission, WebSocket quote streaming, and settlement tracking.
Async Python client for institutional trading desks and algorithmic strategies.
Embeddable React component for instant OTC swap integration.
Direct HTTP interface for any language - full endpoint coverage.
High-throughput Rust HTTP handlers for RFQ submission, quote retrieval, and order management.
Real-time quote streaming and event notifications to solvers and takers.
UCCP-based quote ranking with compliance filtering and fair pricing guarantees.
Maps token pairs to directed corridors and routes to qualified solver sets.
ERC-7683 StandardOrder parsing, validation, and lifecycle tracking.
Executes fills on destination chain OutputSettler contracts.
Watches for oracle proofs and triggers claim/refund on escrow.
Real-time price feeds with gas estimation for competitive quoting.
On-chain attestation storage. Per-chain deployment. Checked pre-trade.
Vendor adapters for Chainalysis, Elliptic, and other identity providers.
IVMS101 message construction and VASP-to-VASP transmission.
Append-only audit trail. Write-Once Read-Many for regulatory compliance.
Origin chain deposit locking. Two modes: Permit2Escrow and CompactEscrow (ResourceLock).
Destination chain fill recording. Resolves limit, dutch auction, and exclusive order types.
Cross-chain attestation verification via Hyperlane ISM integration.
Token approval infrastructure - gasless approvals and allocator-based locking.
Choose Your Path#
Submit orders, receive quotes, accept the best. Quote → sign → track → settle. Works for Direct User, Company, and Broker workspaces.
Fill RFQs. Stream bids, sign, settle origin + destination. Protocol, Company, or Broker bilateral modes.
Four persona tiers, workspace model, data visibility, onboarding options.
Running platform operations? See authentication, events, and custody for cross-cutting integration topics.
Choose Your Integration Path#
Integration Paths
| Feature | REST API | WebSocket | TypeScript SDK (Soon) | Python SDK (Soon) |
|---|---|---|---|---|
Overview5 features | ||||
Best For | Any language, full control | Real-time events | Typed server-side | Data pipelines |
Setup Time | ~1-2 days | ~1 day | on release | on release |
Real-time Quotes | ||||
Auto-reconnect | ||||
Type Safety | ||||
Quick Start#
Submit your first quote request via the REST API:
Submit an RFQ
1const res = await fetch('https://api.tetrafi.io/api/v1/quotes', {2 method: 'POST',3 headers: {4 'Authorization': 'Bearer tfk_live_...',5 'Content-Type': 'application/json',6 },7 body: JSON.stringify({8 inputToken: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',9 outputToken: '0x94b008aA00579c1307B0EF2c499aD98a8ce58e58',10 inputAmount: '1000000000000',11 originChainId: 8453,12 destinationChainId: 10,13 }),14});1516const { quotes } = await res.json();17console.log(`Received {quotes.length} competing quotes`);Core Concepts#
- RFQ - Takers broadcast trade requests; solvers respond with EIP-712 sealed bids. Best price wins.
- Solver / Taker - Solver = liquidity provider competing to fill. Taker = institutional client initiating trades.
- DvP - Delivery versus Payment. Both legs settle or neither does - no counterparty risk.
- StandardOrder (ERC-7683) - Typed intent struct: inputs on origin chain, desired outputs on destination chain.
- Oracle - Cross-chain fill proof (Hyperlane, Wormhole, Polymer, etc.). Proves the solver delivered.
- ComplianceRegistry - On-chain KYC attestation. Non-compliant addresses are rejected at the contract level.