import { z } from "zod";
import { apiGet } from "../client.js";
export const name = "get_liquidations";
export const description =
"Get cross-exchange liquidation data showing long and short liquidation volumes over 24h. " +
"High liquidation volumes indicate forced position closures and market stress. " +
"A long/short liquidation ratio significantly above 1 means longs are being squeezed; " +
"below 1 means shorts are being squeezed. Useful for gauging leveraged positioning pain.";
export const schema = z.object({
exchange: z
.string()
.optional()
.describe("Filter by exchange name (e.g., 'binance', 'hyperliquid'). Omit for all exchanges."),
type: z
.string()
.optional()
.describe("Market type filter (e.g., 'perps'). Omit for default."),
limit: z
.number()
.optional()
.describe("Number of results to return. Default 250."),
});
export async function handler(args: z.infer<typeof schema>) {
return apiGet("/api/v1/market-intelligence/liquidations", {
exchange: args.exchange,
type: args.type,
limit: args.limit,
});
}