# Benqi

### Supported Chains

Available on **Avalanche**

### Available Endpoints:

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

* [<mark style="color:blue;">**getapr**</mark>](#getapr) <mark style="color:blue;">`GET`</mark> - Get the Stader staking APR.
* [<mark style="color:blue;">**getrewards**</mark> ](#getrewards)<mark style="color:blue;">`GET`</mark> - Get the initial staked amount and current staked value by a specified user address.
* [<mark style="color:blue;">**getstake**</mark>](#getstake) <mark style="color:blue;">`GET`</mark> -Get the stake amount for a particular address.
* [<mark style="color:blue;">**getwithdrawalrequests**</mark>](#getwithdrawalrequests)[ ](#getwithdrawalrewards)<mark style="color:blue;">`GET`</mark> - Retrieves all withdrawal requests made by a specified address.
* [<mark style="color:blue;">**getwithdrawalstatus**</mark>](#getwithdrawalstatus)<mark style="color:blue;">`GET`</mark> - Get the status of a withdrawal request made by a specified address.
* [<mark style="color:blue;">**getallowance**</mark>](#getallowance)<mark style="color:blue;">`GET`</mark> - Get the approved allowance amount set by the owner for the spender.
* [<mark style="color:blue;">**Stake**</mark>](#stake) <mark style="color:green;">`POST`</mark> - Initiate a transaction to stake on Stader protocol.
* [<mark style="color:blue;">**requestwithdrawal**</mark> ](#requestwithdrawal)<mark style="color:green;">`POST`</mark> - Initiate a withdrawal request on Stader.
* [<mark style="color:blue;">**claim**</mark>](#claim) <mark style="color:green;">`POST`</mark> - Initiate a transaction to claim staked ETH after a withdrawal request.

*Also see* [<mark style="color:blue;">Error Handling Details</mark>](#error-handling-details)

## Liquid Staking IDs

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

Below is a list of Liquid Staking IDs related to Stader. Please see the [Liquid Staking ID page](https://docs.expand.network/ids/liquid-staking-ids) for a complete Liquid Staking ID list and more information.

<table><thead><tr><th width="275">Liquid Staking Name</th><th>Chain</th><th>Liquid Staking ID</th></tr></thead><tbody><tr><td>Benqi</td><td>Avalanche</td><td>43114</td></tr></tbody></table>

## Endpoint Details

### /getapr

#### Get the Stader staking APR.

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

#### Query Parameters

| Name            | Type   | Description                                                                                            |
| --------------- | ------ | ------------------------------------------------------------------------------------------------------ |
| rpc             | String | Remote procedural call URL.                                                                            |
| liquidStakingId | String | Refer to the [Liquid Staking Id](https://docs.expand.network/ids/liquid-staking-ids) page for details. |

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

```url
https://api.expand.network/liquidstaking/getapr?liquidStakingId=43114
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "timeUnix": "1726234694",
        "apr": "5.46",
        "blockNumber": "50483509"
    }
}
```

{% endtab %}
{% endtabs %}

[<mark style="color:blue;">back to top</mark>](#endpoints-available)

### /getrewards

#### Get the initial staked amount and current staked value by a specified user address.

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

#### Query Parameters

<table><thead><tr><th width="182">Name</th><th width="159">Type</th><th>Description</th></tr></thead><tbody><tr><td>rpc</td><td>String</td><td>Remote procedural call URL.</td></tr><tr><td>liquidStakingId</td><td>String</td><td>Refer to the <a href="../../ids/liquid-staking-ids">Liquid Staking Id</a> page for details.</td></tr><tr><td>address<mark style="color:red;">*</mark></td><td>String</td><td>Public address of the user.</td></tr></tbody></table>

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

```url
https://api.expand.network/liquidstaking/getrewards?liquidStakingId=43114&address=0x10137E2EC5907ceA3151FB00C3Ecd9B48E22B82B
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "stakedAmount": "17208357980018603",
        "stakeValue": "20073834784345071"
    }
}
```

{% endtab %}
{% endtabs %}

[<mark style="color:blue;">back to top</mark>](#endpoints-available)

### /getstake

#### Get the stake amount for a particular address.

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

#### Query Parameters

<table><thead><tr><th width="190">Name</th><th width="167">Type</th><th>Description</th></tr></thead><tbody><tr><td>rpc</td><td>String</td><td>Remote procedural call URL.</td></tr><tr><td>liquidStakingId</td><td>String</td><td>Refer to the <a href="../../ids/liquid-staking-ids">Liquid Staking Id</a> page for details.</td></tr><tr><td>address<mark style="color:red;">*</mark></td><td>String</td><td>Public address of the user.</td></tr></tbody></table>

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

```url
https://api.expand.network/liquidstaking/getstake?address=0x10137E2EC5907ceA3151FB00C3Ecd9B48E22B82B&liquidStakingId=43114
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "sAVAX": "17208357980018603"
    }
}
```

{% endtab %}
{% endtabs %}

[<mark style="color:blue;">back to top</mark>](#endpoints-available)

### /getwithdrawalrequests

#### Get all the withdrawal requests(NFT ids) made by a specified address.

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

#### Query Parameters

<table><thead><tr><th width="193">Name</th><th width="167">Type</th><th>Description</th></tr></thead><tbody><tr><td>rpc</td><td>String</td><td>Remote procedural call URL.</td></tr><tr><td>liquidStakingId</td><td>String</td><td>Refer to the <a href="../../ids/liquid-staking-ids">Liquid Staking Id</a> page for details.</td></tr><tr><td>address<mark style="color:red;">*</mark></td><td>String</td><td>Public address of the user.</td></tr></tbody></table>

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

```url
https://api.expand.network/liquidstaking/getwithdrawalrequests?liquidStakingId=43114&address=0xc1d423aE49fba66AA713610811d13e0BECf213c6
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": [
        "0"
    ]
}
```

{% endtab %}
{% endtabs %}

[<mark style="color:blue;">back to top</mark>](#endpoints-available)

### /getwithdrawalstatus

#### Get the status of a withdrawal request made by a specified address.

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

#### Query Parameters

<table><thead><tr><th width="178">Name</th><th width="183">Type</th><th>Description</th></tr></thead><tbody><tr><td>rpc</td><td>String</td><td>Remote procedural call URL.</td></tr><tr><td>liquidStakingId</td><td>String</td><td>Refer to the <a href="../../ids/liquid-staking-ids">Liquid Staking Id</a> page for details.</td></tr><tr><td>address<mark style="color:red;">*</mark></td><td>String</td><td>The address of user</td></tr><tr><td>requestId<mark style="color:red;">*</mark></td><td>String</td><td>The token id of NFT , which is minted upon request, to claim the rewards.</td></tr></tbody></table>

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

```url
https://api.expand.network/liquidstaking/getwithdrawalstatus?liquidStakingId=43114&requestId=0&address=0xc1d423aE49fba66AA713610811d13e0BECf213c6
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "amountOfsAVAX": "378877936578560186",
        "withdrawalTime": "1726024008"
    }
}
```

{% endtab %}
{% endtabs %}

[<mark style="color:blue;">back to top</mark>](#endpoints-available)

### /getallowance

#### Get the approved allowance amount set by the owner for the spender.

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

#### Query Parameters

<table><thead><tr><th width="212">Name</th><th width="157">Type</th><th>Description</th></tr></thead><tbody><tr><td>rpc</td><td>String</td><td>Remote procedural call URL.</td></tr><tr><td>liquidStakingId</td><td>String</td><td>Refer to the <a href="../../ids/liquid-staking-ids">Liquid Staking Id</a> page for details.</td></tr><tr><td>owner<mark style="color:red;">*</mark></td><td>String</td><td>Public address of the owner of token.</td></tr><tr><td>tokenAddress<mark style="color:red;">*</mark></td><td>String</td><td>Token contract address.</td></tr><tr><td>spender<mark style="color:red;">*</mark></td><td>String</td><td>Public address of the spender of token.</td></tr></tbody></table>

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

```url
https://api.expand.network/liquidstaking/getallowance?liquidStakingId=43114&owner=0x6427B4b028c4A1db5fb5dAf80C22e81115457230&tokenAddress=0x2b2C81e08f1Af8835a78Bb2A90AE924ACE0eA4bE&spender=0x6427B4b028c4A1db5fb5dAf80C22e81115457230
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "allowance": "53880000000000000"
    }
}
```

{% endtab %}
{% endtabs %}

[<mark style="color:blue;">back to top</mark>](#endpoints-available)

### /stake

#### Initiate a transaction to stake on Stader.

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

#### Request Body

<table><thead><tr><th width="214">Name</th><th width="141">Type</th><th>Description</th></tr></thead><tbody><tr><td>rpc</td><td>String</td><td>Remote procedural call URL.</td></tr><tr><td>liquidStakingId</td><td>String</td><td>Refer to the <a href="../../ids/liquid-staking-ids">Liquid Staking Id</a> page for details.</td></tr><tr><td>from<mark style="color:red;">*</mark></td><td>String</td><td>Public address of the owner of this request.</td></tr><tr><td>amount<mark style="color:red;">*</mark></td><td>String</td><td>Amount of token to stake.</td></tr><tr><td>gas</td><td>String</td><td>Maximum gas limit provided by the sender, for the transaction.</td></tr><tr><td>gasPriority</td><td>String</td><td>low, medium, or high.</td></tr></tbody></table>

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

```json
{
    "amount": "1000000000000000000",
    "liquidStakingId": "43114",
    "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
    "gas": "40000"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "43114",
        "from": "0xefdc8FC1145ea88e3f5698eE7b7b432F083B4246",
        "to": "0x2b2C81e08f1Af8835a78Bb2A90AE924ACE0eA4bE",
        "data": "0x5bcb2fc6",
        "value": "1000000000000000000",
        "gas": "40000",
        "referenceId": "39bb3a38c06b4543a4bbf48985a0bcba"
    }
}
```

{% endtab %}
{% endtabs %}

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

```json
{
    "amount": "1000000000000000000",
    "liquidStakingId": "43114",
    "from": "0xefdc8FC1145ea88e3f5698eE7b7b432F083B4246",
    "gas": "40000",
    "gasPriority": "low"
}
```

{% endtab %}

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

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "43114",
        "from": "0xefdc8FC1145ea88e3f5698eE7b7b432F083B4246",
        "to": "0x2b2C81e08f1Af8835a78Bb2A90AE924ACE0eA4bE",
        "data": "0x5bcb2fc6",
        "value": "1000000000000000000",
        "gas": "40000",
        "gasPrice": "25000000000",
        "referenceId": "39bb3a38c06b4543a4bbf48985a0bcba"
    }
}
```

{% endtab %}
{% endtabs %}

[<mark style="color:blue;">back to top</mark>](#endpoints-available)

### /requestwithdrawal

#### Initiate a transaction to request a withdrawal on Stader.

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

#### Request Body

<table><thead><tr><th width="182">Name</th><th width="143">Type</th><th>Description</th></tr></thead><tbody><tr><td>rpc</td><td>String</td><td>Remote procedural call URL.</td></tr><tr><td>liquidStakingId</td><td>String</td><td>Refer to the <a href="../../ids/liquid-staking-ids">Liquid Staking Id</a> page for details.</td></tr><tr><td>from<mark style="color:red;">*</mark></td><td>String</td><td>Public address of the owner of this request.</td></tr><tr><td>amount<mark style="color:red;">*</mark></td><td>String</td><td>Amount of tokens to request withdrawal.</td></tr><tr><td>ownerAddress<mark style="color:red;">*</mark></td><td>String</td><td>Public address of the owner.</td></tr><tr><td>gas</td><td>String</td><td>Maximum gas limit provided by the sender, for the transaction.</td></tr><tr><td>gasPriority</td><td>String</td><td>low, medium, or high.</td></tr></tbody></table>

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

```json
{
    "amount": "100000",
    "liquidStakingId": "43114",
    "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
    "gas": "40000"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "43114",
        "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
        "to": "0x2b2C81e08f1Af8835a78Bb2A90AE924ACE0eA4bE",
        "data": "0xc9d2ff9d00000000000000000000000000000000000000000000000000000000000186a0",
        "gas": "40000",
        "value": "0",
        "referenceId": "575c082d45a44ced9d64017437cdfbae"
    }
}
```

{% endtab %}
{% endtabs %}

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

```json
{
    "amount": "100000",
    "liquidStakingId": "43114",
    "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
    "gas": "40000",
    "gasPriority": "low"
}
```

{% endtab %}

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

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "43114",
        "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
        "to": "0x2b2C81e08f1Af8835a78Bb2A90AE924ACE0eA4bE",
        "data": "0xc9d2ff9d00000000000000000000000000000000000000000000000000000000000186a0",
        "gas": "40000",
        "value": "0",
        "gasPrice": "25000000000",
        "referenceId": "71d1eb3a86254ccb9d2da22c677edc31"
    }
}
```

{% endtab %}
{% endtabs %}

[<mark style="color:blue;">back to top</mark>](#endpoints-available)

### /claim

#### Initiate a transaction to burn the NFT, which is minted upon request, and to claim the rewards.

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

#### Request Body

<table><thead><tr><th width="184">Name</th><th width="108">Type</th><th>Description</th></tr></thead><tbody><tr><td>rpc</td><td>String</td><td>Remote procedural call URL.</td></tr><tr><td>liquidStakingId</td><td>String</td><td>Refer to the <a href="../../ids/liquid-staking-ids">Liquid Staking Id</a> page for details.</td></tr><tr><td>from<mark style="color:red;">*</mark></td><td>String</td><td>Public address of the owner of this request.</td></tr><tr><td>requestId<mark style="color:red;">*</mark></td><td>String</td><td>The token id of NFT , which is minted upon request, to claim the rewards.</td></tr><tr><td>gas</td><td>String</td><td>Maximum gas limit provided by the sender, for the transaction.</td></tr><tr><td>gasPriority</td><td>String</td><td>low, medium, or high.</td></tr></tbody></table>

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

```json
{
    "liquidStakingId": "43114",
    "requestId": "0",
    "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
    "gas": "400000"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "43114",
        "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
        "to": "0x2b2C81e08f1Af8835a78Bb2A90AE924ACE0eA4bE",
        "data": "0xdb006a750000000000000000000000000000000000000000000000000000000000000000",
        "gas": "400000",
        "value": "0",
        "referenceId": "193cb54ca10748b1a6983b876bff3ace"
    }
}
```

{% endtab %}
{% endtabs %}

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

```json
{
    "liquidStakingId": "43114",
    "requestId": "0",
    "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
    "gasPriority": "medium",
    "gas": "400000"
}
```

{% endtab %}

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

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "43114",
        "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
        "to": "0x2b2C81e08f1Af8835a78Bb2A90AE924ACE0eA4bE",
        "data": "0xdb006a750000000000000000000000000000000000000000000000000000000000000000",
        "gas": "400000",
        "value": "0",
        "gasPrice": "30000000000",
        "referenceId": "f94e863e53be482b9f724cebda22af3c"
    }
}
```

{% endtab %}
{% endtabs %}

[<mark style="color:blue;">back to top</mark>](#endpoints-available)

### Error Handling Details

<table><thead><tr><th width="253">Error</th><th>Description</th></tr></thead><tbody><tr><td>400 (Bad Request)</td><td>Indicates the request is invalid or missing the required parameters. The msg field will contain details about the error.</td></tr><tr><td>401 (Unauthorised)</td><td>Indicates the request lacks valid authentication credentials (API key). Ensure that you provide a valid API key in the request headers.</td></tr><tr><td>404 (Not Found)</td><td>Indicates that the specified endpoint or resource does not exist.</td></tr><tr><td>500 (Server Error)</td><td>Indicates an internal server error.</td></tr></tbody></table>

[<mark style="color:blue;">back to top</mark>](#endpoints-available)
