# Selene Tides

Liquidity that follows the HyperCore book. Each Selene tide holds one concentrated Uniswap v4 position on Elysium (chain 99901) and keeps it centred on the HyperCore mid, which a keeper posts to SeleneFeed. Deposit HYPE and the quote asset, receive ERC-20 tide shares, the range moves for you, swap fees compound.

## Tides
- HYPE/USDC (`hype-usdc`): tide 0xdBb0e7417d2236cbf6a168aD642Ac24119Eb906B; Uniswap v4 pool `0xb3032695ffb0a66e6342876dd2386835471466cb2bb70f341947d98a69e265cc` (currency0 native HYPE, currency1 USDC, fee 0.30 %, tick spacing 60, no hook); range +-600 ticks, rebalance when the reference leaves +-300 ticks of the centre.
- HYPE/KNTQ (`hype-kntq`): tide 0x439Be5E001D08DD33Aa47Ca1F7C8942f35e2Cd1e; Uniswap v4 pool `0xf9b8a9101438145d62c9f03156b203c6c573931167e2d36f9061a32575706c8a` (currency0 native HYPE, currency1 KNTQ, fee 0.30 %, tick spacing 60, no hook); range +-900 ticks, rebalance when the reference leaves +-450 ticks of the centre.
- SeleneFeed: 0xC20c291ab21339ff621DF0702Ef387AeBE6d8412. Market 1 = HYPE/USDC (HyperCore spot book @107), market 2 = HYPE/KNTQ (@107 / @334).
- Explorer: https://www.elysiumscan.io

## Read (JSON, no key)
- GET https://www.selenetide.com/api/reference : HyperCore mids and book time, measured Elysium basis (ppm), reference, keeper post and age, pool price and tick
- GET https://www.selenetide.com/api/tides : parameters, live range or the range a tide would open now, totals, share price, fees earned, last rebalance, status reason
- GET https://www.selenetide.com/api/pools : every Elysium pool Selene reads

## Act
- MCP, keyless, Streamable HTTP: POST https://www.selenetide.com/mcp. Tools: tides, reference, quote_deposit, quote_withdraw, deposit_calldata, withdraw_calldata, rebalance_status, hedge_size. It returns reads and calldata; it never signs.
- SDK: https://www.selenetide.com/sdk/selene.js (reference, tides, quoteDeposit, quoteWithdraw, depositCalldata, depositSingleCalldata, withdrawCalldata, rebalanceStatus, hedgeSize, rangeFor).
- Deposit: approve the tide for the quote token (USDC or KNTQ), then deposit(shares, max0, max1, to) with HYPE as msg.value. Use deposit_calldata to get shares and max amounts.
- First deposit into an empty tide: open(amount0Max, amount1Max, to), payable; needs a fresh reference.
- Withdraw: withdraw(shares, min0, min1, to). Always open, proportional, no oracle involved, never paused.
- Rebalance: anyone may call rebalance() when status() says so; the caller earns 5 % of the swap fees collected by that call (after the protocol share).

## Rules
- Reference = HyperCore mid x (1 + measured basis). The basis is clamped to +-3 % and moves at most 0.1 % per minute in the contract.
- A reference older than 900 s (HyperCore time) is never used: rebalance, compound and single-sided deposits stop; withdrawals and two-sided deposits keep working.
- The keeper runs once a minute: it posts both markets when a reference moves 0.20 % (HYPE/USDC) or 0.30 % (HYPE/KNTQ) or every 600 s, then calls rebalance() on any tide that is ready.
- Rebalance needs the pool within 100 ticks (HYPE/USDC) or 150 ticks (HYPE/KNTQ) of the reference and 1,800 s since the previous rebalance.
- Protocol share: 10 % of collected swap fees, capped at 20 % in code.
- No automatic hedge: Elysium contracts cannot write to HyperCore today. hedge_size gives the HYPE perp short to place yourself.
- The contracts are unaudited.
