Architecture
Technical architecture of the Trufonomics exchange
Overview
Trufonomics is built on the TRUF Network, which uses Kwil-DB (decentralized SQL) for consensus rather than a traditional EVM smart contract model. This means the orderbook, matching engine, and settlement logic all run as SQL operations within the Kwil consensus layer.
System Architecture
Core Components
TRUF Network Node
Each node runs a PostgreSQL-based state machine with the following components:
| Component | Function | Frequency |
|---|---|---|
| Orderbook | Limit order storage with FIFO priority | Real-time |
| Matching Engine | Direct, mint, and burn operations | Per-order |
| Settlement | Resolves markets against oracle data | Every 5 min |
| LP Rewards | Distributes to liquidity providers | ~50 blocks |
Data Layer (Truflation)
Separation of concerns
Truflation is an independent oracle — it provides data but does not control the exchange. This is the same relationship as Bloomberg to CME.
Truflation operates independently as the data provider:
- 60+ economic data streams across 9 categories
- Daily updates for most indicators
- Categories: inflation, labor, housing, retail, crypto, commodities, equities, index
Collateral System
- ERC20 token bridge for deposits/withdrawals
- Lock/unlock mechanism (not a separate vault contract)
- All collateral accounting happens within Kwil-DB
SDK Access
import { TrufNetworkClient } from "@trufnetwork/sdk-js"
const client = new TrufNetworkClient({
endpoint: "http://node:8484",
signerInfo: { address: walletAddress, signer }
})
// Place a buy order
await client.PlaceBuyOrder({
marketId: "us-inflation-march-2026",
price: 0.65,
quantity: 100
})Full orderbook + trading + data streams.
import "github.com/trufnetwork/sdk-go/core"
client := core.NewTrufNetworkClient(core.Config{
Endpoint: "http://node:8484",
})
// Query orderbook
orderbook, _ := client.GetOrderBook("us-inflation-march-2026")Full orderbook + indexer examples.
from trufnetwork import TrufNetworkClient
client = TrufNetworkClient(endpoint="http://node:8484")
# Read data streams only
data = client.get_stream("st1x4x...")Data streams only — no orderbook support yet.
Why Not EVM?
No gas costs
SQL-level operations at consensus speed without per-transaction gas costs.
No MEV
No validator front-running — FIFO queue priority means position beats speed.
Full orderbook on-chain
Practical to run limit orders, matching, and settlement entirely on-chain.