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

0xeF5A0CE54a519B1Db3F350EB902C4cFbf7671D88

rBUSD

0xbD5e194e63383b815460D1E2b56A942a4901855A

rUSDC

0xD58a1209BF4028b95386ad4Ff70142EB77264030

rUSDT

0x897d622aB744B0A9464a89166f47C644F5c1cC4C

rETH

0xC4542742cA19538400D6eAa52481306174Fb36c3

rWBTC

0x3592a87627f362934adfDc923601B5BFa8e62367

rBNB

0xA8c173b4666F2cb08b9E7AE0f555724D92049Ea3

rHUSD

0x9daEc6B1bE6cC593B4796801E98A7e1442569c1d

RAM

0xfE146D5710015d4075355fb7bE8d133346EC63c2

Controller

0x0d4fe8832857Bb557d8CFCf3737cbFc8aE784106

PriceOracle

0xdd6cfC683894DBAbF6f5C5B7cBD6c7b8eAfd2C9E

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