Optimism Mainnet · OP Stack · Velodrome Native

Optimism & OP API
for AI Agents

Optimism is the original OP Stack chain — the same technology that powers Base, Blast, and the broader Superchain. AI agents on Optimism pay sub-cent fees, access Velodrome Finance's deep DEX liquidity, earn OP incentives, and participate in one of crypto's most active retroactive public goods ecosystems. Purple Flea gives your agent a full Optimism wallet and REST API with no wallet setup, no KYC, and no infrastructure to manage.

$0.001
Avg tx fee
~2s
Block time
$500M+
Velodrome TVL
10
Chain ID
No KYC
Agent-first

Why Optimism for AI Agents?

Optimism (OP Mainnet) is the original OP Stack rollup and the foundation of the Superchain vision — a network of interoperable L2s that share infrastructure, security, and cross-chain messaging. For AI agents, Optimism offers an unbeatable combination: sub-cent transaction fees, Ethereum-grade finality guarantees, and access to Velodrome Finance, the chain's dominant DEX with over $500 million in TVL and one of the deepest liquidity pools in all of DeFi L2s.

Where Arbitrum competes on GMX perpetuals and TVL, Optimism competes on fee efficiency and ecosystem alignment. Average transaction fees on OP Mainnet run between $0.001 and $0.01 — making it the cheapest chain Purple Flea supports for simple token transfers and DEX swaps. Agents that process hundreds of micro-transactions daily — payment routers, incentive distributors, subscription managers — find that Optimism's fee structure is the most favorable of any EVM chain.

The OP token adds another dimension. Optimism's Retroactive Public Goods Funding (RetroPGF) program rewards builders and protocols that generate genuine value for the ecosystem. Agents that provide useful infrastructure on OP Mainnet may earn OP grants. Additionally, Velodrome's VELO emissions incentivize liquidity providers generously, creating yield opportunities for agents that supply liquidity to Velodrome pools. Combined with SNX (Synthetix) for synthetic assets and sUSD for on-chain stablecoins, Optimism offers a rich, interconnected DeFi ecosystem for autonomous agents.


Optimism API Features

Everything an AI agent needs to operate on OP Mainnet, via a single REST API.

Optimism Wallet Creation

Provision a non-custodial BIP-44 Optimism wallet in a single API call. Receive ETH, USDC, OP, VELO, SNX, and any ERC-20 on OP Mainnet. No seed phrase to manage yourself.

Send ETH & USDC

Transfer ETH and USDC on OP Mainnet for fractions of a cent. The cheapest EVM chain for simple payment flows. Typical USDC transfer: under $0.005. Confirmation in ~2 seconds.

Velodrome DEX Swaps

Swap any token pair on Velodrome Finance — Optimism's dominant AMM. Stable and volatile pool routing. Purple Flea finds the optimal path and handles ERC-20 approvals automatically.

📈

Balance Queries

Fetch ETH, USDC, OP, VELO, SNX, and any ERC-20 balance in one call. Includes USD values using Purple Flea's live price feeds. Aggregate multi-chain balances across all Purple Flea wallets.

Velodrome LP Positions

Mint Velodrome LP positions, deposit into gauges to earn VELO emissions, and claim rewards. Purple Flea manages the full LP lifecycle for your yield-farming agent.

🔗

Superchain Bridging

Bridge assets between Optimism and Ethereum mainnet, Base, or other OP Stack chains via the native bridge or third-party aggregators. Cross-chain in under a minute with fast bridges.


Velodrome DEX for AI Agents

Optimism's native DEX with $500M+ TVL, VELO emissions, and ve(3,3) tokenomics designed for sustainable liquidity.

The DEX that Powers OP Mainnet Liquidity

Velodrome Finance is the dominant DEX on Optimism, modeled on Solidly's ve(3,3) token design. Liquidity providers stake LP tokens in gauges to earn VELO emissions — Velodrome's governance token. veVELO holders (locked VELO) direct emissions toward their preferred pools and earn 100% of trading fees generated by those pools. This creates a self-reinforcing flywheel: deep liquidity attracts volume, volume attracts fee revenue, fee revenue attracts veVELO lockers, lockers direct more emissions to the best pools.

For AI agents, Velodrome represents a yield opportunity with favorable risk/reward. Providing liquidity to stable pools (USDC/USDT, USDC/sUSD) earns VELO emissions on top of trading fees, with minimal impermanent loss risk. Purple Flea's Velodrome integration covers the full workflow: add liquidity, deposit into gauges, claim VELO rewards, and optionally lock VELO for governance participation and boosted emissions.

Stable Pool LPs

Provide USDC/USDT or USDC/sUSD liquidity for low impermanent loss. Earn VELO emissions and trading fees. Best option for agents that want stablecoin yield without directional risk.

Volatile Pool LPs

OP/ETH, VELO/ETH, and other volatile pairs offer higher APRs with VELO gauge emissions. For agents comfortable with impermanent loss in exchange for yield.

🔒

veVELO Locking

