Skip to content
03 / LATENCY

How long a pool stays stale

40 shocks on testnet. On block timestamps, a swap on Base Sepolia reaches the Parallax hook on Unichain Sepolia in p50 1,800 ms (p95 2,600 ms). An off-chain watcher polling public RPC endpoints sees the callback p50 4,044 ms after it sees the Base receipt.

Observer clock, one dot per loop

0s1s2s3s4s5sp50 4,044 ms · p95 4,563 ms
Hopp50 msp95 msmin msmax ms
Base receipt → Lasna react()1,8352,1671,3032,808
Lasna react() → Unichain callback2,1782,7644023,145
Full loop: Base → Unichain4,0444,5632,4934,950

n = 40. Observer clock: the time between this process seeing the Base receipt and seeing each log, from one machine polling every 100 ms.

Both clocks

Spannp50 msp95 msmin msmax ms
Chain: Base block time → Unichain callback block time401,8002,6001,0002,600
Observer: Base receipt seen → Unichain callback seen404,0444,5632,4934,950
Observer: Base receipt seen → Lasna react() seen401,8352,1671,3032,808
Observer: Lasna react() seen → Unichain callback seen402,1782,7644023,145
Observer: shock sent → Base receipt seen401,0531,3419671,968

Method

  1. npm run bench sends a swap on the Base Sepolia reference pool that moves the price 80 to 300 ticks, alternating direction. Every shock is above the reactive contract's 10-tick threshold, so every shock should close a loop.
  2. The script polls all three chains every 100 ms. It looks for the shock receipt on Base, then for the ReferenceForwarded log on the Lasna reactive diamond and the ReferenceUpdated log on the Unichain hook, both filtered by the indexed origin transaction hash.
  3. The chain clock subtracts the Base block timestampMs from the Unichain block timestamp. Anyone can reproduce it from the explorers. Unichain timestamps are whole seconds, so each value carries up to about 1 s of quantisation.
  4. The observer clock takes every reading in one process on one machine, so skew between chains cannot distort it. It includes the time public RPC nodes take to serve a new block and its logs, which is why it is higher than the chain clock.
  5. Lasna block timestamps run slightly behind Base's clock, so a Lasna-only chain-clock split is not meaningful and is not quoted. Per-hop figures use the observer clock.

Raw data and the generated report: LATENCY.md and data/. Every loop is listed in the loop explorer.

The window that is left

The shield works only after the callback lands. An arbitrageur who reaches a Unichain block first still trades at the old reference and pays the base fee. Every second Reactive takes off the loop shrinks this window. Below: the same bot racing both pools, once reacting immediately and once 3 s after the Base receipt.

Bot reacts immediately

base feesurgecallback p50 1,800 msbot's arb lands p50 3,000 ms0s1s2s3s4s5s
Poolarb tradesbefore callbackafter callbackavg fee paidarbitrageur profit (pUSD)
Shielded120121.713%-348.05
Control120120.050%283.97

Bot reacts 3 s after the Base receipt

base feesurgecallback p50 1,800 ms0s1s2s3s4s5s
Poolarb tradesbefore callbackafter callbackavg fee paidarbitrageur profit (pUSD)
Shielded140141.209%8.30
Control100100.050%216.02

Arbitrageur profit is valued at the Base reference price and equals the LPs' loss against rebalancing on those trades. The bot previews the hook's fee and trades only the profitable part of the gap. A second pass after the callback takes whatever is still profitable.