Smart contract withdrawals

As shown in the dApp funds on Reya Network are non-custodial and available to withdraw at anytime. A withdrawal button on the dApp is coming soon, but in the interim you can withdraw directly from the Reya Network smart contracts.

Follow the guide below to withdraw from the smart contracts.

  1. Bridge ETH to Reya Network for gas fees and Socket bridge fees by using this bridge: Note that:

    1. The bridge does not support ETH withdrawals for the time being, so make sure you don’t bridge too much ETH.

    2. Trading on Reya Network is made gas-free via a relayer architecture, if you’re interacting with the contracts directly you will need to pay a small amount of gas (hence the ETH needed).

  2. Withdraw funds from the Passive Pool into your wallet on Reya Network by calling the removeLiquidity function here: To do this, you need to input the following parameters:

    1. poolId: 1

    2. sharesAmount: the amount you want to withdraw multiplied by 10^30 (10 to the power of 30).

    3. minAmount: the amount you want to withdraw multiplied by 10^6

    For example, if you want to withdraw 99.5 rUSD, the parameters will be:

    1. poolId: 1

    2. sharesAmount: 99500000000000000000000000000000

    3. minAmount: 99500000

  3. Unwrap rUSD into USDC by calling the withdraw function here: To do this, you need to input the following parameters:

    1. amount: the amount withdrawn at the previous step, same as minAmount (multiplied by 1000000). For example, if you withdrawn 99.5 rUSD, the parameters will be amount = 99500000

  4. Confirm you have USDC in your Reya Wallet.

  5. Once confirmed, you should bridge funds from Reya Network to a source chain (Ethereum Mainnet/Arbitrum/Optimism/Polygon). To do this, you have to call the bridge function on the Socket contract here:

    1. receiver: your wallet address on the source chain (the chain you are withdrawing to)

    2. amount: the amount withdrawn at the previous steps, same as minAmount (still multiplied by 1000000).

      1. note: the pull down at the end of the row will help you multiply by 10^6 but this number should be the same as the one used in the previous steps

    3. msgGasLimit: 10000000

    4. connector: the socket connector address assigned to the source chain you want to withdraw to.

      NetworkConnector Address

      Ethereum Mainnet








    5. execPayload: 0x

    6. options: 0x

    7. Send native ETH (uint256): the socket bridge fees. As these are dynamic, you can use 10000000000000000 to account for most cases (this is equivalent to 0.01 ETH). Note that you can use lower amount as well (e.g. 1000000000000000, which is equivalent to 0.001 ETH), but it might fail if Socket fees increase.

    Upon completion of these steps, funds should be in the destination wallet address entered, on the network corresponding to the network connecter address used, in 10-15min. If you have not received your funds after an hour, please open a support ticket in our Discord and we can try and help.

Last updated