MakerDAO - Mainnet

Collateralized Borrowing. MakerDAO-v1.2 connector on mainnet triggers methods like open, close, transfer, deposit, withdraw, borrow, payback, withdrawLiquidated, depositAndBorrow, exitDai, depositDai, withdrawDai. You can view details like source code, ABIs on Etherscan.

  • Use 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee to indicate ETH.
  • use -1 or dsa.maxValue for the maximum amount in function.
  • If not sure about the arguments getId and setId, pass 0.

Open

Open a MakerDAO Vault

spells.add({  connector: "MAKERDAO-A",  method: "open",  args: [colType]});
Parameter Type Description
colType string Type of Collateral.(eg: 'ETH-A')

Close

Close a MakerDAO Vault

spells.add({  connector: "MAKERDAO-A",  method: "close",  args: [vault]});
Parameter Type Description
vault uint256 Vault ID to close.

Transfer

Transfer a MakerDAO Vault to "nextOwner"

spells.add({  connector: "MAKERDAO-A",  method: "transfer",  args: [vault, nextOwner]});
Parameter Type Description
vault uint Vault ID to close.
nextOwner address Address of the next owner of the vault.

Deposit

Deposit collateral to a MakerDAO vault

spells.add({  connector: "MAKERDAO-A",  method: "deposit",  args: [vault, amt, getId, setId]});
Parameter Type Description
vault uint256 Vault ID. (Use 0 for last opened vault)
amt uint256 The amount of tokens to deposit. (For max: `uint256(-1)`)
getId uint256 ID to retrieve amt.
setId uint256 ID stores the amount of tokens deposited.

Withdraw

Withdraw collateral from a MakerDAO vault

spells.add({  connector: "MAKERDAO-A",  method: "withdraw",  args: [vault, amt, getId, setId]});
Parameter Type Description
vault uint256 Vault ID. (Use 0 for last opened vault)
amt uint256 The amount of tokens to withdraw. (For max: `uint256(-1)`)
getId uint256 ID to retrieve amt.
setId uint256 ID stores the amount of tokens withdrawn.

Borrow

Borrow DAI using a MakerDAO vault

spells.add({  connector: "MAKERDAO-A",  method: "borrow",  args: [vault, amt, getId, setId]});
Parameter Type Description
vault uint256 Vault ID. (Use 0 for last opened vault)
amt uint256 The amount of DAI to borrow.
getId uint256 ID to retrieve amt.
setId uint256 ID stores the amount of DAI borrowed.

Payback

Payback DAI debt owed by a MakerDAO vault

spells.add({  connector: "MAKERDAO-A",  method: "payback",  args: [vault, amt, getId, setId]});
Parameter Type Description
vault uint256 Vault ID. (Use 0 for last opened vault)
amt uint256 The amount of DAI to payback. (For max: `uint256(-1)`)
getId uint256 ID to retrieve amt.
setId uint256 ID stores the amount of DAI paid back.

WithdrawLiquidated

Withdraw leftover collateral after Liquidation.

spells.add({  connector: "MAKERDAO-A",  method: "withdrawLiquidated",  args: [vault, amt, getId, setId]});
Parameter Type Description
vault uint256 Vault ID. (Use 0 for last opened vault)
amt uint256 token amount to Withdraw. (For max: `uint256(-1)`)
getId uint256 ID to retrieve amt.
setId uint256 ID stores the amount of collateral withdrawn.

DepositAndBorrow

Deposit collateral and borrow DAI.

spells.add({  connector: "MAKERDAO-A",  method: "depositAndBorrow",  args: [vault, depositAmt, borrowAmt, getIdDeposit, getIdBorrow, setIdDeposit, setIdBorrow]});
Parameter Type Description
vault uint256 Vault ID. (Use 0 for last opened vault)
depositAmt uint256 The amount of tokens to deposit. (For max: `uint256(-1)`)
borrowAmt uint256 The amount of DAI to borrow.
getIdDeposit uint256 ID to retrieve depositAmt.
getIdBorrow uint256 ID to retrieve borrowAmt.
setIdDeposit uint256 ID stores the amount of tokens deposited.
setIdBorrow uint256 ID stores the amount of DAI borrowed.

ExitDai

Exit DAI from urn.

spells.add({  connector: "MAKERDAO-A",  method: "exitDai",  args: [vault, amt, getId, setId]});
Parameter Type Description
vault uint256 Vault ID. (Use 0 for last opened vault)
amt uint256 The amount of DAI to exit. (For max: `uint256(-1)`)
getId uint256 ID to retrieve amt.
setId uint256 ID stores the amount of DAI exited.

DepositDai

Deposit DAI in DSR.

spells.add({  connector: "MAKERDAO-A",  method: "depositDai",  args: [amt, getId, setId]});
Parameter Type Description
amt uint256 The amount of DAI to deposit. (For max: `uint256(-1)`)
getId uint256 ID to retrieve amt.
setId uint256 ID stores the amount of DAI deposited.

WithdrawDai

Withdraw DAI from DSR.

spells.add({  connector: "MAKERDAO-A",  method: "withdrawDai",  args: [amt, getId, setId]});
Parameter Type Description
amt uint256 The amount of DAI to withdraw. (For max: `uint256(-1)`)
getId uint256 ID to retrieve amt.
setId uint256 ID stores the amount of DAI withdrawn.

If you still can't find something you're looking for or have any questions, ask them at our developers community on Discord or simply send an Email.


Our team is excited about assisting you to build an application using Instadapp Developer Platform. Your questions and feedback help us make a better development environment for future developers.