Docs
A market kiosk whose balance scale weighs coins against stock certificates

Stock pools

Stock pools (PropAMM)

How the Robinhood Chain PropAMM prices stock-token swaps against USDG with a hook-owned Uniswap v4 pool, a fair-value shield and a daily breaker.

Markdown
On this page

The PropAMM is DegenHive's market for Stock Tokens on Robinhood Chain (4663). Each stock trades against USDG in one Uniswap v4 pool, MakerHook is that pool's only liquidity provider, and every swap fee is set inside the hook.

How it works#

Five contracts run the market on Robinhood Chain:

ContractRole
MakerHookThe v4 hook for every Stock Token/USDG pool, one pool per stock. It alone adds or removes liquidity, blocks donate, enforces the DOMAIN_ENTRY pause, and computes each swap's dynamic LP fee on both MakerHook.swap and router swaps.
MakerQuoterRead-only (eth_call) quoter (quoteExactInput and quoteExactOutput) that simulates the real swap fee path and returns exact output, fee paid and post-swap tick.
MakerPilotThe on-chain engine. Anyone calls step(poolId); it sets fees, layout and auction start fees inside the guard policy bounds.
BookVaultOne per pool. LPs deposit stock and USDG; the book owns everything the hook holds for that pool. See Provide liquidity.
HiveFundThe protocol's own allocator across books. It deposits like any LP through allocate(), once per UTC day.

An off-chain poster, the fairValueUpdater, sends updateFairTick(poolId, fairTick) with the stock's reference price. When entry is paused (DOMAIN_ENTRY), swaps and deposits revert while withdrawals continue to work.

Fig. 1How MakerHook prices a swap
MAKERHOOK DYNAMIC FEEEngine ask or bid fee1Fair-value shield2Router discount3Inventory skew4Size surcharge5Calendar floor, reopen auction6Cap at 999,999 pips7Hook-only liquidityonly MakerHook adds or removes itSwapperMakerHook.swap orany v4 routerThe fee builds from rows 1 to 6and never exceeds row 7.BookVault booksone per poolMakerPilot.stepfees, layout, auctionsinside the guard policyfairValueUpdaterupdateFairTick, freshfor maxStaleSecsRows 2 and 3 apply onlywhile the fair tick is fresh.SwapperMakerHook.swap or any v4 routerMakerHook dynamic feeEngine ask or bid fee1Fair-value shield2Router discount3Inventory skew4Size surcharge5Calendar floor, reopen auction6Cap at 999,999 pips7Set byMakerPilot.steprow 1, layout and auctionsfairValueUpdaterfair tick for rows 2 and 3, while freshBookVault bookssupply all liquidity; only the hook holds it
MakerHook builds each swap's dynamic LP fee from seven layers on both MakerHook.swap and any v4 router, with inputs from MakerPilot and the fair-value poster, over liquidity only the hook holds.

The swap fee#

Every swap, through MakerHook.swap or any v4 router, applies the same dynamic LP fee in pips (1,000,000 pips = 100%) built in this order:

PartWhat it does
Engine feeaskPips for buyers of the stock, bidPips for sellers, set by the engine.
Fair-value shieldArbitrage toward a fresh fair tick pays a surcharge; flow away from it gets rebDiscountBps off.
Router discountA per-router discount (up to 8,000 bps), only while the fair tick is fresh and the trade is not arbitrage. It tapers to zero with trade size.
Inventory skewFlow that reduces the pool's drift from its day-start stock/USDG mix gets up to invRebDiscountBps off; flow that worsens it pays up to invWorsenMaxPips more.
FloorThe fee never drops below a quarter of the engine fee.
Size surchargeTrades above sizeThresholdBps of pool depth pay up to maxSizeFeePips extra.
Calendar floorThe fee is at least the closed-hours fee or the running auction fee, whichever is higher.
Cap999,999 pips.

The hook emits SwapFeeCharged(poolId, sender, zeroForOne, amountSpecified, parts) with each part, so integrators can see what a trade paid.

Fair-value shield#

