DeFi API
Yield discovery with algorithmic risk scoring and LLM risk assessments. All endpoints require x402 payment in USDC on Base (or Solana).
Risk Scoring
- Algorithmic — TVL, impermanent loss, APY sustainability, multi-token exposure, stablecoin status
- Scale — 0-100 (higher = safer). Starts at 100 and deducts for risk factors
- LLM Assessment — Optional natural language risk analysis for top results (
?assess=true) - Cache — Pool data cached 5 min, LLM assessments cached 1 hour
Risk Levels
| Level | Score | Description |
|---|---|---|
| Low | 71-100 | Battle-tested protocol, high TVL, stable yield |
| Medium | 40-70 | Some risk factors — lower TVL, reward-dependent APY, or IL exposure |
| High | 0-39 | Significant risk — very low TVL, extreme APY, or high impermanent loss |
Risk Score Deductions
Starts at 100. Each risk factor deducts points:
/api/v1/yields
$0.05DeFi yield pools on Base with risk scoring. Data from DefiLlama, cached 5 minutes.
| Param | Type | Description |
|---|---|---|
| minApy | number | Minimum APY % (e.g. 5) |
| maxRisk | string | Max risk level: low, medium, high |
| token | string | Filter by token symbol (USDC, WETH) |
| protocol | string | Filter by protocol (aave-v3, morpho) |
| stableOnly | boolean | Only stablecoin pools |
| assess | boolean | Include LLM risk assessments for top 5 |
| limit | number | Max results (default 20) |
curl "https://x402.kodaoracle.com/api/v1/yields?token=USDC&maxRisk=low&assess=true" \
-H "Payment-Signature: <base64-payment>"{
"pools": [
{
"id": "747c1d2c-...",
"protocol": "aave-v3",
"symbol": "USDC",
"tokens": ["USDC"],
"apy": 5.21,
"apyBase": 5.21,
"apyReward": null,
"tvlUsd": 152000000,
"il7d": null,
"riskLevel": "low",
"riskScore": 92,
"category": "lending",
"stablecoin": true,
"updatedAt": "2026-02-15T12:00:00Z"
}
],
"count": 1,
"assessments": {
"747c1d2c-...": {
"poolId": "747c1d2c-...",
"assessment": "Aave V3 USDC on Base — battle-tested lending protocol with $152M TVL. Base APY of 5.21% with no reward dependency. Minimal risk for stablecoin deposits.",
"recommendation": "safe",
"riskFlags": [],
"modelUsed": "kimi",
"generatedAt": "2026-02-15T12:00:00Z",
"cached": false
}
},
"source": "DefiLlama",
"chain": "Base",
"updatedAt": "2026-02-15T12:00:00Z"
}/api/v1/swap
$0.10Token swap on Base with safety pipeline. Runs token audit + price impact checks in parallel. Blocks if safety score < 30 or price impact > 5%.
curl -X POST "https://x402.kodaoracle.com/api/v1/swap" \
-H "Payment-Signature: <base64-payment>" \
-H "Content-Type: application/json" \
-d '{
"tokenIn": "USDC",
"tokenOut": "WETH",
"amountIn": "100",
"sender": "0xYourWallet"
}'{
"success": true,
"amountOut": "0.028",
"priceImpact": "0.12",
"transaction": {
"to": "0x6131B5fae19EA4f9D964eAc0408E4408b66337b5",
"data": "0x...",
"value": "0",
"gas": "350000"
},
"safety": {
"score": 85,
"verdict": "PASS",
"checks": [
{ "name": "token_audit", "passed": true, "score": 90 },
{ "name": "price_impact", "passed": true, "score": 95 }
]
}
}ACP Offerings
DeFi execution via the Agent Commerce Protocol. Agents send tokens to KODA, KODA executes on-chain, output returns to the buyer via ACP's payableDetail.
yield_deposit
Deposit USDC into yield protocols on Base: Avantis (~12% APY from perp fees), Morpho vaults (~3-4% APY), or Aave V3 (~3-5% APY). Returns yield-bearing tokens (aUSDC, vault shares, or avUSDC) via ACP payableDetail.
amount (required), protocol (aave-v3, morpho, avantis), vault (slug for Morpho/Avantis)yield_withdraw
Withdraw USDC from Aave V3, Morpho vaults, or Avantis on Base. For Aave: send aUSDC. For vaults: send vault shares + specify vault slug. USDC returned via ACP payableDetail.
amount (required), protocol (aave-v3, morpho, avantis), vault (required for Morpho/Avantis)yield_finder
Same as GET /api/v1/yields but accessible via ACP. Returns yield pools with risk scores. No funds required.
swap
Token swap on Base. Buyer sends tokenIn, KODA executes swap on-chain, tokenOut returned via payableDetail. Safety pipeline runs on every swap.
tokenIn, tokenOut, amountIn (all required)