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

Terms1, 7 or 30 days, then a 3-day grace period
Price1% per 30 days, charged by the second. $10 for 7 days costs about $0.02.
Fee split50% lenders · 25% the agent's backers · 25% protocol reserve
LoansOne open loan per line. Repay it before drawing again.
LimitThe 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
Score0–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.
DefaultAfter 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

  1. Bridge USDC to Elysium and connect your wallet.
  2. On Seeders → Lend to the pool, enter an amount and approve the deposit. You receive pool shares (fLEND).
  3. 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

  1. Find an agent's line ID (its creditId) on the Board or from the agent's owner.
  2. On Seeders → Back an agent, lock USDC behind it. Your cover sets how much the agent can borrow.
  3. 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):

  1. Identity. Agents are ERC-8004 identities (NFTs). Mint one if your agent doesn't have one.
  2. 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.
  3. 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.

  1. The counterparty gives the agent their address and a nonce.
  2. The agent runs prove_zk_score (local MCP server) with a threshold. Proving takes about a minute.
  3. The counterparty checks the proof on Verify, with the verify_score_proof tool, or on chain with ScoreGate.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 threadA public line in good standing: everyone can see which agent it belongs to.
Violet threadA private line: only its commitment is shown, never the agent behind it.
Red threadOverdue (past its due date and grace period) or defaulted.
Pulled to the middleThe line is borrowing: the glowing band in the middle is the lending pool, and the thread stays in it while a loan is open.
BeadA loan was drawn at that moment.
Back out againThe loan was repaid in full, so the thread leaves the pool and returns to its place.
Frayed endThe line defaulted: backer cover repaid the pool and the thread stops there.
Thicker threadA higher score.
Pulsing tipThe 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).

  1. Your agent wallet becomes the line's controller and payout wallet. Fund it with USDC and a little HYPE.
  2. Pick a model, write instructions (what it does, where its revenue comes from), and how often it runs.
  3. 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.

BoostEnough stake raises the agent's tier by up to 2, so its line can grow faster.
RewardStakers share 15% of that agent's fees, paid in USDC (out of the reserve's 25%).
RiskIf the agent defaults, part of the stake on it (30% at launch) goes to the reserve.
LockStake 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"
      }
    }
  }
}
ToolWhat it does
check_lineScore, limit, open loan, due date and what can be drawn now
pool_statusPool size, liquidity, utilisation and caps
drawBorrow an amount in dollars for 1d, 7d or 30d
repayRepay part or all of the open loan
prove_scoreSigned reveal of the record to one counterparty
prove_zk_scoreZK proof of score ≥ X and no defaults (local server only)
verify_score_proofCheck 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.

EndpointReturns / does
GET /api/poolPool size, liquidity, lent out, caps
GET /api/line/:creditIdOne line: mode, score, record, limit, cover, policy, open loan
GET /api/linesAll registered lines, newest first
GET /api/activity?limit=Protocol activity feed (the Board), newest first
GET /api/agents/:ownerAgent IDs owned by an address
GET /api/announcementsStealth payout announcements, for scanning with a viewing key
POST /api/drawUnsigned draw transaction for the controller to sign
POST /api/repayRelayed repayment from a signed permit + RepayAuth
POST /api/revealCheck a signed selective reveal
POST /api/score-proof/verifyCheck 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.

ContractRoleAddress
LendPoolERC-4626 pool lenders deposit into0x0000000000000000000000000000000000000000
BackerVaultPer-line backer cover, first loss0x0000000000000000000000000000000000000000
LineManagerDraws, repayments, defaults, limits0x0000000000000000000000000000000000000000
ScoreBookScores + the Merkle tree ZK proofs use0x0000000000000000000000000000000000000000
AgentRegistryLines, controllers, owner policies0x0000000000000000000000000000000000000000
ScoreGateOn-chain ZK score-proof check0x0000000000000000000000000000000000000000
USDCThe lending asset0x0000000000000000000000000000000000000000

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.