DeFi operations plugin for swaps, bridging, and cross-chain money market operations via SODAX SDK
The Amped DeFi skill provides on-chain DeFi operations capabilities for agents, enabling seamless swaps, bridging, and money market (supply/borrow/repay/withdraw) actions across multiple chains using the SODAX SDK. This skill abstracts the complexity of cross-chain intent flows, allowance handling, and policy enforcement, allowing agents to execute DeFi operations safely and efficiently.
Key capabilities:
Use these tools to explore supported chains, tokens, and wallet state before executing operations.
| Tool | Purpose |
|---|---|
amped_supported_chains | List all supported spoke chains (e.g., ethereum, arbitrum, sonic) |
amped_supported_tokens | Get supported tokens for a specific module (swaps/bridge/moneyMarket) on a chain |
amped_wallet_address | Resolve wallet address by walletId (validates private key ↔ address match in execute mode) |
amped_money_market_reserves | View available money market reserves (collateral/borrow markets) |
amped_money_market_positions | View user's money market positions on a SINGLE chain |
amped_cross_chain_positions | RECOMMENDED: View aggregated positions across ALL chains with total supply/borrow, health factor, borrowing power, net APY, and risk metrics |
amped_user_intents | Query user's swap/bridge intent history from SODAX backend API. Shows open, filled, cancelled intents with full event details. |
When to use: Always start with discovery tools to verify chain/token support before attempting any operation.
Query the SODAX backend API to retrieve complete intent history for a wallet:
→ amped_user_intents(
walletId="main",
status="all", // "all", "open", or "closed"
limit=10, // Number of results (max 100)
offset=0 // For pagination
)
← Returns: {
pagination: { total: 1545, offset: 0, limit: 10, hasMore: true },
intents: [
{
intentHash: "0x5b18d04a545f089e6de59106fa79498cfc0b0274...",
txHash: "0x1c4a8ded456b97ba9fa2b95ee954ed7e92a40365...",
chainId: 146,
blockNumber: 57622027,
status: "closed",
createdAt: "2025-12-10T19:44:00.380Z",
input: { token: "0x654D...", amount: "10000000000000000000", chainId: 1768124270 },
output: { token: "0x9Ee1...", minAmount: "78684607057391028830", chainId: 5 },
deadline: "2026-12-10T19:48:32.000Z",
events: [
{ type: "intent-filled", txHash: "0x7981...", blockNumber: 57622086, ... }
]
}
],
summary: { totalIntents: 1545, returned: 10, openIntents: 3, closedIntents: 1537 }
}
When to use:
Cross-chain and same-chain token swaps via SODAX's intent-based solver network.
| Tool | Purpose |
|---|---|
amped_swap_quote | Get an exact-input swap quote with slippage and fee estimates |
amped_swap_execute | Execute a swap (handles allowance, approval, and execution automatically) |
amped_swap_status | Check the status of a swap transaction or intent |
amped_swap_cancel | Cancel an active swap intent (where supported) |
When to use swaps:
When NOT to use swaps:
Bridge tokens between chains via the swap infrastructure.
Note: In SODAX, bridges and cross-chain swaps use the same underlying intent-based messaging system. The
amped_bridge_executetool internally delegates to the swap infrastructure, which provides better routing and reliability.Recommendation: Use cross-chain swaps (
amped_swap_quote+amped_swap_execute) directly for bridging. You can swap USDC on one chain directly to native tokens (ETH, AVAX, POL, etc.) on another chain in a single operation.
| Tool | Purpose |
|---|---|
amped_bridge_discover | Discover bridgeable tokens between two chains |
amped_bridge_quote | Check bridgeability, limits, and max bridgeable amount |
amped_bridge_execute | Execute bridge (delegates to swap infrastructure) |
When to use bridging/cross-chain swaps:
Preferred approach for gas distribution:
// Get gas tokens on multiple chains from a single source
→ amped_swap_quote(srcChainId="base", dstChainId="polygon", srcToken="USDC", dstToken="POL", amount="0.5", ...)
→ amped_swap_execute(quote)
// Result: 0.5 USDC on Base → ~4 POL on Polygon
Supply, borrow, repay, and withdraw assets from the SODAX money market with cross-chain capabilities.
| Tool | Purpose |
|---|---|
amped_mm_supply | Supply tokens as collateral to the money market. Supports cross-chain supply. |
amped_mm_withdraw | Withdraw supplied tokens from the money market. Supports cross-chain withdraw. |
amped_mm_borrow | Borrow tokens against supplied collateral. KEY FEATURE: Can borrow to a different chain! |
amped_mm_repay | Repay borrowed tokens. Use repayAll=true for full repay. |
amped_mm_create_supply_intent | [Advanced] Create a supply intent without executing (for custom flows) |
amped_mm_create_borrow_intent | [Advanced] Create a borrow intent without executing (supports cross-chain) |
Cross-Chain Money Market Capabilities:
The SODAX money market supports powerful cross-chain operations:
Cross-Chain Borrow (Most powerful feature)
dstChainId parameter to specify the destination chainCross-Chain Supply
dstChainId parameterCross-Chain Withdraw
dstChainId parameterWhen to use money market:
When NOT to use money market:
⚠️ MUST FOLLOW — These rules are enforced by the Policy Engine:
Always get a quote before executing
amped_swap_quoteamped_bridge_quoteVerify chain and token are supported
amped_supported_chains and amped_supported_tokens before operationsCheck slippage is within acceptable bounds
Never attempt to drain entire wallet
maxSwapInputUsd, maxBridgeAmountToken, maxBorrowUsdAlways verify transaction status after execution
amped_swap_status to track swap completionamped_money_market_positions to verify position updatesEnforce allowlist compliance
allowedChains and allowedTokensByChain per policySimulation is enabled by default
skipSimulation=false unless operator overrideMonitor health factor for money market positions
amped_money_market_positions to monitorUse a safety buffer for near-full withdrawals
withdrawType="all""100" for 100 USDC, "0.5" for 0.5 ETH)"1000" USDC (USDC has 6 decimals) → 1000000000 raw units"1.5" ETH (ETH has 18 decimals) → 1500000000000000000 raw units50 = 0.5% (tight, for stable pairs)100 = 1% (standard)300 = 3% (volatile pairs or cross-chain)maxSlippageBps will be rejected"ethereum" (Ethereum mainnet)"arbitrum" (Arbitrum One)"sonic" (Sonic hub chain)"base" (Base)"optimism" (Optimism)"avalanche" (Avalanche)"bsc" (BNB Smart Chain)"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" (USDC on Ethereum)"0x4200000000000000000000000000000000000006" (WETH on Base)walletId stringrecipient: Optional destination address (defaults to wallet address)timeoutMs: Optional operation timeout in millisecondspolicyId: Optional policy profile selector for custom limitsdstChainId: For cross-chain money market - destination chain for the operationComplete workflow for executing a token swap:
Step 1: Discovery (if needed)
→ amped_supported_chains
→ amped_supported_tokens(module="swaps", chainId="ethereum")
Step 2: Get Quote
→ amped_swap_quote(
walletId="main",
srcChainId="ethereum",
dstChainId="arbitrum",
srcToken="0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
dstToken="0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
amount="1000",
type="exact_input",
slippageBps=100
)
← Returns: { quoteId, expectedOutput, slippageBps, fees, deadline }
Step 3: Review Quote
✓ Check slippageBps ≤ maxSlippageBps (configurable, default 100)
✓ Verify expectedOutput meets requirements
✓ Confirm fees are acceptable
✓ Confirm src/dst tokens are solver-compatible for the selected route
Step 4: Execute Swap
→ amped_swap_execute(
walletId="main",
quote=<quote from step 2>,
maxSlippageBps=100,
skipSimulation=false
)
← Returns: { status, message, spokeTxHash, hubTxHash, intentHash, fulfillmentTxHash?, tracking }
Step 5: Verify Status
→ amped_swap_status(txHash=spokeTxHash)
← Returns: { status, spokeTxHash, hubTxHash, fulfillmentTxHash?, tracking, ...intentDetails }
Step 6: Handle Failures (if needed)
→ amped_swap_cancel(walletId="main", intent=<intent>, srcChainId="ethereum")
Complete workflow for bridging tokens between chains:
Step 1: Discover Routes
→ amped_bridge_discover(
srcChainId="ethereum",
dstChainId="sonic",
srcToken="0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
)
← Returns: { bridgeableTokens: [...] }
Step 2: Get Bridge Quote
→ amped_bridge_quote(
srcChainId="ethereum",
dstChainId="sonic",
srcToken="0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
dstToken="0x29219dd400f2bf60e5a23d13be72b486d4038894"
)
← Returns: { isBridgeable: true, maxBridgeableAmount: "1000000" }
Step 3: Review Limits
✓ Verify isBridgeable === true
✓ Check amount ≤ maxBridgeableAmount
✓ Confirm amount within policy limits
Step 4: Execute Bridge
→ amped_bridge_execute(
walletId="main",
srcChainId="ethereum",
dstChainId="sonic",
srcToken="0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
dstToken="0x29219dd400f2bf60e5a23d13be72b486d4038894",
amount="5000",
recipient="0x..." // optional, defaults to wallet
)
← Returns: { spokeTxHash, hubTxHash }
Complete workflow for supplying to and monitoring money market positions:
Step 1: View Available Markets
→ amped_money_market_reserves(chainId="sonic")
← Returns: { reserves: [
{ token: "USDC", supplyAPY: "4.5%", totalSupplied: "..." },
{ token: "WETH", supplyAPY: "2.1%", totalSupplied: "..." }
]}
Step 2: Check Current Positions (RECOMMENDED: use cross-chain view)
→ amped_cross_chain_positions(walletId="main")
← Returns: {
summary: {
totalSupplyUsd: "15000.00",
totalBorrowUsd: "5000.00",
netWorthUsd: "10000.00",
availableBorrowUsd: "7000.00",
healthFactor: "2.55",
healthFactorStatus: { status: "healthy", color: "green" },
liquidationRisk: "none",
weightedSupplyApy: "4.25%",
weightedBorrowApy: "3.50%",
netApy: "1.08%"
},
chainBreakdown: [...],
collateralUtilization: {...},
riskMetrics: {...},
positions: [...],
recommendations: ["💡 You have $7000.00 in available borrowing power."]
}
Step 3: Supply Tokens
→ amped_mm_supply(
walletId="main",
chainId="sonic",
token="0x29219dd400f2bf60e5a23d13be72b486d4038894",
amount="1000",
useAsCollateral=true // Use as collateral for borrowing
)
← Returns: { txHash, spokeTxHash, hubTxHash }
Step 4: Verify Position Update (cross-chain view)
→ amped_cross_chain_positions(walletId="main")
← Returns: Updated positions reflecting the new supply across all chains
The amped_cross_chain_positions tool provides a unified portfolio view across all chains. This is the recommended way to check money market positions.
What it shows:
Example Response:
{
"success": true,
"walletId": "main",
"address": "0x...",
"timestamp": "2026-02-02T12:58:27.999Z",
"summary": {
"totalSupplyUsd": "25000.00",
"totalBorrowUsd": "8000.00",
"netWorthUsd": "17000.00",
"availableBorrowUsd": "12000.00",
"healthFactor": "2.65",
"healthFactorStatus": { "status": "healthy", "color": "green" },
"liquidationRisk": "none",
"weightedSupplyApy": "4.52%",
"weightedBorrowApy": "3.21%",
"netApy": "2.89%"
},
"chainBreakdown": [
{ "chainId": "ethereum", "supplyUsd": "15000.00", "borrowUsd": "5000.00", "healthFactor": "2.80" },
{ "chainId": "arbitrum", "supplyUsd": "5000.00", "borrowUsd": "2000.00", "healthFactor": "2.50" },
{ "chainId": "sonic", "supplyUsd": "5000.00", "borrowUsd": "1000.00", "healthFactor": "5.00" }
],
"collateralUtilization": {
"totalCollateralUsd": "20000.00",
"usedCollateralUsd": "8000.00",
"availableCollateralUsd": "12000.00",
"utilizationRate": "40.00%"
},
"riskMetrics": {
"maxLtv": "80.00%",
"currentLtv": "32.00%",
"bufferUntilLiquidation": "53.00%",
"safeMaxBorrowUsd": "13600.00"
},
"recommendations": [
"💡 You have $12000.00 in available borrowing power.",
"🌐 You have positions across 3 chains. Monitor each chain's health factor independently."
]
}
When to use:
When presenting portfolio summaries to users:
╔ ╗ ╚ ╝ ╠ ╣ ═ ┌ ┐ └ ┘ ─•, ├, └) with minimal spacingExample:
📊 Portfolio Summary $XX.XX
├ wallets: N | chains: N
├ MM active: ✅
├ 🔑 Main $XX.XX
├ 0xD4f9...011c5
├ 🟦 Base 0.002 ETH $12.48
├ ⚡ LL 0.001 ETH $7.55
├ 💰 MM
└ 🟦 Base $21/$12.5 HF1.34 🟠
Key Feature: Borrow tokens to a different chain than where your collateral is supplied!
Scenario: Supply USDC on Ethereum, borrow USDT to Arbitrum
Step 1: Verify Collateral Position on Source Chain
→ amped_money_market_positions(walletId="main", chainId="ethereum")
← Returns: { positions: [...], totalCollateralUSD, availableBorrowUSD, healthFactor }
Step 2: Check Borrow Capacity
✓ Verify availableBorrowUSD > desired borrow amount
✓ Check healthFactor will remain safe after borrow
Step 3: Cross-Chain Borrow
→ amped_mm_borrow(
walletId="main",
chainId="ethereum", // Source chain (where collateral is)
dstChainId="arbitrum", // Destination chain (where you receive borrowed tokens)
token="0xaf88d065e77c8cC2239327C5EDb3A432268e5831", // USDT on Arbitrum
amount="500",
interestRateMode=2 // Variable rate
)
← Returns: {
txHash,
spokeTxHash, // On Ethereum (source)
hubTxHash,
dstSpokeTxHash, // On Arbitrum (destination)
isCrossChain: true
}
Step 4: Verify Position
→ amped_money_market_positions(walletId="main", chainId="ethereum")
← Returns: Updated positions with new borrow recorded
Step 5: Verify Received Tokens on Destination Chain
→ amped_wallet_address(walletId="main")
← Check USDT balance on Arbitrum via external means or position query
Scenario: Supply tokens on Arbitrum, collateral recorded on Sonic
Step 1: Supply with Cross-Chain Flag
→ amped_mm_supply(
walletId="main",
chainId="arbitrum", // Source chain (where tokens are)
dstChainId="sonic", // Destination chain (where collateral is recorded)
token="0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
amount="1000",
useAsCollateral=true
)
← Returns: {
txHash,
isCrossChain: true,
message: "Tokens supplied on arbitrum. Collateral available on sonic."
}
Step 2: Verify on Destination Chain
→ amped_money_market_positions(walletId="main", chainId="sonic")
← Returns: Collateral should appear on Sonic
Complete workflow for repaying borrowed tokens:
Step 1: Check Borrow Position
→ amped_money_market_positions(walletId="main", chainId="sonic")
← Returns: { positions: [...], totalBorrowUSD, healthFactor }
Step 2: Repay (Full or Partial)
Option A - Partial Repay:
→ amped_mm_repay(
walletId="main",
chainId="sonic",
token="0x...",
amount="500"
)
Option B - Full Repay:
→ amped_mm_repay(
walletId="main",
chainId="sonic",
token="0x...",
repayAll=true
)
Step 3: Verify Repayment
→ amped_money_market_positions(walletId="main", chainId="sonic")
← Returns: Updated positions with reduced borrow, improved healthFactor
Complete workflow for withdrawing supplied tokens:
Step 1: Check Position and Available Liquidity
→ amped_money_market_positions(walletId="main", chainId="sonic")
← Verify: withdrawal won't cause healthFactor to drop below safe level
← Verify: sufficient available liquidity in reserve
Step 2: Withdraw
→ amped_mm_withdraw(
walletId="main",
chainId="sonic",
token="0x...",
amount="500",
withdrawType="default" // Options: default, collateral, all
)
← Returns: { txHash, spokeTxHash, hubTxHash }
If attempting near-full withdrawal:
→ prefer withdrawType="all"
OR reduce manual amount slightly (e.g., 99.5% of visible balance)
Step 3: Verify Withdrawal
→ amped_money_market_positions(walletId="main", chainId="sonic")
← Returns: Updated positions with reduced supply
User: "I have USDC on Ethereum. I want to borrow USDC on Base without moving my collateral."
Agent actions:
1. Check positions on Ethereum
→ amped_money_market_positions(walletId="main", chainId="ethereum")
2. Supply USDC on Ethereum
→ amped_mm_supply(
walletId="main",
chainId="ethereum",
token="0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
amount="10000",
useAsCollateral=true
)
3. Cross-chain borrow to Base
→ amped_mm_borrow(
walletId="main",
chainId="ethereum", // Collateral is here
dstChainId="base", // Receive borrowed tokens here
token="0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", // USDC on Base
amount="5000",
interestRateMode=2
)
4. Verify positions
→ amped_money_market_positions(walletId="main", chainId="ethereum")
→ amped_money_market_positions(walletId="main", chainId="base")
User: "I have collateral on Sonic but I want to withdraw to Arbitrum."
Agent actions:
→ amped_mm_withdraw(
walletId="main",
chainId="sonic", // Collateral source
dstChainId="arbitrum", // Token destination
token="0x...",
amount="1000"
)
| Variable | Description | Default |
|---|---|---|
AMPED_OC_MODE | Operation mode: 'execute' (agent signs) or 'prepare' (returns unsigned txs) | execute |
AMPED_OC_WALLETS_JSON | JSON map of wallet configurations keyed by walletId | {} |
AMPED_OC_RPC_URLS_JSON | JSON map of RPC URLs by chainId | {} |
AMPED_OC_LIMITS_JSON | Policy limits configuration | {} |
AMPED_OC_SODAX_DYNAMIC_CONFIG | Enable dynamic config via sodax.initialize() | false |
AMPED_OC_WALLETS_JSON){
"main": {
"address": "0x...",
"privateKey": "0x..." // Required for execute mode
},
"trading": {
"address": "0x...",
"privateKey": "0x..."
}
}
Security: Private keys are never logged. In prepare mode, only address is required.
AMPED_OC_LIMITS_JSON){
"maxSwapInputUsd": 10000,
"maxBridgeAmountToken": {
"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48": 50000
},
"maxBorrowUsd": 5000,
"maxSlippageBps": 100,
"allowedChains": ["ethereum", "arbitrum", "sonic", "base"],
"allowedTokensByChain": {
"ethereum": ["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "0x..."]
},
"blockedRecipients": ["0x..."]
}
AMPED_OC_RPC_URLS_JSON){
"ethereum": "https://eth-mainnet.g.alchemy.com/v2/...",
"arbitrum": "https://arb-mainnet.g.alchemy.com/v2/...",
"base": "https://base-mainnet.g.alchemy.com/v2/...",
"sonic": "https://rpc.soniclabs.com"
}
Policy violations return structured errors with:
code: Error code (e.g., POLICY_SLIPPAGE_EXCEEDED)message: Human-readable descriptionremediation: Suggested action to resolvecurrent: Current value that violated policylimit: Configured limit| Code | Description | Remediation |
|---|---|---|
POLICY_SLIPPAGE_EXCEEDED | Quote slippage exceeds maxSlippageBps | Increase maxSlippageBps or wait for better conditions |
POLICY_SPEND_LIMIT_EXCEEDED | Amount exceeds per-transaction or daily limit | Reduce amount or request limit increase |
POLICY_CHAIN_NOT_ALLOWED | Chain not in allowedChains | Add chain to allowedChains or use different chain |
POLICY_TOKEN_NOT_ALLOWED | Token not in allowedTokensByChain | Add token to allowlist or use different token |
INSUFFICIENT_BALANCE | Wallet balance < requested amount | Reduce amount or fund wallet |
INSUFFICIENT_ALLOWANCE | Token allowance < requested amount | Tool will auto-approve, or approve manually |
QUOTE_EXPIRED | Quote deadline has passed | Get fresh quote |
QUOTE_UNSUPPORTED_TOKEN | Token is not currently solver-compatible on selected chain | Use compatible assets and re-quote |
BRIDGE_NOT_AVAILABLE | Token pair not bridgeable | Use swap for different tokens or different route |
MM_HEALTH_FACTOR_LOW | Operation would cause liquidation risk | Repay debt or add collateral first |
MM_CROSS_CHAIN_NOT_SUPPORTED | Cross-chain operation not supported for this pair | Use same-chain operation or different token/chain |
For swap execution:
For money market operations (supply, borrow, withdraw, repay):
Execute tools accept an optional clientOperationId parameter for idempotency:
clientOperationId to prevent duplicateswalletId and never shared across agentswalletId only; never passed as parameters| Mode | Signing | Use Case |
|---|---|---|
execute | Agent signs with private key | Automated agents, server-side operations |
prepare | Returns unsigned tx for external signing | Hardware wallets, air-gapped signing, multi-sig |
Structured logs include:
requestId: Unique request identifieragentId: Agent identifier (if available)walletId: Wallet identifieropType: Operation type (swap, bridge, supply, etc.)chainIds, tokenAddresses: Operation contexttxHashes: Transaction hashes (for tracing)Never logged: Private keys, full wallet JSON, sensitive configuration
SonicSpokeProvider instead of EvmSpokeProviderEvmSpokeProvider for standard EVM chains (Ethereum, Arbitrum, Base, etc.)┌─────────────────────────────────────────────────────────────────┐
│ SODAX Money Market Flow │
├─────────────────────────────────────────────────────────────────┤
│ │
│ Cross-Chain Borrow Example: │
│ Supply USDC on Ethereum → Borrow USDT on Arbitrum │
│ │
│ ┌─────────────┐ ┌─────────┐ ┌─────────────┐ │
│ │ Ethereum │ ──────► │ Sonic │ ──────► │ Arbitrum │ │
│ │ (Supply) │ │ (Hub) │ │ (Borrow) │ │
│ └─────────────┘ └─────────┘ └─────────────┘ │
│ │ │ │ │
│ │ 1. Supply USDC │ │ │
│ │ 2. Record collateral│ │ │
│ │─────────────────────►│ │ │
│ │ │ 3. Verify collateral│ │
│ │ │ 4. Process borrow │ │
│ │ │────────────────────►│ │
│ │ │ │ 5. Deliver│
│ │ │ │ USDT │
│ │ │ │ │
│ │
│ Key Insight: Your collateral stays on the source chain, │
│ but you receive borrowed tokens on the destination chain! │
│ │
└─────────────────────────────────────────────────────────────────┘
User: "Swap 100 USDC for ETH on Ethereum"
Agent actions:
1. amped_swap_quote(
walletId="main",
srcChainId="ethereum",
dstChainId="ethereum",
srcToken="0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
dstToken="0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
amount="100",
type="exact_input",
slippageBps=100
)
2. Review quote (slippage 0.8%, expected output 0.042 ETH)
3. amped_swap_execute(walletId="main", quote=<quote>, maxSlippageBps=100)
4. amped_swap_status(txHash=<spokeTxHash>)
User: "Bridge 1000 USDC from Ethereum to Sonic"
Agent actions:
1. amped_bridge_discover(srcChainId="ethereum", dstChainId="sonic", srcToken="0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48")
2. amped_bridge_quote(srcChainId="ethereum", dstChainId="sonic", srcToken="0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", dstToken="0x29219dd400f2bf60e5a23d13be72b486d4038894")
3. amped_bridge_execute(walletId="main", srcChainId="ethereum", dstChainId="sonic", srcToken="0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", dstToken="0x29219dd400f2bf60e5a23d13be72b486d4038894", amount="1000")
User: "Supply 5000 USDC and borrow 2000 USDT on Sonic"
Agent actions:
1. amped_money_market_reserves(chainId="sonic")
2. amped_mm_supply(walletId="main", chainId="sonic", token="0x29219dd400f2bf60e5a23d13be72b486d4038894", amount="5000")
3. amped_money_market_positions(walletId="main", chainId="sonic")
4. amped_mm_borrow(walletId="main", chainId="sonic", token="0x...usdt...", amount="2000")
5. amped_money_market_positions(walletId="main", chainId="sonic") // Verify new health factor
User: "I want to use my USDC on Ethereum as collateral to borrow USDC on Arbitrum for a trading opportunity"
Agent actions:
1. Verify supported chains and tokens
→ amped_supported_tokens(module="moneyMarket", chainId="ethereum")
→ amped_supported_tokens(module="moneyMarket", chainId="arbitrum")
2. Check current positions
→ amped_money_market_positions(walletId="main", chainId="ethereum")
→ amped_money_market_positions(walletId="main", chainId="arbitrum")
3. Supply USDC on Ethereum
→ amped_mm_supply(
walletId="main",
chainId="ethereum",
token="0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
amount="50000",
useAsCollateral=true
)
4. Cross-chain borrow to Arbitrum
→ amped_mm_borrow(
walletId="main",
chainId="ethereum", // Source: collateral is here
dstChainId="arbitrum", // Destination: receive tokens here
token="0xaf88d065e77c8cC2239327C5EDb3A432268e5831", // USDC on Arbitrum
amount="20000",
interestRateMode=2
)
5. Verify the cross-chain borrow worked
→ Check positions on Ethereum (collateral + debt recorded)
→ Check USDC balance on Arbitrum (borrowed tokens received)
Result: User has 20k USDC on Arbitrum to trade with, while their 50k USDC collateral remains on Ethereum!
Critical: ALL DeFi operations MUST route through the SODAX SDK first. External wallet backends (like Bankr) are used ONLY for transaction execution—never for routing decisions.
┌─────────────────────────────────────────────────────────────────┐
│ SODAX SDK (Routing Layer) │
│ ✓ Calculates optimal swap routes │
│ ✓ Determines bridge paths │
│ ✓ Manages money market intents │
│ ✓ Handles slippage, fees, deadlines │
│ ✓ Prepares transaction data (to, data, value) │
└───────────────────────────┬─────────────────────────────────────┘
│
▼ raw transaction data
┌─────────────────────────────────────────────────────────────────┐
│ Wallet Backend (Execution Layer ONLY) │
│ ✓ Signs the pre-computed transaction │
│ ✓ Submits to blockchain │
│ ✓ Returns transaction hash │
│ ✗ NO routing decisions │
│ ✗ NO token swapping logic │
│ ✗ NO DeFi protocol selection │
└─────────────────────────────────────────────────────────────────┘
| Backend | Description | Use Case |
|---|---|---|
localKey | Direct signing via private key from ~/.evm-wallet.json or config | Default, self-custody |
bankr | Bankr API for transaction submission | Managed wallets via Bankr |
The wallet backend is selected via:
config.json → walletBackend: "bankr" | "localKey"AMPED_OC_WALLET_BACKENDlocalKeyWhen walletBackend: "bankr" is configured:
{to, data, value, chainId} is sentThis ensures:
// ~/.openclaw/extensions/amped-defi/config.json
{
"walletBackend": "bankr",
"bankrApiKey": "bk_...",
"bankrApiUrl": "https://api.bankr.bot",
"bankrWalletAddress": "0x..."
}
Security Note: The Bankr API key is stored locally and never exposed in tool parameters or logs.