MakerDAO

Interact with the Maker Protocol

These connectors allow you to interact with the Maker Protocol. Use these connectors to create Vaults, generate DAI and payback debt.

Open

This connector opens a new Maker Vault

spells.add({
  connector: "maker",
  method: "open",
  args: [coll_name]
});

Parameter

Type

Description

coll_name

string

Vault collateral type like ETH-A, BAT-A, USDC-A, etc.

Close

This connector closes a Maker Vault

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

Parameter

Type

Description

vault_id

number

vault number

Deposit

This connector deposits collateral in Vault

spells.add({
  connector: "maker",
  method: "deposit",
  args: [vault_id, amount, getId, setId]
});

Parameter

Type

Description

vault_id

number

vault number

amount

number

The amount of tokens to deposit. use -1 or `dsa.maxValue` to deposit 100% of tokens.

getId

number

ID fetches the amount of token to deposit.

setId

number

ID stores the amount of token deposited.

Withdraw

This connector withdraws collateral from Vault

spells.add({
  connector: "maker",
  method: "withdraw",
  args: [vault_id, amount, getId, setId]
});

Parameter

Type

Description

vault_id

number

vault number.

amount

number

The amount of tokens to withdraw. use -1 or `dsa.maxValue` to withdraw 100%.

getId

number

ID fetches the amount of token to withdraw.

setId

number

ID stores the amount of token withdrawn.

Borrow

Borrows DAI from Vault

spells.add({
  connector: "maker",
  method: "borrow",
  args: [vault_id, amount, getId, setId]
});

Parameter

Type

Description

vault_id

address

vault number

amount

number

The amount of DAI to borrow.

getId

number

ID fetches the amount of DAI to borrow.

setId

number

ID stores the amount of DAI borrowed.

Payback

Pays back DAI debt owed to Vault

spells.add({
  connector: "maker",
  method: "payback",
  args: [vault_id, amount, getId, setId]
});

Parameter

Type

Description

vault_id

number

vault number.

amount

number

The amount of DAI to payback. use -1 or `dsa.maxValue` to payback 100%.

getId

number

ID fetches the amount of DAI to payback.

setId

number

ID stores the amount of DAI paid back.

Transfer

This connector is used to transfer Vaults

spells.add({
  connector: "maker",
  method: "transfer",
  args: [vault, nextOwner]
});

Parameter

Type

Description

vault

number

vault number

nextOwner

address

The address of the next owner of the vault. (Vault Transfers can be assigned to Authorities)

Exit DAI

Withdraws any locked DAI in a Vault's Urn Address.

spells.add({
  connector: "maker",
  method: "exitDai",
  args: [vault, amt, getId, setId]
});

Parameter

Type

Description

vault

number

The vault ID.

amt

number

The amount of DAI to payback. use -1 or `dsa.maxValue` to payback 100%.

getId

number

ID fetches the amount of DAI to payback.

setId

number

ID stores the amount of DAI paid back

Additional Maker Functions

Withdraw Liquidated Collateral

This connector is used to withdraw any remaining collateral after a liquidation event.

spells.add({
  connector: "maker",
  method: "withdrawLiquidated",
  args: [vault_id, amount, getId, setId]
});

Parameter

Type

Description

vault_id

number

The vault number.

amount

number

The amount of liquidated collateral. use -1 or `dsa.maxValue` to withdraw 100%.

getId

number

ID fetches the amount of liquidated collateral to withdraw.

setId

number

ID stores the amount of liquidated collateral withdrawn.

Deposit in DSR

CURRENTLY DISABLED BY MAKERDAO - Read More Here

This connector is used to Deposit into the Dai Savings Rate

spells.add({
  connector: "maker",
  method: "depositDai",
  args: [amount, getId, setId]
});

Parameter

Type

Description

amount

number

The amount of DAI to deposit in DSR. use -1 or `dsa.maxValue` to deposit 100%.

getId

number

ID fetches the amount of DAI to deposit.

setId

number

ID stores the amount of DAI deposited.

Withdraw from DSR

This connector Withdraws DAI from the Dai Savings Rate

spells.add({
  connector: "maker",
  method: "withdrawDai",
  args: [amount, getId, setId]
});

Parameter

Type

Description

amount

number

The amount of DAI to withdraw from DSR. use -1 or `dsa.maxValue` to withdraw 100%

getId

number

ID fetches the amount of DAI to withdraw.

setId

number

ID stores the amount of DAI withdrawn.

Last updated