Skip to content
All docs

Threat model

Assume the trader, relayer and keeper are malicious, the UI is compromised, the indexer lies, an RPC returns stale data, the market gaps, and third parties revert. The question in each row: can funds move other than by the contract rules?

AssumptionWhat the adversary triesWhat stops itResidual risk
Trader is maliciousover-leverage, off-market closes, claim paper profit, withdraw credit, average down past limitsdesk policy checks + stamps; flat-only claims; no credit withdrawal path; Perpl negPnl stamplosing their own stake; gap risk beyond the stake (measured, see paired desk)
Relayer is maliciousalter fields, replay, delay, hold orderssignature over all fields + per-desk domain; nonce; deadline; lastExecutionBlock stampcan drop or delay orders; trader can self-submit
Keeper is maliciousenforce healthy desks, farm bounty, enforce at a bad momentDeskHealthy; bounty once at final settlement from residual only; closes priced at mark +/- 1%a breached desk can be enforced at any moment after the breach (by design)
UI is compromisedtrick the trader into a bad orderthe trader still signs the exact fields; contract limits hold regardless of UIa malicious UI can request a valid-but-unwanted order inside limits
Indexer liesfake history, fake exposurenothing authorizes from the indexer; money screens read chain on two RPCs; keeper reads RPCmisleading history display
RPC is stale or lyingfake success"verified" requires agreement of an independent RPC at the receipt block; disagreement shows verification failedboth RPCs colluding
Market gapsjump through the floor before enforcementstake share above max drawdown; per-desk notional and gross caps; venue liquidation/ADLprincipal loss beyond stakes on large gaps (measured: 206.40 AUSD at a 15% gap without an effective desk cap; ~0 with the 2x cap)
Perpl reverts / halts / freezestrap a desknamed errors; enforce records EnforceCloseFailed and stays Enforcing; trading reverts cleanlyfunds stuck while the venue is halted or the account is frozen
AUSD frozen / pausedblock transfersnone (issuer power)funds stuck
Opposite desks across identitieswin on one desk, breach the other into pool capitalcaps calibrated by the paired-desk self-attack; no Sybil claimbounded by caps in the measured scenarios only
Operator compromiseddrain the poolno transfer function; cap increases timelocked; cohorts immutablepausing growth; lowering caps (blocks new risk, never reductions)

Out of scope

Perpl and Agora admin actions; a stolen, unlocked trader device during an active session (30-minute idle timeout limits the window; payouts only go to the trader's own address); smart-contract bugs not covered by tests (no audit yet).