RAY Tokens

Interact with the ERC-20 version of RAY deposits.

Overview

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.

Mainnet Contracts

Kovan Contracts

Testing Resources

Kovan ETH can be retrieved from the Kovan faucet, and Kovan DAI and Kovan USDC are available through the Compound app.

Community & Team Support

Please use the RAY Discord to ask questions, interact with the community, and talk to RAY developers! RAY Discord Invite

Gas Costs

Action

Average

Mint

127,480

Withdraw

644,306

Mint

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.

Ether
ERC-20 Tokens
Ether
function mint() external payable returns (uint);
ERC-20 Tokens
function mint(uint mintAmount) external returns (uint);

msg.sender is the account which deposits the assets.

Function Parameters
Return Values
Function Parameters

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.

Return Values

The amount of RAY tokens received in exchange for the deposited assets.

Balance of Underlying

Retrieve the amount of the underlying (deposited) asset a RAY token holder owns.

Ether & ERC-20 Tokens
Ether & ERC-20 Tokens
function balanceOfUnderlying(address owner) external returns (uint)
Function Parameters
Return Values
Function Parameters

Ether & ERC-20 Tokens

owner - Address of the RAY token holder.

Return Values

The balance of the underlying asset, in the smallest units of the asset.

Redeem

Redeem a number of RAY tokens for the underlying asset.

Ether & ERC-20 Tokens
Ether & ERC-20 Tokens
function redeem(uint redeemTokens) external returns (uint)
Function Parameters
Return Values
Function Parameters

Ether & ERC-20 Tokens

redeemTokens - the amount of RAY tokens to redeem.

Return Values

The amount of the underlying assets received by the caller.

Redeem Underlying

Redeem a specified amount of the underlying asset.

Ether & ERC-20 Tokens
Ether & ERC-20 Tokens
function redeemUnderlying(uint redeemAmount) external
Function Parameters
Return Values
Function Parameters

Ether & ERC-20 Tokens

redeemAmount - the amount of the underlying asset to redeem, in the smallest units of the underlying asset.

Return Values

Nothing.