Virtualized Funding

Three interactives: the gas problem, how Fsum works, and how different systems compare.

The Gas Problem
Fsum Walkthrough
System Comparison

Drag to see how funding settlement scales with position count

Each approach's gas requirement vs the block gas limit (30M gas). Naive DEX must iterate every position; Perpl always writes a single value.

1,000
CEX (Binance / ByBit) ✓ NO GAS
Background job — zero on-chain cost
Naive DEX (loop all positions) ✓ OK
Appchain (Hyperliquid-style) ⚠ APPCHAIN ONLY
Custom opcodes — validators absorb settlement cost (requires dedicated chain)
Perpl (virtualized Fsum) ✓ O(1) — ALWAYS ~5k GAS
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 time Step 1: click → Next Event

Your Position

LONG
SHORT

Premium PNL

Fsum at open (m)
Fsum at close (j)
Funding events held
Lot size 5
Set open and close markers
to compute premium PNL
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.