Pool Contract
Overview
VarlaPool is the liquidity hub. Lenders deposit stablecoins and receive vault shares. As borrowers pay interest, the share price increases — lenders earn yield simply by holding shares.
Key Functions
| Function | Description | Access |
|---|---|---|
deposit(assets, receiver) | Deposit stablecoins, receive vault shares | Public |
withdraw(assets, receiver, owner) | Burn shares, receive stablecoins | Public |
redeem(shares, receiver, owner) | Redeem specific share amount | Public |
totalAssets() | Stablecoins in pool + outstanding borrows, minus reserves | View |
convertToShares(assets) | Preview shares for a deposit amount | View |
convertToAssets(shares) | Preview assets for a share amount | View |
Share Price Growth
Share price formula
sharePrice ≈ totalAssets / totalShares
totalAssets = availableLiquidity + totalBorrows - reserves - pendingReserveFee
As borrowers pay interest:
├── totalBorrows grows (interest accrues)
├── 90% goes to lenders (increases totalAssets)
├── 10% goes to reserves
└── sharePrice increases → lenders earn yieldShare conversions follow OpenZeppelin's ERC-4626 implementation, which adds one virtual share and one virtual asset to protect against inflation attacks. Results are rounded in favor of the vault.
ℹERC-4626 compatible
VarlaPool implements the full ERC-4626 standard. Any wallet, aggregator, or DeFi protocol that supports ERC-4626 vaults can integrate with Varla's lending pool.