diff --git a/.well-known/ai-tools.json b/.well-known/ai-tools.json index 1281c81..24612b3 100644 --- a/.well-known/ai-tools.json +++ b/.well-known/ai-tools.json @@ -88,6 +88,10 @@ "type": "boolean", "description": "When true, excludes tokens with less than 100 USD liquidity." }, + "exclude_unpriced": { + "type": "boolean", + "description": "When true, excludes token balances without available USD pricing. Default is false." + }, "limit": { "type": "integer", "minimum": 1, @@ -423,6 +427,10 @@ "enum": ["erc20", "native"], "description": "Specify erc20 or native to get only ERC20 stablecoins or native stablecoins (e.g. xDAI on Gnosis)." }, + "exclude_unpriced": { + "type": "boolean", + "description": "When true, excludes token balances without available USD pricing. Default is false." + }, "limit": { "type": "integer", "minimum": 1, diff --git a/evm/balances.mdx b/evm/balances.mdx index fd980df..56d4156 100644 --- a/evm/balances.mdx +++ b/evm/balances.mdx @@ -32,6 +32,10 @@ You can include `metadata=pools` in your request to see which liquidity pool was We also include the `pool_size` field in all responses, allowing you to implement custom filtering logic based on your specific requirements. For a detailed explanation of our approach, see our [Token Filtering](/token-filtering) guide. +### Exclude unpriced balances + +By default, balances for tokens without available pricing data are included in responses. To filter them out, pass `exclude_unpriced=true`. + ### Exclude tokens with less than 100 USD liquidity Use the optional `exclude_spam_tokens` query parameter to automatically filter out tokens with less than 100 USD of liquidity. Include the query parameter `exclude_spam_tokens=true` so that those tokens are excluded from the response entirely. This is distinct from the `low_liquidity` field in the response, which is `true` when liquidity is below 10,000. To learn more about how Sim calculates liquidity data, visit the [Token Filtering](/token-filtering) guide. diff --git a/openapi.json b/openapi.json index a575098..279887b 100644 --- a/openapi.json +++ b/openapi.json @@ -400,6 +400,16 @@ "default": false } }, + { + "name": "exclude_unpriced", + "in": "query", + "description": "When true, excludes balances for tokens without available pricing data. By default, unpriced token balances are included.", + "required": false, + "schema": { + "type": "boolean", + "default": false + } + }, { "name": "historical_prices", "in": "query", @@ -1579,6 +1589,16 @@ "default": false } }, + { + "name": "exclude_unpriced", + "in": "query", + "description": "When true, excludes balances for tokens without available pricing data. By default, unpriced token balances are included.", + "required": false, + "schema": { + "type": "boolean", + "default": false + } + }, { "name": "historical_prices", "in": "query", diff --git a/token-filtering.mdx b/token-filtering.mdx index c9d83b0..fa70468 100644 --- a/token-filtering.mdx +++ b/token-filtering.mdx @@ -69,8 +69,10 @@ The following examples demonstrate how to use this data to create robust filteri Use the optional `exclude_spam_tokens` query parameter on the EVM Balances API to automatically filter out tokens with less than 100 USD of liquidity. Include `exclude_spam_tokens=true` to have those tokens excluded from the response entirely. +By default, balances for tokens without available pricing data are included. Set `exclude_unpriced=true` if you want those unpriced token balances filtered out. + ```bash -curl -s -X GET 'https://api.sim.dune.com/v1/evm/balances/0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045?exclude_spam_tokens=true' \ +curl -s -X GET 'https://api.sim.dune.com/v1/evm/balances/0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045?exclude_spam_tokens=true&exclude_unpriced=true' \ -H 'X-Sim-Api-Key: YOUR_API_KEY' ```