Lending Protocol
Technical documentation for the Bond lending smart contracts.
Architecture
The Bond lending protocol is a custom implementation deployed on the 0G Network. It uses a modular contract architecture with separate contracts for core lending logic, asset management, interest rate calculations, and oracle price feeds.
Contract Addresses (0G Mainnet)
Wrapped 0G (W0G)
0x1Cd0690fF9a693f5EF2dD976660a8dAFc81A109c ↗LendingManager
0x9579CD27C44E87924735E8345c6c091a72d0B21E ↗LendingInterface
0xC7a0b95eA4B7Db08a6Ab7566D2E32D32655E0bb8 ↗CoinFactory
0x8B7939ba488Ff916257404461CF5bE535100f262 ↗LendingCoreAlgorithm
0x48588b412AdD3e04bfF7FbA3be82f673a9D85B8F ↗LendingVaults
0x4E98435A8AAf5208985a2Cf996271Ba08C58F24e ↗RewardContract
0x973Ea4496Ea7C127d2bbF0F378ca12510d3056F4 ↗DepositOrLoanCoinBeacon
0x8c4Cd3Ea063E3755470aE9Fd12D25F17e3Dd16cB ↗Deployment: og-mainnet-prod · Network: 0G Mainnet · Chain ID: 16661
Core Contracts
LendingManager
Central contract managing lending pools, user positions, supply/borrow operations, and collateral state. Orchestrates interactions between other contracts.
LendingInterface
Read-only interface contract providing aggregated views of market data, user positions, and protocol metrics. Used by the frontend for efficient data fetching.
CoinFactory
Factory contract for creating and managing lending pool assets. Handles deposit and loan token minting/burning for each supported asset.
LendingCoreAlgorithm
Pure math contract implementing the interest rate model, health factor calculation, liquidation threshold checks, and utilisation-based rate curves.
LendingVaults
Vault management contract handling isolated lending pools, risk separation, and per-vault accounting.
Oracle
Price oracle integration using Chainlink-compatible AggregatorV3 feeds. Provides real-time asset valuations for collateral assessment and liquidation checks.
RewardContract
Manages protocol incentive distribution and reward accrual for lending participants.
Lending Modes
Mode 0: High Liquidity
Standard shared lending pool with market-driven interest rates. All assets in this mode share the same risk pool and collateral is cross-margined.
Mode 1: Risk Isolation
Isolated lending pools with capped exposure. Each asset has a maximum lending amount, limiting protocol exposure to volatile or newer assets.
Mode 2+: Homogeneous
Specialised lending pools with custom LTV ratios for specific asset pairs or strategies.
Key Parameters (Per Asset)
collateralFactor
Max borrow power as % of supply value
liquidationThreshold
Collateral ratio triggering liquidation
liquidationPenalty
Fee applied to collateral during liquidation
reserveFactor
Protocol's share of interest revenue (0-1)
bestLendingRatio
Optimal utilisation threshold (basis points)
bestDepositInterestRate
Supply rate at optimal utilisation (basis points)
supplyCap
Maximum amount that can be supplied
borrowCap
Maximum amount that can be borrowed