← Back to projects

DeFi Protocol Engineering & Operations

Case study · anonymised client · 2024 → present

26-month full takeover of a live multi-chain DeFi protocol: contracts, dApp, non-custodial automation, treasury and governance. ~55 repositories, 3,300+ commits, 20+ external audit rounds across 5 firms.

ENGAGEMENT

2024 → present (26 months). Full takeover of a live multi-chain DeFi protocol: smart contracts, dApp, off-chain automation, treasury tooling and governance, with user funds on-chain throughout.

SCALE

~55repositories
3,300+commits
300+pull requests
350+Solidity sources
160+test suites
6EVM networks
20+external audit rounds across 5 firms

1 · COLD-START TAKEOVER

Inherited a partial black box: unverified contracts, deployer keys and multisigs outside client control, off-chain dependencies never handed over. We mapped on-chain ownership contract by contract, drove staged key/multisig transfer, rewrote unrecoverable components from verified bytecode, and restored three broken redemption paths so stranded users could exit.

2 · A PRODUCTISED TOKEN FRAMEWORK

Replaced ad-hoc per-asset integrations with one reusable spine (Depositor / Staker / Receipt token / LP staker / FeeDistributor / Whitelist) on UUPS (ERC-1967) proxies with role-based access control, storage-gap regression tests and mainnet-fork tests. Eight asset integrations now ship from it; integration lead time fell from months to weeks.

3 · VAULT ENGINEERING

ERC-4626 strategy vaults, later upgraded in place to an ERC-7540-shaped async redeem queue (request → fulfil → claim) separating NAV locking from liquidity. Cross-chain RWA vault on LayerZero V2 + Stargate V2: hub/spoke ABA routing, OFT share tokens, oracle-reported NAV, slippage preflight and explicit failure recovery, shipped with a nine-contract, auditor-grade technical report.

Async redeem vault
Async redeem vault

4 · NON-CUSTODIAL AUTOMATION

Two-service split: a proposer computes and part-signs batches; an independent executor re-validates and co-signs. Each holds its own AWS KMS key against a 2-of-N Safe, so compromising one service cannot move funds. Atomic MultiSend batches, a KV mirror as tamper-evidence layer, and layered gates: per-call cap, UTC-day cumulative cap, structural %-of-capital cap, balance invariants. Scoped and audited as web2 infrastructure, not only as contracts.

5 · FRONTEND & QUALITY ENGINEERING

Next.js 15 / React 19 / TypeScript / wagmi + viem / RainbowKit. Multichain abstraction without page reloads, a single input auto-routing between AMM swap and contract deposit, dev→staging→prod branch gating. CI runs Playwright end-to-end against a real browser wallet extension under xvfb with screenshot diffing on every PR, plus Vitest integration tests on Anvil mainnet forks.

Reading nav with viem
Reading nav with viem

6 · SECURITY & INCIDENT RESPONSE

Three third-party exploits hit held positions. Each was triaged, quantified publicly within days and given a user recovery path; one ended in the client acquiring the failed protocol. An npm supply-chain incident was traced and cleared the same day. Independent transaction-hash verification was added to every multisig signature. At sunset of the absorbed protocol we unwound positions, relinquished upgrade rights and left the contracts immutable and withdrawable indefinitely.

7 · GOVERNANCE, LEGAL, COMMS

  • 19 on-chain proposals authored and executed
  • delegate participation in three external DAOs
  • DAO legal entity registered
  • MiCA legal opinion obtained
  • jurisdiction gating implemented, then relaxed on counsel
  • two years of public weekly engineering reports

OUTCOMES

Flagship USD vault independently ranked #2 across all chains by a third-party tracker. LP vaults with consistent performance. A tangled 8–12-token legacy emission system consolidated into a single governance asset, with excess supply burned on a published schedule.

AVAILABLE FOR

  • Protocol takeover & technical due diligence
  • Solidity architecture and audit remediation
  • cross-chain vaults
  • key-split operational automation
  • dApp and test infrastructure