Now in Public Beta

The onchain CLI
for agents

One API to automate earning, trading, and leverage with all your favorite models.

integrates
MorphoUniswapCompoundAcrossAave0xHyperliquidPolymarketMorphoUniswapCompoundAcrossAave0xHyperliquidPolymarket
CLI

Get started in one minute.

BASH
$brew install legend-hq/tap/legend-cli
$legend-cli login
$legend-cli accounts create --keygen
Available for
ClaudeOpenAICursorElizaOSLangChain
and all MCP clients
The problem

Building financial agents is hard.

Without Legend

Hard mode

Integrate wallet infrastructure
Learn Morpho / Aave / Compound ABIs
Handle token approvals manually
Manage cross-chain bridging
Provision gas on every network
Build health monitoring
Write an orchestration layer
Months later — agent finally does something

With Legend

Easy mode

Integrate Legend
Learn Morpho / Aave / Compound ABIs
Handle token approvals manually
Manage cross-chain bridging

Every action. Every asset.

What it does

One integration. Every action.

Trade

Buy any asset on major EVM chains + Solana. Best-price routing and deep multichain liquidity. Cross-chain swaps handled automatically.

Earn

Deploy into Aave, Compound, and Morpho. Rate optimization across +100 markets, crosschain.

Borrow

On-demand liquidity against collateral without selling. Configure custom strategies on top of DeFi's most trusted Lending Protocols: Aave, Compound, Morpho.

Transfer

Move value across chains and wallets with a single call. Legend handles bridging, routing, and gas automatically.

Spend

Coming soon

Conversion to cash via virtual card. Your agent pays real expenses from onchain balance.

New Markets

Coming soon

Prediction markets and perpetuals. Hyperliquid and Polymarket integrations — your agent takes positions, manages risk, and settles automatically.

How it works

Transparent planning, streamlined execution.

Every operation can be reviewed before it's signed. Your agent sees exactly what will happen, signs it — then Legend executes it.

01Plan

You request an operation. Legend API returns a human-readable plan — amounts, routes, fees, protocols — before anything moves. Your agent (or a dedicated signing agent) can verify the plan matches the original intent before approving.

02Sign

Flexible signing — bring your own key provider. Supports Privy, Turnkey, Ledger, and EOA keys. Legend never holds signing keys. Nothing moves without your signer's approval.

03Execute

Legend handles gas, bridging, token approvals, and retries — then executes atomically onchain. Only whitelisted, audited DeFi protocols. Your agent can't accidentally route funds into an unknown contract.

Safe by design

Built with the guardrails agents need.

Whitelisted DeFi only

Every action routes through audited, whitelisted protocols. Agents can't accidentally dump funds into unknown contracts. The blast radius of any mistake is constrained by design.

Agent-in-the-loop verification

The Plan → Sign → Execute model means every transaction is confirmed as correct and safe before it is signed. A planner agent constructs the intent. Then a separate signing agent verifies the plan against the original intent before signing.

Sub-accounts per strategy

Each strategy is its own sub-account, resulting in out of the box risk isolation. Run high-risk + low-risk strategies in parallel with peace of mind.

Full activity log — no block explorer required

Every executed action is recorded with amounts, routes, fees, and timestamps. Your agent gets a structured audit trail out of the box — no manually tracing transactions across chains on a block explorer.

Automation

Ready-to-run financial strategies.

Pre-built flows your agent can run continuously.

STRATEGIES

Standing Automations

Define target allocations. Rebalance back to target on a schedule or when drift exceeds a threshold.

Dollar-cost average into any asset on a schedule. Executes at regular intervals regardless of price.

Monitor LTV on borrow positions. Auto-repay when approaching the liquidation threshold.

Watch yield rates continuously across protocols. When a meaningfully better rate appears, migrate the position atomically — no manual intervention.

Earn on principal. Pay recurring costs from yield. Principal untouched. Agent runs indefinitely without a top-up.

DCA out of volatile asset exposure into stablecoins on a schedule.

ORDERS

Conditional triggers

Execute a swap when an asset hits a target price.

Close or reduce a position at defined price levels.

Top up collateral or partially repay when LTV crosses a threshold. Prevents liquidation.

Purchase an asset on a fixed schedule — daily, weekly, or custom interval. Set it and forget it.

Split large orders into smaller executions spread over time. Reduces price impact and slippage on big positions.

Use cases

What people are already building

Autonomous Trading Agents

Execute strategies — DCA, rebalancing, limit orders, cross-chain swaps — autonomously across any asset on any EVM chain + Solana (and soon Polymarket and Hyperliquid).

Self-Sustaining Agents

Earn yield on idle capital and pay their own operating costs from the yield — including paying via virtual card from onchain balance. No human tops them up. Run indefinitely.

Yield Aggregators

Deploy user funds into the best available yield across protocols. Rate optimization, auto-compounding, and migration all handled.

Microloans

Users borrow against holdings without selling. Agent manages collateral health, monitors LTV, and protects positions automatically.

Why Legend

We built this to power our own app.

Proven in production

The same engine running Legend's live consumer app. Real money. Real users. Not a prototype.

Built by DeFi Veterans

The team behind Compound. Deterministic execution, pre-signed plans, and a security model where Legend structurally cannot move funds without a signature.

Transparent Execution

Every plan is human-readable before signing. Chain-bound, replay-protected. Full audit trail — no block explorer spelunking.

Non-Custodial by Design

Legend never holds signing keys. Every transaction requires your signer's approval. Bring your own key provider — Privy, Turnkey, Ledger.