Docs
How Twine works.
Twine is a Uniswap v4 hook. The hook makes a pool behave less like a passive AMM and more like a tightly-managed pair-trade vehicle. Two long-only tokens, one continuously enforced economic relationship.
The hook
Every swap routes through the hook's beforeSwap callback. The hook reads two oracle prices and the pool's current ratio, computes the implied drift from fair value, and returns an asymmetric fee. Swaps that move the pool toward fair are discounted below the base fee; swaps that move it away are surcharged. The result is a market force that pulls the pool back to the implied equilibrium without LPs or stakers having to actively manage anything.
LPs vs stakers
Liquidity providers deposit token0 and token1, mint non-transferable LP shares against a TwinePositionManager, and collect a share of swap fees in both tokens. They do not bear structural-break risk.
STRAND stakers deposit a governance asset into the per-pool underwriting vault. They earn a configurable cut of swap fees in token0/token1 but underwrite the pool: when the hook declares a structural break, it seizes a fraction of staked STRAND to fund a rebalance and every staker takes a pro-rata haircut. A seven-day cooldown blocks staker flight during a break.
Market hours
MSTRX has a real underlying - a US-listed equity. When NYSE is closed the equity oracle stops updating, so Twine cannot honestly price the leg and cannot promise the spread will converge. The hook reads NYSE hours directly on-chain (no off-chain feed; the calendar is hardcoded with DST and US market holidays through 2030, with governance extension), and changes pool behavior accordingly:
- Swaps stay open, at a flat symmetric fee. The asymmetric mechanic is paused until reopen.
- Deposits are blocked. Entering during close means committing capital at a price the protocol explicitly isn't policing - the in-band check would reference a 60-hour-old equity quote, and the asymmetric mechanic that's the whole reason to LP here is off. "Disclose and let them choose" isn't real protection, so the protocol refuses the deposit instead.
- Withdrawals stay open, the entire time. Existing LPs already committed with a defined risk profile; letting them out is "you can change your mind."
- Structural-break detection is paused. The hard-threshold drawdown only runs when prices are live.
Reopens automatically at 9:30 AM ET on the next trading day. No keeper involved.
Structural breaks
If the oracle disagrees with the pool by more than a hard threshold (default 15%) and the pool's recent drawdown exceeds a separate threshold, the hook flips a structuralBreak flag and disables both directional fees and new LP deposits. A drawdown from the vault funds the rebalance back to fair value. Withdrawals stay open the entire time.
Status
Spec version v0.17 Build phase Phases 0-10 complete · live on Base Sepolia Contracts Solidity 0.8.26 (BUSL hook / MIT elsewhere) Audit pending Network Base Sepolia testnet (mocked equity leg)
Source
Deployment
- Chain
- 84532
- Hook
- 0xC5E3357238255445692feFB489F99863bf6EeaC0 ↗
- Position manager
- 0xdf0F7aA4f31aF3088bA558EEd6dd612c47e90Fd0 ↗
- Swap router
- 0xDbD19EA0328dB437BdcCac799b198203a42FCf92 ↗
- Governor
- 0x45377adccdC8102b7938f82E98CdBdF046dC3Cc0 ↗
- Vault
- 0x27AA677242639c008d03CD061E40D9e137b912Ac ↗
- STRAND
- 0x3669C787077db8a7F9B10B21b32D5900Dbae0faE ↗
- Token0
- 0xB975a9637B95F7E7c49C3A1AdEe64997fd8bc9A6 ↗
- Token1
- 0xE7AE1E125D5f0C03143ff37D4F7455E4372D443F ↗