Skip to content
Prabal Pratap Singh
All work

DeFi ยท BTC leverage2026Testnet

Coil

BTC leverage on Mezo. Coil borrows MUSD against your bitcoin, buys more BTC on Mezo Pools and posts it back as collateral in one transaction, inside an account only you control. A permissionless guard can only make a position safer.

coil.up.railway.app
Coil website preview

Problem

Open a leveraged BTC position on Mezo in one transaction, without handing custody or upside to a keeper.

  • Looping leverage by hand takes several borrow and swap transactions, each exposed to price movement.
  • A keeper that can touch a position is a new trust assumption unless its powers are strictly limited.
  • Leverage depends on pool depth, fees and the collateral ratio, so a pool quote must not widen the owner's bounds.

Approach

  • Each owner gets an EIP-1167 clone account. The clone, not the wallet, owns the MUSD trove.
  • flashLoop borrows BTC from the MUSD/BTC pool, opens or increases the trove and repays with minted MUSD in one atomic operation.
  • guard() is permissionless but can only reduce risk; its tip pays only after a real, oracle-measured rise in the collateral ratio.
  • New factories start paused with unset caps. A guardian can pause, only the owner can unpause, and risk-reducing actions stay available.

Outcome

  • Deployed on Mezo Testnet with a public app, guard log and stats page.
  • Release candidate, unaudited. Opening new positions is currently paused on the active testnet factory.
  • The Coil fee is 0.25% on newly minted MUSD only; rescue and exit actions carry no Coil fee.

Stack

SolidityFoundryEIP-1167 clonesMezoTypeScriptNext.js

Want something like this built?

Open to founding-engineer roles. Remote or US relocation.

Email me