Miftahul Arifin
All projects
Blockchain & DeFi

Vault Strategy

Automated Bitcoin leverage that follows the trend, in vaults you own.

RoleSolo build
Year2025
StatusOpen source
Built withSolidity · TypeScript
119passing tests
3risk tiers
1.5×maximum leverage

Why I built it

Managing leveraged Bitcoin by hand means watching moving-average crossovers around the clock, and acting late when a signal fires overnight. I wanted the timing automated without handing custody to a platform.

What it does

How it’s built

A factory contract deploys one strategy contract per user. Rebalancing happens on-chain when the signal changes, with deposits kept separate from active collateral.

The hard part

Gas. Every rebalance touches Aave several times, and if it costs too much relative to the adjustment, the strategy eats its own returns. Cutting storage reads and batching calls kept it worthwhile.

Stack

SolidityTypeScriptAaveEVM