Skip to main content
Perpetra is built from a set of focused pieces rather than one large contract, each one responsible for a single job. Here’s what each one does and roughly how they connect. For live addresses, see Contract Addresses.

How the pieces connect

What each piece does

Custody holds every deposited token and is the only place funds actually move in or out of. Everything else, fees, liquidation payouts, funding, moves value by instructing this piece, never by holding funds itself. See Deposits & Withdrawals. Order signing checks that a submitted order was genuinely authorized by the trader who claims to have placed it. See Order Signing. Off-chain matching pairs up compatible orders before anything reaches the chain. See Off-Chain Matching Engine. Settlement is where a matched trade actually becomes a position, or closes an existing one, on-chain. Risk limits & position health decides whether a trade is currently allowed, and whether an open position is still healthy or needs to be liquidated. See Risk Engine. Price feeds supply the reference and mark prices everything else depends on. See Mark Price & Index Price. Funding payments move value between longs and shorts on a schedule, keeping Perpetra’s price aligned with the broader market. See Funding Rate. Fee collection takes trading and liquidation fees and routes them onward to their destinations. See Fees. Liquidation is the dedicated system for closing out unhealthy positions. See Liquidation Engine. Points & referrals tracks trading and deposit activity, plus referral relationships, for future rewards. See Points & Referrals. Insurance backstop covers the gap on liquidations where a position’s own collateral wasn’t enough to cover what was owed. Approved bot whitelist decides which off-chain bots are allowed to trigger any of the automated pieces above. See Keeper System.