SDK
Simple Actions
Repay

Repay

Usage

import { Matrix } from '@morphous/trinity'
 
const data = Matrix.repay(
  morphoMarketAddress,
  txDeadline,
  fromWallet,
  marketAddress,
  token,
  userAddress,
  smartWalletAddress,
  value,
  max,
)

Configuration

morphoMarketAddress

string - The Morpho Proxy market address, either Morpho Compound or Morpho Aave v2. The corresponding address can be found in Morpho's developer documentation (opens in a new tab).

txDeadline

number - The period of time before the transaction is reverted (in seconds).

fromWallet

boolean - true if the funds should be repayed from the user's wallet, false if the funds should be repayed from the user's DSProxy.

marketAddress

string - Compound or Aave v2 market address. It can be found in Compound's documentation (opens in a new tab) or Aave v2 documentation (opens in a new tab).

token

Token - Object with token data

{
  address: string
  name: string
  symbol: string
  decimals: number
  extensions?: any
}

userAddress

string - User's wallet address.

smartWalletAddress

string - User's DSProxy address.

value

BigNumber - Value to repay.

max

boolean - true if all the debt should be repayed, false if not.

Last updated on December 26, 2022