POOL is the oracle HOOK is the exchange 10× max leverage 1% swap tax · 40 pol / 30 treasury / 20 burn / 10 insurance 5% liquidation bounty · anyone can claim 5 min mark twap · 10 min liq twap 25% oi cap per side · 10% per address 0.1%/hr funding rate clamp BURN 20% of swap fees · keeper-callable NO oracle · NO engine · NO emissions POOL is the oracle HOOK is the exchange 10× max leverage 1% swap tax · 40 pol / 30 treasury / 20 burn / 10 insurance 5% liquidation bounty · anyone can claim 5 min mark twap · 10 min liq twap 25% oi cap per side · 10% per address 0.1%/hr funding rate clamp BURN 20% of swap fees · keeper-callable NO oracle · NO engine · NO emissions
v0.1 · uniswap v4 hook audit in progress

Perps,
hooked into
Uniswap V4.

Coil is a perpetuals protocol that lives entirely inside a Uniswap V4 pool — no oracle, no engine, no separate book. Mark price is the pool's own TWAP. Positions are virtual. The hook does the work. Anyone can liquidate.

@Coilperpseth ↗
10×
max leverage
1%
swap tax · 4-way split
5%
liq bounty · anyone
0ms
oracle lag
— Coil / mark vs spot · live
k = 0.024 · stiffness
SPOT TWAP t-30 t-15 t-5 now funding · -kx
F = −kx
restoring force ≈
funding rate · oi imbalance
01 / how it works

Three primitives. Nothing else.

Most perp protocols are an exchange bolted onto an oracle bolted onto a settlement engine. Coil deletes the middle two. The pool is the oracle. The hook is the exchange. Liquidity is its own counterparty.

01 primitive
Virtual positions, real liquidity.

Opening a long doesn't swap. The hook records collateral, entry tick, and size against the pool's reserves. P&L settles in collateral on close. No CEX-style book, no internal AMM — just bookkeeping over Uniswap.

flash-loan safe·
02 primitive
Mark price is the pool's own TWAP.

V4 exposes tick cumulatives natively. Coil reads a 30-block TWAP for mark, 60-block for liquidations. A flash loan can move spot for one block — it cannot move a 60-block TWAP without sustained capital that exceeds the OI cap.

no chainlink·
03 primitive
LPs are the counterparty.

When longs exceed shorts, LPs are net short — and funding flows from longs to LPs. Plus 40% of every 1% swap tax routes to POL — permanent liquidity growth. Plus swap fees. Three streams, one position. No new token, no emissions.

real yield·
02 / why "coil"

The protocol is, literally, a spring.

Robert Hooke discovered in 1660 that the force restoring a spring is proportional to its displacement. Three and a half centuries later that equation turns out to also describe a perpetual.

When mark drifts above spot, longs are over-paid. Funding kicks in, taxing longs and rewarding shorts — pulling mark back. The further the displacement, the harder the pull. F = −kx.

Every Coil pool has one tunable parameter: k, the funding stiffness. Higher k means faster mean reversion. Same math, every market.

funding = k · ( marktwap − spottwap ) / spottwap k = 0.024 · clamped ±0.1%/hr · paid per block
SPOT MARK F = −kx ·1660 displacement → restoring force
03 / anti-mev stack

Six layers between you and the bot.

Every previous "perps on AMM" attempt got drained by flash loans or sandwiched into oblivion. Coil addresses each known attack class explicitly. None of these are clever; together they make the math not pencil out for the attacker.

L1
30-block TWAP mark
Mark price = tickCumulative averaged over the last 30 blocks. A flash-loan price spike is one block of work; it cannot move the average enough to extract before the loan unwinds.
L2
60-block liquidation TWAP
Liquidations use a longer, more conservative TWAP than the mark. Spikes that wouldn't liquidate a healthy position at spot can't liquidate it on Coil either.
L3
Open-interest cap at 25% of reserves
Total notional per side is capped relative to pool depth. The attacker can never hold a position big enough to make the mark dance to their tune.
L4
Same-block open-close blocked
The hook rejects close transactions on positions opened in the same block. Kills the textbook sandwich: open at spot, push price with own swap, close at favorable mark.
L5
Funding rate clamp · ±0.1%/hr
Funding is hard-capped per period. A pumped OI imbalance can't suddenly drain leveraged positions through funding alone.
L6
Insurance fund · 10% of fees
10% of every fee flows to the insurance fund, which absorbs bad-debt events and gas-refunds liquidators. Solvency doesn't depend on a token.
04 / who shows up

Two sides. One pool.

A trader and an LP touching Coil are doing different things mechanically — but they're touching the same contract, drawing from the same reserves, settling against the same TWAP.

For traders

— virtual perp positions, isolated margin
  • 01Deposit ETH or USDC as isolated collateral.flexible
  • 02Choose direction and leverage up to 10×.≤10×
  • 03Entry & mark = pool's TWAP tick, not spot.twap
  • 04P&L accrues continuously; funding ticks every block.per block
  • 05Close anytime — settlement debits/credits collateral.instant
  • 06Health factor < 1/15 → auto-liquidatable.1/15

