Docs
How Fides works
Everything you need to lend, back an agent, give your own agent a credit line, or plug Fides into an agent runtime.
Overview
Fides gives AI agents small credit lines on Elysium, Kinetiq's Layer 2 for Hyperliquid. An agent starts with a $5 line, borrows for 1, 7 or 30 days, and repays from what it earns. Each on-time repayment raises its score, and the line grows step by step to $500.
Three groups take part:
- Lenders deposit USDC into one shared pool and earn half of every fee.
- Backers lock USDC behind a specific agent they trust. If that agent defaults, the backer's cover repays the pool first. Backers earn a quarter of the agent's fees.
- Agents (and their owners) borrow inside limits the owner sets once, on chain.
The core rule: a loan only opens if backer cover already covers the principal plus every fee it could accrue. That's why a default never reaches lenders.
How a line works
| Terms | 1, 7 or 30 days, then a 3-day grace period |
| Price | 1% per 30 days, charged by the second. $10 for 7 days costs about $0.02. |
| Fee split | 50% lenders · 25% the agent's backers · 25% protocol reserve |
| Loans | One open loan per line. Repay it before drawing again. |
| Limit | The lowest of: the tier cap, the owner's policy, and what backer cover can fully secure |
| Tiers | $5 → $25 → $50 → $100 → $250 → $500, unlocked by score |
| Score | 0–1,000. On-time repayment +50 if paid by someone else (e.g. a customer), +10 if self-funded. Late: +0. Default: back to 0, recorded forever. |
| Default | After term + 3 days, anyone can flag it. Backer cover repays the pool. |
Currency & fees
Everything is in USDC: loans, repayments, deposits and backing. It's USDC bridged 1:1 from HyperEVM through Elysium's official bridge. HYPE is only used for gas, the small fee every Elysium transaction pays. Private-mode repayments can go through Fides' relayer, which pays that gas for you.
Lenders who withdraw within 7 days of depositing pay 0.5%, which stays in the pool for the other lenders. Moving funds from Elysium back to HyperEVM takes about 24 hours (the bridge's challenge period).
For lenders
- Bridge USDC to Elysium and connect your wallet.
- On Seeders → Lend to the pool, enter an amount and approve the deposit. You receive pool shares (fLEND).
- Your shares grow as fees come in. Withdraw any time, up to the pool's idle liquidity.
Lent-out funds come back as loans are repaid, so very large withdrawals may need to wait for repayments.
For backers
- Find an agent's line ID (its
creditId) on the Board or from the agent's owner. - On Seeders → Back an agent, lock USDC behind it. Your cover sets how much the agent can borrow.
- Earn 25% of its fees, added to your cover. Withdraw whenever no open loan needs that cover.
Your cover is what's at risk. If the agent defaults, it pays the pool. Only back agents you have a reason to trust.
Registering an agent
On Start → Create an agent, an owner signs in with their wallet, names the agent, and gives it a credit identity in a few steps (it then appears on the Agents directory):
- Identity. Agents are ERC-8004 identities (NFTs). Mint one if your agent doesn't have one.
- Line. Register a public or private line, and name a controller: a key used only to draw from this line. Never use the agent's trading wallet; that would link its activity to the line.
- Policy. Sign the limits the controller can act within: maximum single draw, allowed terms, auto-repay on or off, and an expiry date. The contract enforces them.
Borrowing & repaying
The controller draws on Borrow, through the MCP tools, or via the SDK. Repay before the due date from earned revenue; fees accrue by the second, so repaying early is always cheaper.
- Anyone can repay any line. The fee is paid first, then principal. Partial repayments are fine.
- Repaying in the 3-day grace period closes the loan but earns no score. After grace, anyone can flag the default.
- With auto-repay on, Fides' keeper pulls the repayment from the controller's USDC allowance about an hour before the due date.
Private mode
Private lines hide who is borrowing. Amounts and timing stay public.
- The line's ID is
poseidon(agentId, secret), computed on your device and never linked to the agent on chain. Keep the secret safe: losing it loses the credit history. - Every draw pays out to a fresh one-time stealth address (ERC-5564), derived from your stealth meta-address.
- Repay from that stealth address through the relayer: it signs a permit and a repayment authorisation, and the relayer submits it and pays the gas. Repaying from your main wallet would re-link the loan to you.
- On Borrow, paste your stealth keys to find your payouts and repay from them. The keys never leave your browser tab.
ZK score proofs
A private agent can prove “my line has a score of at least X and has never defaulted” without revealing which line is theirs.
- The counterparty gives the agent their address and a nonce.
- The agent runs
prove_zk_score(local MCP server) with a threshold. Proving takes about a minute. - The counterparty checks the proof on Verify, with the
verify_score_prooftool, or on chain withScoreGate.check.
Proofs are bound to that verifier and nonce, so they can't be replayed to anyone else. They stay valid for about an hour after the score tree next changes.
The Loom: reading the threads
The Board opens with the Loom: every credit line on Fides drawn as a thread running through time, from the moment it opened (left) to now (the dashed line on the right).
| Lime thread | A public line in good standing: everyone can see which agent it belongs to. |
| Violet thread | A private line: only its commitment is shown, never the agent behind it. |
| Red thread | Overdue (past its due date and grace period) or defaulted. |
| Pulled to the middle | The line is borrowing: the glowing band in the middle is the lending pool, and the thread stays in it while a loan is open. |
| Bead | A loan was drawn at that moment. |
| Back out again | The loan was repaid in full, so the thread leaves the pool and returns to its place. |
| Frayed end | The line defaulted: backer cover repaid the pool and the thread stops there. |
| Thicker thread | A higher score. |
| Pulsing tip | The line is live right now. |
Hover a thread to see its ID, score and status; click it to open the line with its full story: every borrow, repayment, backing and default, plus the AI model running it if Fides hosts that agent.
Sign-in & agent wallets
Sign in with your email or a wallet. If you sign up with email, you get your own wallet automatically (an embedded wallet from Privy). It's yours:
- Fund it by sending USDC, plus a little HYPE for gas, from any wallet or exchange to its address on Elysium.
- Export its private key any time from the agent wallet card. Neither Fides nor Privy can see that key: it's split between secure hardware and your login, and only reassembled when you sign.
- If you sign in with your own wallet instead, Fides never creates one for you.
Hosted agents
Don't have an agent running anywhere? Choose Hosted by Fides when you create one, and Fides runs it for you on a schedule with the AI model you pick (via OpenRouter).
- Your agent wallet becomes the line's controller and payout wallet. Fund it with USDC and a little HYPE.
- Pick a model, write instructions (what it does, where its revenue comes from), and how often it runs.
- Approve Fides to sign for that wallet. This is a limited signer: it can only call Fides' contracts, within caps, and you can revoke it at any time.
Each run, the agent checks its line and balances, then borrows, repays, or does nothing. Every action is checked against the chain before anything is signed: at most one draw and one repayment per run, never beyond its limits. Pause it, resume it, run it now, or read its run log on Start.
Honest version of “who has access”: Fides can sign for a hosted agent's wallet only through the signer you approved, only within its policy, and only until you revoke it. Fides can never export your key.
Token staking
FIDES holders can stake behind an agent they believe in, on Seeders → Stake FIDES.
| Boost | Enough stake raises the agent's tier by up to 2, so its line can grow faster. |
| Reward | Stakers share 15% of that agent's fees, paid in USDC (out of the reserve's 25%). |
| Risk | If the agent defaults, part of the stake on it (30% at launch) goes to the reserve. |
| Lock | Stake can't be withdrawn while the agent has an open loan. |
Staking never replaces USDC backer cover: every loan still needs full USDC cover, so lenders are exactly as safe with or without stake.
MCP server
Hosted at https://api.usefides.xyz/mcp (streamable HTTP). Reads need no key; write tools return unsigned transactions for the agent to sign.
Local (stdio) runs next to the agent and holds the line's controller key, so it signs and sends itself, always inside the owner's on-chain policy. Add STEALTH_META_ADDRESS for private lines, and AGENT_ID + CREDIT_SECRET to enable prove_zk_score. Example for Claude Code (.mcp.json):
{
"mcpServers": {
"fides": {
"command": "npx",
"args": ["tsx", "path/to/fides/api/src/stdio.ts"],
"env": {
"ELYSIUM_RPC_URL": "https://…",
"CONTROLLER_PRIVATE_KEY": "<this line's controller key>",
"ASSET_ADDRESS": "0x0000000000000000000000000000000000000000",
"IDENTITY_ADDRESS": "0x0000000000000000000000000000000000000000",
"REGISTRY_ADDRESS": "0x0000000000000000000000000000000000000000",
"SCOREBOOK_ADDRESS": "0x0000000000000000000000000000000000000000",
"LEND_POOL_ADDRESS": "0x0000000000000000000000000000000000000000",
"BACKER_VAULT_ADDRESS": "0x0000000000000000000000000000000000000000",
"LINE_MANAGER_ADDRESS": "0x0000000000000000000000000000000000000000",
"SCORE_GATE_ADDRESS": "0x0000000000000000000000000000000000000000"
}
}
}
}| Tool | What it does |
|---|---|
check_line | Score, limit, open loan, due date and what can be drawn now |
pool_status | Pool size, liquidity, utilisation and caps |
draw | Borrow an amount in dollars for 1d, 7d or 30d |
repay | Repay part or all of the open loan |
prove_score | Signed reveal of the record to one counterparty |
prove_zk_score | ZK proof of score ≥ X and no defaults (local server only) |
verify_score_proof | Check a ZK score proof on chain |
Agents should also read skill.md: when to borrow, how to pick a term, and how to repay.
REST API
Base URL https://api.usefides.xyz. Amounts are USDC base units (6 decimals) as strings. Write endpoints are rate-limited.
| Endpoint | Returns / does |
|---|---|
GET /api/pool | Pool size, liquidity, lent out, caps |
GET /api/line/:creditId | One line: mode, score, record, limit, cover, policy, open loan |
GET /api/lines | All registered lines, newest first |
GET /api/activity?limit= | Protocol activity feed (the Board), newest first |
GET /api/agents/:owner | Agent IDs owned by an address |
GET /api/announcements | Stealth payout announcements, for scanning with a viewing key |
POST /api/draw | Unsigned draw transaction for the controller to sign |
POST /api/repay | Relayed repayment from a signed permit + RepayAuth |
POST /api/reveal | Check a signed selective reveal |
POST /api/score-proof/verify | Check a ZK score proof |
TypeScript SDK
@fides/sdk wraps the contracts with viem: reading lines and the pool, building transactions, stealth addresses, relayed repayments, and (from @fides/sdk/zk) score proofs.
import { FidesAgent, privateCreditId, randomSecret, generateStealthKeys } from "@fides/sdk";
// Private line: compute the ID locally; never publish agentId next to it.
const secret = randomSecret();
const creditId = privateCreditId(agentId, secret);
const stealth = generateStealthKeys(); // save all of these safely
const agent = new FidesAgent(publicClient, addresses, controllerWallet);
const line = await agent.getLine(creditId); // score, limit, available…
await agent.draw({ creditId, amount: 5_000_000n, term: "7d", stealthMetaAddress: stealth.metaAddress });Contracts
Currently pointed at Elysium testnet.
| Contract | Role | Address |
|---|---|---|
| LendPool | ERC-4626 pool lenders deposit into | 0x0000000000000000000000000000000000000000 |
| BackerVault | Per-line backer cover, first loss | 0x0000000000000000000000000000000000000000 |
| LineManager | Draws, repayments, defaults, limits | 0x0000000000000000000000000000000000000000 |
| ScoreBook | Scores + the Merkle tree ZK proofs use | 0x0000000000000000000000000000000000000000 |
| AgentRegistry | Lines, controllers, owner policies | 0x0000000000000000000000000000000000000000 |
| ScoreGate | On-chain ZK score-proof check | 0x0000000000000000000000000000000000000000 |
| USDC | The lending asset | 0x0000000000000000000000000000000000000000 |
Risks & limits
- Unaudited beta. The pool and each line are capped, admin changes go through a 24-hour timelock, and an audit comes before caps are raised. Only deposit what you can afford to lose.
- Young chain. Elysium launched with a single sequencer. An outage could delay repayments; the 3-day grace period exists so it can't force defaults.
- Privacy is partial. Private mode hides identity, not amounts or timing.
- Exits take time. Withdrawals are limited by idle liquidity, and bridging back to HyperEVM takes about 24 hours.
