MakerDAO

Collateralized Borrowing

MakerDAO connector triggers methods like open vault, deposit, borrow, and others. You can view details like source code, ABIs on Etherscan.

  • If vault_id is 0, then it assumes the latest vault created.
  • use -1 or dsa.maxValue for the maximum amount in functions.
  • If not sure about the arguments getId and setId, pass 0.

Open

Open a new vault.

spells.add({
  connector: "maker",
  method: "open",
  args: [coll_name]
});
ParameterTypeDescription
coll_namestringVault collateral type like ETH-A, BAT-A, USDC-A.

Close

To close a vault.

spells.add({
  connector: "maker",
  method: "close",
  args: [vault_id]
});
ParameterTypeDescription
vault_idnumberThe vault number.

Deposit

Deposit collateral in vault.

spells.add({
  connector: "maker",
  method: "deposit",
  args: [vault_id, amount, getId, setId]
});
ParameterTypeDescription
vault_idnumberThe vault number.
amountnumberThe amount of tokens to deposit. use -1 or `dsa.maxValue` to deposit 100% of tokens.
getIdnumberID fetches the amount of token to deposit.
setIdnumberID stores the amount of token deposited.

Withdraw

Withdraw collateral from vault.

spells.add({
  connector: "maker",
  method: "withdraw",
  args: [vault_id, amount, getId, setId]
});
ParameterTypeDescription
vault_idnumberThe vault number.
amountnumberThe amount of tokens to withdraw. use -1 or `dsa.maxValue` to withdraw 100%.
getIdnumberID fetches the amount of token to withdraw.
setIdnumberID stores the amount of token withdrawn.

Borrow

Borrow DAI from vault.

spells.add({
  connector: "maker",
  method: "borrow",
  args: [vault_id, amount, getId, setId]
});
ParameterTypeDescription
vault_idaddressThe vault number.
amountnumberThe amount of DAI to borrow.
getIdnumberID fetches the amount of DAI to borrow.
setIdnumberID stores the amount of DAI borrowed.

Payback

Payback DAI Debt in vault.

spells.add({
  connector: "maker",
  method: "payback",
  args: [vault_id, amount, getId, setId]
});
ParameterTypeDescription
vault_idnumberThe vault number.
amountnumberThe amount of DAI to payback. use -1 or `dsa.maxValue` to payback 100%.
getIdnumberID fetches the amount of DAI to payback.
setIdnumberID stores the amount of DAI paid back.

Transfer

Vault ID to transfer.

spells.add({
  connector: "maker",
  method: "transfer",
  args: [vault, nextOwner]
});
ParameterTypeDescription
vaultnumberThe vault ID.
nextOwneraddressThe address of the next owner of the vault. Note: The new owner should be one the Auths of the DSA that is being transferred.

Exit DAI

Withdraws any locked DAI in a vault's urn address.

spells.add({
  connector: "maker",
  method: "exitDai",
  args: [vault, amt, getId, setId]
});
ParameterTypeDescription
vaultnumberThe vault ID.
amtnumberThe amount of DAI to payback. use -1 or `dsa.maxValue` to payback 100%.
getIdnumberID fetches the amount of DAI to payback.
setIdnumberID stores the amount of DAI paid back.

Extra Functions

Withdraw Liquidated Collateral

Withdraw the leftover collateral after a vault gets liquidated.

spells.add({
  connector: "maker",
  method: "withdrawLiquidated",
  args: [vault_id, amount, getId, setId]
});
ParameterTypeDescription
vault_idnumberThe vault number.
amountnumberThe amount of liquidated collateral. use -1 or `dsa.maxValue` to withdraw 100%.
getIdnumberID fetches the amount of liquidated collateral to withdraw.
setIdnumberID stores the amount of liquidated collateral withdrawn.

Deposit in DSR

Deposit DAI in DSR.

spells.add({
  connector: "maker",
  method: "depositDai",
  args: [amount, getId, setId]
});
ParameterTypeDescription
amountnumberThe amount of DAI to deposit in DSR. use -1 or `dsa.maxValue` to deposit 100%.
getIdnumberID fetches the amount of DAI to deposit.
setIdnumberID stores the amount of DAI deposited.

Withdraw from DSR

Withdraw DAI from DSR.

spells.add({
  connector: "maker",
  method: "withdrawDai",
  args: [amount, getId, setId]
});
ParameterTypeDescription
amountnumberThe amount of DAI to withdraw from DSR. use -1 or `dsa.maxValue` to withdraw 100%
getIdnumberID fetches the amount of DAI to withdraw.
setIdnumberID 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 Telegram, 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.

Best way to stay connected with our progress.