get_stablecoin_flows
Track stablecoin supply changes across major assets to monitor capital flows in crypto markets, providing minting/redemption data, net flow signals, and depeg warnings.
Instructions
Track stablecoin supply changes across USDT, USDC, and all major stablecoins. Shows total supply, 24h/7d/30d minting and redemptions, net capital flow signal, depeg warnings, and liquidity assessment. Stablecoin flows are a leading indicator of capital entering or leaving crypto.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/get-stablecoin-flows.ts:30-72 (handler)The main handler function for the get_stablecoin_flows tool, which fetches data, processes it into a summary and guidance, and caches the result.
export async function getStablecoinFlowsTool(cache: CacheService): Promise<StablecoinFlowsOutput | ErrorOutput> { const cached = cache.get<StablecoinFlowsOutput>(CACHE_KEY); if (cached) return cached.data; try { const data = await getStablecoinData(); const summary = generateSummary(data); const guidance = generateGuidance(data); const result: StablecoinFlowsOutput = { total_supply_usd: data.total_supply_usd, change_24h_usd: data.total_change_24h_usd, change_7d_usd: data.total_change_7d_usd, change_30d_usd: data.total_change_30d_usd, change_24h_pct: data.total_change_24h_pct, change_7d_pct: data.total_change_7d_pct, change_30d_pct: data.total_change_30d_pct, net_flow_signal: data.net_flow_signal, top_stablecoins: data.top_stablecoins.map(s => ({ symbol: s.symbol, circulating_usd: s.circulating_usd, change_7d_pct: s.change_7d_pct, peg_price: s.peg_price, depeg_risk: s.depeg_risk, })), depeg_warnings: data.depeg_warnings, liquidity_summary: summary, agent_guidance: guidance, }; cache.set(CACHE_KEY, result, getCacheTtl(BASE_TTL)); return result; } catch (err) { return { error: true, error_source: 'get_stablecoin_flows', agent_guidance: 'Stablecoin data unavailable. Cannot assess capital inflows, minting activity, or depeg risk. This is a critical liquidity signal — proceed conservatively without it.', last_known_data: cache.get<StablecoinFlowsOutput>(CACHE_KEY)?.data ?? null, data_warnings: ['Stablecoin data source temporarily unavailable.'], }; } } - Schema definition for the output of the get_stablecoin_flows tool.
export interface StablecoinFlowsOutput { total_supply_usd: number; change_24h_usd: number; change_7d_usd: number; change_30d_usd: number; change_24h_pct: number; change_7d_pct: number; change_30d_pct: number; net_flow_signal: string; top_stablecoins: Array<{ symbol: string; circulating_usd: number; change_7d_pct: number; peg_price: number | null; depeg_risk: boolean; }>; depeg_warnings: string[]; liquidity_summary: string; agent_guidance: string; }