For LPs

— three yield streams, one position
  • 01Provide liquidity to the ETH/USDC V4 pool.v4
  • 02Collect swap fees as on any V4 pool.0.05–0.30%
  • 03POL grows from 40% of swap fees permanently.40% / swap
  • 04Collect funding when OI is imbalanced.net
  • 05Bad debt absorbed by insurance fund first.10% fees
  • 06Withdraw anytime, subject to OI utilization.≤80%
05 / architecture

One pool, one hook, one keeper market.

The entire protocol is two contracts: the V4 pool and the Coil hook. There is no governance proxy, no oracle adapter, no off-chain matching engine. Keepers are anyone.

Trader openPosition() closePosition() Swapper / LP swap() addLiquidity() Coil Hook beforeSwap · afterSwap virtual position book funding accrual · per block tick TWAP reader liquidation engine V4 Pool ETH / USDC tickCumulative Liquidator liquidate(id) → 5% Insurance Fund 10% of fees collateral, intent swap, lp read tick · charge fee bounty backstop
06 / specs

Numbers, not vibes.

v0.1 mainnet parameters. All values are governable through a 7-day timelock — there is no admin key that can mutate them instantly.

MAX_LEVERAGE
Maximum opening leverage per position.
10.00×
LIQUIDATION_LEVERAGE
Position is liquidatable when effective leverage exceeds this. Maintenance margin = 1/15.
15.00×
MARK_TWAP_BLOCKS
Window over which tick cumulatives are averaged for entry, P&L and funding.
30
LIQ_TWAP_BLOCKS
Conservative window used by the liquidation engine only.
60
OI_CAP_PER_SIDE
Open interest per side capped as fraction of pool reserves.
25%
OPEN_FEE_BPS / CLOSE_FEE_BPS
Fee on open and on close, denominated in ETH notional.
0.5% / 0.5%
FUNDING_K
Stiffness coefficient. Higher → faster mean reversion.
0.024
FUNDING_CLAMP
Hard cap on funding per hour to prevent griefing.
±0.1%/hr
LIQUIDATION_BOUNTY
Fraction of remaining collateral paid to whoever calls liquidate().
5.00%
PARTIAL_LIQ_THRESHOLD
Positions above this notional liquidate in 50% chunks via Dutch auction.
50 ETH
INSURANCE_TAKE
Fraction of swap-tax fees routed to insurance fund.
10.00%
SAME_BLOCK_CLOSE
Whether positions opened this block can be closed this block.
disabled
07 / liquidation

Anyone can liquidate. Most do it for a living.

Coil runs an open keeper market. The bounty is large enough to fund a competitive bot operation, the partial-liquidation Dutch auction prevents winner-takes-all gas wars, and the insurance fund covers gas on losses.

i.

Health check

Any address calls liquidate(positionId). The hook recomputes the position's health using the 60-block TWAP.

ii.

Threshold gate

Reverts unless collateral / positionValue < 1/15. Healthy positions cost only the caller's gas — protocol pays nothing.

iii.

Settlement

Position is closed at TWAP. Remaining collateral is computed after P&L and accrued funding.

iv.

Bounty payout

5% of remaining collateral goes directly to the caller. The trader keeps the rest. The protocol takes nothing.

v.

Gas refund

If the liquidation succeeded but bounty < gas spent, insurance tops up. Keepers never lose money on a valid call.

vi.

Large positions

Positions > 50 ETH liquidate in 50% chunks via Dutch auction — no single bot can monopolize them, no PGA on gas.

Liquidator economics

A liquidator running a watcher on Coil can expect tail returns competitive with the best perp keepers — without proprietary oracle feeds. The contract is the oracle.

Sample math: a 10 ETH position liquidated at health-factor floor with 0.9 ETH remaining collateral pays the keeper 0.045 ETH (~$150 at $3.4k).

5%
bounty · paid in collateral · plus gas refund · partial liq on size > 50 ETH
08 / roadmap

Ship, then generalize.

One market on one chain first. Get the math right in production. Then generalize the hook to arbitrary V4 pools.

Q2 · 2026 · now

Devnet & audit

  • Hook reference impl
  • Tick TWAP integration
  • Foundry invariant suite
  • Audit firm engaged
Q3 · 2026

Testnet beta

  • ETH/USDC on Base Sepolia
  • Public liquidator API
  • Keeper bot reference
  • Frontend v1
Q4 · 2026

Mainnet · single market

  • ETH/USDC live, Base
  • Capped TVL ramp
  • Insurance bootstrap
  • Audit report public
2027 →

Multi-pool & multi-chain

  • Permissionless markets
  • BSC · Arbitrum · Unichain
  • Cross-margin mode
  • k governance via timelock

The pool is the oracle.
The hook is the exchange.

Permissionless perpetuals don't need a new chain, a new oracle, or a new token. They needed a hook.