USDC · USDT · DAI · 8 Chains

Stablecoin API
for AI Agents

Stablecoins are the operating currency of the agent economy. Send, receive, swap, bridge, and earn yield on USDC, USDT, DAI, USDS, PYUSD, and FRAX across 8 chains — all through a single unified API with no KYC.

USDC
USDT
DAI
USDS
PYUSD
FRAX

Stablecoins as the operating currency of agent economies

AI agents managing real capital need a predictable unit of account. Volatile assets like ETH or SOL work for speculation, but agents handling payroll, escrow, and treasury operations need something that does not fluctuate 10% overnight. Stablecoins solve this.

The agent economy has coalesced around USDC as the primary stablecoin for inter-agent payments. It is widely supported, regulated by Circle under US money transmission laws, and available on every major chain. USDT dominates on Tron and in high-volume exchange contexts. DAI and USDS (formerly DAI) remain important for DeFi collateral where censorship-resistance matters.

Purple Flea agents use stablecoins across four key workflows: payments (escrow and direct agent-to-agent transfers), collateral (posting USDC collateral for DeFi positions), yield (supplying to lending protocols while idle), and treasury management (holding a stable reserve between active trades).

Escrow and inter-agent payments
USDC is the standard for Purple Flea's trustless escrow service. Agents lock USDC into escrow contracts, conditions are verified on-chain, and funds are released automatically. No counterparty risk, no manual settlement.
DeFi collateral
Agents post USDC as collateral on Aave, Compound, or Spark to borrow other assets for leveraged strategies. USDC collateral is risk-free from the lender's perspective, so it commands the highest loan-to-value ratios on most protocols.
Yield on idle capital
Agents earning USDC from trading or referrals should not leave it idle. Supplying USDC to Aave earns 4-8% APY depending on market conditions. Purple Flea's yield API lets agents deploy and withdraw from lending protocols in a single call.
Stable treasury reserve
Between active positions, agent treasuries should hold stablecoins rather than volatile assets. USDC on Base or Arbitrum provides safety, liquidity, and yield opportunity while the agent waits for the next entry signal.

Six stablecoins, eight chains

Purple Flea supports the six most important stablecoins in DeFi across all eight chains in the network. Each stablecoin has different trust assumptions, chain availability, and optimal use cases.

Stablecoin Issuer Backing Chains Best For
USDC Circle USD reserves All 8 Payments, escrow
USDT Tether Mixed reserves All 8 High-volume trading
DAI MakerDAO Crypto-collateral EVM chains DeFi collateral
USDS Sky (MakerDAO) Crypto-collateral Ethereum, Base DAI migration
PYUSD PayPal USD reserves Ethereum, Solana PayPal ecosystem
FRAX Frax Finance Algorithmic+collateral EVM chains Curve stable pools
Recommendation for agents: Use USDC as your primary operating currency. It has the best chain coverage, native bridging via Circle CCTP, the strongest regulatory standing, and is accepted by every DeFi protocol Purple Flea integrates. Hold USDT only if you are operating in high-volume Tron-based payment flows.

Circle CCTP: send USDC between chains without wrapped token risk

When most bridges move USDC, they lock your tokens on the source chain and issue a synthetic wrapped version on the destination. This wrapped token is only as safe as the bridge's smart contracts — dozens of bridge exploits have turned wrapped tokens worthless overnight.

Circle CCTP eliminates this risk entirely. USDC is burned on the source chain, Circle attests the burn cryptographically, and fresh native USDC is minted on the destination. The tokens that arrive in your agent's wallet are 100% native USDC, not a bridge derivative. Settlement takes 1-2 minutes and costs approximately $0.50 flat regardless of transfer size.

Purple Flea automatically uses CCTP for USDC transfers between CCTP-supported chains. For transfers to chains not yet supported by CCTP, Purple Flea falls back to the next-best bridge with a clear label indicating which protocol is being used.

🔥
Burn and mint model
No custody. No wrapped tokens. No bridge risk. USDC is destroyed on the source and created fresh on the destination by Circle itself.
1-2 minute settlement
Faster than lock-and-mint bridges that require 10-20 minute confirmation windows. Agents can move capital quickly without long waits.
💰
~$0.50 flat fee
Bridge $100 or $10 million for the same ~$0.50. For any meaningful transfer size, CCTP is the cheapest option by a significant margin.

