live_mark_dislocations
Retrieve historical mark and oracle price dislocations for any coin to identify basis stress or oracle drift before liquidations. Data includes timestamped mark price, oracle price, and basis percentage up to 30 days.
Instructions
Get historical mark/oracle dislocation data for a coin. Use this to answer questions like 'did basis stress or oracle drift show up before liquidations?'. Returns timestamped mark price, oracle price, and basis percentage over the last 30 days.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| useToonFormat | No | Return data in compact toon format (default: true). Set to false for standard JSON. | |
| coin | Yes | Coin symbol (e.g. BTC, ETH, SOL). For builder dex markets use prefix:COIN | |
| hours | No | Number of hours of history to return (default 168 = 7 days, max 720 = 30 days) |
Implementation Reference
- src/index.ts:626-640 (handler)The handler function for live_mark_dislocations. It calls the coin risk history API endpoint with useToon=false, then extracts and returns only the markDislocations array from the response along with metadata (coin, hours, count, availability, freshness). Finally applies toon encoding if requested.
async ({ useToonFormat, coin, hours }) => { const history = await callAPI(false, `/live/risk/coins/${normalizeCoin(coin)}/history`, { hours: String(hours) }); const result = { success: history.success, coin: history.coin, hours: history.hours, count: Array.isArray(history.markDislocations) ? history.markDislocations.length : 0, markDislocations: history.markDislocations || [], availability: history.availability, freshness: history.freshness, generatedAt: history.generatedAt, }; return toolResult(useToonFormat ? toonEncode(result) : result); } ); - src/index.ts:617-625 (schema)Input schema for live_mark_dislocations tool. Accepts useToonFormat (boolean, default true), coin (string symbol), and hours (number, default 168 = 7 days, max 720 = 30 days).
"live_mark_dislocations", { description: "Get historical mark/oracle dislocation data for a coin. Use this to answer questions like 'did basis stress or oracle drift show up before liquidations?'. Returns timestamped mark price, oracle price, and basis percentage over the last 30 days.", inputSchema: { useToonFormat: useToonFormatSchema, coin: z.string().min(1).max(20).describe("Coin symbol (e.g. BTC, ETH, SOL). For builder dex markets use prefix:COIN"), hours: z.number().min(1).max(720).default(168).describe("Number of hours of history to return (default 168 = 7 days, max 720 = 30 days)"), }, }, - src/index.ts:616-640 (registration)Registration of the live_mark_dislocations tool. Conditionally registered via shouldRegister('live_mark_dislocations') — not in FREE_TIER_TOOLS, so requires an API key.
if (shouldRegister("live_mark_dislocations")) server.registerTool( "live_mark_dislocations", { description: "Get historical mark/oracle dislocation data for a coin. Use this to answer questions like 'did basis stress or oracle drift show up before liquidations?'. Returns timestamped mark price, oracle price, and basis percentage over the last 30 days.", inputSchema: { useToonFormat: useToonFormatSchema, coin: z.string().min(1).max(20).describe("Coin symbol (e.g. BTC, ETH, SOL). For builder dex markets use prefix:COIN"), hours: z.number().min(1).max(720).default(168).describe("Number of hours of history to return (default 168 = 7 days, max 720 = 30 days)"), }, }, async ({ useToonFormat, coin, hours }) => { const history = await callAPI(false, `/live/risk/coins/${normalizeCoin(coin)}/history`, { hours: String(hours) }); const result = { success: history.success, coin: history.coin, hours: history.hours, count: Array.isArray(history.markDislocations) ? history.markDislocations.length : 0, markDislocations: history.markDislocations || [], availability: history.availability, freshness: history.freshness, generatedAt: history.generatedAt, }; return toolResult(useToonFormat ? toonEncode(result) : result); } );