# Get Effective Price (Preview Market Order)

## Get Effective Price (Preview Market Order)

<mark style="color:blue;">`GET`</mark> `https://api.swivel.exchange/v2/fillpreview?underlying=u&maturity=m&protocol=p&volume=v&vault=w&exit=e`

This endpoint allows you to request a limit order payload that matches a given market order.\
\
Returns the effective price as well as orders for consumption.

#### Query Parameters

| Name                                         | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                       |
| -------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| underlying<mark style="color:red;">\*</mark> | string  | The underlying token being transacted. E.g. USDC, DAI, etc.,                                                                                                                                                                                                                                                                                                                                                                      |
| maturity<mark style="color:red;">\*</mark>   | string  | The maturity of market in unix seconds.                                                                                                                                                                                                                                                                                                                                                                                           |
| volume<mark style="color:red;">\*</mark>     | string  | The amount of currency to use.                                                                                                                                                                                                                                                                                                                                                                                                    |
| vault<mark style="color:red;">\*</mark>      | boolean | Indicates if an order is in relation to a initiating/exiting a vault or zcToken                                                                                                                                                                                                                                                                                                                                                   |
| exit<mark style="color:red;">\*</mark>       | boolean | Indicated if an order is an exit or an initiate                                                                                                                                                                                                                                                                                                                                                                                   |
| protocol<mark style="color:red;">\*</mark>   | integer | <p>A pointer that refers to a given yield bearing market like Lido or Compound.</p><p></p><p>The protocol enum values:</p><p></p><p><code>enum Protocols {</code></p><p>  <code>Erc4626 = 0,</code> </p><p>  <code>Compound = 1,</code> </p><p>  <code>Rari = 2,</code> </p><p>  <code>Yearn = 3,</code> </p><p>  <code>Aave = 4,</code> </p><p>  <code>Euler = 5,</code> </p><p>  <code>Lido = 6</code></p><p><code>}</code></p> |

{% tabs %}
{% tab title="200 " %}

```
{
    "orders": [
        {
            "order": {
                "key": "0xa8181ff6e0bfa16130944d5add7220eed46f44796de7d4216728dde40376ac5e",
                "maker": "0x096Da21Ac79ae1EDbC69A07CE5c705E6c77Fec90",
                "underlying": "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa",
                "vault": true,
                "exit": false,
                "principal": "107758620689655172413793",
                "premium": "10000000000000000000000",
                "maturity": "1669957199",
                "expiry": "1641371984",
                "protocol": 1
            },
            "meta": {
                "price": "0.0928",
                "signature": "0xa4e8958193cf2cb9c70e4c4a7df9c3c7b68f89fd2f250d80e6bc9dbd9cba8c54415fb2f4d8da33c1d81d5a028233255b52adbf36bee3a2a929fb3ea3e735ff7a1c",
                "premiumAvailable": "10000000000000000000000",
                "principalAvailable": "107758620689655172413793",
                "previewFill": "1000",
                "sequence": 63593
            }
        }
    ],
    "effectivePrice": "0.092799999999999997156",
    "timestamp": 1640178873
}
```

{% endtab %}

{% tab title="400 Passed volume exceeds available" %}

```
{
     "message": "passed volume exceeds available" 
}
```

{% endtab %}

{% tab title="400: Bad Request Passed volume exceeds the maximum number of orders allowed" %}

```javascript
{
    "message": "passed volume exceeds the maximum number of orders allowed"
}
```

{% endtab %}
{% endtabs %}
