# State price

## What is this endpoint for? <a href="#what-is-this-endpoint-for" id="what-is-this-endpoint-for"></a>

This endpoint should be used when there isn’t enough liquidity to produce a direct or synthetic price. Especially useful for DeFi-only assets, state price derives a price by analyzing the real-time state of liquidity pools for the selected asset, inspecting the pools’ reserves, balances, and recent flow to infer a-price consistent with current market conditions.\
\
The data includes the calculated state price and the trading volume from the associated block within each pool, expressed in USD. \
\
Pool eligibility depends on the pairing: non-LST tokens must be paired with USDT, USDC, or wETH, while LST tokens must be paired with wETH.&#x20;

## Endpoint&#x20;

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

```url
gateway-v0-grpc.kaiko.ovh
```

{% endtab %}

{% tab title="http" %}

```url
gateway-v0-http.kaiko.ovh
```

{% endtab %}

{% tab title="API (Testing)" %}

```url
https://gateway-v0-http.kaiko.ovh/api/stream/aggregatedstateprice
```

{% endtab %}
{% endtabs %}

## Parameters

<table><thead><tr><th width="184">Parameter</th><th width="387">Description</th><th>Examples</th><th data-type="checkbox">Mandatory?</th></tr></thead><tbody><tr><td><code>asset</code></td><td>The asset name you would like to get data for. <br><br>To retrieve data for all eligible assets at once, simply enter * in the asset parameter field. </td><td><code>ageur,wsteth</code> </td><td>true</td></tr></tbody></table>

## Fields

<table><thead><tr><th width="223">Field</th><th width="537">Description</th></tr></thead><tbody><tr><td><code>datetime</code></td><td>Timestamp at which the data has been processed. One data point per second will be published.</td></tr><tr><td><code>base</code></td><td>Base asset requested.</td></tr><tr><td><code>aggregatedPriceUsd</code></td><td>State price aggregated over multiple pools, denominated in USD.</td></tr><tr><td><code>aggregatedPriceEth</code></td><td>State price aggregated over multiple pools, denominated in ETH.<br><br>This field will return empty for LST tokens.</td></tr><tr><td><code>tsEvent</code></td><td>Date of the publication.</td></tr><tr><td><code>lstQuote</code></td><td>LST quote token if relevant, otherwise will return empty.</td></tr></tbody></table>

## Request examples

{% tabs %}
{% tab title="Python" %}
**Make sure to read our** [**Python quick-start guide**](/stream/general/quick-start-guides/quick-start-python.md) **before starting.**&#x20;

{% @github-files/github-code-block url="<https://github.com/kaikodata/kaiko-sdk-examples/blob/master/python/code-example/aggregated_state_price_v1_request.py>" visible="false" %}
{% endtab %}

{% tab title="cURL" %}
**cURL requests are intended for testing purposes only.**

{% code overflow="wrap" %}

```url
curl -X POST "https://gateway-v0-http.kaiko.ovh/api/stream/aggregatedstateprice" -H "accept: application/json" -H "X-Api-Key: $KAIKO_API_KEY" -H "Content-Type: application/json" -d "{ \"asset\": \"wsteth\", \"start_time\": \"2025-01-07T10:48:59.528Z\", \"end_time\": \"2025-01-08T10:48:59.528Z\" }"
```

{% endcode %}
{% endtab %}

{% tab title="Other examples" %}
For more advanced users, you can access our full SDK [here](https://github.com/kaikodata/kaiko-sdk-examples/tree/master), where you'll find more coding languages, examples and guidance.
{% endtab %}
{% endtabs %}

## Response Example

```json
{
	"result": {
		"datetime": "2024-10-23T09:45:13.000964543Z",
		"base": "wsteth",
		"aggregatedPriceUsd": "3036.2060425401045987863569203955",
		"aggregatedPriceEth": "1.1822171670279031",
		"tsEvent": "2024-10-23T09:45:13.447941047Z",
		"lstQuote": "weth"
	}
}
```


---

# 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.kaiko.com/stream/analytics-solutions/kaiko-fair-market-value/emerging-assets/state-price.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.
