Skip to content

EarnForge is a monorepo of five published packages that wraps the LI.FI Earn API into production-grade developer surfaces. It covers the full vault set across 17 chains and 27 protocols with full pagination, Zod-validated schemas, risk scoring, strategy presets, gas optimization, and guards for all 24 known API pitfalls.

Terminal window
npm i @earnforge/sdk
import { createEarnForge } from '@earnforge/sdk';
const forge = createEarnForge();
const top = await forge.vaults.top({ asset: 'USDC', limit: 5 });
for (const vault of top) {
const risk = forge.riskScore(vault);
console.log(`${vault.name} APY ${vault.analytics.apy.total}% Risk ${risk.score}/10 (${risk.label})`);
}

@earnforge/sdk

Zod-typed client for Earn Data API + Composer. Risk scoring, strategy presets, portfolio suggestions, gas optimization. 24 pitfall guards built in. Read the SDK docs

@earnforge/cli

Commander CLI wrapping the SDK. 19 commands, all with --json output. earnforge doctor runs 22 checks: 18 pitfall guards plus 4 environment checks. Read the CLI docs

@earnforge/react

11 React hooks built on wagmi + TanStack Query. Includes useEarnDeposit state machine for full deposit flows. Read the React docs

@earnforge/mcp

12 MCP tools for Claude Desktop, Cursor, and Windsurf: including the six LI.FI’s own hosted server does not offer. Read the MCP docs

@earnforge/skill

SKILL.md + 5 reference files following the Agent Skills specification. Give any coding agent Earn API superpowers. Read the Skill docs

EarnForge Studio

Next.js + Tailwind web app. Vault explorer, DeFiLlama sparklines, risk badges, strategy picker, and code generator.

Risk Scoring

How the 0-10 composite score works: 7 dimensions, weighted formula, calibrated thresholds. Read the guide

24 Pitfalls

Every production pitfall in the LI.FI Earn API, how the SDK defeats each one, and which test verifies it. Read the guide