Getting Started
These docs are a comprehensive guide to the Ram protocol.
Contracts
The Ram Protocol contracts are fully open and verified, visit us on:
GitHub Link | Desciption |
Comment-rich contracts, for contributors, reviewers, and auditors. | |
Simplified interfaces, for projects to integrate Ram Protocol. | |
Contract ABIs. |
Networks
The Ram Protocol is currently deployed on the following networks:
Contract | ABI | Address |
rTT |
| |
rBUSD |
| |
rUSDC |
| |
rUSDT |
| |
rETH |
| |
rWBTC |
| |
rBNB |
| |
rHUSD |
| |
RAM |
| |
Controller |
| |
PriceOracle |
|
Protocol Math
The Ram protocol contracts use a system of exponential math, in order to represent fractional quantities with sufficient precision.
Most numbers are represented as a mantissa, an unsigned integer scaled by 1 * 10 ^ 18, in order to perform basic math at a high level of precision.
rToken and Underlying Decimals
Prices and exchange rates are scaled by the decimals unique to each asset; rTokens are ERC-20 tokens with 8 decimals, while their underlying tokens vary, and have a public member named decimals.
rToken | rToken Decimals | Underlying | Underlying Decimals |
rTT | 8 | TT | 18 |
rBUSD | 8 | TT-BUSD | 18 |
rUSDC | 8 | TT-USDC | 6 |
rUSDT | 8 | TT-USDT | 6 |
rETH | 8 | TT-ETH | 18 |
rWBTC | 8 | TT-WBTC | 8 |
rBNB | 8 | TT-BNB | 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.
Interest accrues to all suppliers and borrowers in a market when any ThunderCore address interacts with the market’s rToken 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 rToken contract). Interest compounds only during blocks in which the rToken contract has one of the aforementioned methods invoked.
Last updated