LogoLogo
Home Page
  • Get Started
    • What is Tren Finance?
      • LP Tokens
      • Money Market Deposits
      • Concentrated Liquidity Positions
      • PT Tokens
    • FAQ
  • TrenOS
    • What is TrenOS?
    • AI Agent Network
    • Learning & Data Processing
    • Agent Specialization
      • Interest Rate + Borrowing Fee Optimizer
      • XY
      • Asset Risk
      • Gauge
      • User Interaction
      • Market Sentiment
      • Yield Optimization
      • Proof of Liquidity
      • Collateral Manager
      • Liquidation Prediction
      • Ecosystem
    • Vector Databases & AI Knowledge Storage
    • TrenOS Architecture
    • Community-Driven AI Expansion
  • Protocol
    • Protocol Design & Risk Management
    • Isolated Modules
    • Liquidations
    • Asset Risk
      • Liquidity Risk
      • Oracle Risk
      • Security Risk
      • Centralisation Risk
    • Proof-of-Liquidity
    • Hooks
      • Looping Leverage
      • Rebase Token Wrapper
      • Auto-Rollover
      • Auto-Compounder
      • Router
    • FlashMint
    • Fees
    • Single Sided Liquidity (SSL)
    • Gauges
  • Tokens
    • XY
    • TREN & veTREN
  • Resources
    • Official Links
    • Security Audits
    • Contract Addresses
      • Withdrawing via Smart Contracts
    • Media Kit
Powered by GitBook
LogoLogo
On this page

Was this helpful?

  1. Resources
  2. Contract Addresses

Withdrawing via Smart Contracts

PreviousContract AddressesNextMedia Kit

Last updated 1 month ago

Was this helpful?

How to Repay Loans and Withdraw Collateral via Smart Contract

Follow the steps here:

  1. Go to the link below. You should be on the "Contract" and "Write as Proxy" tabs

  1. Click on the "Connect to Web3" button and connect your wallet.

  1. Click on the "+" tab next to the "_debtTokenAmount (uint256)" field. Select the 10^18 option.

  1. You should now see the following page. Click on "Write" to confirm the transaction in your wallet.

  1. 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:

  1. 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.

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 (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

0x4bD135524897333bec344e50ddD85126554E58B4
https://arbiscan.io/address/0xe534ab76e7bcb2e8559815043491e662d13d43bc#writeProxyContract