Skip to main content

RToken (Isolated Pools)

The RToken contract represents a tokenized supply position within an isolated liquidity pool. Each market in an isolated pool deploys its own RToken instance, which wraps an underlying asset and enables it to be used for lending and borrowing within that pool.

Overview

The isolated pool RToken is deployed on a per-pool basis. Each RToken accrues interest independently and interacts exclusively with its parent pool's Comptroller for risk management. Users receive RTokens upon supplying assets and redeem them to withdraw their principal plus accrued interest.

Key Functions

mint

Supplies underlying tokens to the market and mints RTokens to the caller.

function mint(uint256 mintAmount) external returns (uint256);

redeem / redeemUnderlying

Redeems RTokens for the underlying asset. redeem specifies the number of RTokens to burn, while redeemUnderlying specifies the amount of underlying to receive.

function redeem(uint256 redeemTokens) external returns (uint256);
function redeemUnderlying(uint256 redeemAmount) external returns (uint256);

borrow

Borrows underlying tokens from the market against the caller's collateral.

function borrow(uint256 borrowAmount) external returns (uint256);

repayBorrow

Repays an outstanding borrow on behalf of the caller or another account.

function repayBorrow(uint256 repayAmount) external returns (uint256);
function repayBorrowBehalf(address borrower, uint256 repayAmount) external returns (uint256);

liquidateBorrow

Liquidates an under-collateralized borrower's position, seizing their collateral.

function liquidateBorrow(
address borrower,
uint256 repayAmount,
IRToken rTokenCollateral
) external returns (uint256);

exchangeRateCurrent

Returns the current exchange rate between RTokens and the underlying asset.

function exchangeRateCurrent() external returns (uint256);

See Also