SDK
Deposit & Borrow

Deposit & Borrow

Usage

import { Matrix } from '@morphous/trinity'
 
const data = Matrix.depositBorrow(
  morphoMarketAddress,
  txDeadline,
  fromWallet,
  toWallet,
  supplyMarketAddress,
  borrowMarketAddress,
  supplyToken,
  borrowToken,
  userAddress,
  smartWalletAddress,
  supplyValue,
  borrowValue
)

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 deposited from the user's wallet, false if the funds should be deposited from the user's DSProxy.

toWallet

boolean - true if the funds should be transfered to the user's wallet, false if the funds should stay on the user's DSProxy.

supplyMarketAddress

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

borrowMarketAddress

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

supplyToken

Token - Object with supply token data

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

borrowToken

Token - Object with borrow token data

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

userAddress

string - User's wallet address.

smartWalletAddress

string - User's DSProxy address.

supplyValue

BigNumber - Value to deposit.

borrowValue

BigNumber - Value to borrow.

Last updated on December 26, 2022