Lydion is an open-source Model Context Protocol server that gives AI agents safe, policy-guarded access to on-chain value. Plug it into Claude, Cursor or any MCP client, and your agent can read markets, check wallets, scan tokens for scams and price x402 payments. Every spend goes through a policy engine that you configure, and nothing the agent says can change it.
The Lydion landing page. The Guard card and feed tags over the hero are illustrations, not live traffic.
At a glance
WhatMCP server (Node.js, ESM, zero build step)
ForAI agents that need market data, wallet reads, risk checks and spend control
Tools25: 16 read-only (incl. 4 Equity Rails), 9 for execution and approvals
ExtensionLydion Guard: the same checks in your browser, before every signature
ChainsEthereum, Base, Arbitrum, Optimism, Polygon, BNB Chain, Avalanche, Robinhood Chain, plus Base Sepolia and Sepolia
DataPublicNode RPC · GoPlus Security · DefiLlama · CoinGecko · KyberSwap · Yahoo / Nasdaq (equities). Free, no API keys
LicenseMIT
Why Lydion exists
AI agents are turning into economic actors. They call paid APIs, buy data, and soon will trade and pay each other. To do that they need money, and today the usual answer is to hand the model a private key or an exchange API key.
That is dangerous. An LLM can be prompt-injected: a malicious web page, token name or email can tell it to "send everything to 0x…". With a raw key, nothing stops it.
Lydion splits capability from authority. The agent gets rich, typed tools to understand the market. Authority to spend stays in a policy engine on your machine, configured by you and enforced in code.
Raw private key in the agent
Any prompt injection can drain funds
No spending limits
No idea whether a token is a scam
No audit trail
Each agent re-implements web3 plumbing
Agent + Lydion MCP
Limits enforced server-side, so prompts can't change them
Daily, per-transaction, per-counterparty and hard caps, plus hourly velocity limits
Risk scan before every buy
Append-only, hash-chained spend ledger
One server works with any MCP client
How it works
Lydion runs as a local process next to your MCP client and talks to it over stdio. The client (Claude Desktop, Cursor, Claude Code and others) lists Lydion's tools to the model. When the model decides to call one, the request flows through Lydion to public data sources, and every spend passes through the policy engine first.
Request flow: agent → MCP client → Lydion → data sources. Spends are always evaluated by the policy engine before any action.
Discover. On start, the client asks Lydion for its tool list. Each tool has a name, description and JSON schema, so the model knows when and how to call it.
Call. The model calls a tool with arguments. Lydion validates them (bad addresses, unknown chains and negative amounts are rejected before anything runs).
Guard. For anything involving money, Lydion evaluates the policy and returns a decision with human-readable reasons.
Answer. Results come back as structured JSON. The model turns them into a plain-language answer for you.
Quick start
Requirements: Node.js 18.17+ and git. No API keys needed. The 16 read-only tools work without a wallet; the execution tools need an agent wallet (see Execution & approvals).
Option A · npm (recommended)
terminal
npx -y lydion-mcp
Not on npm yet The lydion-mcp package is about to be published. Until it is, npx -y lydion-mcp will fail: use Option B, which works today.
# 1. get the code
git clone https://github.com/lydion-mcp/lydion
cd lydion-mcp/server
# 2. install (three dependencies: MCP SDK, zod, viem)
npm install
# 3. verify: every read tool against live data, then the policy, equities, execution# (local x402 merchant, no real funds), smart account, allowances, grants, x402 and console suites
npm test
# 4. or run one suite on its own, e.g. execution, approvals, x402 and HTTP
node test/execution.js
The smoke test prints the tool list and every read tool’s answer, ending with all calls completed; each later suite ends with its own line, such as all execution checks passed. A failed check prints ✕ and stops the run.
Real output of npm test: live ETH/TAO/BTC prices, Base gas, a wallet balance, a USDC risk scan, and input validation rejecting a bad address.
Tip To explore tools interactively, run npm run inspect. It opens the official MCP Inspector in your browser.
Troubleshooting Run node src/index.js doctor. It checks Node, limits, execution chains, RPC, the approval channel and the ledger, and prints one fix per problem (exit code 1 if anything is broken). See Owner console.
Client setup
From source (works today), use the absolute path to server/src/index.js, as below. Once Lydion is published to npm, you can replace "command": "node", "args": ["…/index.js"] with "command": "npx", "args": ["-y", "lydion-mcp"].
Any client that supports MCP over stdio works: Windsurf, Zed, Cline, Continue, the OpenAI Agents SDK and custom agents built on the MCP SDK. Point it at node …/server/src/index.js. Environment variables configure the policy (see Configuration).
What a session looks like: the agent scans the token, asks the policy engine, and advises against the purchase. (Illustrative conversation; the token address is shortened.)
Tool reference
Every tool returns JSON as text content. Errors come back with isError: true and a readable message, so the agent can recover. Tools marked read-only never move funds; tools marked write · policy-gated can, only through the execution gate.
The tool catalog on the landing page: the 25 tools documented below.
get_price
read-onlymarket
Spot price in USD, 24h change, market cap and 24h volume for one or more tokens. Accepts common symbols (ETH, TAO, SOL…) or CoinGecko ids. Unknown symbols are resolved through CoinGecko search.
Security scan of a token contract. Lydion fetches GoPlus Security data and turns it into a 0–100 risk score (higher means riskier), a verdict and a list of flags. Agents should run it before buying any unfamiliar token.
Reputation check for an address: phishing, drainer contracts, sanctions, mixers, honeypot deployers and other malicious activity. Run it before sending funds anywhere new.
Best-route swap quote across DEXs from the KyberSwap aggregator, with Lydion's checks built in: price impact, gas as a share of the trade, a risk scan of the token being bought (anything outside a curated list of majors goes through the same scoring as scan_token) and the policy decision. Pass sender and Lydion also builds the exact router transaction and runs it through simulate_tx, so the agent sees what it would receive before anything is signed.
Param
Type
Description
chain
enum
Default ethereum
sellrequired
string
Symbol (ETH, USDC, WETH…) or contract address
buyrequired
string
Symbol or contract address
amountrequired
decimal string
Amount of sell in whole units, e.g. "0.25"
slippage_bps
int 1–500
Default 50 (0.5%). Sets min_out
sender
0x…
Wallet that would swap. Enables calldata build + simulation
fund_sender
boolean
What-if mode: simulate as if the sender held enough native token
Verdicts: OK_TO_SWAP (every check passes), REVIEW (warnings, e.g. thin liquidity or a token with elevated risk), NEEDS_APPROVAL (policy wants a human), DO_NOT_SWAP (any check fails: impact above 5%, risky token, policy deny, or the simulation reverts).
Ask: "Quote 0.5 ETH to USDC on Base and tell me if it's safe to do."
simulate_tx
read-onlyrisknew in 0.2
Dry-runs any EVM transaction against live chain state (eth_simulateV1 with transfer tracing) and reports what it would actually do to the sender: assets leaving and entering with USD values, approvals granted, NFTs leaving, the revert reason, gas cost, counterparty reputation and the policy decision. This is the answer to the most common way agents and people lose funds: signing calldata they did not write.
Param
Type
Description
chain
enum
Default ethereum
fromrequired
0x…
Sender (the agent wallet)
torequired
0x…
Destination contract or wallet
data
hex
Calldata. Default "0x" (plain transfer)
value
decimal string
Native value in whole units, e.g. "0.01"
fund_sender
boolean
What-if mode: hypothetical native balance for the simulation
response · unlimited USDC approval to a plain wallet
Medium warnings: unlimited approval to a contract, NFT leaving, unpriced asset
NEEDS_APPROVAL
Policy asks for a human (over a limit, or value that could not be priced)
DO_NOT_SIGN
High warnings: approval to a plain wallet, setApprovalForAll, flagged counterparty, or policy deny
WILL_REVERT
The transaction fails on-chain and would only burn gas; the reason is included
Fail-closed by design: if an outgoing asset cannot be priced, the policy decision is raised to needs_approval instead of being waved through as a $0 micro-payment.
The same check in the landing-page playground, on live Base state.
Ask: "A dApp wants me to sign this. What does it actually do?"
policy_check
read-onlypolicy
Asks the policy engine whether a proposed spend is allowed. If a recipient is given, Lydion checks its reputation automatically, and a flagged recipient is always denied. Agents must call this before moving funds and respect the answer.
{ "decision": "allow", "reasons": ["covered by grant G7C21E0 ($20.00 of $25 left, expires 2026-11-24 13:02 UTC)"],
"coveredReasons": ["owner requires approval for non-micro spends"], "grant": "G7C21E0",
"remainingTodayUsd": 45, "counterparty": "api.meteo.xyz", "lastHour": { "transactions": 1, "microPayments": 0 }, "recipient_flags": [] }
counterparty is the lowercased merchant, or the recipient when there is no merchant: budgets, lists and grants are matched against it. lastHour counts the spends in the rolling 60 minutes the velocity limits look at. When a spend grant covers the spend, grant is its id and coveredReasons lists the approval reasons it waived. Swap grants are scoped to the sold token and only match inside swap_quote / execute_swap, not here.
Requests a URL. If the server answers HTTP 402 Payment Required using the x402 protocol, Lydion parses the payment options (scheme, network, asset, pay-to address, amount) and returns the policy decision for the cheapest priced one. It reads the requirements exactly like x402_pay: the base64 PAYMENT-REQUIRED header (x402 v2) when present and valid, otherwise the JSON body (v1). Only USDC on Base or Base Sepolia, the options x402_pay can settle (payable: true), is priced in USD; other assets are listed with amount_usd: null. It does not pay. To pay, use x402_pay.
Today's spend (UTC day), the remaining budget, today's ledger entries, spend per counterparty (with its budget, if one is set), spends in the last hour against the velocity limits, per-day totals for recent days, the active spend grants and the active policy limits.
Param
Type
Description
days
integer 1–30
How many UTC days of per-day totals to return in history, newest first. Default 1 (today)
Recomputes the hash chain of the spend ledger from the first entry. ok is false if any entry was edited, removed, reordered or inserted; firstBadSeq is the first entry that no longer verifies and head is the hash of the last entry that does. Keep a copy of head somewhere else (a note, a commit, a chat message) and you can later prove the history up to that point was not rewritten. No parameters.
{ "ok": false, "entries": 7, "firstBadSeq": 3, "error": "hash does not match the entry", "head": "41d0…", "file": "~/.lydion-mcp/ledger.jsonl" }
Equity tools (new in 0.4)
Read-only tools for tokenized stocks: the real exchange price, each verified tokenized version, the Parity Guard verdict and the US market calendar. See Equity Rails.
get_equity_quote
read-onlyequitiesnew in 0.4
Reference price for a US stock or ETF from Yahoo Finance (Nasdaq API as fallback): price, previous close, change, exchange, timestamp and the current session. For tickers with a verified tokenized version, it adds each token's on-chain price (DefiLlama by contract, CoinGecko fallback), its premium against the share, the price age and the contract addresses.
Param
Type
Description
tickerrequired
string
US ticker, e.g. TSLA, AAPL, NVDA, SPY (case-insensitive)
Ask: "What is Tesla at, and what do the tokenized versions trade at on-chain?"
parity_check
read-onlyequitiesnew in 0.4
Parity Guard. Compares every verified tokenized version of a stock with the real share and returns a verdict per token. Agents should run it before buying any tokenized stock and must not buy on ABOVE_BAND.
Param
Type
Description
tickerrequired
string
US ticker
band_pct
number
Allowed premium in percent. Default LYDION_EQ_PARITY_BAND_PCT, or 0.5
Verdict
Meaning
WITHIN_BAND
Premium or discount inside the band: ok to buy at this price
ABOVE_BAND
The token costs more than the share by more than the band: block buys
BELOW_BAND
Discount beyond the band: flag it, it can mean a depeg, a redemption problem or a stale price
NO_PRICE / NO_REFERENCE
One side of the comparison is missing: do not trade
NO_TOKENIZED_VERSION
The ticker is not in the verified registry yet
response
{ "ticker": "TSLA", "band_pct": 0.5, "market_open": true, "session": "regular",
"reference": { "price": 386.37, "kind": "live", "source": "Yahoo Finance" },
"tokens": [
{ "token": "TSLAx", "premium_pct": -0.477, "verdict": "WITHIN_BAND", "action": "ok to buy at this price" },
{ "token": "TSLAon", "premium_pct": -0.28, "verdict": "WITHIN_BAND", "action": "ok to buy at this price" } ] }
When the US market is closed, reference.kind is "last close" and a note explains that tokens keep trading 24/7, so a gap can reflect after-hours news. The band is never widened silently. Token prices older than an hour are marked stale.
Ask: "Is NVDAx fairly priced right now? Only buy if it is within 0.5% of the real share."
market_hours
read-onlyequitiesnew in 0.4
Whether the US regular session is open now, the current session (pre-market 04:00–09:30, regular 09:30–16:00, after-hours 16:00–20:00 ET, closed), when it closes or next opens in UTC and New York time, and the next holidays and 13:00 ET early closes. Daylight saving time is handled through the America/New_York time zone.
The calendar is computed from the NYSE rules: ten holidays a year (Saturday holidays move to Friday, Sunday ones to Monday, except New Year's Day on a Saturday) and early closes on July 3 when July 4 falls Tuesday to Friday, the day after Thanksgiving and December 24 when it falls Monday to Thursday. Unit tests pin the 2026 and 2027 dates.
equity_policy_check
read-onlyequitiesnew in 0.5
Would buying this tokenized share pass the equity guardrails? Checks market hours, Parity Guard for the exact token, the per-trade cap (LYDION_EQ_MAX_TRADE_USD) and the per-ticker position cap including current holdings (LYDION_EQ_MAX_POSITION_USD). Returns allow, needs_approval or deny with every check. execute_swap applies the same rules automatically.
Param
Type
Description
tickerrequired
string
US stock ticker, e.g. TSLA
value_usdrequired
number
Size of the intended buy in USD
token
string
Tokenized version, e.g. TSLAx or TSLAon (default: the first verified one)
chain
enum
Chain to read current holdings on
Ask: "Could I buy $80 of TSLA on-chain right now within my rules?"
Execution tools (new in 0.3)
These nine tools are the only ones that can move funds or touch approvals. Every action goes through the same gate: simulation on live state, the policy engine, a human approval when the policy asks for one, then signing. They run only on chains the owner enabled (default base-sepolia). See Execution & approvals.
wallet_info
read-onlyexecution
The agent wallet address, where it may execute, its native balance on each enabled chain, and how approvals reach the owner. Never returns key material. No parameters.
Without a wallet it returns { "configured": false } with the setup command for the owner.
send_transaction
write · policy-gatedexecution
Sends a transaction from the agent wallet. It is simulated first with simulate_tx and blocked if it would revert or looks malicious (WILL_REVERT, DO_NOT_SIGN). Then the policy engine decides. If a human must approve, the tool returns pending_approval with an approval_id; once the owner approves, the agent calls it again with the same arguments plus approval_id. Simulation warnings (verdict REVIEW) also require approval.
Param
Type
Description
chain
enum
Default base-sepolia. Must be in LYDION_EXECUTION_CHAINS
torequired
0x…
Recipient wallet or contract
value
decimal string
Native amount in whole units. Default "0"
data
hex
Calldata. Default "0x" (plain transfer)
approval_id
6 hex chars
An approval the owner granted for exactly these arguments
onchain_status comes from the receipt: confirmed, reverted, or pending if no receipt arrived within 45 seconds. The spend is written to the ledger as soon as the transaction is broadcast.
Ask: "Send 0.001 test ETH to 0x2222…2222 on Base Sepolia."
execute_swap
write · policy-gatedtrading
Swaps at the best DEX route from the agent wallet. It runs swap_quote with the agent wallet as sender (price impact, token risk, policy, simulation), goes through the approval flow, then rebuilds the route right before sending so the price is fresh; min_out still protects the trade. Swap routes come from KyberSwap, which does not cover testnets, so this tool needs a mainnet chain the owner opted in to.
Selling an ERC-20 (since v0.3.1): if the router's allowance is lower than the amount, the swap becomes a two-step plan: approve the router for the exact amount (never unlimited), then swap. Both steps are simulated together in one eth_simulateV1 block, so the swap is checked against the new allowance before anything is signed, and one human approval covers both steps. The approve is sent first and must confirm before the swap is sent. If the swap then fails, the response says so; the exact allowance stays in place, covers only this amount and is used by the next identical swap. Native-token sells are a single step.
Param
Type
Description
chain
enum
Default base-sepolia; in practice a mainnet listed in LYDION_EXECUTION_CHAINS
sellrequired
string
Native symbol (ETH), curated symbol (USDC) or contract address
The approval is bound to chain, sell, buy, amount and slippage_bps, not to the calldata, because the route is rebuilt before sending. Other statuses: failed with step: "approve" (the approve did not confirm, the swap was not sent) or step: "swap" (the swap reverted after the approve was mined).
x402_pay
write · policy-gatedpayments
Fetches a URL. If it answers HTTP 402, Lydion picks a supported option (scheme exact, USDC on Base or Base Sepolia), checks max_usd and the policy, signs an EIP-3009 TransferWithAuthorization with the agent wallet, retries the request with the payment, and returns the paid content plus the settlement receipt. The merchant's facilitator submits the transfer on-chain; the agent pays no gas.
Param
Type
Description
urlrequired
URL
Resource to fetch and pay for
max_usd
number ≤ 1000
Refuse if the price is above this
approval_id
6 hex chars
Approval granted for exactly this payment
Protocol
Requirements arrive in
Payment sent in
Receipt in
x402 v1
JSON body (maxAmountRequired, network base-sepolia)
The EIP-712 domain (name, version) is read from the token contract itself, not from the 402 response: USDC on Base mainnet signs as "USD Coin", on Base Sepolia as "USDC", both version "2". A signature with the wrong name would be rejected by the token. Each authorization uses a random 32-byte nonce and is valid for the merchant's maxTimeoutSeconds.
Other statuses: free (no 402, body returned as is), blocked (no supported option, above max_usd, policy deny, or an invalid approval), pending_approval (see the approval flow) and payment_failed (the merchant rejected the payment; nothing is recorded in the ledger).
Ask: "Buy today's weather data for Dubai from api.meteo.xyz, max 5 cents."
list_allowances
read-onlyexecution
Active ERC-20 approvals a wallet has granted, by default the agent wallet, each with a verdict. Rows come from the GoPlus token approval index and are checked against a live allowance(owner, spender) call, so an approval already revoked on-chain is dropped even if the index lags. Pairs passed in pairs are read on-chain directly: GoPlus has no index for testnets, so on Base Sepolia this is how you check an allowance. Spender type comes from the chain (eth_getCode), reputation from GoPlus and check_address.
Param
Type
Description
chain
enum
Default base-sepolia. Any supported chain; listing never signs
owner
0x…
Wallet to inspect. Default: the agent wallet
pairs
[{ token, spender }]
Up to 50 token/spender pairs to read on-chain as well
Verdict
When
REVOKE
Spender is flagged (GoPlus approval data or address reputation), unlimited approval to a wallet, or an unverified contract
REVIEW
Unlimited approval to a contract, or any approval to a wallet
An amount of 2255 or more is reported as "unlimited". When GoPlus is unavailable or rate-limited the response carries a warning and only pairs are checked; pairs whose allowance() call fails are listed under unreadable.
Ask: "Which token approvals does your wallet still have open? Revoke the risky ones."
revoke_allowance
write · policy-gatedexecution
Sets an allowance of the agent wallet back to zero by sending approve(spender, 0) to the token. A revoke moves no value, but it is still a signing action, so it runs exactly the send_transaction gate: execution chains, LYDION_EXECUTION, simulation, policy and owner approval. Under the default policy a $0 call fits the micro-allowance and is sent without a human; if the owner's policy or a simulation warning asks for approval, the tool returns pending_approval and says so. If the allowance is already zero it returns nothing_to_revoke and signs nothing.
Param
Type
Description
chain
enum
Default base-sepolia. Must be in LYDION_EXECUTION_CHAINS
The approval is bound to the calldata, so an approval for one spender cannot be used to revoke (or re-approve) another. Statuses: sent, pending_approval, blocked and nothing_to_revoke.
approval_status
read-onlyapprovals
Status of one approval request: pending, approved, denied or expired. The agent can only read approvals; no tool can grant one.
Param
Type
Description
approval_idrequired
6 hex chars
Id returned with pending_approval
response
{ "id": "3F9A1C", "status": "approved", "kind": "x402", "summary": "Pay $5 USDC to api.meteo.xyz for …", "value_usd": 5,
"reasons": ["owner requires approval for non-micro spends"], "expires_at": "2026-11-24T12:15:00.000Z", "decided_by": "telegram:owner" }
list_approvals
read-onlyapprovals
The 20 most recent approval requests, newest first, in the same shape as approval_status. No parameters.
list_grants
read-onlyapprovals
Spend grants the owner created (see Spend grants): active grants plus those that expired, ran out or were revoked in the last 24 hours, newest first, with spent and remaining USD. status is active, used_up, expired, revoked or unscoped (a swap grant for plain kyberswap made before 0.7.1: listed until it expires, covers nothing). scope says what a grant covers: { "kind": "counterparty" } for a merchant host or address, { "kind": "swap", "chain", "sellToken" } for a swap grant. The agent can read grants but no tool can create, extend or revoke one. No parameters.
Equity guardrails: per-trade cap (above → approval), per-ticker position cap (above → deny), regular hours only
LYDION_ACCOUNT
eoa
smart: the agent acts from an ERC-4337 Coinbase Smart Wallet owned by its key (atomic multi-call, sponsored gas)
LYDION_BUNDLER_URL / LYDION_PAYMASTER_URL
Pimlico public / (empty)
Bundler and paymaster RPC for smart mode; {chainId} is replaced. The public bundler is rate-limited: use your own key in production
LYDION_MICRO_ALLOWANCE_USD
1
Micro-payments at or below this pass automatically (within the daily limit)
LYDION_MAX_MICRO_PER_HOUR
10
More micro-payments than this in a rolling 60 minutes need approval
LYDION_MAX_TX_PER_HOUR
20
More spends of any size than this in a rolling 60 minutes need approval
LYDION_COUNTERPARTY_LIMITS
(empty)
Daily USD budget per merchant or recipient address, e.g. api.example.com=5,0xabc…=20. Above it, a human must approve
LYDION_ALLOWLIST
(empty)
Comma-separated merchants or recipient addresses (swaps count as kyberswap). If set, anyone else above the micro allowance is denied; listed ones still go through every limit
LYDION_DENYLIST
(empty)
Always denied
LYDION_REQUIRE_APPROVAL
true
Require approval for every non-micro spend
LYDION_LEDGER_LOG
~/.lydion-mcp/ledger.jsonl
Append-only, hash-chained spend ledger. If only LYDION_LEDGER is set, it defaults to the same folder
LYDION_LEDGER
~/.lydion-mcp/ledger.json
Pre-0.6 daily ledger. Today's entries are imported once into an empty log; it is no longer written
LYDION_GRANTS
grants.json next to the ledger log
Where spend grants are stored. In-flight grant reservations live next to the ledger log (ledger.claims.json)
LYDION_GRANT_MAX_HOURS
24
Longest spend grant the owner can create
LYDION_GRANT_MAX_USD
daily limit
Largest spend grant total (never above the hard cap)
The policy engine is the core of Lydion. It is about 390 lines of plain, auditable code (server/src/policy.js) that turns a proposed spend into one of three decisions:
allowWithin every limit. Typically an x402 micro-payment.
needs_approvalOver a soft limit. A human must confirm.
denyBreaks a hard rule. Nothing can override it.
Evaluation order: hard rules first (any failure is final), then the micro allowance, then soft limits.Real decisions from the test suite with LYDION_DAILY_LIMIT_USD=50 and LYDION_ALLOWLIST=uniswap.
Why it's injection-proof
Limits are read from environment variables when the process starts and enforced in code. The model can only ask for a decision through policy_check; no tool exists that changes the policy at runtime. A prompt-injected agent can request a $10,000 transfer, and the engine returns deny.
Velocity and counterparty limits
The micro allowance makes small payments frictionless, so the engine also watches the rate. An agent stuck in a loop could otherwise make fifty $1 payments and drain a $50 budget without a human ever seeing one. Over a rolling 60 minutes of recorded spends:
More than LYDION_MAX_MICRO_PER_HOUR (10) micro-payments: the next micro-payment needs approval, with the reason more than 10 micro-payments in the last hour.
More than LYDION_MAX_TX_PER_HOUR (20) spends of any size: the next spend needs approval, with more than 20 transactions in the last hour.
A spend that would take a merchant or recipient past its daily budget in LYDION_COUNTERPARTY_LIMITS needs approval, with above daily budget for api.example.com ($4.00 of $5). Keys are matched case-insensitively against the merchant (or the recipient address when there is no merchant).
These are soft limits: they raise the decision to needs_approval, never to deny, and they apply even to spends that would otherwise pass as micro-payments.
The ledger
Every spend Lydion makes is appended as one line to ~/.lydion-mcp/ledger.jsonl. Lines are never rewritten, so history is kept across days and restarts, and daily totals, per-counterparty totals and the hourly window are all computed from it. Each line is hash-chained to the one before:
hash is the SHA-256 of the entry's canonical JSON (keys sorted, without hash) and prev is the hash of the previous entry (64 zeros for the first). Changing, deleting or inserting any line breaks the chain from that point, and verify_ledger reports where. Spends made under a spend grant carry a grant field with its id, inside the hash. A ledger written by an older version (ledger.json) is imported once, for today's entries.
Execution & approvals (v0.3)
From v0.3 an agent can act, not just read: send transactions, swap and pay x402 merchants from its own small wallet. There is exactly one code path that signs (server/src/execute.js), and every action passes the same gate in order:
Simulate. The transaction is dry-run on live state with simulate_tx. Anything that would revert or trips a high-severity warning (drainer approval, flagged counterparty) is blocked before it can be signed.
Policy. The policy engine decides on the USD value leaving the wallet: allow, needs_approval or deny. Deny is final.
Human approval. If the policy asks for a human, or the simulation raised medium warnings, the action is parked as an approval request and the owner is notified.
Sign and send. Only then does the wallet sign and broadcast.
Ledger. The spend is recorded, so daily limits hold across restarts.
Opt-in chains
Execution runs only on chains listed in LYDION_EXECUTION_CHAINS. The default is base-sepolia, a testnet: nothing real can be spent until the owner opts in to a mainnet explicitly, for example LYDION_EXECUTION_CHAINS=base-sepolia,base. LYDION_EXECUTION=off disables execution entirely and leaves the read-only tools working. Test ETH is still valued at the ETH price, so limits behave on testnet exactly as they would on mainnet.
The agent wallet
Running from source? The CLI examples on this page use npx lydion-mcp <command>. From a source checkout, run the same command from the server/ folder as node src/index.js <command>, e.g. node src/index.js init-wallet.
terminal
npx lydion-mcp init-wallet
# Created a new agent wallet.# address 0xB6c6…445a# key file ~/.lydion-mcp/agent-key.json (keep it private; it never leaves this machine)# executes base-sepolia (LYDION_EXECUTION_CHAINS)
The key is stored in ~/.lydion-mcp/agent-key.json with file mode 600 (or passed as LYDION_AGENT_KEY). No tool returns it and it is never logged; wallet_info shows only the address. Treat it as a hot wallet: fund it with what you are willing to let the agent spend, not your savings. For testing, use Base Sepolia ETH and USDC from a faucet.
Approvals
An approval request is bound to a SHA-256 hash of the exact action parameters (chain, recipient, value, calldata; or URL, payee, asset and amount for x402). It can be used once and expires after 15 minutes (LYDION_APPROVAL_TTL_MIN). An approved $5 payment therefore cannot be swapped for a $500 one or replayed. The agent has no tool that can approve: it can only read the status.
TelegramSet LYDION_TELEGRAM_BOT_TOKEN and LYDION_TELEGRAM_CHAT_ID. Each request arrives as a compact message with the simulation summary (assets out and in with USD, allowances granted, risk verdict, counterparty, policy reasons) and three buttons: Approve once (single use, bound to the exact parameters), Approve + 1h grant (also creates a spend grant for that counterparty) and Deny. Only callbacks from that chat are accepted.
CLInpx lydion-mcp approvals lists requests; npx lydion-mcp approve <id> or deny <id> decides. grant, grants and revoke-grant manage spend grants. Works with no extra setup.
Admin HTTPPOST /approvals/<id>/approve (or /deny) with Authorization: Bearer $LYDION_ADMIN_TOKEN. The admin token must differ from the agent token; the server refuses to start otherwise.
Webhook · emailSet LYDION_APPROVAL_WEBHOOK and every request is POSTed as JSON within 5 s (a slow or broken endpoint never blocks the tool). Point it at Zapier, Make, n8n or a small function that sends an email (e.g. via Resend). With LYDION_APPROVAL_WEBHOOK_SECRET the body is signed with HMAC-SHA256 in X-Lydion-Signature.
ExpiryUndecided requests expire. A pending, denied, expired or already-used approval makes the tool return blocked with the reason.
webhook payload · POST to LYDION_APPROVAL_WEBHOOK
{ "type": "approval_requested",
"approval": { "id": "3F9A1C", "summary": "Pay $5 USDC to api.meteo.xyz for https://api.meteo.xyz/v1/forecast",
"value_usd": 5, "reasons": ["owner requires approval for non-micro spends"], "expires_at": "2026-11-24T12:15:00.000Z" },
"approve_hint": "npx lydion-mcp approve 3F9A1C (or deny 3F9A1C)" }
// verify on the receiver (Node):// crypto.createHmac('sha256', SECRET).update(rawBody).digest('hex') === header.slice(7)
The pending response tells the agent which channels were reached: "notified_via": ["telegram", "webhook"], or ["none"] when only the CLI is set up.
Spend grants (0.7)
A spend grant is a time-boxed, scoped pre-approval: up to $X to counterparty Y for N hours, optionally with a per-spend cap. While it is active, a matching spend that the policy would park for approval passes instead, with the reason covered by grant G7C21E0 ($20.00 of $25 left, expires 2026-11-24 13:02 UTC). Everything else still asks.
What a grant can waive: the per-transaction limit, the remaining daily budget, "owner requires approval", velocity limits and per-counterparty budgets.
What it never touches: a deny (hard cap, denylist, flagged counterparty, allowlist miss), simulation warnings, unpriced outgoing value and tokenized-stock buys. Those behave exactly as without a grant.
Counterparty: the merchant host for x402 (api.meteo.xyz) or the to address of a plain transfer. Swaps are scoped to the token sold on one chain: kyberswap:<chain>:<sellTokenAddress>, e.g. kyberswap:base:0x833589fcd6edb6e08f4c7c32d4f71b54bda02913 for selling USDC on Base (the native coin is 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee), so a grant made from one swap does not cover selling anything else. Budgets, lists and the ledger still use kyberswap as the counterparty. Grants match exactly, lowercased.
Older swap grants: before 0.7.1 a swap grant was for plain kyberswap and covered every swap. Such grants no longer cover anything; they are listed with status unscoped until they expire (24 h at most) and can still be revoked. A plain kyberswap grant can no longer be created.
Room: spends under a grant are written to the ledger with a grant field inside the hash chain, and the room left is computed from those entries. The executor re-checks the grant and reserves its room right before signing, under the same cross-process lock as the ledger, so parallel calls cannot overspend it, even from two Lydion processes sharing one ledger (stdio and HTTP). A reservation is released when the spend is recorded or fails, and lapses after 10 minutes otherwise.
Owner only: grants are created from Telegram or the CLI, never by the agent. LYDION_GRANT_MAX_HOURS (24) and LYDION_GRANT_MAX_USD (the daily limit) cap every grant; expired and revoked grants are ignored. The agent sees them through list_grants and spending_report.
Approve + 1h grant in Telegram approves the request once and creates a grant for its counterparty (for a swap: selling the same token on the same chain) of max(request value, per-tx limit) for one hour, capped by LYDION_GRANT_MAX_USD. The approved request itself does not use the grant. The button is offered for x402 payments, swaps and plain transfers; not for contract calls (a grant to a token contract would cover transfers to anyone) or tokenized-stock buys.
terminal
npx lydion-mcp grant api.meteo.xyz 20 4 --per-tx 5
# G7C21E0 granted: up to $20 to api.meteo.xyz (max $5/tx) until 2026-11-24 16:02 UTC
npx lydion-mcp grants
# G7C21E0 active api.meteo.xyz $20 of $20 left (max $5/tx) expires 2026-11-24 16:02 UTC
npx lydion-mcp grant kyberswap:base:0x833589fcd6edb6e08f4c7c32d4f71b54bda02913 30 2 # swaps selling USDC on Base
npx lydion-mcp revoke-grant G7C21E0
Allowance hygiene
Simulation stops a bad approval before it is signed, but approvals the wallet granted earlier stay open until someone revokes them. list_allowances lists them with a verdict per row (REVOKE, REVIEW, OK), and revoke_allowance sets one back to zero through the same gate as every other signing action. A zero approval grants nothing, so the simulation does not block a revoke because its spender is flagged; that is exactly the case where revoking matters most.
A full flow
x402_pay with a $5 price (above the $1 micro allowance)
// 1 · agent → x402_pay({ url: "https://api.meteo.xyz/v1/forecast" })
{ "status": "pending_approval", "approval_id": "3F9A1C", "expires_at": "2026-11-24T12:15:00.000Z",
"reasons": ["owner requires approval for non-micro spends"], "notified_via": ["telegram"],
"next": "Ask the owner to approve (…), then call this tool again with the same arguments and approval_id" }
// 2 · owner taps ✅ Approve in Telegram (or: npx lydion-mcp approve 3F9A1C)// 3 · agent → x402_pay({ url: "https://api.meteo.xyz/v1/forecast", approval_id: "3F9A1C" })
{ "status": "paid", "amount_usd": 5, "approved_by": "3F9A1C", "receipt": { "success": true, … }, "body": "…" }
// 4 · the same approval_id again → { "status": "blocked", "reason": "approval 3F9A1C was already used" }
Every step of this flow, including the replay and wrong-parameter cases, is covered by server/test/execution.js against a local x402 merchant that verifies the EIP-3009 signature.
x402 payments
x402 revives the long-unused HTTP 402 Payment Required status code for machine payments. Instead of API keys and monthly plans, a server answers 402 with a price, the client pays a few cents in a stablecoin, and retries the request with a payment proof. This fits AI agents well: no sign-ups, pay per use, settled on-chain.
All five steps run in x402_pay: the price is checked against the policy, the agent wallet signs an EIP-3009 authorization, and the merchant settles it on-chain. x402_quote stops after step 3.
Remote agents (HTTP)
Besides stdio, Lydion can serve MCP over Streamable HTTP, for agents that run on another machine or in the cloud. The server is stateless: every request to POST /mcp gets a fresh MCP server instance.
It binds to 127.0.0.1 by default. Use --host 0.0.0.0 (or LYDION_HTTP_HOST) only behind TLS, for example a reverse proxy.
LYDION_HTTP_TOKEN is required and must be at least 16 characters; the server will not start without it.
The admin endpoints are disabled unless LYDION_ADMIN_TOKEN is set, and it must differ from the agent token, so the agent can never approve its own spends.
client config (any MCP client with Streamable HTTP)
lydion-mcp doctor checks your setup and prints a ✓ / ! / ✗ checklist with one fix per problem. It covers Node, every limit (velocity and counterparty budgets too), execution chains (warns when a mainnet is on), the wallet address (never the key), RPC reachability per chain, the Telegram, webhook or CLI approval channel, ledger integrity and today's spend, the approvals store and the HTTP bind. Tokens are masked to their first 4 characters. It exits with 1 if anything is ✗.
terminal
npx lydion-mcp doctor
# ✓ execution base-sepolia (testnet only)# ✓ rpc base-sepolia chainId 84532 · 210 ms# ✓ ledger ~/.lydion-mcp/ledger.jsonl · 12 entries · chain intact · head 3f9a1c0e7b2d…# ! owner console dashboard disabled: no owner token# fix: set LYDION_ADMIN_TOKEN=$(openssl rand -hex 24) and run `lydion-mcp http`
When LYDION_ADMIN_TOKEN is set, the HTTP transport also serves a read-only dashboard. Open http://127.0.0.1:3333/dashboard?token=<owner token>. The page keeps the token in the tab's sessionStorage, removes it from the address bar and refreshes every 10 s. It shows today's spend against the limit, counterparty budgets, last-hour velocity, 30-day history, ledger integrity, pending and recent approvals, the wallet and enabled chains, and spend grants.
Endpoint
Auth
Purpose
GET /dashboard
?token= or Bearer LYDION_ADMIN_TOKEN
Self-contained page (inline CSS/JS, no CDN, works offline)
GET /dashboard/data
Bearer LYDION_ADMIN_TOKEN
The same data as JSON
Read-only: no approve or deny buttons and no write endpoints. Decisions stay with Telegram, the CLI and POST /approvals/<id>/….
Constant-time token check; Cache-Control: no-store, X-Content-Type-Options: nosniff, Referrer-Policy: no-referrer and a strict nonce-based CSP.
Without an owner token the dashboard returns 404.
[ Browser extension · v0.3.0 ]
Lydion Guard (browser extension)
See what you sign. Lydion Guard brings the checks the MCP server runs for AI agents to people signing in a browser. When any website asks your wallet to sign, Guard reads the request first, simulates it on live chain state and shows a verdict before MetaMask, Rabby or Coinbase Wallet opens.
What it does
Transaction firewall. Intercepts eth_sendTransaction on any dApp and runs the same simulation core as simulate_tx: assets leaving and arriving with USD values, approvals granted, revert reason, gas. You then Reject or Continue to wallet.
Batches (EIP-5792). Intercepts wallet_sendCalls, with or without atomicRequired. Every call is decoded and checked on its own, the batch is simulated in order in one block, and the verdict is the worst of the calls. The overlay lists each call, for example Call 2 of 3: approve unlimited USDC to 0x2222…2222.
NFT approvals.setApprovalForAll(operator, true) on ERC-721 / ERC-1155 is DO NOT SIGN when the operator is a plain wallet or a flagged address and REVIEW when it is a contract, with the collection name: Gives 0x… control of ALL your Basenames NFTs. Revoking (false) shows an info line. A single ERC-721 approve(to, tokenId) to a plain wallet is REVIEW.
Signature firewall. Decodes Permit (EIP-2612) and Permit2 signature requests, the most common one-click drain. Flags unlimited amounts, spenders that are plain wallets or flagged addresses, and long deadlines.
Look-alike address check. Address poisoning: scammers send dust or zero-value transfers from vanity addresses that share the first and last characters with an address you really use, hoping you copy the fake one from your history. Guard remembers the addresses you actually sent to or approved (the 200 most recent, on your device) and compares every new native transfer, ERC-20 transfer / transferFrom and approve target, NFT operator, permit spender (EIP-2612, DAI-style, Permit2) and to / recipient field in typed data with them, including every call of a batch. Same first 4 and last 4 characters but a different address: DO NOT SIGN, with the differing middle shown. Same last 4 only, and never used before: REVIEW. A known address shows how many times you used it.
Scan with Lydion. Select or right-click any 0x… address on a page (X, Telegram Web, a DEX) to get a 0–100 token risk score, or the reputation of a wallet.
Popup. On / off, pause on the current site, counters of checked / warned / blocked requests, the latest checks, and how many addresses Guard remembers, with a Clear button.
Works with MetaMask, Rabby, Coinbase Wallet and any wallet that exposes an EIP-1193 provider or announces itself through EIP-6963. Chains: Ethereum, Base, Arbitrum, Optimism, Polygon, BNB Chain, Avalanche, plus Base Sepolia and Sepolia.
How the overlay decides
Guard uses the verdicts documented for simulate_tx, so a human and an agent see the same answer for the same transaction:
Verdict
What you see
SAFE TO SIGN
Succeeds, no warnings. A compact confirmation; the wallet opens as usual.
REVIEW
Medium warnings, for example an unlimited approval to a known contract, setApprovalForAll to a contract, or an asset that could not be priced.
DO NOT SIGN
High warnings: approval or Permit to a plain wallet, setApprovalForAll to a plain wallet or flagged operator, a flagged counterparty, a look-alike of an address you used before. In a batch, any single call is enough.
WILL REVERT
The transaction would fail on-chain and only burn gas. The reason is shown.
You always decide. Continue to wallet passes the original, unmodified request to your wallet; Reject returns the standard "user rejected" error (EIP-1193 code 4001) to the website.
Install
Lydion Guard is in beta. The Chrome Web Store and Firefox Add-ons listings are on the way; until they are live, install it from source (two minutes, no build step):
Unzip lydion-guard-*-chrome.zip from the latest release (or use the extension/ folder of the repository).
Open chrome://extensions (or brave://extensions) and switch on Developer mode.
Click Load unpacked and select the unzipped folder (or extension/).
Pin Lydion Guard to the toolbar. Open any dApp: the next signature request goes through Guard first.
Download or clone the repository.
Open about:debugging#/runtime/this-firefox.
Click Load Temporary Add-on… and pick extension/manifest.json.
Temporary add-ons are removed when Firefox restarts. A permanent install comes with the Firefox Add-ons listing.
Store status
Store
Status
Chrome Web Store
In review soon: load unpacked from GitHub until then.
Firefox Add-ons
In review soon: load it as a temporary add-on until then.
One codebase (Manifest V3) for both. Only install Lydion Guard from the links on this site: crypto extensions are a common target for look-alike clones.
Permissions
Permission
Why it is needed
storage
Settings, local counters and remembered addresses for the look-alike check
contextMenus
The Scan with Lydion right-click item
activeTab
Lets the popup read the current tab's site when you click it, for Pause on this site. No access to other tabs or history.
Content scripts on all sites
Any site can ask your wallet to sign, so Guard must be present on every page to see the request first. It does not read page content otherwise.
Simulation, risk and price lookups. Nothing else is contacted.
Privacy
No account, no telemetry, no backend of ours. Guard never touches keys or seed phrases: it reads the request on its way to the wallet, and that is all. When a site asks you to sign, the transaction goes to PublicNode for simulation, the addresses involved to GoPlus for reputation, and token addresses to DefiLlama / CoinGecko for prices. The addresses Guard remembers for the look-alike check stay in your browser's local extension storage: they never leave your device and are never sent to any service. Clear them any time from the popup. Full details: Privacy policy.
Limits Guard shows what a request would do on current chain state. State can change between the check and the signature, and risk data comes from third-party heuristics. It reduces risk; it cannot remove it.
Security model
Prompt injectionPolicy is enforced outside the model. No tool can modify limits.
Malicious tokensscan_token flags honeypots, mint authority, taxes and unlocked LP before a buy.
Drainer addressesRecipients are reputation-checked inside policy_check. Flagged means deny.
Bad inputJSON-schema validation rejects malformed addresses, unknown chains and negative amounts.
Key exposureThe agent wallet key lives in a mode-600 file or an env var on your machine. No tool returns it; wallet_info shows only the address.
Hot walletThe agent spends from its own small wallet, never your main one. Fund it with what you are willing to risk; mainnets are opt-in per chain.
Self-approvalNo tool can approve. Approvals come from Telegram (one chat only), the CLI, or an admin token the agent never sees.
Swapped or replayed actionsAn approval is bound to a hash of the exact parameters, is single-use and expires in 15 minutes.
Blind signingEvery transaction is simulated before signing; reverts and drainer patterns are blocked outright.
Third-party dataData sources can be wrong or down. Lydion reports errors explicitly and the agent should treat "unknown" as risky.
Disclaimer Lydion reduces risk but cannot remove it. Risk scores come from third-party heuristics. This is not financial advice; you are responsible for funds your agents control.
Equity Rails (phase 4: quotes since 0.4, guardrails since 0.5)
Stocks are moving on-chain as tokenized equities: tokens that track a real share and trade 24/7 on Solana, Arbitrum, Base and other chains. Agents will want to manage them the same way they manage crypto. Equity Rails extends Lydion to stocks, using the same policy engine and adding one equities-specific safety layer.
Parity Guard
A tokenized share should trade close to its underlying stock. When liquidity is thin or the market is closed, it can drift, and an agent buying at a 3% premium simply loses money. Before every buy, Parity Guard compares the on-chain price with the exchange reference price and blocks the trade when the premium is outside your band.
It is live as parity_check. A real response from 2026-11-24, with the US market open:
Lydion only prices tokens it has verified: each contract address comes from the CoinGecko coin API and its symbol() was read on-chain on Ethereum (and Arbitrum for xStocks). Both issuers target one token per underlying share; small persistent gaps can come from dividend handling, fees or after-hours trading.
Ticker
Token
Issuer
Ethereum contract
TSLA
TSLAx
Backed · xStocks
0x8ad3c73f833d3f9a523ab01476625f269aeb7cf0
TSLAon
Ondo Global Markets
0xf6b1117ec07684d3958cad8beb1b302bfd21103f
AAPL
AAPLx
Backed · xStocks
0x9d275685dc284c8eb1c79f6aba7a63dc75ec890a
AAPLon
Ondo Global Markets
0x14c3abf95cb9c93a8b82c1cdcb76d72cb87b2d4c
NVDA
NVDAx
Backed · xStocks
0xc845b2894dbddd03858fd2d643b4ef725fe0849d
NVDAon
Ondo Global Markets
0x2d1f7226bd1f780af6b9a49dcc0ae00e8df4bdee
SPY
SPYx
Backed · xStocks
0x90a2a4c76b5d8c0bc892a69ea28aa775a8f2dd48
SPYon
Ondo Global Markets
0xfedc5f4a6c38211c1338aa411018dfaf26612c08
xStocks are also deployed at the same address on Arbitrum and BNB Chain; Ondo tokens have separate BNB Chain contracts. All addresses are in server/src/equities.js.
Market hours
market_hours knows the NYSE calendar (holidays, observed days, 13:00 ET early closes) and daylight saving time, so an agent can tell a live reference price from last night's close.
Equity guardrails
Rule
Example
Why
LYDION_EQ_MARKET_HOURS_ONLY
true
Equity buys only during the regular NYSE session (live)
LYDION_EQ_PARITY_BAND_PCT
0.5
Parity Guard for the exact token: above the band, buys are denied (live)
LYDION_EQ_MAX_TRADE_USD
100
Per-trade cap: bigger buys need a human (live)
LYDION_EQ_MAX_POSITION_USD
500
Per-ticker position cap including current holdings: above it, denied (live)
(no setting)
always
No leverage: only verified 1:1 tokenized shares are on the registry (live)
Note Tokenized equities are regulated differently from country to country and may be unavailable where you live. Lydion will only route to venues you allowlist. Nothing here is investment advice.
$LYDN token
Status $LYDN launches on Pons, the launchpad on Robinhood Chain. The contract address is posted on this site first, before any announcement; anything else is not Lydion.
Field
Value
Ticker
LYDN
Chain
Robinhood Chain
Launchpad
Pons
Contract
Published here at launch
The software does not depend on the token: the MCP server and Lydion Guard are MIT licensed, free to run and work without holding anything. Any future token utility (for example around a hosted gateway) is a roadmap idea, not a shipped feature. Not financial advice.
Roadmap
Phase 1 · Q3 2026GenesisMarket and wallet tools on 7 EVM chains, stdio transport, MIT license.
Phase 2 · Q4 2026GuardrailsPolicy engine + ledger ✓, risk scanner ✓, x402 quotes ✓, docs & live playground ✓, guarded swap quotes ✓, pre-sign transaction simulation ✓. Still to do: npm publish and MCP registries.
Phase 3 · Q1 2027Wallets & paymentsAgent wallet ✓, policy-gated execution ✓, x402 settlement in USDC ✓, Telegram / CLI / HTTP approvals ✓, HTTP transport ✓, Lydion Guard browser extension (now v0.3), live on the Chrome Web Store and Firefox Add-ons ✓. Velocity limits, per-counterparty budgets, hash-chained ledger and allowance hygiene (0.6) ✓. Spend grants, Telegram one-tap grants, doctor and owner dashboard (0.7) ✓. ERC-20 sells with exact allowances ✓, email approvals via signed webhook ✓. ERC-4337 smart accounts ✓ (LYDION_ACCOUNT=smart: Coinbase Smart Wallet, atomic batches, optional paymaster). Next: scoped session keys enforced on-chain, security audit #1.
No API keys: everything runs on free public endpoints. The 16 read-only tools need no wallet. To let the agent act, the owner creates a small agent wallet with npx lydion-mcp init-wallet (from source: node src/index.js init-wallet).
Can my agent actually move money today?
Yes, from v0.3, within limits. It can send transactions, swap (native coin or ERC-20, with an exact allowance) and pay x402 merchants from its own wallet, and only after simulation, the policy engine and, when the policy asks, your approval. By default it can do this only on the Base Sepolia testnet; mainnets are opt-in through LYDION_EXECUTION_CHAINS.
Does Lydion Guard replace my wallet?
No. It sits in front of your wallet: it reads the signature request, shows what it would do, and then passes the original request to MetaMask, Rabby or any other wallet if you continue. Your wallet still holds your keys and does the signing.
Does Lydion Guard see my keys?
No. It never touches keys, seed phrases or passwords. It only reads the request a website sends to the wallet, before the wallet receives it. See the privacy policy.
Which AI models work with it?
Any model behind an MCP-capable client: Claude (Desktop, Code), Cursor, Windsurf, Zed, Cline, the OpenAI Agents SDK, or your own agent built on the MCP SDK.
Is my data sent anywhere?
Only the queries a tool needs: token ids to CoinGecko, addresses to the RPC and GoPlus. Lydion has no telemetry.
What happens when a data source is down?
The tool returns isError: true with the reason. Requests time out after 12 seconds, so the agent is never left hanging.
How is this different from giving the agent an exchange API key?
An exchange key lets the model do anything the key allows. Lydion's policy engine sits in between with limits, allowlists and approvals that the model cannot change.
Contributing
Lydion is MIT-licensed and contributions are welcome. A new tool is about 20 lines: register it inside createServer() in server/src/tools.js with a zod schema and a handler, put data access in data.js, and add a call to test/smoke.js. Anything that signs must go through execute.js.
server/src/tools.js
server.registerTool('my_tool', {
title: 'My tool',
description: 'What it does and when the agent should use it.',
inputSchema: { address: Address, chain: Chain },
annotations: { readOnlyHint: true },
}, safe(async ({ address, chain }) => {
return { address, chain, result: '…' };
}));
Good first issues: ERC-20 balances, a second swap aggregator as a price cross-check, Solana RPC support, more chains. See the issues on GitHub.