The shield is fresh while block.timestamp <= updatedAt + maxStaleSecs, with maxStaleSecs at most 3,600 seconds. Each update moves at most 500 ticks from the last fair tick and lands within 1,000 ticks of the pool's TWAP. When the pool tick is more than deadbandTicks from fair, a trade toward fair pays:

Arbitrage surcharge (pips)
arb = min( (|tick - fairTick| - deadbandTicks) * 100 * lvrGainBps / 10000, maxArbFeePips )

lvrGainBps is at most 20,000 and maxArbFeePips at most 250,000. With no fresh fair tick, the shield and every router discount switch off and the pool runs on the engine fee and calendar.

Market hours#

The council sets a weekly calendar per pool in minutes after Monday 00:00 UTC: up to 16 trading sessions and 16 auction times. Outside every session the fee is at least closedFeePips (at most the guard's maxFeePips, 10%). At each auction time the fee floor starts at the armed start fee and falls linearly to zero over auctionDuration (1 minute to 1 hour). This is a reopen Dutch auction: the price gap that builds while the stock market is closed is sold to the first trader who accepts the falling fee.

MakerPilot.step#

MakerPilot.step(bytes32 poolId) is permissionless and runs at most once per minStepSecs (60 seconds to 1 day) per pool. It reads only the pool's own TWAP, holdings and day-start mix. It measures volatility, sets a fee level plus inventory skew, picks a calm or storm layout, and arms the next auction's start fee. The guard policy bounds every action: fees inside [minFeePips, maxFeePips], the average fee moving at most feeStepPips per feePeriod, and layout changes rate-limited by layoutInterval and layoutsPerDay.

The daily breaker#

On the first check of each UTC day the hook records the pool's holdings at the TWAP. If the pool later loses more than dayLossBps against simply holding those day-start tokens, the breaker trips. The engine is locked for dayLockSecs, fees go to safeFeePips, and all liquidity moves to full range. Clearing the breaker early (clearBreaker) waits the 2-day timelock.

Why this limits LVR#

Loss-versus-rebalancing (LVR) is what an AMM gives away when arbitrageurs trade against its stale price after the real price moves. The PropAMM narrows that loss in four places:

  • The shield prices arbitrage by its distance to fair value, so the pool keeps part of each move.
  • Closed-hours fees stop cheap trades against a price that cannot be checked.
  • Reopen auctions sell the overnight gap through a falling fee.
  • The breaker caps one day's loss against holding.

The book's performance fee is charged on gain over holding, so it is paid only when the pool beats holding its tokens.

The numbers#

ParameterBoundWho changes it
Swap fee cap999,999 pipsFixed
maxFeePips (engine)1 to 100,000 pipsCouncil, 2-day timelock
maxStaleSecs0 (off) to 3,600 sCouncil, 2-day timelock
lvrGainBps / maxArbFeePips≤ 20,000 / ≤ 250,000Council, 2-day timelock
Router discount≤ 8,000 bpsCut at once, raise after 2 days
auctionMaxPips≤ 200,000Council, 2-day timelock
dayLossBps / dayLockSecs1 to 2,000 bps / 1 hour to 30 daysCouncil, 2-day timelock
Calendar≤ 16 sessions, ≤ 16 auctionsCouncil, immediate

Edge cases#

  • Swaps revert with EmptyPool on both routes if the full-range position has no liquidity.
  • While DOMAIN_ENTRY is paused, every swap reverts with DomainError (directly in MakerHook.swap and in beforeSwap for routers), including the books' own fee sales. Book withdrawals still run.
  • MakerHook.swap enforces the DOMAIN_ENTRY pause directly, computes the same dynamic LP fee stack (fair-value shield, swap guard and calendar floor) with sender set to the hook itself, and emits SwapFeeCharged. A router discount applies to MakerHook.swap only if the hook's own address is listed.

These docs describe the architecture and smart contracts across Hyperliquid L1 (HyperEVM) (chain id 999) and Robinhood Chain (chain id 4663). Nothing here is investment advice or a promise of returns. DegenHive is not affiliated with, endorsed by, or sponsored by Hyperliquid, Robinhood Markets, Inc., Nasdaq, Inc., or their affiliates.