Building Blocks
Lending Market Owner/Authority:
This is the account that owns the entire pool, there is one for Main, Isolated, etc.
Lending Market (state)
Contains all the reserves.
Reserves State (Market-level positions)
For every pool, each token has its own reserve, this is where Supply/Balances are tracked, and is updated using the account value * pyth_price pulled from oracles
Obligations State (User-level positions)
Each user’s position is called an obligation, and is updated using RefreshObligation by calling Pyth_price + the % of Liquidity provided (for supply) or cumulative borrow rate (for borrows)
Reserves State:
  • Asset: Reserve Token
  • Address: Reserve Address that contains the ATA of the liquidity
  • CollateralMintAddress: cToken Mint Address
  • CollateralSupplyAddress: Where cTokens are held to be used as collateral
  • Liquidity Address: ATA of the Reserve that contains the tokens
  • LiquidityFeeReceiverAddress: Where borrow fees generated are held before being sweep into the protocol treasury
Example:
1
},
2
{
3
"asset": "UST",
4
"address": "Ab48bKsiEzdm481mGaNVmv9m9DmXsWWxcYHM588M59Yd",
5
"collateralMintAddress": "nZtL8HKX3aQtk3VpdvtdwPpXF2uMia522Pnan2meqdf",
6
"collateralSupplyAddress": "4HXDioboWL85gQocYNkWM62AB5ctrf8jVykSVco67Lzx",
7
"liquidityAddress": "5LyHdTXh1MSbRzE7xfTtfpV8W5eaySJnSiTs6FdHhrSo",
8
"liquidityFeeReceiverAddress": "4GctGML68E1kDcvskGTXRPY9ngxmxVnJXjpsJ68YBXPR",
9
"userSupplyCap": 5000000
10
},
11
{
Copied!
Copy link