# Aave V3

### Supported Chains

Available on **Ethereum Mainnet and Testnet, Arbitrum, Avalanche, Base, and Polygon.**

### Available Endpoints:

*Click on the endpoint to jump to the section with full details*

* [**/**](#getprice)[<mark style="color:blue;">**getpool**</mark><mark style="color:blue;">`GET`</mark>](#getpool) - Get the lend and borrow APY for the given pool from AAVE protocol.
* [<mark style="color:blue;">**/**</mark>](#getuserliquidity)[<mark style="color:blue;">**getpools**</mark>](#getpools) <mark style="color:blue;">`GET`</mark> - Get the list of supply and borrow APYs of the mentioned assets.&#x20;
* <mark style="color:blue;">**/**</mark>[<mark style="color:blue;">**getuseraccountdata**</mark>](#getuseraccountdata) <mark style="color:blue;">`GET`</mark> - Get the repay, borrow, withdraw amount and health factor details for the given user.
* [<mark style="color:blue;">**/getuserpositions**</mark>](#getuserpositions) <mark style="color:blue;">`GET`</mark> - Retrieves the lending and borrowing positions of a user, including details such as token balances and collateral usage status.
* [<mark style="color:blue;">**/borrow**</mark>](#borrow) <mark style="color:green;">`POST`</mark> - Trigger the borrow transaction from the given protocol.
* [**/**<mark style="color:blue;">**d**</mark>](#addliquidity)[<mark style="color:blue;">**eposit**</mark>](#deposit) <mark style="color:green;">`POST`</mark> - Trigger the deposit transaction from the given protocol.
* [<mark style="color:blue;">**/r**</mark>](#removeliquidity)[<mark style="color:blue;">**epay**</mark>](#repay)<mark style="color:green;">`POST`</mark> - Trigger the repay transaction from the given protocol.
* [<mark style="color:blue;">**/**</mark>](#removeliquidity)[<mark style="color:blue;">**withdraw**</mark>](#withdraw)<mark style="color:green;">`POST`</mark> - Trigger the withdraw transaction from the given protocol.
* [<mark style="color:blue;">**/**</mark>](#removeliquidity)[<mark style="color:blue;">**migrate**</mark>](#migrate)<mark style="color:green;">`POST`</mark> - Trigger the migrate transaction from the given protocol.
* [<mark style="color:blue;">**/**</mark>](#removeliquidity)[<mark style="color:blue;">**setuseremode**</mark>](#setuseremode)<mark style="color:green;">`POST`</mark> - Trigger the E-Mode options for the user.
* [<mark style="color:blue;">**/**</mark>](#removeliquidity)[<mark style="color:blue;">**exitisolationmode**</mark>](#exitisolationmode)<mark style="color:green;">`POST`</mark> - Trigger the exit of isolation mode options for the user.

### Lending Protocol IDs

Many endpoints have a parameter where you can provide a lendborrow ID.&#x20;

Below is a list of lendborrow IDs related to Aave V3. Please see the [lendborrowID](/ids/lending-protocol-ids.md) for a complete Lending Protocol ID list and more information.

| Lending Protocol Name | Chain                    | Lending Protocol ID |
| --------------------- | ------------------------ | ------------------- |
| Aave V3               | Ethereum                 | 1200                |
| Aave V3               | Ethereum Testnet Sepolia | 1202                |
| Aave V3               | Avalanche                | 1203                |
| Aave V3               | Arbitrum                 | 1204                |
| Aave V3               | Polygon                  | 1205                |
| Aave V3               | Base                     | 1206                |
| Aave V3               | Optimism                 | 1207                |

## Endpoint Details

### /getpool

#### Get the lend and borrow APY for the given pool from AAVE protocol.

<mark style="color:blue;">`GET`</mark> `https://api.expand.network/lendborrow/getpool`

#### Query Parameters

| Name                                           | Type    | Description                                                                                                                          |
| ---------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| rpc                                            | String  | Remote procedural call URL.                                                                                                          |
| lendborrowId<mark style="color:red;">\*</mark> | String  | Refer to the [Lend and Borrow ID](/ids/lending-protocol-ids.md) page for details.                                                    |
| asset<mark style="color:red;">\*</mark>        | String  | Token address to get the details of.                                                                                                 |
| useCustomVaults                                | Boolean | If true, the request will be processed using the partner's dedicated vaults. If false or omitted, it uses the standard public pools. |

{% tabs %}
{% tab title="Sample Request" %}

```url
https://api.expand.network/lendborrow/getpool?lendborrowId=1200&asset=0x6b175474e89094c44da98b954eedeac495271d0f
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "tokenAddress": "0x6b175474e89094c44da98b954eedeac495271d0f",
        "poolAddress": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
        "variableBorrowRate": "17.17",
        "stableBorrowRate": "18.67",
        "variableSupplyRate": "0",
        "stableSupplyRate": "11.96",
        "ltv": "63",
        "availableLiquidity": "8950905768339714587617037",
        "reserveSize": "125705701896860739215535363"
    }
}
```

{% endtab %}
{% endtabs %}

### /getpools

#### Returns a list of supply and borrow APYs for assets supported by the Aave V3 protocol.

<mark style="color:blue;">`GET`</mark> `https://api.expand.network/lendborrow/getpools`

#### Query Parameters

<table><thead><tr><th>Name</th><th width="190">Type</th><th>Description</th></tr></thead><tbody><tr><td>lendborrowId<mark style="color:red;">*</mark></td><td>String</td><td>Identify the protocol by providing a <a href="/pages/XV9uszAmPg5EAsIr4yzR">Lending Protocol ID.</a> For example, Aave V3 on Ethereum is 1200. </td></tr><tr><td>assets</td><td>String</td><td>Provide a comma-separated list of token addresses to filter specific assets. If left blank, data for all assets supported by the protocol will be returned.</td></tr><tr><td>address</td><td>String</td><td>The public address of the sender.</td></tr><tr><td>rpc</td><td>String</td><td>Remote procedural call URL.</td></tr><tr><td>useCustomVaults</td><td>Boolean</td><td>If true, the request will be processed using the partner's dedicated vaults. If false or omitted, it uses the standard public pools.</td></tr></tbody></table>

{% tabs %}
{% tab title="Sample Request" %}

```
https://api.expand.network/lendborrow/getpools?lendborrowId=1200
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "FRAX": {
            "tokenAddress": "0x853d955acef822db058eb8505911ed77f175b99e",
            "poolAddress": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
            "variableBorrowRate": "17.00",
            "stableBorrowRate": "0.00",
            "variableSupplyRate": "0",
            "stableSupplyRate": "12.45",
            "ltv": "0",
            "availableLiquidity": "54923305553322344701626",
            "reserveSize": "650047524499480835549952",
            "tokenSymbol": "FRAX"
        },
        "wstETH": {
            "tokenAddress": "0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0",
            "poolAddress": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
            "variableBorrowRate": "0.47",
            "stableBorrowRate": "0.00",
            "variableSupplyRate": "0",
            "stableSupplyRate": "0.01",
            "ltv": "78.5",
            "availableLiquidity": "992836307810782540121810",
            "reserveSize": "1015065135630218396600073",
            "tokenSymbol": "wstETH"
        },
        "cbETH": {
            "tokenAddress": "0xbe9895146f7af43049ca1c1ae358b0541ea49704",
            "poolAddress": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
            "variableBorrowRate": "0.86",
            "stableBorrowRate": "0.00",
            "variableSupplyRate": "0",
            "stableSupplyRate": "0.04",
            "ltv": "75",
            "availableLiquidity": "6763004466247910156681",
            "reserveSize": "7160022618905139219048",
            "tokenSymbol": "cbETH"
        },
        "USDC": {
            "tokenAddress": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
            "poolAddress": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
            "variableBorrowRate": "10.02",
            "stableBorrowRate": "0.00",
            "variableSupplyRate": "0",
            "stableSupplyRate": "8.35",
            "ltv": "75",
            "availableLiquidity": "130127857697538",
            "reserveSize": "1761203345161530",
            "tokenSymbol": "USDC"
        },
        "RPL": {
            "tokenAddress": "0xd33526068d116ce69f19a9ee46f0bd304f21a51f",
            "poolAddress": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
            "variableBorrowRate": "4.66",
            "stableBorrowRate": "0.00",
            "variableSupplyRate": "0",
            "stableSupplyRate": "1.64",
            "ltv": "0",
            "availableLiquidity": "283805898461442804183895",
            "reserveSize": "505633140202467190948506",
            "tokenSymbol": "RPL"
        },
        "LDO": {
            "tokenAddress": "0x5a98fcbea516cf06857215779fd812ca3bef1b32",
            "poolAddress": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
            "variableBorrowRate": "0.22",
            "stableBorrowRate": "0.00",
            "variableSupplyRate": "0",
            "stableSupplyRate": "0.00",
            "ltv": "40",
            "availableLiquidity": "5567358015093172290775082",
            "reserveSize": "5648884466090294233350743",
            "tokenSymbol": "LDO"
        },
        "1INCH": {
            "tokenAddress": "0x111111111117dc0aa78b770fa6a738034120c302",
            "poolAddress": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
            "variableBorrowRate": "1.75",
            "stableBorrowRate": "0.00",
            "variableSupplyRate": "0",
            "stableSupplyRate": "0.12",
            "ltv": "57",
            "availableLiquidity": "2353887307144738474135434",
            "reserveSize": "2580260459835739983817175",
            "tokenSymbol": "1INCH"
        },
        "UNI": {
            "tokenAddress": "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984",
            "poolAddress": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
            "variableBorrowRate": "0.49",
            "stableBorrowRate": "0.00",
            "variableSupplyRate": "0",
            "stableSupplyRate": "0.01",
            "ltv": "65",
            "availableLiquidity": "3772668744594281243030841",
            "reserveSize": "3896485087868897582534843",
            "tokenSymbol": "UNI"
        },
        "rETH": {
            "tokenAddress": "0xae78736cd615f374d3085123a210448e74fc6393",
            "poolAddress": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
            "variableBorrowRate": "0.49",
            "stableBorrowRate": "0.00",
            "variableSupplyRate": "0",
            "stableSupplyRate": "0.01",
            "ltv": "75",
            "availableLiquidity": "42786920207676018925820",
            "reserveSize": "44165424967969205168667",
            "tokenSymbol": "rETH"
        },
        "LUSD": {
            "tokenAddress": "0x5f98805a4e8be255a32880fdec7f6728c6568ba0",
            "poolAddress": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
            "variableBorrowRate": "8.35",
            "stableBorrowRate": "0.00",
            "variableSupplyRate": "0",
            "stableSupplyRate": "5.39",
            "ltv": "0",
            "availableLiquidity": "732008157782705236289462",
            "reserveSize": "3785608593131778512959540",
            "tokenSymbol": "LUSD"
        },
        "DAI": {
            "tokenAddress": "0x6b175474e89094c44da98b954eedeac495271d0f",
            "poolAddress": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
            "variableBorrowRate": "5.23",
            "stableBorrowRate": "0.00",
            "variableSupplyRate": "0",
            "stableSupplyRate": "3.43",
            "ltv": "63",
            "availableLiquidity": "20116190904329074108544817",
            "reserveSize": "161227720827627549197855027",
            "tokenSymbol": "DAI"
        },
        "BAL": {
            "tokenAddress": "0xba100000625a3754423978a60c9317c58a424e3d",
            "poolAddress": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
            "variableBorrowRate": "6.13",
            "stableBorrowRate": "0.00",
            "variableSupplyRate": "0",
            "stableSupplyRate": "0.20",
            "ltv": "57",
            "availableLiquidity": "5461808366567556320757020",
            "reserveSize": "5695504786919720097775530",
            "tokenSymbol": "BAL"
        },
        "ENS": {
            "tokenAddress": "0xc18360217d8f7ab5e7c516566761ea12ce7f9d72",
            "poolAddress": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
            "variableBorrowRate": "0.55",
            "stableBorrowRate": "0.00",
            "variableSupplyRate": "0",
            "stableSupplyRate": "0.01",
            "ltv": "39",
            "availableLiquidity": "257622018102494483285103",
            "reserveSize": "264915342974442126735250",
            "tokenSymbol": "ENS"
        },
        "MKR": {
            "tokenAddress": "0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2",
            "poolAddress": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
            "variableBorrowRate": "0.13",
            "stableBorrowRate": "0.00",
            "variableSupplyRate": "0",
            "stableSupplyRate": "0.00",
            "ltv": "65",
            "availableLiquidity": "22317721451329464915781",
            "reserveSize": "22498947821677587448345",
            "tokenSymbol": "MKR"
        },
        "LINK": {
            "tokenAddress": "0x514910771af9ca656af840dff83e8264ecf986ca",
            "poolAddress": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
            "variableBorrowRate": "0.16",
            "stableBorrowRate": "0.00",
            "variableSupplyRate": "0",
            "stableSupplyRate": "0.00",
            "ltv": "66",
            "availableLiquidity": "12841888770900167942661273",
            "reserveSize": "12972794519516805036037702",
            "tokenSymbol": "LINK"
        },
        "SNX": {
            "tokenAddress": "0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f",
            "poolAddress": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
            "variableBorrowRate": "3.83",
            "stableBorrowRate": "0.00",
            "variableSupplyRate": "0",
            "stableSupplyRate": "0.11",
            "ltv": "49",
            "availableLiquidity": "876958995457643001455419",
            "reserveSize": "917448341348890598571604",
            "tokenSymbol": "SNX"
        },
        "USDT": {
            "tokenAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
            "poolAddress": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
            "variableBorrowRate": "5.19",
            "stableBorrowRate": "0.00",
            "variableSupplyRate": "0",
            "stableSupplyRate": "4.06",
            "ltv": "75",
            "availableLiquidity": "265199532954034",
            "reserveSize": "2013985901200635",
            "tokenSymbol": "USDT"
        },
        "WETH": {
            "tokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
            "poolAddress": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
            "variableBorrowRate": "2.65",
            "stableBorrowRate": "0.00",
            "variableSupplyRate": "0",
            "stableSupplyRate": "1.99",
            "ltv": "80.5",
            "availableLiquidity": "169301799517216699851714",
            "reserveSize": "1438734804109467684281299",
            "tokenSymbol": "WETH"
        },
        "WBTC": {
            "tokenAddress": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
            "poolAddress": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
            "variableBorrowRate": "0.64",
            "stableBorrowRate": "0.00",
            "variableSupplyRate": "0",
            "stableSupplyRate": "0.04",
            "ltv": "73",
            "availableLiquidity": "3641724175444",
            "reserveSize": "3922957400637",
            "tokenSymbol": "WBTC"
        },
        "sDAI": {
            "tokenAddress": "0x83f20f44975d03b1b09e64809b757c47f942beea",
            "poolAddress": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
            "variableBorrowRate": "0.00",
            "stableBorrowRate": "0.00",
            "variableSupplyRate": "0",
            "stableSupplyRate": "0.00",
            "ltv": "75",
            "availableLiquidity": "19660800347008258200820319",
            "reserveSize": "19660800347008258200820319",
            "tokenSymbol": "sDAI"
        },
        "AAVE": {
            "tokenAddress": "0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9",
            "poolAddress": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
            "variableBorrowRate": "0.00",
            "stableBorrowRate": "0.00",
            "variableSupplyRate": "0",
            "stableSupplyRate": "0.00",
            "ltv": "66",
            "availableLiquidity": "1199043096578210200140138",
            "reserveSize": "1199043096578210200140138",
            "tokenSymbol": "AAVE"
        },
        "CRV": {
            "tokenAddress": "0xd533a949740bb3306d119cc777fa900ba034cd52",
            "poolAddress": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
            "variableBorrowRate": "10.42",
            "stableBorrowRate": "0.00",
            "variableSupplyRate": "0",
            "stableSupplyRate": "2.51",
            "ltv": "35",
            "availableLiquidity": "5870235544561016402074394",
            "reserveSize": "9333074134649437853135767",
            "tokenSymbol": "CRV"
        }
    }
}
```

{% endtab %}
{% endtabs %}

### /getuseraccountdata

#### Get the repay, borrow, withdraw amount and health factor details for a given user.

<mark style="color:blue;">`GET`</mark> `https://api.expand.network/lendborrow/getuseraccountdata`

#### Query Parameters

| Name                                               | Type    | Description                                                                                                                          |
| -------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| rpc                                                | String  | Remote procedural call URL.                                                                                                          |
| lendborrowId<mark style="color:red;">\*</mark>     | String  | Refer to the [lend borrow Id](broken://pages/XoZTiUkj66UXxqYVd64n) page for details.                                                 |
| asset<mark style="color:red;">\*</mark>            | String  | Token address.                                                                                                                       |
| address<mark style="color:red;">\*</mark>          | String  | Public address of sender.                                                                                                            |
| interestRateMode<mark style="color:red;">\*</mark> | String  | Interest mode as per Aave. Is set '1' as default.                                                                                    |
| useCustomVaults                                    | Boolean | If true, the request will be processed using the partner's dedicated vaults. If false or omitted, it uses the standard public pools. |

{% tabs %}
{% tab title="Sample Request" %}

```url
https://api.expand.network/lendborrow/getuseraccountdata?interestRateMode=1&address=0x6fCe63859a859a0f30eD09B12F5010d790618ca4&asset=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48&lendborrowId=1200
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "tokenAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
        "repayAmount": "0",
        "borrowAmount": "15336571492",
        "borrowErrorMessage": "The Stable Rate is not enabled for this currency",
        "withdrawAmount": "0",
        "healthFactor": "1965438342704054090"
    }
}
```

{% endtab %}
{% endtabs %}

### /getuserpositions

#### Retrieves the lending and borrowing positions of a user, including details such as token balances and collateral usage status.

<mark style="color:blue;">`GET`</mark> `https://api.expand.network/lendborrow/getuserpositions`

#### Query Parameters

| Name                                           | Type    | Descriptions                                                                                                                         |
| ---------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| rpc                                            | String  | Remote procedural call URL.                                                                                                          |
| address<mark style="color:red;">\*</mark>      | String  | Public address of sender.                                                                                                            |
| lendBorrowId<mark style="color:red;">\*</mark> | String  | Refer to the [lend borrow Id](/ids/lending-protocol-ids.md) page for details.                                                        |
| useCustomVaults                                | Boolean | If true, the request will be processed using the partner's dedicated vaults. If false or omitted, it uses the standard public pools. |
| assets                                         | String  | Comma-separated list of token addresses to filter specific assets. If omitted, data for all supported assets will be returned.       |

{% tabs %}
{% tab title="Sample Request" %}

```url
https://api.expand.network/lendborrow/getuserpositions?address=0x6fCe63859a859a0f30eD09B12F5010d790618ca4&lendborrowId=1200
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": [
        {
            "underlyingAsset": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
            "scaledATokenBalance": "223979452864104791",
            "usageAsCollateralEnabledOnUser": true,
            "aToken": "0x4d5F47FA6A74757f35C14fD3a6Ef8E3C9BC514E8",
            "currentBalance": "235492464491675513",
            "rewardsAPYPercentage": "1.98",
            "accruedRewards": "11513011627570722",
            "prices": {
                "usd": [
                    {
                        "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2": "4308.039027805227"
                    }
                ]
            }
        },
        {
            "underlyingAsset": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
            "scaledVariableDebt": "84207861",
            "usageAsCollateralEnabledOnUser": false,
            "aToken": "0x98C23E9d8f34FEFb1B7BD6a91B7FF122F4e16F5c",
            "currentDebt": "100026949",
            "interestAPRPercentage": "6.11",
            "accruedInterest": "15819088",
            "prices": {
                "usd": [
                    {
                        "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48": "0.9998045672762118"
                    }
                ]
            }
        }
    ]
}
```

{% endtab %}
{% endtabs %}

### /borrow

#### Trigger the borrow transaction from the given protocol.

<mark style="color:green;">`POST`</mark> `https://api.expand.network/lendborrow/borrow`

#### Request Body

| Name                                           | Type   | Description                                                                       |
| ---------------------------------------------- | ------ | --------------------------------------------------------------------------------- |
| lendborrowId<mark style="color:red;">\*</mark> | String | Refer to the [Lend and Borrow ID](/ids/lending-protocol-ids.md) page for details. |
| asset<mark style="color:red;">\*</mark>        | String | Token address to borrow.                                                          |
| amount<mark style="color:red;">\*</mark>       | String | Number of tokens to be borrowed.                                                  |
| interestRateMode                               | String | Interest mode as per Aave. 0 for static and 1 for variable.                       |
| onBehalfOf<mark style="color:red;">\*</mark>   | String | Required in case borrow need to be done on behalf of other public address.        |
| from<mark style="color:red;">\*</mark>         | String | Sender public address.                                                            |
| gas                                            | String | Maximum gas to be approved for transaction.                                       |
| rpc                                            | String | Remote procedural call URL.                                                       |
| gasPriority                                    | String | low, medium, or high.                                                             |

{% tabs %}
{% tab title="Sample Request" %}

```json
{
    "lendborrowId": "1200",
    "asset": "0x65afadd39029741b3b8f0756952c74678c9cec93",
    "amount": "100",
    "from": "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45",
    "onBehalfOf": "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45",
    "interestRateMode": "2",
    "gas": "408298"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId":"1",
        "from": "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45",
        "to": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
        "value": "0",
        "gas": "408298",
        "data": "0xa415bcad00000000000000000000000065afadd39029741b3b8f0756952c74678c9cec93000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000829bfb482331b9dc2becb5483eca79c0578c3a45"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Sample Request" %}
**With gasPriority (low):**

```json
{
    "lendborrowId": "1200",
    "asset": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
    "amount": "1000000000",
    "from": "0x4C99D660A51D41bE5D47D66a3d89d5B83D92f27E",
    "onBehalfOf": "0x4C99D660A51D41bE5D47D66a3d89d5B83D92f27E",
    "interestRateMode": "2",
    "gas": "408298",
    "gasPriority":"low"
}
```

{% endtab %}

{% tab title="Sample Response" %}
**With gasPriority:**

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x4C99D660A51D41bE5D47D66a3d89d5B83D92f27E",
        "to": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
        "value": "0",
        "gas": "408298",
        "data": "0xa415bcad0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000000000000000000000000000000000003b9aca00000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000004c99d660a51d41be5d47d66a3d89d5b83d92f27e",
        "gasPrice": "14089187713"
    }
}
```

{% endtab %}
{% endtabs %}

### /deposit

#### Trigger the deposit transaction from the given protocol.

<mark style="color:green;">`POST`</mark> `https://api.expand.network/lendborrow/deposit`

#### Request Body

| Name                                           | Type    | Description                                                                                                                          |
| ---------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| lendborrowId<mark style="color:red;">\*</mark> | String  | Refer to the [Lend and Borrow ID](/ids/lending-protocol-ids.md) page for details.                                                    |
| asset<mark style="color:red;">\*</mark>        | String  | Token address to deposit.                                                                                                            |
| amount<mark style="color:red;">\*</mark>       | String  | Number of tokens to deposit.                                                                                                         |
| onBehalfOf<mark style="color:red;">\*</mark>   | String  | Required in case deposit need to be done on behalf of other public address.                                                          |
| from<mark style="color:red;">\*</mark>         | String  | Sender public address.                                                                                                               |
| gas                                            | String  | Maximum gas to be approved for the transaction.                                                                                      |
| rpc                                            | String  | Remote procedural call URL.                                                                                                          |
| involveBaseToken                               | String  | <p>0 for any ERC-20 token,<br>1 for ETH.</p>                                                                                         |
| gasPriority                                    | String  | low, medium, or high.                                                                                                                |
| useCustomVaults                                | Boolean | If true, the request will be processed using the partner's dedicated vaults. If false or omitted, it uses the standard public pools. |

{% tabs %}
{% tab title="Sample Request" %}

```json
{
    "lendborrowId": "1200",
    "asset": "0x65afadd39029741b3b8f0756952c74678c9cec93",
    "amount": "10000000000000000",
    "from": "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45",
    "onBehalfOf": "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45",
    "gas": "408298"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45",
        "to": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
        "value": "0",
        "gas": "408298",
        "data": "0xe8eda9df00000000000000000000000065afadd39029741b3b8f0756952c74678c9cec93000000000000000000000000000000000000000000000000002386f26fc10000000000000000000000000000829bfb482331b9dc2becb5483eca79c0578c3a450000000000000000000000000000000000000000000000000000000000000000",
        "referenceId": "7fb853868e4749879ef57d96aae5b9a2"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Sample Request" %}
**With gasPriority (medium):**

```json
{
    "lendborrowId": "1200",
    "asset": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
    "amount": "10000000000",
    "from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
    "onBehalfOf": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
    "gas": "408298",
    "gasPriority":"low"
}
```

{% endtab %}

{% tab title="Sample Response" %}
**With gasPriority:**

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
        "to": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
        "value": "0",
        "gas": "408298",
        "data": "0xe8eda9df0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f00000000000000000000000000000000000000000000000000000002540be400000000000000000000000000fae7d9854995e28beb1b1da864ee2a1e2ec17f070000000000000000000000000000000000000000000000000000000000000000",
        "gasPrice": "2800283955",
        "referenceId": "6bc93df7b66e4c1c9d069f6c88459a77"
    }
}
```

{% endtab %}
{% endtabs %}

### /repay

#### Trigger the repay transaction from the given protocol.

<mark style="color:green;">`POST`</mark> `https://api.expand.network/lendborrow/repay`

#### Request Body

| Name                                           | Type   | Description                                                                       |
| ---------------------------------------------- | ------ | --------------------------------------------------------------------------------- |
| lendborrowId<mark style="color:red;">\*</mark> | String | Refer to the [Lend and Borrow ID](/ids/lending-protocol-ids.md) page for details. |
| asset<mark style="color:red;">\*</mark>        | String | Token address to repay.                                                           |
| interestRateMode                               | String | Interest mode as per Aave. 0 for static and 1 for variable.                       |
| onBehalfOf<mark style="color:red;">\*</mark>   | String | Required in case repay need to be done on behalf of other public address.         |
| from<mark style="color:red;">\*</mark>         | String | Sender public address.                                                            |
| gas                                            | String | Maximum gas to be approved for the transaction.                                   |
| rpc                                            | String | Remote procedural call URL.                                                       |
| amount<mark style="color:red;">\*</mark>       | String | Amount to repay.                                                                  |
| gasPriority                                    | String | low, medium, or high.                                                             |

{% tabs %}
{% tab title="Sample Request" %}

```json
{
    "lendborrowId": "1200",
    "asset": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
    "amount": "100000",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "onBehalfOf": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "interestRateMode": "1",
    "gas": "408298"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
        "to": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
        "value": "0",
        "gas": "408298",
        "data": "0x573ade81000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000063056e00436da25bcf48a40dfbbdcc7089351006",
        "referenceId": "206365ea298a46c790b0ae51add101c3"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Sample Request" %}
**With gasPriority (low):**

```json
{
    "lendborrowId": "1200",
    "asset": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
    "amount": "1000000000",
    "from": "0x4C99D660A51D41bE5D47D66a3d89d5B83D92f27E",
    "onBehalfOf": "0x4C99D660A51D41bE5D47D66a3d89d5B83D92f27E",
    "interestRateMode": "2",
    "gas": "408298",
    "gasPriority":"low"
}
```

{% endtab %}

{% tab title="Sample Response" %}
**With gasPriority:**

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x4C99D660A51D41bE5D47D66a3d89d5B83D92f27E",
        "to": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
        "value": "0",
        "gas": "408298",
        "data": "0x573ade810000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000000000000000000000000000000000003b9aca0000000000000000000000000000000000000000000000000000000000000000020000000000000000000000004c99d660a51d41be5d47d66a3d89d5b83d92f27e",
        "gasPrice": "2658967750",
        "referenceId": "f6c53d54c20241e3a49458a90a4e7c6d"
    }
}
```

{% endtab %}
{% endtabs %}

### /withdraw

#### Trigger the withdraw transaction from the given protocol.

<mark style="color:green;">`POST`</mark> `https://api.expand.network/lendborrow/withdraw`

#### Request Body

| Name                                           | Type    | Description                                                                                                                          |
| ---------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| lendborrowId<mark style="color:red;">\*</mark> | String  | Refer to the [Lend and Borrow ID](/ids/lending-protocol-ids.md) page for details.                                                    |
| asset<mark style="color:red;">\*</mark>        | String  | Token address to be withdraw.                                                                                                        |
| amount<mark style="color:red;">\*</mark>       | String  | Number of tokens to withdraw.                                                                                                        |
| to<mark style="color:red;">\*</mark>           | String  | Recipient public address.                                                                                                            |
| from<mark style="color:red;">\*</mark>         | String  | Sender public address.                                                                                                               |
| gas                                            | String  | Maximum gas to be approved for the transaction.                                                                                      |
| rpc                                            | String  | Remote procedural call URL.                                                                                                          |
| gasPriority                                    | String  | low, medium, or high.                                                                                                                |
| useCustomVaults                                | Boolean | If true, the request will be processed using the partner's dedicated vaults. If false or omitted, it uses the standard public pools. |

{% tabs %}
{% tab title="Sample Request" %}

```json
{
    "lendborrowId": "1200",
    "asset": "0x65afadd39029741b3b8f0756952c74678c9cec93",
    "amount": "10000000000000000",
    "from": "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45",
    "to": "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45",
    "gas": "408298"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45",
        "to": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
        "value": "0",
        "gas": "408298",
        "data": "0x69328dec00000000000000000000000065afadd39029741b3b8f0756952c74678c9cec93000000000000000000000000000000000000000000000000002386f26fc10000000000000000000000000000829bfb482331b9dc2becb5483eca79c0578c3a45",
        "referenceId": "934bca3df66d411ab6ed56ab879badd9"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Sample Request" %}
**With gasPriority:**

```json
{
    "lendborrowId": "1200",
    "asset": "0x65afadd39029741b3b8f0756952c74678c9cec93",
    "amount": "10000000000000000",
    "from": "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45",
    "to": "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45",
    "gas": "408298",
    "gasPriority": "high"
}
```

{% endtab %}

{% tab title="Sample Response" %}
**With gasPriority:**

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45",
        "to": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
        "value": "0",
        "gas": "408298",
        "data": "0x69328dec00000000000000000000000065afadd39029741b3b8f0756952c74678c9cec93000000000000000000000000000000000000000000000000002386f26fc10000000000000000000000000000829bfb482331b9dc2becb5483eca79c0578c3a45",
        "gasPrice": "3851175507",
        "referenceId": "1875f3d54ba14016b0231d763b5a949e"
    }
}
```

{% endtab %}
{% endtabs %}

### /migrate

#### Trigger the migrate transaction from the given protocol.

<mark style="color:green;">`POST`</mark> `https://api.expand.network/lendborrow/migrate`

#### Request Body

| Name                                           | Type   | Description                                                                       |
| ---------------------------------------------- | ------ | --------------------------------------------------------------------------------- |
| lendborrowId<mark style="color:red;">\*</mark> | String | Refer to the [Lend and Borrow ID](/ids/lending-protocol-ids.md) page for details. |
| assets                                         | String | Token addresses to migrate.                                                       |
| from<mark style="color:red;">\*</mark>         | String | Sender public address.                                                            |
| gas                                            | String | Maximum gas to be approved for the transaction.                                   |
| rpc                                            | String | Remote procedural call URL.                                                       |

{% tabs %}
{% tab title="Sample Request" %}

```json
{
    "lendborrowId": "1200",
    "assets": [
        "0x6b175474e89094c44da98b954eedeac495271d0f"
    ],
    "from": "0x356dB816602c85e2075774bB77D13995c8Bab023",
    "gas": "329000"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x356dB816602c85e2075774bB77D13995c8Bab023",
        "to": "0xb748952c7bc638f31775245964707bcc5ddfabfc",
        "value": "0",
        "gas": "329000",
        "data": "0x3698d492000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000010000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "referenceId": "76137704aa884a90b6a47082bc65e735"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Sample Request" %}
**With gasPriority:**&#x20;

```json
{
    "lendborrowId": "1200",
    "assets": [
        "0x6b175474e89094c44da98b954eedeac495271d0f"
    ],
    "from": "0x356dB816602c85e2075774bB77D13995c8Bab023",
    "gas": "329000",
    "gasPriority": "medium"
}
```

{% endtab %}

{% tab title="Sample Response" %}
**With gasPriority:**

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x356dB816602c85e2075774bB77D13995c8Bab023",
        "to": "0xb748952c7bc638f31775245964707bcc5ddfabfc",
        "value": "0",
        "gas": "329000",
        "data": "0x3698d492000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000010000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "gasPrice": {
            "gasPrice": "3297136333"
        },
        "referenceId": "fce1e543076e4bc9b23c74afaa114d3f"
    }
}
```

{% endtab %}
{% endtabs %}

### /setuseremode

#### Trigger the E-Mode options for the user.

<mark style="color:green;">`POST`</mark> `https://api.expand.network/lendborrow/setuseremode`

#### Request Body

| Name                                           | Type   | Description                                                                       |
| ---------------------------------------------- | ------ | --------------------------------------------------------------------------------- |
| lendborrowId<mark style="color:red;">\*</mark> | String | Refer to the [Lend and Borrow ID](/ids/lending-protocol-ids.md) page for details. |
| categoryId<mark style="color:red;">\*</mark>   | String | 0 for default. 1 for stablecoins.                                                 |
| from<mark style="color:red;">\*</mark>         | String | Sender public address.                                                            |
| gas                                            | String | Maximum gas to be approved for the transaction.                                   |
| rpc                                            | String | Remote procedural call URL.                                                       |
| gasPriority                                    | String | low, medium, or high.                                                             |

{% tabs %}
{% tab title="Sample Request" %}

```json
{
    "lendborrowId": "1200",
    "from": "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45",
    "categoryId": "1",
    "gas": "408298"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45",
        "to": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
        "value": "0",
        "gas": "408298",
        "data": "0x28530a470000000000000000000000000000000000000000000000000000000000000001",
        "referenceId": "85e2f3fd6c904f2bb55305c1d9075ee3"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Sample Request" %}
**With gasPriority (low):**

```json
{
    "lendborrowId": "1200",
    "from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
    "categoryId": "1",
    "gas": "408298",
    "gasPriority":"low"
}
```

{% endtab %}

{% tab title="Sample Response" %}
**With gasPriority:**

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
        "to": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
        "value": "0",
        "gas": "408298",
        "data": "0x28530a470000000000000000000000000000000000000000000000000000000000000001",
        "gasPrice": "2914558556",
        "referenceId": "cf07b3d78fc348e49da9e8511f9f5794"
    }
}
```

{% endtab %}
{% endtabs %}

### /exitisolationmode

#### Trigger the exit of isolation mode options for the user.

<mark style="color:green;">`POST`</mark> `https://api.expand.network/lendborrow/exitisolationmode`

#### Request Body

| Name                                           | Type   | Description                                                                       |
| ---------------------------------------------- | ------ | --------------------------------------------------------------------------------- |
| lendborrowId<mark style="color:red;">\*</mark> | String | Refer to the [Lend and Borrow ID](/ids/lending-protocol-ids.md) page for details. |
| asset<mark style="color:red;">\*</mark>        | String | Token address to exit isolation mode.                                             |
| from<mark style="color:red;">\*</mark>         | String | Sender public address.                                                            |
| gas                                            | String | Maximum gas to be approved for the transaction.                                   |
| rpc                                            | String | Remote procedural call URL.                                                       |

{% tabs %}
{% tab title="Sample Request" %}

```json
{
    "lendborrowId": "1200",
    "asset": "0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2",
    "from": "0xf7426829DBAAc7F26b48C49A04a93fc4f75cfa41",
    "gas": "429000"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
  "status": 200,
  "msg": "success",
  "data": {
    "chainId": "1",
    "from": "0xf7426829DBAAc7F26b48C49A04a93fc4f75cfa41",
    "to": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
    "value": "0",
    "gas": "429000",
    "data": "0x5a3b74b90000000000000000000000009f8f72aa9304c8b593d555f12ef6589cc3a579a20000000000000000000000000000000000000000000000000000000000000000",
    "referenceId": "8581446eb9aa421dabf15ce8b55cb25d"
  }
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Sample Request" %}
**With gasPriority:**

```json
{
    "lendborrowId": "1200",
    "asset": "0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2",
    "from": "0xf7426829DBAAc7F26b48C49A04a93fc4f75cfa41",
    "gas": "429000",
    "gasPriority": "high"
}
```

{% endtab %}

{% tab title="Sample Response" %}
**With gasPriority:**

```json
{
  "status": 200,
  "msg": "success",
  "data": {
    "chainId": "1",
    "from": "0xf7426829DBAAc7F26b48C49A04a93fc4f75cfa41",
    "to": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
    "value": "0",
    "gas": "429000",
    "data": "0x5a3b74b90000000000000000000000009f8f72aa9304c8b593d555f12ef6589cc3a579a20000000000000000000000000000000000000000000000000000000000000000",
    "referenceId": "8581446eb9aa421dabf15ce8b55cb25d"
  }
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.expand.network/integrations/lending-protocols/aave-v3.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
