dexPairsOhlcvLatest
Retrieve current UTC day OHLCV market values for one or more spot pairs. Use contract address, network ID, or slug to fetch accurate cryptocurrency market data.
Instructions
Returns the latest OHLCV market values for one or more spot pairs for the current UTC day.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| aux | No | ||
| contract_address | No | ||
| convert_id | No | ||
| network_id | No | ||
| network_slug | No | ||
| reverse_order | No | ||
| skip_invalid | No |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"aux": {
"type": "string"
},
"contract_address": {
"type": "string"
},
"convert_id": {
"type": "string"
},
"network_id": {
"type": "string"
},
"network_slug": {
"type": "string"
},
"reverse_order": {
"type": "string"
},
"skip_invalid": {
"type": "string"
}
},
"type": "object"
}
Implementation Reference
- index.js:385-390 (handler)The main handler function for the 'dexPairsOhlcvLatest' tool. It invokes handleEndpoint which makes an API request to the CoinMarketCap endpoint '/v4/dex/pairs/ohlcv/latest' with the provided parameters, formats the response, and returns it.async (params) => { return handleEndpoint(async () => { const data = await makeApiRequest(apiKey, '/v4/dex/pairs/ohlcv/latest', params) return formatResponse(data) }) }
- index.js:376-384 (schema)Zod schema defining the input parameters for the tool, all optional strings.{ contract_address: z.string().optional(), network_id: z.string().optional(), network_slug: z.string().optional(), aux: z.string().optional(), convert_id: z.string().optional(), skip_invalid: z.string().optional(), reverse_order: z.string().optional() },
- index.js:374-391 (registration)The registration of the 'dexPairsOhlcvLatest' tool using server.tool, including name, description, schema, and handler function.server.tool("dexPairsOhlcvLatest", "Returns the latest OHLCV market values for one or more spot pairs for the current UTC day.", { contract_address: z.string().optional(), network_id: z.string().optional(), network_slug: z.string().optional(), aux: z.string().optional(), convert_id: z.string().optional(), skip_invalid: z.string().optional(), reverse_order: z.string().optional() }, async (params) => { return handleEndpoint(async () => { const data = await makeApiRequest(apiKey, '/v4/dex/pairs/ohlcv/latest', params) return formatResponse(data) }) } )