TVL–
Volume 24h–
Fees (all time)–
Paid to lockers–
Buybacks–
Epoch ends in–

Market Guard

A stock token's pool can drift from the real share price. The first trader to bring it back takes the gap from liquidity providers. Market Guard makes that trade pay part of the gap to the LPs instead.

How it works

oracle    = (feed0 / 10^feedDecimals0) / (feed1 / 10^feedDecimals1) × 10^dec1 / 10^dec0
deviation = |poolPrice − oracle| / oracle                     (pips, before the swap)
guardFee  = captureBps × (deviation − tolerance)  only for the swap that moves the pool towards the oracle
  • Feeds are Chainlink USD feeds on Robinhood Chain (the zero address counts as 1 USD, for USDG).
  • Trades the other way, and every trade while the pool is within the free range, pay nothing extra.
  • The market's maximum LP fee still caps the total.
  • Recommended for stock tokens: both feeds set, free range 1.5%, capture 50%, max answer age 25 hours (the feeds update on a 0.5% move or every 24 hours, and follow US equities 24/5).

When it switches itself off

Any doubt about the oracle switches the guard off for that swap, and swaps never fail because of it: no oracle set, a feed that reverts, returns too little data, burns its gas budget (100k per read; only five words of the answer are copied), a non-positive answer, an update time of zero or in the future, an answer older than the maximum age, or the sequencer uptime feed (if set) reporting down or a restart within the grace period. Stock feeds stop on weekends, so the guard pauses once their answers are older than the maximum age.

Reading it

FeeHook.guardState(key) returns (on, feeZeroForOne, feeOneForZero, deviationPips); MarketRegistry.oracleOf(id) returns the settings. The owner sets an oracle through the timelock (setMarketOracle); the guardian can switch it off at once (clearMarketOracle).