[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
  • Maker -> Compound
  • Compound -> Maker
  1. πŸ‘©β€πŸ’» DSA SDK
  2. Example Use Cases

Lending Bridge

Move lent DAI between Maker and Compound

Step 1

Installation or just use your browser console.

Step 2

Setup Account

Step 3

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.

Maker -> Compound

Benefits

  • When DAI Supply rate on Compound > Maker. Generally happens when DAI > $1.

  • Help make DAI stable.

Recipe

  1. MakerDAO: withdraw DAI

  2. Compound: deposit DAI

Requirements

  • User must have DAI deposited in Maker.

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)

Compound -> Maker

Benefits

  • When DAI Supply rate on Maker > Compound. Generally happens when DAI < $1.

  • Help make DAI stable.

Recipe

  1. Compound: withdraw DAI

  2. MakerDAO: deposit DAI

Requirements

  • User must have DAI deposited in Compound.

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)
PreviousDebt SwapNextLending Swap

Last updated 4 years ago