# Synthetix

### /getprice

Get the exchange amount in Protocol Tokens for entered Pegged Tokens.

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

#### Query Parameters

| Name                                     | Type   | Description                                                                                               |
| ---------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------- |
| syntheticId                              | String | Refer to the [synthetics-ids](https://docs.expand.network/ids/synthetics-ids "mention") page for details. |
| amount<mark style="color:red;">\*</mark> | String | Amount in Synths.                                                                                         |

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

```url
https://api.expand.network/synthetic/getprice?amount=58798
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "peggedToProtocolToken": "22177"
    }
}
```

{% endtab %}
{% endtabs %}

### /depositpeggedtoken

Deposit pegged token.

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

#### Request Body

| Name                                     | Type   | Description                                                                                               |
| ---------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------- |
| syntheticId                              | String | Refer to the [synthetics-ids](https://docs.expand.network/ids/synthetics-ids "mention") page for details. |
| amount<mark style="color:red;">\*</mark> | String | Amount of pegged token.                                                                                   |
| from<mark style="color:red;">\*</mark>   | String | Address of the sender of the token.                                                                       |
| gas                                      | String | Maximum gas limit provided by the sender, for the transaction.                                            |
| gasPriority                              | String | low, medium, or high.                                                                                     |

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

```json
{
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",      
    "amount": "100000000000000000",
    "gas": "300000",
    "syntheticId": "6000"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
        "value": "0",
        "gas": "300000",
        "data": "0xdc8fa6c2000000000000000000000000000000000000000000000000016345785d8a0000",
        "to": "0xE1f64079aDa6Ef07b03982Ca34f1dD7152AA3b86"
    }
}
```

{% endtab %}
{% endtabs %}

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

#### With gasPriority:

```json
{
    "from": "0x731FDBd6871aD5cD905eE560A84615229eD8197a",
    "amount": "100000",
    "gas": "300000",
    "syntheticId": "6000",
    "gasPriority": "medium"
}
```

{% endtab %}

{% tab title="Sample Response" %}

#### With gasPriority:

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x731FDBd6871aD5cD905eE560A84615229eD8197a",
        "value": "0",
        "gas": "300000",
        "data": "0xdc8fa6c200000000000000000000000000000000000000000000000000000000000186a0",
        "to": "0xE1f64079aDa6Ef07b03982Ca34f1dD7152AA3b86",
        "gasPrice": "17327449829"
    }
}
```

{% endtab %}
{% endtabs %}

### /withdrawpeggedtoken

Withdraw pegged token.

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

#### Request Body

| Name                                   | Type   | Description                                                                                               |
| -------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------- |
| syntheticId                            | String | Refer to the [synthetics-ids](https://docs.expand.network/ids/synthetics-ids "mention") page for details. |
| from<mark style="color:red;">\*</mark> | String | Address of the owner of the token.                                                                        |
| gas                                    | String | Maximum gas to be approved for the transaction.                                                           |
| gasPriority                            | String | low, medium, or high.                                                                                     |

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

```json
{
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "gas": "300000",
    "syntheticId": "6000"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
        "value": "0",
        "gas": "300000",
        "data": "0x81b797dc",
        "to": "0xE1f64079aDa6Ef07b03982Ca34f1dD7152AA3b86"
    }
}
```

{% endtab %}
{% endtabs %}

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

#### With gasPriority:

```json
{
    "from": "0x731FDBd6871aD5cD905eE560A84615229eD8197a",
    "gas": "300000",
    "syntheticId": "6000",
    "gasPriority": "medium"
}
```

{% endtab %}

{% tab title="Sample Response" %}

#### With gasPriority:

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x731FDBd6871aD5cD905eE560A84615229eD8197a",
        "value": "0",
        "gas": "300000",
        "data": "0x81b797dc",
        "to": "0xE1f64079aDa6Ef07b03982Ca34f1dD7152AA3b86",
        "gasPrice": "16948048970"
    }
}
```

{% endtab %}
{% endtabs %}
