One storage write per event — ~5k gas, regardless of position count
Settlement Stats
Open positions
1,000
Naive DEX gas required
25,000,000
Blocks needed (naive)
0.83
Perpl gas per event
~5,000
At this scale, naive settlement fits in a single block — barely.
Funding events — step through timeStep 1: click → Next Event
Your Position
LONG
SHORT
Premium PNL
Fsum at open (m)—
Fsum at close (j)—
Funding events held—
Lot size5
Set open and close markers to compute premium PNL
⚡ Computed in 2 reads — no matter how many events
CEX
Binance / ByBit
Centralized server
Settlement method
Background job iterates all accounts
Gas per funding event
None (off-chain)
Scales to 100k positions
✓ Yes
Trustless / verifiable
✗ No
Composable with DeFi
✗ No
FAILS
Naive DEX
General EVM smart contract
Settlement method
Loop every position, write each slot
Gas per funding event
O(N) — grows with position count
Scales to 100k positions
✗ 83 blocks at 100k pos
Trustless / verifiable
✓ Yes
Composable with DeFi
✓ Yes
APPCHAIN
Hyperliquid
Dedicated app-chain
Settlement method
Custom VM opcode — validators settle for free
Gas per funding event
Near-zero (custom opcode)
Scales to 100k positions
✓ Yes
Trustless / verifiable
⚠ Partially (custom chain)
Composable with DeFi
✗ No (isolated chain)
PERPL
Perpl
Virtualized Fsum on EVM
Settlement method
Write Fsum once; positions settle lazily on change/close
Gas per funding event
O(1) — ~5k gas always
Scales to 100k positions
✓ Yes
Trustless / verifiable
✓ Fully on-chain
Composable with DeFi
✓ Yes (Monad EVM)
The key insight: Perpl decouples the funding event (updating the market-level Fsum — O(1)) from funding settlement (computing each position's payment — deferred to the next trade or close). Positions never need to be touched at funding time. Their cumulative payment is computed lazily and exactly using just two stored values: Fsum at open and Fsum at close.