# Flatfund

Hyperliquid funding as a fixed rate. Fixed-for-floating locks on the hourly funding of Hyperliquid perps, settled in USDC on Elysium (chain 99901, gas in HYPE, USDC 0xb47c4C8F73F009CC0C0d3f92B388d13E293F0B65, 6 decimals).

## Markets
hype, btc, eth, sol (Hyperliquid perps, cap ±0.05% an hour per print) and nvda, sp500, gold (trade.xyz perps on Hyperliquid, cap ±0.10% an hour).

## Rules
- long = receive the floating funding longs pay on Hyperliquid, pay fixed (a perp long fixing its cost). short = pay floating, receive fixed (a short or basis trade fixing its income).
- A print is Hyperliquid's settled hourly funding (fundingHistory). The keeper proposes it after the hour; it is final after 15 minutes unless one of two guardians disputes it. Disputed prints never reach the index.
- PnL = side × notional × ((index now − index at open) − fixed × prints carried).
- Maturities: any 00:00 UTC from 1 to 60 days out. Margin 3% to open, 1.5% to stay; anyone may liquidate below 1.5% (reward 0.2% of notional, max 40 USDC).
- Fee 0.04% of notional on open and early close (hard cap 0.25%), 75% to the market's pool, 25% to the protocol.
- Quote: mid = w × avg(last 24 prints) + (1 − w) × avg(last 168), w = 0.75 / 0.5 / 0.35 for 7 / 30 / 60 days; each side = mid ± (0.00006% + 6% of |mid|) an hour.

## Read (keyless JSON, CORS open)
- GET https://flatfund.tech/api/markets
- GET https://flatfund.tech/api/funding?market=hype&hours=168
- GET https://flatfund.tech/api/quote?market=hype&side=long&notional=1000&tenor=30d
- GET https://flatfund.tech/api/radar?sort=abs&limit=50
- GET https://flatfund.tech/api/wallet?address=0x…
- GET https://flatfund.tech/api/backtest?market=btc&days=30
- GET https://flatfund.tech/api/chain (block, gas, contract addresses once deployed)

## MCP
Streamable HTTP, keyless, read-only: POST https://flatfund.tech/mcp. Tools: markets, funding, quote, radar, wallet, backtest, chain. It never signs; sign with your own wallet.

    claude mcp add flatfund --transport http https://flatfund.tech/mcp

Rates are decimals per hour (0.0000125 = 0.00125% an hour). The contracts are unaudited. Not investment advice.
