Modular DeFi banking
on Polygon.
A four-contract banking suite β yield-bearing savings, over-collateralized lending, and an on-chain treasury. No intermediaries. No API keys. No LLM.
// GET STARTED
Test the protocol in 4 steps.
BankChain runs on local Hardhat. 100M BCK are minted at genesis; the Treasury account holds 90M.
- STEP 01
Start the local node
From the repo root, run
npx hardhat nodein one terminal. It prints 20 test accounts β copy any private key for later. - STEP 02
Add Hardhat to MetaMask
Network name: Hardhat Local, RPC URL:
http://127.0.0.1:8545, Chain ID:31337, symbol: ETH. - STEP 03
Send yourself test BCK
Import one of the Hardhat accounts into MetaMask. From the Treasury (
0x5FbDβ¦80aa3) BCK is mintable by deployer β easiest: use the deployer account, it owns 99M+ BCK. - STEP 04
Deposit & earn
Open Vault, approve BCK, then deposit. Yield starts accruing per-second from lending-pool interest.
// PROTOCOL
Four contracts. One banking primitive.
Each contract is a single-responsibility module owned by a Timelock Treasury. Composable, upgrade-safe, fully on-chain.
BankToken
BCKERC-20 base
Mintable, burnable, pausable. Permit-enabled for gasless approvals. Owned by Treasury.
SavingsVault
svBCKERC-4626 vault
Yield-bearing shares. Deposits earn from lending pool interest minus a 5% performance fee.
LendingPool
LendOver-collateralized
Compound-style borrow index, 80% LTV, utilization-based interest, on-chain liquidation.
Treasury
TIMELOCKGovernance
OZ TimelockController with 24h delay. All parameter changes route through it. No multisig shortcuts.
Treasury ββownsββ> BankToken Treasury ββownsββ> SavingsVault Treasury ββownsββ> LendingPool SavingsVault ββusesββ> BankToken (deposit/withdraw asset) LendingPool ββusesββ> BankToken (collateral + borrow)
// HOW IT WORKS
Two products. Three steps.
Hold BCK
Get BankChain tokens from the Treasury faucet on testnet, or swap on a DEX on mainnet.
Deposit or Borrow
Deposit BCK into the Vault to earn yield, OR post BCK as collateral to borrow against it.
Earn & Repay
Vault yield accrues per-second. Loan interest is fixed-rate, utilization-based. Withdraw or repay anytime.
// WHY THIS
Different from Aave, Compound, Uniswap.
Most DeFi protocols optimize for billions in TVL. BankChain optimizes for clarity, testability, and verifiability.
| Property | Aave / Compound | BankChain |
|---|---|---|
| Contracts | 20+ across versions | 4 contracts |
| Lines of code (core) | 5,000+ | ~700 |
| Local full-stack test | Impossible (mainnet forks) | 10 min β `npx hardhat node` |
| Frontend | Massive codebase | Next.js 14, 6 routes |
| Backend indexer | Subgraph / TheGraph | Express + Prisma + SQLite |
| Governance | Snapshot + multi-sig | OZ TimelockController (24h) |
| AI / LLM dependency | None | None β slash commands only |
The trade-off: not built for billions in TVL. Built to be readable, forkable, and 100% testable locally.
// ORIGIN
A reference implementation, not a yield farm.
Existing DeFi protocols are production-grade but intimidating β thousands of lines of code, layered upgradeability, dependencies on oracles and off-chain workers. Hard to audit, harder to fork, almost impossible to run locally end-to-end.
BankChain is the opposite. Four contracts, one treasury, ~700 lines of Solidity. Every parameter is timelock-controlled. Every function is event-emitted. The full stack β contracts, backend indexer, frontend, slash-command UI β runs on a single laptop with npx hardhat node and three terminals.
The point isn't to compete with Aave on TVL. The point is to give developers a readable, forkable, end-to-end-testable DeFi primitive they can extend, audit, or integrate. MIT licensed. No API key required.
// TOKENOMICS
100,000,000 BCK. Fixed supply.
No inflation. No minting after genesis (timelock-controlled). Allocations released via linear vesting.
Liquidity backstop, grants, parameter changes (timelock-controlled)
Partner integrations, audits, bug bounty
DEX listings, market making
4-year linear vesting, 1-year cliff
Initial lending liquidity (deposited at genesis)
// ROADMAP
Where we're going.
Genesis
- βContracts written (4 files, 700+ LOC)
- βOpenZeppelin 5.x base
- βHardhat test suite (48 passing)
- βLocal deployment verified
Public testnet
- βPublic testnet deployment
- βFaucet for BCK
- βFrontend launch on bankchain.vercel.app
- βExternal audit kickoff
Mainnet + Governance
- βPolygon mainnet launch
- βSnapshot-based governance
- βBug bounty program (up to $50K)
- βMulti-sig on Treasury
Cross-chain + V2
- βArbitrum + Base deployments
- βFlash loans (V2)
- βLP-token collateral types
- βMobile app (React Native)
// SECURITY
Built to be attacked. Hardened to survive.
Timelock-controlled parameters
All sensitive changes (fees, LTV, mint authority) pass through a 24h timelock with public queue.
Two-step ownership transfer
Every privileged contract uses OpenZeppelin's Ownable2Step β no accidental transfer to dead addresses.
OpenZeppelin battle-tested
ERC20, ERC4626, TimelockController, ReentrancyGuard, Pausable, Permit β all v5.x, all audited by OZ.
Compound-style interest model
RAY-precision borrow index, snapshotted on every user action, immune to single-tx inflation attacks.
Reentrancy-guarded
All value-moving functions use ReentrancyGuard. No external calls before state writes.
Test coverage
48 Hardhat tests covering mint, burn, share math, borrow, repay, interest accrual, liquidation, and edge cases.