[OLD] Instadapp Docs
  • Introduction
  • DeFi Smart Account (DSA)
  • DSA SDK
    • Running Instadapp SDK
  • 💻Instadapp GUI
    • Integrated Protocols
      • Aave
      • Compound Finance
      • MakerDAO
    • Strategies
    • Multi-Protocol Refinancing
    • Authorities
    • Debt Collateral Ratio
  • 👩‍💻 DSA SDK
    • Casting Spells
    • Build a Connector
    • Connectors
      • Basic
      • Authority
      • Instapool
      • MakerDAO
      • Compound
      • Comp
      • Aave
      • dYdX
      • 1Inch
      • Uniswap
      • OasisDEX
      • Kyber
      • Curve sBTC
      • Curve sUSD
      • Curve yUSD
    • Resolvers
      • Accounts
      • Balances
      • Instapool
      • MakerDAO
      • Compound
      • Aave
      • dYdX
      • 1inch
      • Uniswap
      • OasisDex
      • Kyber
      • Curve sBTC
      • Curve sUSD
      • Curve yUSD
    • getId/setId
    • Example Use Cases
      • Long ETH
      • Short DAI
      • Debt Swap
      • Lending Bridge
      • Lending Swap
      • Debt Bridge
  • 👩‍🏫 Tutorials
    • Getting Started
    • Moving Assets into DSA
    • In-App Swaps
  • Additional Info
    • Contract Infomation
    • FAQs
    • Security Audits
    • Release History
  • 🌏Links
    • Homepage
    • DApp
    • Discord
    • Contact Us
Powered by GitBook
On this page
  • Open
  • Close
  • Deposit
  • Withdraw
  • Borrow
  • Payback
  • Transfer
  • Exit DAI
  • Additional Maker Functions
  • Withdraw Liquidated Collateral
  • Deposit in DSR
  • Withdraw from DSR
  1. 👩‍💻 DSA SDK
  2. Connectors

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

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.

PreviousInstapoolNextCompound

Last updated 4 years ago

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

Authorities