# Pendle

### Supported Chains&#x20;

Available on **Arbitrum, Base, Binance Smart Chain, Ethereum** and **Optimism**

### Available Endpoints:

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

* [<mark style="color:blue;">**/get**</mark>](#getvaults)[<mark style="color:blue;">**markets**</mark>](#getmarkets)<mark style="color:blue;">`GET`</mark> - Returns the list of the pendle market .
* <mark style="color:blue;">**/**</mark>[<mark style="color:blue;">**getmarkettokens**</mark>](#getmarkettokens)<mark style="color:blue;">`GET`</mark> -Returns all the tokens in the specified market address.
* [<mark style="color:blue;">**/**</mark>](#depositvault)[<mark style="color:blue;">**getmarketdata**</mark>](#getmarketdata)<mark style="color:blue;">`GET`</mark> - Returns the data for the specified market .
* [<mark style="color:blue;">**/getbalance**</mark>](#getbalance)<mark style="color:blue;">`GET`</mark> -Returns the balance of particular address of the specified market .
* [<mark style="color:blue;">**/**</mark>](#getvaults)[<mark style="color:blue;">**transferliquidity**</mark>](#transferliquidity)<mark style="color:green;">`POST`</mark> - Initiate the transfer liquidity from source market address to destination market address .
* [<mark style="color:blue;">**/**</mark>](#depositvault)[<mark style="color:blue;">**redeem**</mark>](#redeem)<mark style="color:green;">`POST`</mark> - Initiates a redeem transaction within a yield aggregator protocol, converting yield-bearing tokens back into their underlying asset.
* [<mark style="color:blue;">**/mint**</mark> ](#mint)<mark style="color:green;">`POST`</mark> -Initiates a mint transaction within a yield aggregator protocol, converting deposited assets into yield-bearing tokens (or share tokens).
* [<mark style="color:blue;">**/swap**</mark> ](#swap)<mark style="color:green;">`POST`</mark> - Initiates a swap transaction within a yield aggregator protocol, enabling users to exchange deposited tokens for another asset via the yield aggregation mechanism.
* [<mark style="color:blue;">**/addliquidity**</mark> ](#addliquidity)<mark style="color:green;">`POST`</mark> - Initiate the transaction to add liquidity from a specified market .
* [<mark style="color:blue;">**/**</mark>](#withdrawvault)[<mark style="color:blue;">**removeliquidity**</mark>](#removeliquidity)<mark style="color:green;">`POST`</mark> - Initiate the transaction to remove liquidity from a specified market.

### Yield Aggregator IDs

Below is a list of Yield Aggregator IDs related to Pendle. Please see the \[[yield-aggregator-id](https://docs.expand.network/ids/yield-aggregator-id "mention")]\(../../ids/yield-aggregator-id) for a complete Yield Aggregator ID list and more information.

| Yield Aggregator Name | Chain               | Yield Aggregator ID |
| --------------------- | ------------------- | ------------------- |
| Pendle                | Ethereum            | 5200                |
| Pendle                | Arbitrum            | 5201                |
| Pendle                | Base                | 5202                |
| Pendle                | Optimism            | 5203                |
| Pendle                | Binance Smart Chain | 5204                |

## Endpoint Details

### /getmarkets

#### Returns the list of the pendle market .

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

#### Query Parameters

| Name                                                | Type    | Description                                                                                                         |
| --------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| rpc                                                 | String  | Remote procedural call URL.                                                                                         |
| yieldAggregatorId<mark style="color:red;">\*</mark> | String  | Refer to the [yield-aggregator-id](https://docs.expand.network/ids/yield-aggregator-id "mention") page for details. |
| includeInactive                                     | Boolean | <p>If <code>true,</code> return the Market with expiry also.<br>By default, <code>false</code></p>                  |

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

```url
https://api.expand.network/yieldaggregator/getmarkets?yieldAggregatorId=5200&includeInactive=true
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": [
        {
            "name": "stETH",
            "expiry": "2025-12-25T00:00:00.000Z",
            "underlyingAsset": "0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0",
            "marketAddress": "0xc374f7ec85f8c7de3207a10bb1978ba104bda3b2",
            "ptAddress": "0xf99985822fb361117fcf3768d34a6353e6022f5f",
            "ytAddress": "0xf3abc972a0f537c1119c990d422463b93227cd83",
            "syAddress": "0xcbc72d92b2dc8187414f6734718563898740c0bc",
            "isActive": true
        },
        {
            "name": "sUSDe",
            "expiry": "2025-03-27T00:00:00.000Z",
            "underlyingAsset": "0x9d39a5de30e57443bff2a8307a4256c8797a3497",
            "marketAddress": "0xcdd26eb5eb2ce0f203a84553853667ae69ca29ce",
            "ptAddress": "0xe00bd3df25fb187d6abbb620b3dfd19839947b81",
            "ytAddress": "0x96512230bf0fa4e20cf02c3e8a7d983132cd2b9f",
            "syAddress": "0x3ee118efc826d30a29645eaf3b2eaac9e8320185",
            "isActive": true
        },
        {
            "name": "USDe",
            "expiry": "2025-03-27T00:00:00.000Z",
            "underlyingAsset": "0x4c9edd5852cd905f086c759e8383e09bff1e68b3",
            "marketAddress": "0xb451a36c8b6b2eac77ad0737ba732818143a0e25",
            "ptAddress": "0x8a47b431a7d947c6a3ed6e42d501803615a97eaa",
            "ytAddress": "0x4a8036efa1307f1ca82d932c0895faa18db0c9ee",
            "syAddress": "0x4db99b79361f98865230f5702de024c69f629fec",
            "isActive": true
        },
        {
            "name": "rsENA",
            "expiry": "2025-03-27T00:00:00.000Z",
            "underlyingAsset": "0xc65433845ecd16688eda196497fa9130d6c47bd8",
            "marketAddress": "0x7e0209ab6fa3c7730603b68799bbe9327dab7e88",
            "ptAddress": "0xb930dd4ea22cd4404c30d68b72e18453adcf93a2",
            "ytAddress": "0x7d128742816aa09af2e9f0ca8c96450ceec17d7a",
            "syAddress": "0x64046776c9c856fdc5c39c6eba101adc8e18291f",
            "isActive": true
        },
        {
            "name": "rsETH",
            "expiry": "2025-06-26T00:00:00.000Z",
            "underlyingAsset": "0xa1290d69c65a6fe4df752f95823fae25cb99e5a7",
            "marketAddress": "0xfd482179ddee989c45eab19991852f80ff31457a",
            "ptAddress": "0xe08c45f3cfe70f4e03668dc6e84af842bee95a68",
            "ytAddress": "0x9335a7a9208cda49f287ea9af7b3d1faadfcfe80",
            "syAddress": "0x730a5e2acebccaa5e9095723b3cb862739da793c",
            "isActive": true
        },
        {
            "name": "eETH",
            "expiry": "2025-06-26T00:00:00.000Z",
            "underlyingAsset": "0xcd5fe23c85820f7b72d0926fc9b05b43e359b7ee",
            "marketAddress": "0xf4cf59259d007a96c641b41621ab52c93b9691b1",
            "ptAddress": "0xef6122835a2bbf575d0117d394fda24ab7d09d4e",
            "ytAddress": "0x08aefe9dfe7818caaedd94e38e910d2155b7d2b0",
            "syAddress": "0xac0047886a985071476a1186be89222659970d65",
            "isActive": true
        },
        {
            "name": "eBTC (Zerolend)",
            "expiry": "2025-03-27T00:00:00.000Z",
            "underlyingAsset": "0x52bb650211e8a6986287306a4c09b73a9affd5e9",
            "marketAddress": "0x98ffefd1a51d322c8def6d0ba183e71547216f7f",
            "ptAddress": "0x8b89d5ea6c9ea52dab5834e9789aa10085c14858",
            "ytAddress": "0x1477a353f248ac94b52f863e234755943a18b94c",
            "syAddress": "0x96af5d9e4d01fb892fd2d76bfc0e3c07aecf8b6b",
            "isActive": true
        },
        {
            "name": "agETH",
            "expiry": "2025-06-26T00:00:00.000Z",
            "underlyingAsset": "0xe1b4d34e8754600962cd944b535180bd758e6c2e",
            "marketAddress": "0xbe8549a20257917a0a9ef8911daf18190a8842a4",
            "ptAddress": "0x6e43f6abce001c14c7115d20908d0c272338eaf1",
            "ytAddress": "0x0310a860cf7efe8f54ab9b4de49cd071c37fcbcb",
            "syAddress": "0xb1b9150f2085f6a553b547099977181ca802752a",
            "isActive": true
        },
        {
            "name": "uniETH",
            "expiry": "2025-06-26T00:00:00.000Z",
            "underlyingAsset": "0xf1376bcef0f78459c0ed0ba5ddce976f1ddf51f4",
            "marketAddress": "0xbba9baaa6b3107182147a12177e0f1ec46b8b072",
            "ptAddress": "0x302091967c09323815594ad8db2d8de35c3a1985",
            "ytAddress": "0x999a3847707511e06e6df03029d7edb04f9099c8",
            "syAddress": "0xc430db19339a3051192233b4c49f9ab3dc6d16b7",
            "isActive": true
        },
        {
            "name": "pufETH",
            "expiry": "2025-06-26T00:00:00.000Z",
            "underlyingAsset": "0xd9a442856c234a39a81a089c06451ebaa4306a72",
            "marketAddress": "0x58612beb0e8a126735b19bb222cbc7fc2c162d2a",
            "ptAddress": "0x9cfc9917c171a384c7168d3529fc7e851a2e0d6d",
            "ytAddress": "0x784a0bb8208c70290cac6bcbc3650ceb9227813e",
            "syAddress": "0x253008ba4ae2f3e6488dc998a5321d4eb1a0c905",
            "isActive": true
        },
        {
            "name": "weETHs",
            "expiry": "2025-06-26T00:00:00.000Z",
            "underlyingAsset": "0x917cee801a67f933f2e6b33fc0cd1ed2d5909d88",
            "marketAddress": "0xcba3b226ca62e666042cb4a1e6e4681053885f75",
            "ptAddress": "0xa3170a9ee20d9832d933d4355676d09f66909d12",
            "ytAddress": "0xaac7db6c2bc926ade954d69a2d705f059043ea02",
            "syAddress": "0x012badcc6e824c2ea32bd5367ebda3be3402c9c5",
            "isActive": true
        },
        {
            "name": "liquidBeraETH",
            "expiry": "2025-04-10T00:00:00.000Z",
            "underlyingAsset": "0x83599937c2c9bea0e0e8ac096c6f32e86486b410",
            "marketAddress": "0x46e6b4a950eb1abba159517dea956afd01ea9497",
            "ptAddress": "0x50bf5c6445b79b79e368856095a70c564d0c6966",
            "ytAddress": "0x6bd07c8691651a31c2d56532e4e5c0f46e1d80e8",
            "syAddress": "0x14c1878bd3f989d0d2199c537ea1a6d3b5225d05",
            "isActive": true
        },
        }
    ]
}
```

{% endtab %}
{% endtabs %}

### /getmarkettokens

#### Returns all the tokens in the specified market address.

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

#### Query Parameters

| Name                                                | Type   | Description                                                                                                         |
| --------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------- |
| rpc                                                 | String | Remote procedural call URL.                                                                                         |
| marketAddress<mark style="color:red;">\*</mark>     | String | Address of the specific market.                                                                                     |
| yieldAggregatorId<mark style="color:red;">\*</mark> | String | Refer to the [yield-aggregator-id](https://docs.expand.network/ids/yield-aggregator-id "mention") page for details. |

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

```url
https://api.expand.network/yieldaggregator/getmarkettokens?yieldAggregatorId=5200&marketAddress=0xcdd26eb5eb2ce0f203a84553853667ae69ca29ce
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "mintTokens": [
            "0x4c9edd5852cd905f086c759e8383e09bff1e68b3",
            "0x9d39a5de30e57443bff2a8307a4256c8797a3497"
        ],
        "redeemTokens": [
            "0x9d39a5de30e57443bff2a8307a4256c8797a3497"
        ],
        "Swap": {
            "tokensIn": [
                "0x9d39a5de30e57443bff2a8307a4256c8797a3497",
                "0x3ee118efc826d30a29645eaf3b2eaac9e8320185",
                "0x4c9edd5852cd905f086c759e8383e09bff1e68b3",
                "0x111111111117dc0aa78b770fa6a738034120c302",
                "0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9",
                "0xe1b4d34e8754600962cd944b535180bd758e6c2e",
                "0xd1b5651e55d4ceed36251c61c50c889b36f6abb5",
                "0x8be3460a480c80728a8c4d7a5d5303c85ba7b3b9",
                "0xa663b02cf0a4b149d2ad41910cb81e23e1c41c32",
                "0x77e06c9eccf2e797fd462a92b6d7642ef85b0a44",
                "0x6985884c4392d348587b19cb9eaaf157f13271cd"
            ],
            "tokensOut": [
                "0x9d39a5de30e57443bff2a8307a4256c8797a3497",
                "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
                "0xcd5fe23c85820f7b72d0926fc9b05b43e359b7ee",
                "0x7223442cad8e9ca474fc40109ab981608f8c4273",
                "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                "0x163f8c2467924be0ae7b5347228cabf260318753",
                "0x4691937a7508860f876c9c0a2a617e7d9e945d4b",
                "0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0",
                "0x77e06c9eccf2e797fd462a92b6d7642ef85b0a44",
                "0x6985884c4392d348587b19cb9eaaf157f13271cd"
            ]
        }
    }
}
```

{% endtab %}
{% endtabs %}

### /getmarketdata

#### Returns the data for the specified market .

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

#### Query Parameters

| Name                                                | Type    | Description                                                                                                         |
| --------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| rpc                                                 | String  | Remote procedural call URL.                                                                                         |
| marketAddress<mark style="color:red;">\*</mark>     | Boolean | Address of the specific market.                                                                                     |
| yieldAggregatorId<mark style="color:red;">\*</mark> | String  | Refer to the [yield-aggregator-id](https://docs.expand.network/ids/yield-aggregator-id "mention") page for details. |

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

```url
https://api.expand.network/yieldaggregator/getmarketdata?yieldAggregatorId=5200&marketAddress=0xcdd26eb5eb2ce0f203a84553853667ae69ca29ce
```

{% endtab %}

{% tab title="Sample Response" %}

<pre class="language-json"><code class="lang-json"><strong>{
</strong>    "status": 200,
    "msg": "success",
    "data": {
        "liquidityInUsd": "134907506.52283007",
        "tradingVolumeInUsd": "36339381.69865377",
        "totalSupply": "26392820.87417019",
        "totalPtTokens": "89416948.23342799",
        "totalLpTokens": "61534199.832070634",
        "totalSyTokens": "40588366.38292736"
    }
}
</code></pre>

{% endtab %}
{% endtabs %}

### /getbalance

#### Returns the balance of particular address of the specified market .

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

#### Query Parameters

| Name                                                | Type   | Description                                                                                                         |
| --------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------- |
| rpc                                                 | String | Remote procedural call URL.                                                                                         |
| marketAddress<mark style="color:red;">\*</mark>     | String | Address of the specific market.                                                                                     |
| yieldAggregatorId<mark style="color:red;">\*</mark> | String | Refer to the [yield-aggregator-id](https://docs.expand.network/ids/yield-aggregator-id "mention") page for details. |
| address<mark style="color:red;">\*</mark>           | String | Public address of the user.                                                                                         |

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

```url
https://api.expand.network/yieldaggregator/getbalance?marketAddress=0x8098b48a1c4e4080b30a43a7ebc0c87b52f17222&address=0x8dC3F8e1449E56929Aa7a721C9082ce4A9771F47&yieldAggregatorId=5200
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "balance": "2517682103"
    }
}
```

{% endtab %}
{% endtabs %}

### /transferliquidity

#### Initiate the transfer liquidity from source market address to destination market address .

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

#### Query Parameters

| Name                                                | Type    | Description                                                                                                         |
| --------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| rpc                                                 | String  | Remote procedural call URL.                                                                                         |
| marketAddress<mark style="color:red;">\*</mark>     | String  | Source market address.                                                                                              |
| yieldAggregatorId<mark style="color:red;">\*</mark> | String  | Refer to the [yield-aggregator-id](https://docs.expand.network/ids/yield-aggregator-id "mention") page for details. |
| from<mark style="color:red;">\*</mark>              | String  | Public Address of the user.                                                                                         |
| dstMarketAddress<mark style="color:red;">\*</mark>  | String  | destination market address.                                                                                         |
| lpAmount<mark style="color:red;">\*</mark>          | String  | <p>LP token amount. <br>The minimum valuation is 0.01 USD</p>                                                       |
| ptAmount<mark style="color:red;">\*</mark>          | String  | <p>Principal token amount.<br>The minimum valuation is 0.01 USD</p>                                                 |
| ytAmount<mark style="color:red;">\*</mark>          | String  | <p>Yield token amount.<br>The minimum valuation is 0.01 USD</p>                                                     |
| slippage                                            | String  | <p>Percentage of total swap value. By default, 1.</p><p>0 <= slippage value < 100</p>                               |
| gas                                                 | String  | Maximum gas limit provided by the sender, for the transaction.                                                      |
| redeemRewards                                       | Boolean | Redeem accrued rewards.                                                                                             |
| zeroPriceImpact                                     | Boolean | Zero price impact mode.                                                                                             |
| gasPriority                                         | String  | Low, medium, or high.                                                                                               |

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

```json
{
   "yieldAggregatorId":"5200",
   "marketAddress":"usde",
   "from":"0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
   "dstMarketAddress":"0xcdd26eb5eb2ce0f203a84553853667ae69ca29ce",
   "slippage" : "0.05",
   "gas":"1000000",
   "lpAmount":"1000000000000000000",
   "ptAmount":"1000000000000000000",
   "ytAmount":"1000000000000000000"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
   "status": 200,
   "msg": "success",
   "data": {
       "chainId": "1",
       "from": "0xdae2f6eddda6fb4fb60cc02633de27e2b431b402",
       "to": "0x888888888889758F76e7103c6CbF23ABbF58F946",
       "value": "0",
       "gas": "1000000",
       "data": "0x9fa02c860000000000000000000000005039da22e5126e7c4e9284376116716a91782faf000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000003e0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000003247036e0520000000000000000000000005039da22e5126e7c4e9284376116716a91782faf000000000000000000000000b451a36c8b6b2eac77ad0737ba732818143a0e250000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000002200000000000000000000000004c9edd5852cd905f086c759e8383e09bff1e68b30000000000000000000000000000000000000000000000",
       "estimationCheck": true,
       "referenceId": "5b86393c4dc74d9bb0fee01660829e5a"
   }
}
```

{% endtab %}
{% endtabs %}

### /redeem

Initiates a redeem transaction within a yield aggregator protocol, converting yield-bearing tokens back into their underlying asset.

<mark style="color:blue;">**Note:**</mark> Redeem PT & YT to tokens. If called before YT's expiry, both PT & YT of equal amounts are needed and will be burned.Else, only PT is needed and will be burned.\
User can redeem standard yield token by providing syAddress, similarly user can redeem yield token address by providing ytAddress.

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

#### Query Parameters

| Name                                                | Type   | Description                                                                                                         |
| --------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------- |
| rpc                                                 | String | Remote procedural call URL.                                                                                         |
| tokenOut<mark style="color:red;">\*</mark>          | String | Address of token to be redeemed.                                                                                    |
| yieldAggregatorId<mark style="color:red;">\*</mark> | String | Refer to the [yield-aggregator-id](https://docs.expand.network/ids/yield-aggregator-id "mention") page for details. |
| from<mark style="color:red;">\*</mark>              | String | Public Address of the user.                                                                                         |
| amountIn<mark style="color:red;">\*</mark>          | String | Amount to be redeemed.                                                                                              |
| syAddress<mark style="color:red;">\*</mark>         | String | Standard yield address.                                                                                             |
| ytAddress<mark style="color:red;">\*</mark>         | String | Yield token address.                                                                                                |
| slippage                                            | String | <p>Percentage of total swap value. By default, 1.</p><p>0 <= slippage value < 100</p>                               |
| gas                                                 | String | Maximum gas limit provided by the sender, for the transaction.                                                      |
| gasPriority                                         | String | Low, medium, or high.                                                                                               |

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

```json
{
   "yieldAggregatorId":"5200",
   "from":"0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
   "amountIn":"10000000000000000000",
   "tokenOut":"0x4db99b79361f98865230f5702de024c69f629fec",
   "slippage" : "5",
   "gas":"1000000",
   "ytAddress":"0x4a8036efa1307f1ca82d932c0895faa18db0c9ee"
}

```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
   "status": 200,
   "msg": "success",
   "data": {
       "chainId": "1",
       "from": "0xdae2f6eddda6fb4fb60cc02633de27e2b431b402",
       "to": "0x888888888889758F76e7103c6CbF23ABbF58F946",
       "value": "0",
       "gas": "1000000",
       "data": "0x339748cb000000000000000000000000dae2f6eddda6fb4fb60cc02633de27e2b431b4020000000000000000000000004a8036efa1307f1ca82d932c0895faa18db0c9ee0000000000000000000000000000000000000000000000008ac7230489e8000000000000000000000000000000000000000000000000000083d6c7aab6360000",
       "estimationCheck": true,
       "referenceId": "d0de8589aa8f4306b3a5b3c2044e28f1"
   }
}
```

{% endtab %}
{% endtabs %}

### /mint

Initiates a mint transaction within a yield aggregator protocol, converting deposited assets into yield-bearing tokens (or share tokens).

<mark style="color:blue;">**Note:**</mark> \
User can mint standard yield token by providing syAddress, similarly user can mint yield token address by providing ytAddress.

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

#### Query Parameters

| Name                                                | Type   | Description                                                                                                         |
| --------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------- |
| rpc                                                 | String | Remote procedural call URL.                                                                                         |
| tokenIn<mark style="color:red;">\*</mark>           | String | Address of token to be mint.                                                                                        |
| yieldAggregatorId<mark style="color:red;">\*</mark> | String | Refer to the [yield-aggregator-id](https://docs.expand.network/ids/yield-aggregator-id "mention") page for details. |
| from<mark style="color:red;">\*</mark>              | String | Public Address of the user.                                                                                         |
| syAddress<mark style="color:red;">\*</mark>         | String | Standard yield address.                                                                                             |
| ytAddress<mark style="color:red;">\*</mark>         | String | Yield token address.                                                                                                |
| amountIn<mark style="color:red;">\*</mark>          | String | Amount to be mint.                                                                                                  |
| slippage                                            | String | <p>Percentage of total swap value. By default, 1.</p><p>0 <= slippage value < 100</p>                               |
| gas                                                 | String | Maximum gas limit provided by the sender, for the transaction.                                                      |
| gasPriority                                         | String | Low, medium, or high.                                                                                               |

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

```json
{
   "yieldAggregatorId":"5200",
   "from":"0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
   "amountIn":"10000000000000000000",
   "tokenIn":"0x4db99b79361f98865230f5702de024c69f629fec",
   "slippage" : "0.05",
   "gas":"1000000",
   "ytAddress":"0x4a8036efa1307f1ca82d932c0895faa18db0c9ee"
}

```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
   "status": 200,
   "msg": "success",
   "data": {
       "chainId": "1",
       "from": "0xdae2f6eddda6fb4fb60cc02633de27e2b431b402",
       "to": "0x888888888889758F76e7103c6CbF23ABbF58F946",
       "value": "0",
       "gas": "1000000",
       "data": "0x1a8631b2000000000000000000000000dae2f6eddda6fb4fb60cc02633de27e2b431b4020000000000000000000000004a8036efa1307f1ca82d932c0895faa18db0c9ee0000000000000000000000000000000000000000000000008ac7230489e8000000000000000000000000000000000000000000000000000083d6c7aab6360000",
       "estimationCheck": true,
       "referenceId": "3173e53c1af44cda8f70d4990858d2c6"
   }
}

```

{% endtab %}
{% endtabs %}

### /swap

Initiates a swap transaction within a yield aggregator protocol, enabling users to exchange deposited tokens for another asset via the yield aggregation mechanism.

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

#### Query Parameters

| Name                                                | Type    | Description                                                                                                            |
| --------------------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------- |
| rpc                                                 | String  | Remote procedural call URL.                                                                                            |
| enableAggregator                                    | Boolean | If true, enable swap aggregator to swap between tokens that cannot be natively converted from/to the underlying asset. |
| yieldAggregatorId<mark style="color:red;">\*</mark> | String  | Refer to the [yield-aggregator-id](https://docs.expand.network/ids/yield-aggregator-id "mention") page for details.    |
| from<mark style="color:red;">\*</mark>              | String  | Public Address of the user.                                                                                            |
| path<mark style="color:red;">\*</mark>              | String  | Comma-separated values of token pair.                                                                                  |
| amountIn<mark style="color:red;">\*</mark>          | String  | Amount to be swapped.                                                                                                  |
| marketAddress<mark style="color:red;">\*</mark>     | String  | Address of the market.                                                                                                 |
| slippage                                            | String  | <p>Percentage of total swap value. By default, 1.</p><p>0 <= slippage value < 100</p>                                  |
| gas                                                 | String  | Maximum gas limit provided by the sender, for the transaction.                                                         |
| gasPriority                                         | String  | Low, medium, or high.                                                                                                  |

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

```json
{
  "yieldAggregatorId":"5200",
  "marketAddress":"usde",
  "from":"0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
  "amountIn":"10000000000000000000",
  "path":["0x8a47b431a7d947c6a3ed6e42d501803615a97eaa",
           "0x4db99b79361f98865230f5702de024c69f629fec"],
  "slippage" : "5",
  "gas":"1000000",
  "enableAggregator":true
}

```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
   "status": 200,
   "msg": "success",
   "data": {
       "chainId": "1",
       "from": "0xdae2f6eddda6fb4fb60cc02633de27e2b431b402",
       "to": "0x888888888889758F76e7103c6CbF23ABbF58F946",
       "value": "0",
       "gas": "1000000",
       "data": "0x2a50917c000000000000000000000000dae2f6eddda6fb4fb60cc02633de27e2b431b402000000000000000000000000b451a36c8b6b2eac77ad0737ba732818143a0e250000000000000000000000000000000000000000000000008ac7230489e8000000000000000000000000000000000000000000000000000089f69f2983fe3071000000000000000000000000000000000000000000000000489cbf8f1d0c8549000000000000000000000000000000000000000000000000b587dee5c89f4d3600000000000000000000000000000000000000000000000091397f1e3a190a92000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
       "estimationCheck": true,
       "referenceId": "8d5b7f177bf541d385f723d4891a792e"
   }
}

```

{% endtab %}
{% endtabs %}

### /addliquidity

#### Initiate the transaction to add liquidity from a specified market .

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

#### Query Parameters

| Name                                                | Type    | Description                                                                                                         |
| --------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| rpc                                                 | String  | Remote procedural call URL.                                                                                         |
| tokenIn<mark style="color:red;">\*</mark>           | String  | Address of the token to be added.                                                                                   |
| yieldAggregatorId<mark style="color:red;">\*</mark> | String  | Refer to the [yield-aggregator-id](https://docs.expand.network/ids/yield-aggregator-id "mention") page for details. |
| from<mark style="color:red;">\*</mark>              | String  | Public Address of the owner.                                                                                        |
| marketAddress<mark style="color:red;">\*</mark>     | String  | Address of the market.                                                                                              |
| amount<mark style="color:red;">\*</mark>            | String  | If user is initiating single side liquidity provisioning .                                                          |
| amountPtIn<mark style="color:red;">\*</mark>        | String  | If user is initiating dual liquidity provisioning .                                                                 |
| zeroPriceImpact                                     | Boolean | Zero price impact mode.                                                                                             |
| slippage                                            | String  | <p>Percentage of total swap value. By default, 1.</p><p>0 <= slippage value < 100</p>                               |
| gas                                                 | String  | Maximum gas limit provided by the sender, for the transaction.                                                      |
| gasPriority                                         | String  | Low, medium, or high.                                                                                               |

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

```json
{
   "yieldAggregatorId":"5200",
   "marketAddress":"usde",
   "from":"0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
   "amount":"10000000000000000000",
   "tokenIn":"0x4db99b79361f98865230f5702de024c69f629fec",
   "slippage" : "1",
   "amountPtIn":"100000",
   "gas":"1000000"
}

```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
   "status": 200,
   "msg": "success",
   "data": {
       "chainId": "1",
       "from": "0xdae2f6eddda6fb4fb60cc02633de27e2b431b402",
       "to": "0x888888888889758F76e7103c6CbF23ABbF58F946",
       "value": "0",
       "gas": "1000000",
       "data": "0x97ee279e000000000000000000000000dae2f6eddda6fb4fb60cc02633de27e2b431b402000000000000000000000000b451a36c8b6b2eac77ad0737ba732818143a0e250000000000000000000000000000000000000000000000008ac7230489e8000000000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000000000000000c741",
       "estimationCheck": true,
       "referenceId": "410bcb32a855442caa186a8a7a599d1e"
   }
}
```

{% endtab %}
{% endtabs %}

### /removeliquidity

#### Initiate the transaction to remove liquidity from a specified market .

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

#### Query Parameters

| Name                                                | Type    | Description                                                                                                           |
| --------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------- |
| rpc                                                 | String  | Remote procedural call URL.                                                                                           |
| tokenOut<mark style="color:red;">\*</mark>          | String  | Address of token to be removed.                                                                                       |
| yieldAggregatorId<mark style="color:red;">\*</mark> | String  | Refer to the [yield-aggregator-id](https://docs.expand.network/ids/yield-aggregator-id "mention") page for details.   |
| from<mark style="color:red;">\*</mark>              | String  | Public Address of the owner.                                                                                          |
| marketAddress<mark style="color:red;">\*</mark>     | String  | Address of the market.                                                                                                |
| amountIn<mark style="color:red;">\*</mark>          | String  | Amount to be removed                                                                                                  |
| enableAggregator                                    | String  | If true, enable swap aggregator to swap between tokens that cannot be natively converted from/to the underlying asset |
| isDual                                              | Boolean | If true, then dual-token removal mode will be initiated and user will get back both tokens and PT                     |
| slippage                                            | String  | <p>Percentage of total swap value. By default, 1.</p><p>0 <= slippage value < 100</p>                                 |
| gas                                                 | String  | Maximum gas limit provided by the sender, for the transaction.                                                        |
| gasPriority                                         | String  | Low, medium, or high.                                                                                                 |

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

```json
{
   "yieldAggregatorId":"5200",
   "marketAddress":"usde",
   "from":"0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
   "amountIn":"10000000000000000000",
   "tokenOut":"0x4db99b79361f98865230f5702de024c69f629fec",
   "slippage" : "1",
   "isDual":true,
   "gas":"1000000",
   "enableAggregator":true
}

```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
   "status": 200,
   "msg": "success",
   "data": {
       "chainId": "1",
       "from": "0xdae2f6eddda6fb4fb60cc02633de27e2b431b402",
       "to": "0x888888888889758F76e7103c6CbF23ABbF58F946",
       "value": "0",
       "gas": "1000000",
       "data": "0xb7d75b8b000000000000000000000000dae2f6eddda6fb4fb60cc02633de27e2b431b402000000000000000000000000b451a36c8b6b2eac77ad0737ba732818143a0e250000000000000000000000000000000000000000000000008ac7230489e800000000000000000000000000000000000000000000000000001a3314a2f53c7a6f0000000000000000000000000000000000000000000000010bfcf818602b1a92",
       "estimationCheck": true,
       "referenceId": "a2b80241f98544579531de6190c45729"
   }
}
```

{% endtab %}
{% endtabs %}
