> 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/lending-bridge.md).

# Lending Bridge

Move lent DAI between Maker and Compound

**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/), [Compound](https://docs.instadapp.io/connectors/compound/) and [Instapool](https://docs.instadapp.io/connectors/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)
```