Lock VELO to obtain veVELO. Vote on gauge weights to direct emissions. Earn bribes from protocols wanting more VELO emissions. Purple Flea automates vote and claim cycles.


Optimism vs. Other EVM Chains

How OP Mainnet compares to other chains for AI agent workloads.

Metric Optimism Base Arbitrum Ethereum
Avg Tx Fee $0.001–0.01 Lowest $0.001–0.05 $0.01–0.10 $1–20+
Block Time ~2s ~2s <1s ~12s
Rollup Type Optimistic (Bedrock) Optimistic (OP Stack) Optimistic (Nitro) L1
Native DEX Velodrome Best Stable Yields Aerodrome GMX + Uniswap v3 Uniswap v3 + Curve
TVL (DeFi) ~$1B ~$3B $15B+ $50B+
Superchain Yes Original Yes No N/A
USDC Type Native (Circle) Native (Circle) Native (Circle) Native (Circle)
Unique DeFi Synthetix sUSD + SNX Coinbase ecosystem GMX perps Curve, Aave, Compound
Chain ID 10 8453 42161 1

Get Your Agent on Optimism

From zero to a funded OP Mainnet wallet in four API calls.

01

Register your agent

Create an agent account on Purple Flea and receive your API key. Works across all chains — one registration gives you access to Optimism, Ethereum, Arbitrum, Base, and more.

register.sh
# Register your agent on Purple Flea curl -X POST https://api.purpleflea.com/v1/agents/register \ -H "Content-Type: application/json" \ -d '{"name": "my-op-agent", "chain": "optimism"}' # Response: { "agent_id": "agt_...", "api_key": "pfk_..." }
02

Create an Optimism wallet

Provision a non-custodial wallet on OP Mainnet. Same Ethereum address format; same derivation path. Your agent's wallet works identically on Ethereum and Optimism.

create-wallet.sh
curl -X POST https://api.purpleflea.com/v1/wallets \ -H "Authorization: Bearer pfk_..." \ -H "Content-Type: application/json" \ -d '{"chain": "optimism", "label": "op-main"}' # Response: # { # "wallet_id": "wlt_...", # "address": "0x1234...abcd", # "chain": "optimism", # "chain_id": 10 # }
03

Send ETH and USDC on Optimism

Transfer ETH or USDC to any address on OP Mainnet. Fees are typically under $0.01 — cheap enough for agent micro-payments and frequent settlement flows.

send-usdc-op.sh
curl -X POST https://api.purpleflea.com/v1/wallets/wlt_.../send \ -H "Authorization: Bearer pfk_..." \ -H "Content-Type: application/json" \ -d '{ "token": "USDC", "chain": "optimism", "to": "0xRecipientAddress", "amount": "10.00" }' # Response: # { "tx_hash": "0xabc...", "fee_usd": "0.005", "status": "confirmed" }
04

Swap on Velodrome via Purple Flea

Execute any token swap on Velodrome Finance. Purple Flea handles route selection between stable and volatile pools, ERC-20 approvals, and transaction submission.

swap-velodrome.sh
curl -X POST https://api.purpleflea.com/v1/defi/swap \ -H "Authorization: Bearer pfk_..." \ -H "Content-Type: application/json" \ -d '{ "chain": "optimism", "wallet_id": "wlt_...", "protocol": "velodrome", "token_in": "ETH", "token_out": "USDC", "amount_in": "0.1", "slippage_bps": 30 }' # Response: # { "amount_out": "342.10", "fee_usd": 0.007, "tx_hash": "0x..." }

Optimism API in Practice

Real code for common agent use cases on OP Mainnet.

Velodrome — Add Liquidity and Stake

velodrome-lp.js
// Add USDC/ETH liquidity to Velodrome volatile pool const lp = await fetch( 'https://api.purpleflea.com/v1/defi/velodrome/add-liquidity', { method: 'POST', headers: { 'Authorization': 'Bearer pfk_...' }, body: JSON.stringify({ chain: 'optimism', wallet_id: 'wlt_...', token_a: 'USDC', token_b: 'ETH', amount_a: '500', amount_b: '0.145', pool_type: 'volatile', stake_gauge: true, // auto-stake for VELO }), } ); const result = await lp.json(); // { // lp_amount: "14.22", // gauge_staked: true, // velo_apy: "18.4%", // tx_hash: "0xabc..." // }

Multi-Agent USDC Payments on OP

agent-payments.js
// Agent pays multiple sub-agents for completed tasks const payments = [ { to: '0xAgent1...', amount: '2.50' }, { to: '0xAgent2...', amount: '1.75' }, { to: '0xAgent3...', amount: '3.00' }, ]; // Batch send — one approval, multiple transfers const batch = await fetch( 'https://api.purpleflea.com/v1/wallets/wlt_.../send-batch', { method: 'POST', headers: { 'Authorization': 'Bearer pfk_...' }, body: JSON.stringify({ chain: 'optimism', token: 'USDC', transfers: payments, }), } ); // Total fee for 3 payments: ~$0.02 // On Ethereum mainnet: ~$45-90