Earn 4-8% APY on idle stablecoins

An agent's stablecoin balance sitting idle in a wallet earns nothing. Purple Flea's yield aggregator automatically identifies the highest-yield lending market for your stablecoin across Aave, Compound, and Spark, then routes your deposit to the optimal protocol.

Rates fluctuate based on market demand for borrowing. During periods of high leverage demand in DeFi, USDC supply APY on Aave Base has reached 8-12%. During quiet periods, 4-5% is typical. Purple Flea monitors rates across all protocols and can automatically rebalance your deposit to the highest-yield option if the rate differential exceeds a configured threshold.

🏭
Aave v3
Available on Ethereum, Arbitrum, Base, Optimism, Polygon, Avalanche. Deep liquidity, high supply rates during active markets. Recommended primary venue.
📈
Compound v3
Available on Ethereum, Arbitrum, Base, Polygon. Different rate dynamics from Aave. Purple Flea routes to Compound when it offers better rates than Aave.
Spark Protocol
MakerDAO's lending protocol. Best rates for DAI and USDS. If your agent holds DAI, Spark is typically the highest-yield option for DAI lending.
🔄
Auto-rebalancing
Set a minimum rate differential (e.g., 0.5%) to trigger automatic rebalancing. If a better rate becomes available, Purple Flea migrates your deposit without agent code changes.
Instant withdrawal
Lending positions can be withdrawn in a single API call. Purple Flea uses flash-withdrawal patterns on protocols that support it, ensuring your agent can access funds quickly.
📋
Interest tracking
Every deposit, accrual, and withdrawal is logged in the Purple Flea monitoring system. Your agent's yield earnings appear in the performance metrics dashboard.

Swap between stablecoins with minimal slippage via Curve

Different counterparties in the agent economy prefer different stablecoins. Curve Finance's stable pools are the canonical venue for stablecoin-to-stablecoin swaps, offering 0.01-0.04% fees with virtually zero slippage for trades up to several million dollars.

Purple Flea routes stablecoin swaps through Curve stable pools by default. For swaps that Curve does not cover (e.g., USDC to PYUSD), the routing engine checks Uniswap v3 stable pairs and dYdX as fallbacks. Every swap returns the actual fee and slippage so your agent can make informed decisions about whether to proceed.

Curve 3pool and stable pools: The Curve 3pool (USDC/USDT/DAI) has historically had over $1 billion in liquidity, making it the most efficient swap venue for the three major stablecoins. Fees are 0.04% with near-zero price impact for trades under $5 million.

Common stablecoin operations in code

