Getting Started
Draft version.
Guides
Networks
The contract addresses of different networks are listed below.
Name
Description
Address
eRNA
Ribose Network Atom
0x3Dd95b5d01c7C8E154401e751b9F9Bfe490b85cA
eVBC
RADR network
0x95681029d4cAf9abaabb15845c9C7ADEBCE6a4fa
eUSDT
Tether USD
0xFD4Df231B04904a96F95e6A727D075277dA93d4E
eLEND
Lendland
0xBff78dF614C9FEbE012A2Bc4FD9958a4573Df6E5
eNOVA
Novaswap
0x98F007a79807943EaDcAF601d8b494726B9c3932
Unitroller
Lendland Controller
0x97153f1373862A0D44eE534fB31E92C31E70D51C
PriceOracle
Price Oracle
0x42602b74221A0081aEF237BB1fCBcc709496eF47
Math
eToken and underlying decimals
Most of the tokens of ERC20 contracts in GeneChain are 18-digits, and a few are 6-digits, such as USDT. The eTokens corresponding to these tokens are all 8-digits.
eToken
Decimals
Underlying token
Decimals
eRNA
8
RNA
18
eVBC
8
VBC
18
eUSDT
8
USDT
6
eLEND
8
LEND
18
eETH
8
ETH
18
eBTC
8
BTC
18
eNOVA
8
NOVA
18
Exchange Rate
The Exchange Rate represents the ratio between eToken and the underlying token. As market interest increases, each eToken can be converted into an ever-increasing number of underlying assets.
oneETokenInUnderlying = exchangeRateCurrent / (1 * 10 ^ (18 + underlyingDecimals - eTokenDecimals))
There is no underlying contract for RNA, so to do this with eRNA, set underlyingDecimals to 18.
Calculating Accrued Interest
Interest rates for each market update on any block in which the ratio of borrowed assets to supplied assets in the market has changed. The amount interest rates are changed depends on the interest rate model smart contract implemented for the market, and the amount of change in the ratio of borrowed assets to supplied assets in the market.
Lendland uses different interest rate modes, the corresponding contract addresses are listed below:
Name
Address
RNAInterestRateModel
0xB7C7e2B41E20AF4ffD08ce017286Cc625e5D3327
USDTInterestRateModel
0x5420fB2A471813f00647E88AABf8E4b6899E9cDb
VBCInterestRateModel
0xD64d95657c1eCC702c14425E120834dB456332E3
NovaInterestRateModel
0x2698fC941F5F79D7B7Ebf474f84c678b4bD85479
LendInterestRateModel
0x2698fC941F5F79D7B7Ebf474f84c678b4bD85479
Interest accrues to all suppliers and borrowers in a market when any GeneChain address interacts with the market’s eToken contract, calling one of these functions: mint, redeem, borrow, or repay. Successful execution of one of these functions triggers the accrueInterest method, which causes interest to be added to the underlying balance of every supplier and borrower in the market. Interest accrues for the current block, as well as each prior block in which the accrueInterest method was not triggered (no user interacted with the cToken contract). Interest compounds only during blocks in which the eToken contract has one of the aforementioned methods invoked.
Calculating the APY
The Annual Percentage Yield (APY) for supplying or borrowing in each market can be calculated using the value of supplyRatePerBlock (for supply APY) or borrowRatePerBlock (for borrow APY) in this formula:
Rate = eToken.supplyRatePerBlock(); // Integer
Rate = 2345678
RNA Mantissa = 1 * 10 ^ 18 (RNA has 18 decimal places)
Blocks Per Day = 28800 (3 seconds per block)
Days Per Year = 365
APY = ((((Rate / ETH Mantissa * Blocks Per Day + 1) ^ Days Per Year)) - 1) * 100
Last updated
Was this helpful?