# Liquidisium

Uniswap v4 hooks that plug Elysium pools (chain 99901) into Hyperliquid. A swap that moves a Liquidisium pool toward the HyperCore reference pays 80% of the gap as its fee, capped at 3%. Every other swap pays 0.05%. A reference older than 120 s or more than 10% away: flat 0.30%.

Reference = HyperCore mid (spot @107 for HYPE/USDC, @107 / @334 for HYPE/KNTQ) x the measured Elysium basis, posted by a keeper until EL1Read.

## Read
- GET /api/reference : mids, basis, keeper post and age, pool price, gap, buy and sell fee (pips)
- GET /api/markets : pool keys (native HYPE as currency0, fee 0x800000, tick spacing 10), ids
- GET /api/pools?window=86400 : swaps, volume, base fees, gap fees to LPs
- GET /api/swaps?limit=100 , /api/channels , /api/posts

## Act
- MCP (keyless, Streamable HTTP): POST /mcp. Tools: markets, reference, quote_fee, pool_stats, hedge_size, open_pool_calldata, register_channel_calldata. Reads and calldata only.
- SDK: /sdk/liquidisium.js (reference, quoteFee, swapCalldata, openPoolCalldata, hedgeSize, poolStats)
- Swaps go through the v4 UniversalRouter 0x1B341FDD55d56F8E08409A2C25DDFad93Eb03C1a (V4_SWAP, SWAP_EXACT_IN_SINGLE). Quote tokens need Permit2 approval.

## Rules an arbitrageur should know
- Toward swap with gap g >= 0.10%: fee = min(3%, max(0.05%, 0.8 g)). LPs get 0.05% + 0.8 (fee - 0.05%).
- Your all-in price on a toward swap stays on your side of the reference.
- The contracts are unaudited.