Claim Velodrome VELO Rewards

claim-velo.js
// Check pending VELO rewards const pending = await fetch( 'https://api.purpleflea.com/v1/defi/velodrome/rewards?wallet=wlt_...&chain=optimism', { headers: { 'Authorization': 'Bearer pfk_...' } } ).then(r => r.json()); // pending: { velo: "45.2", velo_usd: "18.30" } if (parseFloat(pending.velo) > 10) { // Worth claiming — fee is ~$0.005 const claim = await fetch( 'https://api.purpleflea.com/v1/defi/velodrome/claim', { method: 'POST', headers: { 'Authorization': 'Bearer pfk_...' }, body: JSON.stringify({ chain: 'optimism', wallet_id: 'wlt_...', }), } ); }

Superchain Bridge — OP to Base

superchain-bridge.js
// Bridge USDC from Optimism to Base (both OP Stack) const bridge = await fetch( 'https://api.purpleflea.com/v1/bridge', { method: 'POST', headers: { 'Authorization': 'Bearer pfk_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ from_chain: 'optimism', to_chain: 'base', token: 'USDC', amount: '100', wallet_id: 'wlt_...', fast: true, // use third-party fast bridge }), } ); // Funds arrive on Base in ~60 seconds // Bridge fee: ~$0.10-0.50 depending on provider

Optimism as the Superchain Foundation

OP Mainnet is the origin chain of an expanding network of interoperable rollups using the same OP Stack codebase.

One Codebase, Many Chains

The Superchain is a vision of many chains sharing a single OP Stack codebase, cross-chain messaging protocol, and security model. OP Mainnet (chain ID 10) is the original deployment. Base (chain ID 8453), Mode, Zora, Blast, and dozens of others run the same software with different configurations. An agent deployed on Optimism can bridge seamlessly to any Superchain member — and with the upcoming OP Interop standard, will be able to make cross-chain calls in a single transaction.

◆ OP Mainnet (10) ◆ Base (8453) ◆ Mode (34443) ◆ Zora (7777777) ◆ Blast (81457) ◆ Fraxtal (252) ◆ Lisk (1135) ◆ + many more

What AI Agents Build on Optimism

Common agent architectures that benefit from OP Mainnet's cheap fees and Velodrome ecosystem.

🏭

DeFi Yield Agents

Automate Velodrome liquidity provisioning, VELO reward claiming, and stable pool compounding. Sub-cent fees make frequent compound cycles profitable at any balance size.

💳

Payment Agents

Route USDC payments between agents for sub-cent fees. Optimism is the cheapest EVM chain for simple transfers, making it ideal for high-volume agent-to-agent settlement.

Superchain Multi-Chain Agents

Deploy on OP Mainnet as a hub and bridge to Base, Mode, and other OP Stack chains. Leverage Superchain interop for cross-chain strategy execution in upcoming protocol upgrades.

📈

SNX Synthetic Agents

Mint sUSD using SNX as collateral. Access Synthetix synthetic assets for hedging. Optimism is home to Synthetix's main deployment with deep sUSD liquidity on Velodrome.

🌳

RetroPGF Grant Agents

Build useful tools on Optimism and apply for Retroactive Public Goods Funding. Agents that contribute genuine value to the OP ecosystem qualify for OP token grants.

Treasury Diversification

Hold USDC on OP Mainnet to minimize fees on frequent spending. Bridge surplus to Ethereum mainnet for cold storage. Keep operating reserves cheap and liquid.


Optimism Token Support

All major OP Mainnet tokens supported natively. No contract addresses required — just use ticker symbols.

ETH

Native Ethereum on OP Mainnet. Used for gas fees and as a base asset. Purple Flea auto-manages ETH for gas on behalf of your agent.

💲

USDC

Circle-native USDC on Optimism. Canonical stablecoin for agent treasuries and payments. No bridge risk. Deep liquidity on Velodrome stable pools.

WETH

Wrapped ETH for DeFi protocols. Purple Flea wraps and unwraps automatically when interacting with Velodrome and Uniswap v3 pools that require WETH.

OP

Optimism's governance token. Earned via RetroPGF grants and ecosystem programs. Liquid on Velodrome and transferable via Purple Flea.

VELO

Velodrome's emissions token. Earned by LP gauge stakers. Lock as veVELO to earn trading fees and vote on emission weights. Purple Flea supports full VELO lifecycle.

SNX

Synthetix staking token. Stake SNX to mint sUSD and earn protocol fees. Optimism is home to Synthetix's main L2 deployment with the deepest SNX liquidity.

sUSD

Synthetix's synthetic stablecoin. Minted by SNX stakers. Used as a stable medium of exchange in Synthetix's ecosystem and available on Velodrome pools.

Custom ERC-20

Any ERC-20 on OP Mainnet is queryable by contract address. Send, receive, and check balance for any token your agent needs to interact with.


Explore the Purple Flea Ecosystem


Start Building on Optimism

Register your agent, create an OP Mainnet wallet, and send your first transaction in under five minutes. No KYC. No credit card. Just API calls.