Collateralized Borrowing
MakerDAO connector triggers methods like open vault, deposit, borrow, and others. You can view details like source code, ABIs on Etherscan.
vault_id
is 0, then it assumes the latest vault created.dsa.maxValue
for the maximum amount in functions.getId
and setId
, pass 0.Open a new 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. |
To close a vault.
spells.add({
connector: "maker",
method: "close",
args: [vault_id]
});
Parameter | Type | Description |
---|---|---|
vault_id | number | The vault number. |
Deposit collateral in vault.
spells.add({
connector: "maker",
method: "deposit",
args: [vault_id, amount, getId, setId]
});
Parameter | Type | Description |
---|---|---|
vault_id | number | The 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 collateral from vault.
spells.add({
connector: "maker",
method: "withdraw",
args: [vault_id, amount, getId, setId]
});
Parameter | Type | Description |
---|---|---|
vault_id | number | The 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 DAI from vault.
spells.add({
connector: "maker",
method: "borrow",
args: [vault_id, amount, getId, setId]
});
Parameter | Type | Description |
---|---|---|
vault_id | address | The 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 DAI Debt in vault.
spells.add({
connector: "maker",
method: "payback",
args: [vault_id, amount, getId, setId]
});
Parameter | Type | Description |
---|---|---|
vault_id | number | The 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. |
Vault ID to transfer.
spells.add({
connector: "maker",
method: "transfer",
args: [vault, nextOwner]
});
Parameter | Type | Description |
---|---|---|
vault | number | The vault ID. |
nextOwner | address | The address of the next owner of the vault. Note: The new owner should be one the Auths of the DSA that is being transferred. |
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. |
Withdraw the leftover collateral after a vault gets liquidated.
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 DAI in DSR.
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 DAI from DSR.
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. |
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.
Best way to stay connected with our progress.