{ "staus": 123, "message": "<string>" }
Check the API status and network availability
https://api.fibrous.finance/base/healthcheck
curl "https://api.fibrous.finance/base/healthcheck"
{ "staus": 200, "message": "{Base} Fibrous Finance Router is alive and well - routing your tokens faster than you can say \"impermanent loss\"" }
class FibrousClient { constructor() { this.networks = ['base', 'hyperevm', 'scroll', 'starknet']; } async getHealthyNetwork() { const healthChecks = await Promise.all( this.networks.map(async (network) => { try { const response = await fetch( `https://api.fibrous.finance/${network}/health` ); const data = await response.json(); return { network, status: data.status, latency: data.latency?.rpc || Infinity }; } catch (error) { return { network, status: 'unhealthy', latency: Infinity }; } }) ); // Find the healthiest network with lowest latency const healthy = healthChecks .filter(check => check.status === 'healthy') .sort((a, b) => a.latency - b.latency); return healthy[0]?.network || null; } async executeSwapWithFallback(swapParams) { const network = await this.getHealthyNetwork(); if (!network) { throw new Error('No healthy networks available'); } console.log(`Using ${network} network`); // Execute swap on the selected network return this.executeSwap(network, swapParams); } }
// Example: Datadog monitoring async function monitorHealth() { const health = await checkHealth('base'); statsd.gauge('fibrous.api.latency.rpc', health.latency.rpc); statsd.gauge('fibrous.api.latency.database', health.latency.database); if (health.status !== 'healthy') { statsd.increment('fibrous.api.unhealthy'); // Alert your team } }