Skip to main contentSkip to FAQSkip to contact
2 min read

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.

Traditional OTC

Manual OTC Settlement

  • Phone calls and chat negotiations
  • Manual KYC per counterparty
  • T+1 to T+3 settlement
  • Counterparty risk exposure
  • No audit trail
With TetraFi

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

@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

Choose Your Path#

Running platform operations? See authentication, events, and custody for cross-cutting integration topics.

Choose Your Integration Path#

Integration Paths

FeatureREST API
WebSocketTypeScript SDK (Soon)Python SDK (Soon)
Overview5 features
Best For
Any language, full controlReal-time eventsTyped server-sideData pipelines
Setup Time
~1-2 days~1 dayon releaseon release
Real-time Quotes
Auto-reconnect
Type Safety

Quick Start#

Submit your first quote request via the REST API:

Submit an RFQ

Language
TypeScript
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});
15
16const { quotes } = await res.json();
17console.log(`Received {quotes.length} competing quotes`);
17 linestypescript

Coming Soon SDK preview. Commands below target the upcoming @tetrafi/sdk (TypeScript) and tetrafi-sdk (Python). Use REST / WebSocket directly until release. The terminal demo below previews the intended SDK experience.

Install & First Request
Press play to start demo...

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.
What's newFull changelog