For the complete documentation index, see llms.txt. This page is also available as Markdown.

How to Supply

You can supply any supported asset and earn interest across any chain through Replete by interacting with RepletePool . After supplying collateral, you are able to create borrow positions with supported assets or withdraw to a different chain.

From Any Chain

To supply native token (if supported) through RepletePool, set the asset parameter as RepletePool.ETH_ADDRESS() and set amount as the intended supply amount. Ensure that msg.value covers the bridge transfer fee too. msg.value should equal amount + bridgeFee.

If supplying native is not supported, the function will revert with error Replete_UnsupportedAsset(address asset)

Interface

Stargate v1

 /**
  * @notice Supplies an `amount` of `asset` into the reserve, receiving in return overlying rTokens.
  * - E.g. User supplies 100 USDC and gets in return 100 rUSDC
  * @dev Ensure that this contract has enough allowance to spend `asset` locally
  * @param asset The local underlying asset to supply
  * @param amount The amount to be supplied in local asset decimals
  * @param onBehalfOf The address that will receive the rTokens on Pool Chain.
  *  Even if you will not transact on Pool Chain, it is recommended to set this
  *  to an address you can control.
  * @param referralCode Referral code for integrators -- can safely set to 0
  * @param stgParams Stargate v1 related bridge parameters
  */
function supply(
   address asset,
   uint256 amount,
   address onBehalfOf,
   uint16 referralCode,
   StargateSupplyParams calldata stgParams
) external payable;

Stargate v2

Example

Stargate v1

Stargate v2

Last updated