send-usdc-base-cctp.js
// Send 500 USDC on Base via Circle CCTP (native, no wrapped tokens) const PURPLE_FLEA_API_KEY = process.env.PURPLE_FLEA_API_KEY; async function sendUSDC(toAddress, amount, fromChain = 'ethereum', toChain = 'base') { const res = await fetch('https://purpleflea.com/v1/stablecoin/send', { method: 'POST', headers: { 'Authorization': `Bearer ${PURPLE_FLEA_API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ token: 'USDC', amount: amount, from_chain: fromChain, to_chain: toChain, to_address: toAddress, // Purple Flea auto-selects CCTP for cross-chain USDC // For same-chain transfers, it's a simple ERC-20 transfer }) }); const result = await res.json(); console.log(`Transfer ID: ${result.transfer_id}`); console.log(`Protocol: ${result.protocol}`); // "cctp" for cross-chain USDC console.log(`Fee: $${result.fee_usd}`); console.log(`Source tx: ${result.source_tx_hash}`); return result; } // Send 500 USDC from Ethereum to Base (auto-uses CCTP) sendUSDC('0xRecipientAgentAddress...', 500.00, 'ethereum', 'base') .catch(console.error);
swap-usdt-to-usdc-curve.js
// Swap 1000 USDT to USDC via Curve stable pool (minimum slippage) async function swapStable(fromToken, toToken, amount, chain = 'ethereum') { // Step 1: Get quote const quoteRes = await fetch('https://purpleflea.com/v1/stablecoin/swap/quote', { method: 'POST', headers: { 'Authorization': `Bearer ${process.env.PURPLE_FLEA_API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ from_token: fromToken, to_token: toToken, amount, chain }) }); const quote = await quoteRes.json(); console.log(`Route: ${quote.route}`); // e.g. "curve_3pool" console.log(`Output: ${quote.output_amount} ${toToken}`); console.log(`Fee: ${quote.fee_pct}%`); // typically 0.01-0.04% on Curve console.log(`Slippage: ${quote.slippage_pct}%`); if (quote.slippage_pct > 0.1) { console.warn('Slippage too high, aborting swap'); return null; } // Step 2: Execute swap const swapRes = await fetch('https://purpleflea.com/v1/stablecoin/swap/execute', { method: 'POST', headers: { 'Authorization': `Bearer ${process.env.PURPLE_FLEA_API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ quote_id: quote.quote_id, wallet_address: '0xYourAgentAddress...' }) }); const result = await swapRes.json(); console.log(`Swap complete: ${result.tx_hash}`); console.log(`Received: ${result.received_amount} ${toToken}`); return result; } swapStable('USDT', 'USDC', 1000, 'ethereum').catch(console.error);
supply-usdc-aave.js
// Supply USDC to Aave v3 on Base, earn yield automatically async function supplyToAave(amount, chain = 'base') { // Check current supply APY first const ratesRes = await fetch( `https://purpleflea.com/v1/stablecoin/yield/rates?token=USDC&chain=${chain}`, { headers: { 'Authorization': `Bearer ${process.env.PURPLE_FLEA_API_KEY}` } } ); const rates = await ratesRes.json(); console.log('Current USDC supply rates:'); rates.protocols.forEach(p => { console.log(` ${p.protocol}: ${p.apy.toFixed(2)}% APY`); }); const bestProtocol = rates.protocols[0]; // sorted by APY console.log(`\nSupplying to ${bestProtocol.protocol} at ${bestProtocol.apy.toFixed(2)}% APY`); const supplyRes = await fetch('https://purpleflea.com/v1/stablecoin/yield/supply', { method: 'POST', headers: { 'Authorization': `Bearer ${process.env.PURPLE_FLEA_API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ token: 'USDC', amount: amount, chain: chain, protocol: bestProtocol.protocol, wallet_address: '0xYourAgentAddress...' }) }); const result = await supplyRes.json(); console.log(`Supply tx: ${result.tx_hash}`); console.log(`aTokens received: ${result.atoken_amount}`); console.log(`Position ID: ${result.position_id}`); return result; } supplyToAave(5000, 'base').catch(console.error);

Recommended stablecoin patterns for agent operations

Different agent roles have different optimal stablecoin strategies. The patterns below represent common configurations used by agents on the Purple Flea network.

💱
Escrow in USDC
Use USDC for all inter-agent escrow payments. Both parties hold the same stablecoin with no bridge or swap friction. USDC escrow contracts settle in under 10 seconds.
🔂
Receive in USDT, settle daily
Agents receiving payment from multiple counterparties may receive USDT from some. Batch-swap to USDC at end of day via Curve 3pool to consolidate into a single asset.
💸
Idle treasury in Aave
Any USDC held for more than one hour should be earning yield. Supply to Aave, withdraw instantly when needed. The compounding effect of 5% APY on a $10,000 treasury is ~$500/year.
🚑
DeFi collateral in DAI
For agents needing to post collateral on MakerDAO-adjacent protocols, hold DAI. Swap USDC → DAI via Curve before posting collateral. Swap back after unwinding positions.
Cross-chain in USDC via CCTP
Moving capital between chains? Always prefer USDC + CCTP over bridging other stablecoins. Native USDC lands on the destination chain ready to use with no unwrapping needed.
🔒
Minimum balance reserve
Always keep a USDC reserve on each active chain to cover gas relay fees and small transfers. Purple Flea's monitoring API alerts when any chain balance drops below your configured minimum.