Lending Bridge
Move lent DAI between Maker and Compound
Last updated
Move lent DAI between Maker and Compound
Last updated
let withdrawAmount = 20; // 20 DAI
let withdrawAmtInWei = dsa.tokens.fromDecimal(withdrawAmount, "dai");
let dai_address = dsa.tokens.info.dai.address;
let spells = dsa.Spell();
spells.add({
connector: "maker",
method: "withdrawDai",
args: [withdrawAmtInWei, 0, 0]
});
spells.add({
connector: "compound",
method: "deposit",
args: [dai_address, 0, 0, 0]
});
dsa.cast(spells).then(console.log)let withdrawAmount = 20; // 20 DAI
let withdrawAmtInWei = dsa.tokens.fromDecimal(withdrawAmount, "dai");
let dai_address = dsa.tokens.info.dai.address;
let spells = dsa.Spell();
spells.add({
connector: "compound",
method: "withdraw",
args: [eth_address, withdrawAmtInWei, 0, 0]
});
spells.add({
connector: "maker",
method: "depositDai",
args: [withdrawAmtInWei, 0, 0]
});
dsa.cast(spells).then(console.log)