RAY deposits are represented as ERC-20 tokens, called RAY tokens. RAY tokens perpetually increase in value as the underlying accrues interest, and can be used in many applications through its ERC-20 interface.
Token | Kovan Address |
rayETH | |
rayDAI | |
rayUSDC |
Kovan ETH can be retrieved from the Kovan faucet, and Kovan DAI and Kovan USDC are available through the Compound app.
Please use the RAY Discord to ask questions, interact with the community, and talk to RAY developers! RAY Discord Invite​
Action | Average |
Mint | 127,480 |
Withdraw | 644,306 |
Deposit assets and receive RAY tokens. Deposits of ERC-20 tokens require approval of the appropriate RAY token contract beforehand.
Note the unique function signature for ETH and ERC-20 mints. The function to use depends on your deposit token (ETH or an ERC-20). Use the tabs below to toggle the functions.
​function mint() external payable returns (uint);
​function mint(uint mintAmount) external returns (uint);
msg.sender
is the account which deposits the assets.
Ether
There are no function parameters. However, remember to send the ETH value in the transaction as the value
field.
ERC-20 Tokens
mintAmount
- amount to deposit in the smallest units of the asset.
The amount of RAY tokens received in exchange for the deposited assets.
Retrieve the amount of the underlying (deposited) asset a RAY token holder owns. Uses the exchangeRateBurn()
(see below).
​function balanceOfUnderlying(address owner) external returns (uint)
Ether & ERC-20 Tokens
owner
- Address of the RAY token holder.
The balance of the underlying asset, in the smallest units of the asset.
Redeem a number of RAY tokens for the underlying asset.
​function redeem(uint redeemTokens) external returns (uint)
Ether & ERC-20 Tokens
redeemTokens
- the amount of RAY tokens to redeem.
The amount of the underlying assets received by the caller.
Redeem a specified amount of the underlying asset.
​function redeemUnderlying(uint redeemAmount) external
Ether & ERC-20 Tokens
redeemAmount
- the amount of the underlying asset to redeem, in the smallest units of the underlying asset.
Nothing.
Each RAY Token is convertible into a perpetually increasing quantity of the underlying asset, as yield is earned by RAY.
Exchange Rate Current
Use exchangeRateCurrent()
to find the current exchange rate between RAY Tokens <> underlying asset. This is the fully realized value of a RAY Token. Use this to find the full value of a RAY Token.
Note, the function is not view
because it may change state.
function exchangeRateCurrent() external returns (uint)
The fully realized exchange rate between RAY Tokens and the underlying asset, in units of wei (scaled by 1e18
).
Exchange Rate Burn
Use exchangeRateBurn()
to find the burn exchange rate between RAY Tokens <> underlying asset. This is always either less than or equal to the exchangeRateCurrent()
- and doesn't reflect all the yield earnt by RAY.
The burn exchange rate is used to price RAY Tokens on burn - also known as withdrawals from RAY. Use this to get the value of a RAY Token if one was to withdrew at that instant.
Note, this function is not view
because it may change state - though generally, it won't.
function exchangeRateBurn() external returns (uint)
The exchange rate between RAY Tokens and the underlying asset, used to price RAY Tokens upon withdrawal from the system. In units of wei (scaled by 1e18
).