Withdrawing via Smart Contracts
Last updated
Was this helpful?
Last updated
Was this helpful?
Follow the steps here:
Go to the link below. You should be on the "Contract" and "Write as Proxy" tabs https://arbiscan.io/address/0xe534ab76e7bcb2e8559815043491e662d13d43bc#writeProxyContract
Click on the "Connect to Web3" button and connect your wallet.
Repay your XY debt first by clicking on "8. repayDebtTokens." Enter the token contract address of the isolated module in which you borrowed XY from in the "_asset (address) field". For example, enter 0x4bD135524897333bec344e50ddD85126554E58B4 (contract address of USDC/USDM Curve LP token) if you borrowed XY in the USDC/USDM Curve LP isolated module. Next, Enter the XY amount that you wish to repay under the "_debtTokenAmount (uint256)" field. Under the "_upperHint (address)" and "lowerHint(address)" fields, enter 0x0000000000000000000000000000000000000000
Click on the "+" tab next to the "_debtTokenAmount (uint256)" field. Select the 10^18 option.
You should now see the following page. Click on "Write" to confirm the transaction in your wallet.
Next, withdraw your collateral. Click on "16. withdrawColl" Enter the collateral token amount that you wish to withdraw under the "_collWithdrawal (uint256)" field. For example, if you want to withdraw 5 USDM/Curve LP tokens, enter 5. This is the only difference from steps 3, 4, and 5, so follow the same steps as you did previously. Once you have completed the steps, you should see the following:
Click on "Write" to confirm the transaction in your wallet. You have now successfully repaid your loan and withdrew your collateral via Tren Finance's smart contracts.