Open Leverage

To execute open leverage

  • Approve CreditCaller a big number for the token you would like to collateralise.

  • call CreditCaller.openLendCredit with parameters _recipient: borrower's address _ratios: ratio between collateral asset and borrowed asset _borrowedTokens : tokens you want to borrow _amountIn: amount of collateral asset _token : collateral asset _depositor : GMXDepositor address

To execute repay borrow

  • call CreditUser.getUserCounts with parameters _recipient : Address of borrowers

  • function return number of borrower for the borrower

  • call CreditCaller.repayCredit with parameters _borrowedIndex: index of each borrow

  • collateralAmountOut will be returned. It represents the amount of token transferred to borrower after closing the leverage.

To execute claim reward for degen farmers

  • call CreditCaller.claimFor with parameters _target: collateral reward address and manager address _recipient: borrowers address

To execute liquidation

  • call CreditCaller.liquidate with parameters _recipient : borrowers address _borrowedIndex: borrow index

Last updated