# Aave

These connections are used to interact with AAVE protocol to facilitate transactions like deposit, borrow, withdraw, payback, and more.

## Deposit

This connector deposits assets into the AAVE protocol

```
spells.add({
  connector: "aave",
  method: "deposit",
  args: [token, amount, getId, setId]
});
```

| Parameter | Type    | Description                                                                  |
| --------- | ------- | ---------------------------------------------------------------------------- |
| token     | address | The token address to deposit.                                                |
| amount    | number  | The amount of tokens to deposit. use -1 or \`dsa.maxValue\` to deposit 100%. |
| getId     | number  | ID fetches the amount of token to deposit.                                   |
| setId     | number  | ID stores the amount of token deposited.                                     |

## Withdraw

This connector withdraw assets from the AAVE protocol

```
spells.add({
  connector: "aave",
  method: "withdraw",
  args: [token, amount, getId, setId]
});
```

| Parameter | Type    | Description                                                                 |
| --------- | ------- | --------------------------------------------------------------------------- |
| token     | address | The token address to withdraw. use -1 or \`dsa.maxValue\` to withdraw 100%. |
| amount    | number  | The amount of tokens to withdraw.                                           |
| getId     | number  | ID fetches the amount of token to withdraw.                                 |
| setId     | number  | ID stores the amount of token withdrawn.                                    |

## Borrow

This borrow tokens against your credit limit from the AAVE protocol.

```
spells.add({
  connector: "aave",
  method: "borrow",
  args: [token, amount, getId, setId]
});
```

| Parameter | Type    | Description                               |
| --------- | ------- | ----------------------------------------- |
| token     | address | The token address to borrow.              |
| amount    | number  | The amount of tokens to borrow.           |
| getId     | number  | ID fetches the amount of token to borrow. |
| setId     | number  | ID stores the amount of token borrowed.   |

## Payback

This connector pays back borrowed assets to the AAVE protocol.

```
spells.add({
  connector: "aave",
  method: "payback",
  args: [token, amount, getId, setId]
});
```

| Parameter | Type    | Description                                                                  |
| --------- | ------- | ---------------------------------------------------------------------------- |
| token     | address | The token address to payback.                                                |
| amount    | number  | The amount of tokens to payback. use -1 or \`dsa.maxValue\` to payback 100%. |
| getId     | number  | ID fetches the amount of token to payback.                                   |
| setId     | number  | ID stores the amount of token paid back.                                     |
