> For the complete documentation index, see [llms.txt](https://instadapp-3.gitbook.io/instadapp-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://instadapp-3.gitbook.io/instadapp-docs/dsa-sdk/usecases/short-dai.md).

# Short DAI

**Step 1**

[Installation](https://docs.instadapp.io/installation) or just use your browser console.

**Step 2**

[Setup Account](https://docs.instadapp.io/setup)

**Step 3**

Trigger the following uniquely designed spells to fulfill this use case. Check [this section](https://docs.instadapp.io/cast) for generic details around casting spells.

The DSA will cast the spells across the [MakerDAO](https://docs.instadapp.io/connectors/makerdao/), [OasisDEX](https://docs.instadapp.io/connectors/oasis/) and [Instapool](https://docs.instadapp.io/connectors/instapool/) connectors in the following sequence.

**Benefits**

* When DAI > $1. Arbitrage benefit due to price difference of DAI & USDC.
* Help make DAI stable.

**Recipe**

1. **Instapool**: borrow DAI
2. **OasisDEX**: swap DAI with USDC
3. **MakerDAO**: open USDC vault
4. **MakerDAO**: deposit USDC in vault
5. **MakerDAO**: borrow DAI from vault
6. **Instapool**: payback DAI

**Requirements**

* User should have base amount of USDC to perform the leverage. Liquidation on Compound is 83.33% which means for 1 DAI borrowed, user needs to have the balance of 0.25 USDC for collateral to perform this spell.
* Maker vault minimum debt requirement is 20 DAI.

Copy

```
let borrowAmount = 20; // 20 DAI
let borrowAmtInWei = dsa.tokens.fromDecimal(borrowAmount, "dai"); // borrow flash loan and swap via OasisDEX

let slippage = 2; // 2% slippage.
let dai_address = dsa.tokens.info.dai.address
let usdc_address = dsa.tokens.info.usdc.address

let buyAmount = await dsa.oasis.getBuyAmount("USDC", "DAI", borrowAmount, slippage);

let spells = dsa.Spell();

spells.add({
  connector: "instapool",
  method: "flashBorrow",
  args: [dai_address, borrowAmtInWei, 0, 0]
});

spells.add({
  connector: "oasis",
  method: "sell",
  args: [usdc_address, dai_address, borrowAmtInWei, buyAmount.unitAmt, 0, 0]
});

spells.add({
  connector: "maker",
  method: "open",
  args: ["USDC-A"]
});

spells.add({
  connector: "maker",
  method: "deposit",
  args: [0, -1, 0, 0] // deposit all USDC
});

spells.add({
  connector: "maker",
  method: "borrow",
  args: [0, borrowAmtInWei, 0, 0]
});

spells.add({
  connector: "instapool",
  method: "flashPayback",
  args: [dai_address, 0, 0]
});

dsa.cast(spells).then(console.log)
```
