Levva Liquidity Balancer
2025 — 26Optimization · Rust
A Rust MILP solver that allocates vault liquidity in production.
Protocol & Smart Contract Engineer · Remote
I build DeFi protocols end to end — deriving the mechanism math, writing the smart contracts, and building the Rust and C# services that run them in production. My work has shipped to mainnet and through audits, from leveraged-trading pools to multi-asset yield vaults, across EVM, Solana, Substrate, and Stellar. This is where I keep my work, my writing, and the occasional derivation I'm still chasing.
Optimization · Rust
A Rust MILP solver that allocates vault liquidity in production.
Protocol Engineer
Lead author of an upgradeable ERC-4626 multi-asset vault — plus the C# backend.
Protocol Engineer — built from scratch
Leveraged-trading EVM protocol — I derived its deleverage-coefficient model and was top contributor.
Deriving Marginly's deleverage coefficients with linear algebra — an extra coefficient on top of the scaled-balance trick Aave already uses, and why the whole thing collapses into a few numbers you can update in O(1).
Reworking Levva's vault liquidity balancer from an earlier C# heuristic into a Rust solver that works out — globally, in one pass — exactly how much to move along each route. Modeled as flows on a graph and solved as a MILP; the moves come out cheapest as a bonus.
A companion to the Marginly math. Spreading one borrower's bad debt across a whole pool collapses, in the single-token case, into a tidy 2×2 coefficient you apply globally — the same scaled-balance trick. With many tokens at different prices it looks like it balloons into an ever-growing tensor. It doesn't have to: with the right state it stays a finite matrix — just no longer a tidy one.