Smart contract withdrawals
Last updated
Last updated
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.
Bridge ETH to Reya Network for gas fees and Socket bridge fees by using this bridge: https://bridge.gelato.network/bridge/reya-network. Note that:
The bridge does not support ETH withdrawals for the time being, so make sure you don’t bridge too much ETH.
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).
Withdraw funds from the Passive Pool into your wallet on Reya Network by calling the removeLiquidity function here: https://usecannon.com/packages/reya-omnibus/latest/1729-main/interact/reya-omnibus/PassivePoolProxy/0xB4B77d6180cc14472A9a7BDFF01cc2459368D413#selector-0x0b7c92f9. To do this, you need to input the following parameters:
poolId: 1
sharesAmount: the amount you want to withdraw multiplied by 10^30 (10 to the power of 30).
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:
poolId: 1
sharesAmount: 99500000000000000000000000000000
minAmount: 99500000
Unwrap rUSD into USDC by calling the withdraw function here: https://usecannon.com/packages/reya-omnibus/latest/1729-main/interact/reya-omnibus/RUSDProxy/0xa9F32a851B1800742e47725DA54a09A7Ef2556A3#selector-0x2e1a7d4d. To do this, you need to input the following parameters:
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
Confirm you have USDC in your Reya Wallet.
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: https://explorer.reya.network/address/0x1d43076909Ca139BFaC4EbB7194518bE3638fc76?tab=write_contract#405e720a.
receiver: your wallet address on the source chain (the chain you are withdrawing to)
amount: the amount withdrawn at the previous steps, same as minAmount (still multiplied by 1000000).
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
msgGasLimit: 10000000
connector: the socket connector address assigned to the source chain you want to withdraw to.
execPayload: 0x
options: 0x
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.
Add the chain to your wallet. There is a link in the footer of: https://explorer.reya.network/
Add the token at address: 0x3B860c0b53f2e8bd5264AA7c3451d41263C933F2 For example using Metamask: Enter the contract address and the symbol and decimals should auto-populate. Press Next
To do this, you have to provide the following parameters:
Network | Connector Address |
---|---|
Ethereum Mainnet
0x807B2e8724cDf346c87EEFF4E309bbFCb8681eC1
Arbitrum
0x663dc7E91157c58079f55C1BF5ee1BdB6401Ca7a
Optimism
0xe48AE3B68f0560d4aaA312E12fD687630C948561
Polygon
0x54CAA0946dA179425e1abB169C020004284d64D3