on-solana · acting within the slot

Your position has a guardthat fires before theliquidator does.

Wick reads a leveraged perps position on every slot and acts at the threshold — autonomous on Drift, co-signed on Jupiter. You hold the keys. Wick holds the trigger.

WICK // AUTONOMOUS GUARD
WATCH
>
dispatch
187µs
venue
Drift
status
protected
WITHDRIFTJUPITERPYTHMAGICBLOCKSOLANA

WHAT RUNS ON A TICK

MAGICBLOCK

Ephemeral Rollup

The guard PDA delegates into the ER so Drift checks run inside a slot, then commits back to L1.

DRIFT

Autonomous

The guard holds a delegation and signs the reduce-only CPI itself. Nonce commits on land.

JUPITER

Co-signed

No delegation, so the guard builds the instruction and waits. You sign it on L1.

PYTH

Verified price

Every tick prices against a PriceUpdateV2 inside the staleness and confidence gate.

POLICY

USD caps

Per-action and daily caps are checked in USD notional, and the daily total accumulates.

SOLVER

Smallest close

A bounded binary search finds the least you have to close to get back above the buffer.

ROUTECONFIG

Kill switch

Every state-mutating instruction checks the pause flag — and rejects if it is missing.

01 — THE GUARD

The guard, explained

A delegated guard reads the position's health each tick. When it dips, the guard responds on the authority regime the venue allows — autonomously where it holds a delegation, build-only where it does not.

HEALTH

Health is recomputed on every tick from the verified Pyth price, your collateral and position size — in fixed point, cross-multiplied, never divided. The trigger buffer sits above the liquidation threshold, so there is room to move.

1.001.342.00
cross-multiplied every tick — equity vs maintenance margin

TRIGGER

At the threshold the guard acts. A bounded solver finds the smallest partial close that restores the buffer, caps are enforced in USD, and the order is reduce-only by construction — the guard cannot open exposure.

health1.15 trigger
distance to trigger 0.19

PROOF

The nonce only commits once the venue action actually lands, so a failed dispatch never looks like a success. Nothing is silently skipped: if no action fits inside your caps, the guard escalates instead of no-oping.

  • reduce order built
  • reduce order signed
  • reduce order landed
  • dispatch 187µs · nonce committed on land
02 — SPEED

Latency is the product

Dispatch is measured from the tick entering the guard to the venue CPI landing. Every number below is read out of a recorded benchmark run — not a live feed, and not a projection.

AUTONOMOUS DISPATCH LATENCY
recorded sample · n=300 · vs L1 slot ~400ms
0500µs1.0ms1.5ms50ms target — off scale, 267× headroom
min 178µsp50 187µsp99 266µsmax 1.40ms

litesvm in-process: OnTick -> velocity place_perp_order CPI lands

P50
0µs
vs ~400ms slot
P99
0µs
recorded tail
SAMPLES
0
recorded dispatches
HEADROOM
0×
under the 50ms lane
03 — MAGICBLOCK

A cascade does not wait for the next block

Liquidations happen inside a slot. A guard that can only act once per block is reading a price that has already moved. Wick delegates its guard PDA into a MagicBlock Ephemeral Rollup so it can check, decide and dispatch many times inside the window the move is actually happening in.

Powered by MagicBlockEPHEMERAL ROLLUPS
ON L1 ALONE

One check per ~400ms slot

A liquidation cascade moves inside a slot. If the guard only wakes when the next block lands, the price it read is already history and the position is already gone.

1 check per 400ms slot

  • price read is a block old before it is used
  • one tick per slot, no matter how fast the move
  • every check pays L1 fees and contends for blockspace
DELEGATED TO THE ER

187µs per check, measured

The guard PDA delegates into a MagicBlock Ephemeral Rollup. Checks run on delegated state at ER speed, and the state commits back to L1 — so the guard reacts inside the window the cascade actually happens in.

≈2,139 checks fit in the same slot

  • p50 dispatch 187µs over 300 recorded runs
  • many ticks inside a single L1 slot
  • state commits back to L1; ownership reverts on undelegate

THE ROUND TRIP

  1. Delegateix 4
    Guard delegates into the ER
    owner signs · PDA moves to the validator
  2. OnPriceTickix 7
    Ticks run on delegated state
    187µs p50 · price → health → caps → dispatch
  3. Commitix 6
    State commits back to L1
    guard stays delegated
  4. CommitAndUndelegateix 5
    Session ends, ownership reverts
    final commit · PDA returns to the program
04 — MECHANISM

One tick, eight stages

The critical path inside a single OnPriceTick instruction. The order is load-bearing: price before health, health before nonce, caps before dispatch. Any stage can reject, and a rejected tick mutates nothing.

  1. 01
    Read Pyth price
    PriceUpdateV2, Full-verified
  2. 02
    Check staleness
    3 stale ticks → degraded
  3. 03
    Compute health
    cross-multiplied, no division
  4. 04
    Check nonce
    monotonic, steps by one
  5. 05
    Enforce caps
    per-action + daily USD
  6. 06
    Select action
    TP → top-up → partial close
  7. 07
    Dispatch
    autonomous, or build for owner
  8. 08
    Commit nonce
    only once the action lands

WATCH → DETECT → ACT → CONFIRM