Port positions b/w Maker & Compound
Installation or just use your browser console.
Trigger the following uniquely designed spells to fulfill this use case. Check this section for generic details around casting spells.
The DSA will cast the spells across the MakerDAO, Compound and Instapool connectors in the specified sequence.
let borrowAmount = dsa.tokens.fromDecimal(200000, "dai"); // 200000 DAI
let dai_address = dsa.tokens.info.dai.address
let eth_address = dsa.tokens.info.eth.address
let vault_id = 0; // User's Vault ID
let spells = dsa.Spell();
spells.add({
connector: "instapool",
method: "flashBorrow",
args: [dai_address, borrowAmount, 0, 0]
});
spells.add({
connector: "maker",
method: "payback",
args: [vault_id, -1, 0, "534"] // max payback and setting the payback amount with id 534
});
spells.add({
connector: "maker",
method: "withdraw",
args: [vault_id, -1, 0, "987"] // max withdraw and setting the withdrawn amount with id 987
});
spells.add({
connector: "compound",
method: "deposit",
args: [eth_address, 0, "987", 0] // get deposit amount with id 987
});
spells.add({
connector: "compound",
method: "borrow",
args: [dai_address, 0, "534", 0] // get borrow amount with id 534
});
spells.add({
connector: "instapool",
method: "flashPayback",
args: [dai_address, 0, 0]
});
dsa.cast(spells).then(console.log)
let borrowAmount = dsa.tokens.fromDecimal(200000, "dai"); // 200000 DAI
let dai_address = dsa.tokens.info.dai.address;
let eth_address = dsa.tokens.info.eth.address;
let vault_id = 0; // User's Vault ID
let spells = dsa.Spell();
spells.add({
connector: "instapool",
method: "flashBorrow",
args: [dai_address, borrowAmount, 0, 0]
});
spells.add({
connector: "compound",
method: "payback",
args: [dai_address, -1, 0, "692"] // max payback and setting the payback amount with id 692
});
spells.add({
connector: "compound",
method: "withdraw",
args: [eth_address, -1, 0, "578"] // max withdraw and setting the withdrawn amount with id 578
});
spells.add({
connector: "maker",
method: "deposit",
args: [vault_id, 0, "578", 0] // get deposit amount with id 578
});
spells.add({
connector: "maker",
method: "borrow",
args: [vault_id, 0, "692", 0] // get borrow amount with id 534
});
spells.add({
connector: "instapool",
method: "flashPayback",
args: [dai_address, 0, 0]
});
dsa.cast(spells).then(console.log)
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.