Arcadia Finance

Tags

registry.modelcontextprotocol.io

Configuration

{
  "mcpServers": {
    "mcp-server": {
      "url": "https://mcp.arcadia.finance/mcp",
      "type": "http"
    }
  },
  "requiresAuth": true,
  "requiresOAuth": false
}

Available Tools (38)

read_account_info

Get full overview of an Arcadia account: health factor, collateral value, debt, deposited assets, liquidation price, and automation status. Health factor = 1 - (used_margin / liquidation_value): 1 = no debt (safest), >0 = healthy, 0 = liquidation threshold, <0 = past liquidation. Higher is safer. On Base, also returns which asset managers are enabled (rebalancer, compounder, yield_claimer, merkl_operator, cow_swapper). LP positions in assets[] include a dex_protocol field (slipstream, slipstream_v2, staked_slipstream, staked_slipstream_v2, uniV3, uniV4) — use this as the dex_protocol param for write_asset_manager.* tools. The automation object uses internal AM key names (slipstreamV1, slipstreamV2, uniV3, uniV4): map slipstreamV1 → 'slipstream'/'staked_slipstream', slipstreamV2 → 'slipstream_v2'/'staked_slipstream_v2', uniV3 → 'uniV3', uniV4 → 'uniV4'. Numeric fields without a _usd suffix are in the account's numeraire token raw units (divide by 10^decimals: 6 for USDC, 18 for WETH, 8 for cbBTC). Fields ending in _usd are in USD with 18 decimals (divide by 1e18). health_factor is unitless. Asset amounts are raw token units. To list all accounts for a wallet, use read_wallet_accounts.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "account_address"
  ],
  "properties": {
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    },
    "account_address": {
      "type": "string",
      "description": "Arcadia account address"
    }
  },
  "additionalProperties": false
}

read_account_history

Get historical collateral and debt values for an Arcadia account over time. Returns a time series of snapshots (timestamp, collateral_value, debt_value, net_value). Each value is the account's net value in USD (human-readable, not raw units). Useful for charting account performance over a period.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "account_address"
  ],
  "properties": {
    "days": {
      "type": "number",
      "default": 14,
      "description": "Number of days of history (default 14)"
    },
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    },
    "account_address": {
      "type": "string",
      "description": "Arcadia account address"
    }
  },
  "additionalProperties": false
}

read_account_pnl

Get PnL (cost basis) and yield earned for an Arcadia account. Returns lifetime totals: cost basis vs current value (negative cost_basis = net profit withdrawn), net transfers per token, total yield earned in USD and per token. cost_basis, current_value, cost_diff are in USD (human-readable). Per-token fields (net_transfers, summed_yields_earned) are in raw token units.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "account_address"
  ],
  "properties": {
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    },
    "account_address": {
      "type": "string",
      "description": "Arcadia account address"
    }
  },
  "additionalProperties": false
}

read_pool_list

List all Arcadia lending pools: TVL, utilization, available liquidity. Key fields: interest_rate = current borrow cost, lending_apy = lender yield. All rates are decimal fractions (1.0 = 100%, 0.06 = 6%). For APY history on a specific pool, use read_pool_info.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "properties": {
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    }
  },
  "additionalProperties": false
}

read_pool_info

Get detailed info for a single lending pool including APY history over time. Useful for analyzing rate trends and comparing pools. Use read_pool_list to discover pool addresses.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "pool_address"
  ],
  "properties": {
    "days": {
      "type": "number",
      "default": 14,
      "description": "Number of days of APY history"
    },
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    },
    "pool_address": {
      "type": "string",
      "description": "Pool address"
    }
  },
  "additionalProperties": false
}

read_asset_list

List supported collateral assets on Arcadia. Returns compact list (address, symbol, decimals, type). Use search to filter by symbol substring. For USD prices, use read_asset_prices.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "properties": {
    "search": {
      "type": "string",
      "description": "Filter assets by symbol (case-insensitive substring match)"
    },
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    }
  },
  "additionalProperties": false
}

read_asset_prices

Get USD prices for one or more asset addresses. Pass a single address or comma-separated addresses. Returns a price map keyed by address.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "asset_addresses"
  ],
  "properties": {
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    },
    "asset_addresses": {
      "type": "string",
      "description": "Single address or comma-separated addresses for price lookup"
    }
  },
  "additionalProperties": false
}

read_strategy_list

Get Arcadia LP strategies. Use featured_only=true for curated top strategies (recommended first call). Returns a paginated list with 7d avg APY for each strategy's default range. Increase limit or use offset for pagination. All APY values are decimal fractions (1.0 = 100%, 0.05 = 5%). For full detail on a specific strategy (APY per range width), use read_strategy_info.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "properties": {
    "limit": {
      "type": "number",
      "default": 25,
      "description": "Max strategies to return (default 25)"
    },
    "offset": {
      "type": "number",
      "default": 0,
      "description": "Skip first N strategies for pagination"
    },
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    },
    "featured_only": {
      "type": "boolean",
      "default": false,
      "description": "Return only featured/curated strategies (recommended)"
    }
  },
  "additionalProperties": false
}

read_strategy_info

Get full detail for a specific LP strategy by ID — includes APY per range width (narrower range = higher APY but more rebalancing cost/risk), pool info, and configuration. Use read_strategy_list to discover strategy IDs. All APY values are decimal fractions (1.0 = 100%, 0.05 = 5%).

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "strategy_id"
  ],
  "properties": {
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    },
    "strategy_id": {
      "type": "number",
      "description": "Strategy ID"
    }
  },
  "additionalProperties": false
}

read_strategy_recommendation

Get a rebalancing recommendation for an Arcadia account — suggests asset changes to optimize yield. Uses 1d APY (not 7d like read_strategy_list), so recommended strategies may differ from the list ranking. APY values are decimal fractions (0.05 = 5%). weekly_earning_difference is in USD.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "account_address"
  ],
  "properties": {
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    },
    "account_address": {
      "type": "string",
      "description": "Arcadia account address"
    }
  },
  "additionalProperties": false
}

read_point_leaderboard

Get the Arcadia points leaderboard (paginated). For a specific wallet's points balance, use read_wallet_points.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "properties": {
    "limit": {
      "type": "number",
      "default": 25,
      "description": "Max leaderboard entries to return (default 25)"
    },
    "offset": {
      "type": "number",
      "default": 0,
      "description": "Skip first N leaderboard entries for pagination"
    }
  },
  "additionalProperties": false
}

read_guides

Get Arcadia workflow guides and reference documentation. Call this before multi-step workflows (opening LP positions, enabling automation, closing positions) or when you need contract addresses, asset manager addresses, or strategy parameters. Topics: overview (addresses + tool catalog), automation (rebalancer/compounder setup), strategies (step-by-step templates), selection (how to evaluate and parameterize strategies).

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "properties": {
    "topic": {
      "enum": [
        "overview",
        "automation",
        "strategies",
        "selection"
      ],
      "type": "string",
      "description": "overview = addresses + tool catalog, automation = rebalancer/compounder/claimer setup, strategies = step-by-step LP templates, selection = pool evaluation + leverage sizing"
    }
  },
  "additionalProperties": false
}

read_wallet_balances

Get native ETH and ERC20 token balances for a wallet address. Reads directly from chain via RPC multicall. Use before write_account_add_liquidity or write_account_deposit to verify the wallet has sufficient tokens. Returns both raw balance (smallest unit/wei) and formatted (human-readable) per token.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "wallet_address",
    "token_addresses"
  ],
  "properties": {
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    },
    "wallet_address": {
      "type": "string",
      "description": "Wallet address to check balances for"
    },
    "token_addresses": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "ERC20 token contract addresses to check"
    }
  },
  "additionalProperties": false
}

read_wallet_allowances

Check ERC20 token allowances for a spender address. Use before write_wallet_approve to avoid redundant approvals — skip approving if the current allowance is already sufficient.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "owner_address",
    "spender_address",
    "token_addresses"
  ],
  "properties": {
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    },
    "owner_address": {
      "type": "string",
      "description": "Token owner address (the wallet granting approval)"
    },
    "spender_address": {
      "type": "string",
      "description": "Spender address to check allowance for (e.g. Arcadia account address)"
    },
    "token_addresses": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "ERC20 token contract addresses to check"
    }
  },
  "additionalProperties": false
}

read_wallet_accounts

List all Arcadia accounts owned by a wallet address. Returns a summary of each account (address, name). Call read_account_info with a specific account_address for full details like health factor, collateral, and debt.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "wallet_address"
  ],
  "properties": {
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    },
    "wallet_address": {
      "type": "string",
      "description": "Wallet address to list accounts for"
    }
  },
  "additionalProperties": false
}

read_wallet_points

Get Arcadia points balance for a specific wallet address.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "wallet_address"
  ],
  "properties": {
    "wallet_address": {
      "type": "string",
      "description": "Wallet address to get points for"
    }
  },
  "additionalProperties": false
}

read_asset_manager_intents

List all available automation intents with their tool names, required parameters, and supported chains. Use this to discover which automations can be configured and what each one does. Each intent has a corresponding write_asset_manager.{id} tool that returns encoded args. To apply automations, call the intent tools then pass the combined result to write_account_set_asset_managers. All intent tools accept enabled=false to disable. Multiple intents can be combined by merging their returned arrays into a single set_asset_managers call.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "properties": {
    "chain_id": {
      "type": "number",
      "description": "Filter to automations available on this chain. Omit to see all."
    }
  },
  "additionalProperties": false
}

write_account_create

Build an unsigned transaction to create a new Arcadia account via the Factory contract. account_version: 3 with creditor → V3 margin account (can borrow/leverage). account_version: 0 or 4 → V4 spot account (no borrowing, creditor is ignored, any ERC20 allowed). Returns the predicted account address (deterministic via CREATE2).

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "salt",
    "wallet_address"
  ],
  "properties": {
    "salt": {
      "type": "number",
      "description": "Unique salt (uint32) for deterministic account address"
    },
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    },
    "creditor": {
      "type": "string",
      "description": "Lending pool address for V3 margin account. Ignored for V4 spot accounts (version 0 or 4)."
    },
    "wallet_address": {
      "type": "string",
      "description": "Wallet address that will send the transaction (tx.origin, needed for address prediction)"
    },
    "account_version": {
      "type": "number",
      "default": 0,
      "description": "Account version: 0 = latest (V4 spot), 3 = margin (can borrow). 1/2 = legacy."
    }
  },
  "additionalProperties": false
}

write_account_deposit

Build an unsigned transaction to deposit assets into an Arcadia account as collateral. Supports ERC20 tokens and ERC721 NFTs (LP positions). NOT needed before write_account_add_liquidity — that tool deposits from wallet atomically. Ensure the account is approved first (call read_wallet_allowances to check, then write_wallet_approve if needed). Account version is auto-detected on-chain (override with account_version if needed).

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "account_address",
    "asset_addresses",
    "asset_amounts"
  ],
  "properties": {
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    },
    "asset_ids": {
      "type": "array",
      "items": {
        "type": "number"
      },
      "description": "Token IDs: 0 for ERC20, NFT token ID for ERC721"
    },
    "asset_types": {
      "type": "array",
      "items": {
        "type": "number"
      },
      "description": "V4 only. Asset types per asset: 1=ERC20, 2=ERC721, 3=ERC1155. If omitted, inferred from asset_ids (non-zero → ERC721)."
    },
    "asset_amounts": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Amounts in raw units/wei, one per asset"
    },
    "account_address": {
      "type": "string",
      "description": "Arcadia account address"
    },
    "account_version": {
      "type": "number",
      "description": "Override account version (3 or 4). Auto-detected on-chain if omitted."
    },
    "asset_addresses": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Token contract addresses to deposit"
    }
  },
  "additionalProperties": false
}

write_account_withdraw

Build an unsigned transaction to withdraw assets from an Arcadia account to the owner's wallet. Only the account owner can withdraw. Will revert if the account has debt and withdrawal would make it undercollateralized. Does not support max_uint256 — pass exact amounts from read_account_info. Account version is auto-detected on-chain (override with account_version if needed).

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "account_address",
    "asset_addresses",
    "asset_amounts"
  ],
  "properties": {
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    },
    "asset_ids": {
      "type": "array",
      "items": {
        "type": "number"
      },
      "description": "Token IDs: 0 for ERC20, NFT token ID for ERC721"
    },
    "asset_types": {
      "type": "array",
      "items": {
        "type": "number"
      },
      "description": "V4 only. Asset types per asset: 1=ERC20, 2=ERC721, 3=ERC1155. If omitted, inferred from asset_ids (non-zero → ERC721)."
    },
    "asset_amounts": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Amounts in raw units/wei, one per asset"
    },
    "account_address": {
      "type": "string",
      "description": "Arcadia account address"
    },
    "account_version": {
      "type": "number",
      "description": "Override account version (3 or 4). Auto-detected on-chain if omitted."
    },
    "asset_addresses": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Token contract addresses to withdraw"
    }
  },
  "additionalProperties": false
}

write_account_borrow

Build an unsigned transaction to borrow from an Arcadia lending pool against account collateral. NOT needed for leveraged LP — write_account_add_liquidity handles borrowing internally when leverage > 0. Only works with margin accounts (created with a creditor/lending pool). Spot accounts (no creditor) cannot borrow — the tool will validate this and reject. Before borrowing, verify the account has positive free margin via read_account_info: collateral_value must exceed used_margin.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "pool_address",
    "account_address",
    "amount",
    "to"
  ],
  "properties": {
    "to": {
      "type": "string",
      "description": "Address to receive borrowed tokens"
    },
    "amount": {
      "type": "string",
      "description": "Amount in raw units"
    },
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    },
    "pool_address": {
      "type": "string",
      "description": "Lending pool: LP_WETH=0x803ea69c7e87D1d6C86adeB40CB636cC0E6B98E2, LP_USDC=0x3ec4a293Fb906DD2Cd440c20dECB250DeF141dF1, LP_CBBTC=0xa37E9b4369dc20940009030BfbC2088F09645e3B"
    },
    "account_address": {
      "type": "string",
      "description": "Arcadia account address used as collateral"
    }
  },
  "additionalProperties": false
}

write_account_repay

Repay debt to an Arcadia lending pool using tokens from the wallet (requires ERC20 allowance). To repay using account collateral instead (no wallet tokens needed), use write_account_deleverage. Check allowance first (read_wallet_allowances), then approve the pool if needed (write_wallet_approve). Check outstanding debt with read_account_info.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "pool_address",
    "account_address",
    "amount"
  ],
  "properties": {
    "amount": {
      "type": "string",
      "description": "Amount in raw units, or 'max_uint256' to repay all debt in full"
    },
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    },
    "pool_address": {
      "type": "string",
      "description": "Lending pool address. Base: LP_WETH=0x803ea69c7e87D1d6C86adeB40CB636cC0E6B98E2, LP_USDC=0x3ec4a293Fb906DD2Cd440c20dECB250DeF141dF1, LP_CBBTC=0xa37E9b4369dc20940009030BfbC2088F09645e3B"
    },
    "account_address": {
      "type": "string",
      "description": "Arcadia account address with debt"
    }
  },
  "additionalProperties": false
}

write_account_add_liquidity

Multi-step flash-action: atomically combines [deposit from wallet] + [use account collateral] + [swap to optimal ratio] + [mint LP] + [borrow if leveraged] in ONE transaction. Do NOT call write_account_deposit separately. Capital sources: wallet tokens (deposits array), existing account collateral (use_account_assets=true), or both. Check allowances first (read_wallet_allowances), then approve if needed (write_wallet_approve). Supports depositing multiple tokens and minting multiple LP positions in one tx. Works with both margin accounts (can leverage) and spot accounts (no leverage). For workflows, call read_guides('strategies'). The returned calldata is time-sensitive — sign and broadcast within 30 seconds. If the transaction reverts due to price movement, rebuild and sign again immediately (retry at least once before giving up). Response includes tenderly_sim_url and tenderly_sim_status for pre-broadcast validation. expected_value_change is in raw units of the account's numeraire token (6 decimals for USDC, 18 for WETH). Negative = cost to open, positive = value gained. Compare before.total_account_value and after.total_account_value for the full picture.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "account_address",
    "wallet_address",
    "positions"
  ],
  "properties": {
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    },
    "deposits": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "asset",
          "amount"
        ],
        "properties": {
          "asset": {
            "type": "string",
            "description": "Token address to deposit from wallet"
          },
          "amount": {
            "type": "string",
            "description": "Amount in raw units"
          },
          "decimals": {
            "type": "number",
            "description": "Token decimals (e.g. 6 for USDC, 18 for WETH). Default 18."
          }
        },
        "additionalProperties": false
      },
      "description": "Wallet tokens to deposit. Approve each token first (write.wallet.approve). Omit to use only account collateral."
    },
    "leverage": {
      "type": "number",
      "default": 0,
      "description": "0 = no borrow, 2 = 2x leverage. Margin accounts only."
    },
    "slippage": {
      "type": "number",
      "default": 100,
      "description": "Basis points, 100 = 1%"
    },
    "positions": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "strategy_id"
        ],
        "properties": {
          "tick_lower": {
            "type": "number",
            "description": "Lower tick for concentrated range. Omit for full range."
          },
          "tick_upper": {
            "type": "number",
            "description": "Upper tick for concentrated range. Omit for full range."
          },
          "strategy_id": {
            "type": "number",
            "description": "From read.strategy.list (or read.strategy.info for full range detail)"
          }
        },
        "additionalProperties": false
      },
      "description": "LP positions to mint. For a single position, pass one entry."
    },
    "wallet_address": {
      "type": "string",
      "description": "Wallet address of the account owner"
    },
    "account_address": {
      "type": "string",
      "description": "Arcadia account address"
    },
    "use_account_assets": {
      "type": "boolean",
      "default": false,
      "description": "If true, use ALL existing account collateral for LP minting. Fetched automatically."
    }
  },
  "additionalProperties": false
}

write_account_remove_liquidity

Flash-action: PARTIALLY decreases liquidity from an LP position. The position remains open with reduced liquidity; underlying tokens stay in the account. For FULL position exit (burn LP + swap + repay + withdraw), use write_account_close instead — it batches everything into one atomic transaction. The returned calldata is time-sensitive — sign and broadcast within 30 seconds. If the transaction reverts due to price movement, rebuild and sign again immediately (retry at least once before giving up). Response includes tenderly_sim_url and tenderly_sim_status for pre-broadcast validation.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "account_address",
    "asset_address",
    "asset_id",
    "adjustment"
  ],
  "properties": {
    "asset_id": {
      "type": "number",
      "description": "NFT token ID"
    },
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    },
    "adjustment": {
      "type": "string",
      "description": "Liquidity amount to remove (raw uint128 value as string). Must be less than total liquidity — for full removal use write.account.close."
    },
    "asset_address": {
      "type": "string",
      "description": "Position manager contract"
    },
    "account_address": {
      "type": "string",
      "description": "Arcadia account address"
    }
  },
  "additionalProperties": false
}

write_account_swap

Flash-action: swaps assets within an Arcadia account in one atomic transaction. The backend finds the optimal swap route. NOTE: If you are closing a position (swap + repay + withdraw), prefer write_account_close which batches everything atomically. Only use this tool for standalone swaps within an active position. The returned calldata is time-sensitive — sign and broadcast within 30 seconds. If the transaction reverts due to price movement, rebuild and sign again immediately (retry at least once before giving up). Response includes tenderly_sim_url and tenderly_sim_status for pre-broadcast validation — if tenderly_sim_status is 'false', do NOT broadcast the transaction.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "account_address",
    "asset_from",
    "asset_to",
    "amount_in"
  ],
  "properties": {
    "asset_to": {
      "type": "string",
      "description": "Token address to swap to"
    },
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    },
    "slippage": {
      "type": "number",
      "default": 100,
      "description": "Basis points, 100 = 1%"
    },
    "amount_in": {
      "type": "string",
      "description": "Raw units"
    },
    "asset_from": {
      "type": "string",
      "description": "Token address to swap from"
    },
    "account_address": {
      "type": "string",
      "description": "Arcadia account address"
    }
  },
  "additionalProperties": false
}

write_account_deleverage

Multi-step flash-action: sells account collateral to the debt token and repays in one atomic transaction — no wallet tokens needed. To repay from wallet tokens instead, use write_account_repay. NOTE: If you are closing a position (remove LP + swap + repay + withdraw), prefer write_account_close which batches everything atomically. Only use this tool for standalone repayment while keeping the position active. The returned calldata is time-sensitive — sign and broadcast within 30 seconds. If the transaction reverts due to price movement, rebuild and sign again immediately (retry at least once before giving up). Response includes tenderly_sim_url and tenderly_sim_status for pre-broadcast validation — if tenderly_sim_status is 'false', do NOT broadcast the transaction.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "account_address",
    "amount_in",
    "asset_from",
    "numeraire",
    "creditor"
  ],
  "properties": {
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    },
    "creditor": {
      "type": "string",
      "description": "Lending pool address"
    },
    "slippage": {
      "type": "number",
      "default": 100,
      "description": "Basis points, 100 = 1%"
    },
    "amount_in": {
      "type": "string",
      "description": "Collateral amount to sell (raw units)"
    },
    "numeraire": {
      "type": "string",
      "description": "Debt token address"
    },
    "asset_from": {
      "type": "string",
      "description": "Collateral token to sell"
    },
    "account_address": {
      "type": "string",
      "description": "Arcadia account address"
    }
  },
  "additionalProperties": false
}

write_account_stake

Flash-action: stake, unstake, or claim rewards for an LP position in one atomic transaction. Use the `action` parameter to select the operation. `asset_address` is the position manager contract — pass the non-staked PM address when staking, or the staked PM address when unstaking. The returned calldata is time-sensitive — sign and broadcast within 30 seconds. If the transaction reverts due to price movement, rebuild and sign again immediately (retry at least once before giving up). Tenderly simulation may not be available for this endpoint — verify the position exists with read_account_info before signing.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "account_address",
    "action",
    "asset_address",
    "asset_id"
  ],
  "properties": {
    "action": {
      "enum": [
        "stake",
        "unstake",
        "claim"
      ],
      "type": "string",
      "description": "Action to perform"
    },
    "asset_id": {
      "type": "number",
      "description": "NFT token ID of the LP position"
    },
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    },
    "asset_address": {
      "type": "string",
      "description": "Position manager contract address"
    },
    "account_address": {
      "type": "string",
      "description": "Arcadia account address"
    }
  },
  "additionalProperties": false
}

write_account_close

Atomic flash-action that closes an Arcadia account position in ONE transaction. Combines up to 3 steps atomically: [burn LP position] + [swap all tokens to a single target asset] + [repay debt]. Tokens remain in the account after closing — use write_account_withdraw to send them to your wallet. ALWAYS try this tool first when closing/exiting a position. Only fall back to individual tools (write_account_remove_liquidity, write_account_swap, write_account_deleverage, write_account_withdraw) if this tool fails. Supports two modes: - close_lp_only=true: Burns LP and leaves underlying tokens in the account. Use as step 1 if the full close fails, then call again with close_lp_only=false to swap+repay the remaining tokens. - close_lp_only=false (default): Full atomic close — burns LP, swaps everything to receive_assets, repays debt. Remaining tokens stay in the account. Follow up with write_account_withdraw to send to wallet. Supports multiple receive assets with custom distribution. The returned calldata is time-sensitive — sign and broadcast within 30 seconds. If the transaction reverts due to price movement, rebuild and sign again immediately (retry at least once before giving up). Response includes tenderly_sim_url and tenderly_sim_status for pre-broadcast validation.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "account_address",
    "assets"
  ],
  "properties": {
    "assets": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "asset_address",
          "asset_id",
          "amount",
          "decimals"
        ],
        "properties": {
          "amount": {
            "type": "string",
            "description": "Amount to sell (use '1' for NFT positions)"
          },
          "asset_id": {
            "type": "number",
            "description": "NFT token ID (0 for ERC20 tokens)"
          },
          "decimals": {
            "type": "number",
            "description": "Token decimals (use 1 for NFT positions)"
          },
          "asset_address": {
            "type": "string",
            "description": "Token or position manager address"
          }
        },
        "additionalProperties": false
      },
      "description": "Assets to close/sell from the account. IMPORTANT: For LP positions (NFTs), always use amount='1' and decimals=1 — do NOT pass the liquidity amount. asset_address = position manager, asset_id = NFT token ID. For ERC20 tokens: asset_id = 0, amount = full balance in raw units, decimals = real token decimals. Get all values from read.account.info."
    },
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    },
    "slippage": {
      "type": "number",
      "default": 100,
      "description": "Basis points, 100 = 1%"
    },
    "close_lp_only": {
      "type": "boolean",
      "default": false,
      "description": "true = only burn LP positions, leave underlying tokens in account. false = full close (burn + swap + repay)."
    },
    "receive_assets": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "asset_address",
          "decimals"
        ],
        "properties": {
          "decimals": {
            "type": "number",
            "description": "Token decimals of the target asset"
          },
          "distribution": {
            "type": "number",
            "description": "Fraction of proceeds (0-1). Defaults to equal split across all receive assets."
          },
          "asset_address": {
            "type": "string",
            "description": "Target token address (e.g. USDC, WETH)"
          }
        },
        "additionalProperties": false
      },
      "description": "Target assets to receive after closing. For a single target, pass one entry. Required when close_lp_only=false. Omit for close_lp_only=true."
    },
    "account_address": {
      "type": "string",
      "description": "Arcadia account address"
    }
  },
  "additionalProperties": false
}

write_wallet_approve

Build an unsigned approval transaction. For ERC20 tokens: generates approve(spender, amount). For ERC721/ERC1155 NFTs (e.g. LP positions): generates setApprovalForAll(operator, true). Required before write_account_deposit or write_account_add_liquidity (when depositing from wallet). Tip: call read_wallet_allowances first to check if approval already exists — skip this if the current allowance is sufficient.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "token_address",
    "spender_address"
  ],
  "properties": {
    "amount": {
      "type": "string",
      "default": "max_uint256",
      "description": "ERC20 only: amount in raw units, or 'max_uint256' for unlimited. Ignored for NFTs."
    },
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    },
    "asset_type": {
      "enum": [
        "erc20",
        "erc721",
        "erc1155"
      ],
      "type": "string",
      "default": "erc20",
      "description": "Token type: 'erc20' (default) for fungible tokens, 'erc721' or 'erc1155' for NFTs (LP positions)"
    },
    "token_address": {
      "type": "string",
      "description": "Token contract address to approve"
    },
    "spender_address": {
      "type": "string",
      "description": "Address being approved — use the Arcadia account address for deposits"
    }
  },
  "additionalProperties": false
}

write_asset_manager_rebalancer

Encode args for the rebalancer automation. When the LP position goes out of range, Arcadia's bot repositions it centered on the current price. All pending fees and staking rewards are claimed and compounded into the new position. Strategy config: 'default' (all params at defaults) uses when_out_of_range — rebalances exactly when price exits range. 'custom' (any param differs) uses time_and_price_based_triggers — adds configurable trigger offsets, cooldowns, and token composition. Returns { asset_managers, statuses, datas } — pass to write_account_set_asset_managers to build the unsigned tx. Combinable: merge arrays from multiple intent tools to configure several automations in one tx. trigger_lower_ratio and trigger_upper_ratio are independent — asymmetric configs are valid (e.g. trigger_lower_ratio=-50000, trigger_upper_ratio=0 means: trigger 5% of the tick range before the lower boundary is hit, but only trigger exactly at the upper boundary). Ratios represent tick distance, not price: a ratio of 50000 shifts the trigger by 5% of (tick_upper − tick_lower) ticks, which is not the same as 5% of price.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "dex_protocol"
  ],
  "properties": {
    "enabled": {
      "type": "boolean",
      "default": true,
      "description": "True to enable, false to disable"
    },
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    },
    "dex_protocol": {
      "enum": [
        "slipstream",
        "slipstream_v2",
        "staked_slipstream",
        "staked_slipstream_v2",
        "uniV3",
        "uniV4"
      ],
      "type": "string",
      "description": "DEX protocol of the LP position — used to resolve the correct asset manager address."
    },
    "strategy_hook": {
      "type": "string",
      "description": "Strategy hook address. Defaults to minimal hook. Only override for custom hooks."
    },
    "compound_leftovers": {
      "enum": [
        "all",
        "none",
        "token0",
        "token1"
      ],
      "type": "string",
      "default": "all",
      "description": "What to reinvest after rebalance (default \"all\" = compound both)"
    },
    "max_rebalance_time": {
      "type": "integer",
      "default": 1000000000000,
      "description": "Max seconds before forced rebalance (default 1e12 = effectively disabled)"
    },
    "min_rebalance_time": {
      "type": "integer",
      "default": 3600,
      "description": "Min seconds between rebalances (default 3600 = 1 hour)"
    },
    "trigger_lower_ratio": {
      "type": "integer",
      "default": 0,
      "description": "Offset from tick_lower, as a fraction of the position's tick range, scaled by 1e6. trigger_tick_lower = tick_lower - tick_range * ratio. 0 = trigger at the boundary. Positive (e.g. 50000 = 5% of tick range): trigger tick is outside the position — price must travel further beyond the range before rebalance fires (delayed). Negative (e.g. -50000 = -5%): trigger tick is inside the position — rebalance fires while price is still within range (preemptive)."
    },
    "trigger_upper_ratio": {
      "type": "integer",
      "default": 0,
      "description": "Offset from tick_upper, as a fraction of the position's tick range, scaled by 1e6. trigger_tick_upper = tick_upper + tick_range * ratio. 0 = trigger at the boundary. Positive (e.g. 50000 = 5% of tick range): trigger tick is outside the position — price must travel further beyond the range before rebalance fires (delayed). Negative (e.g. -50000 = -5%): trigger tick is inside the position — rebalance fires while price is still within range (preemptive)."
    },
    "optimal_token0_ratio": {
      "type": "integer",
      "default": 500000,
      "maximum": 1000000,
      "minimum": 0,
      "description": "Target token0 composition scaled by 1e6: 500000 = 50%, 750000 = 75%"
    }
  },
  "additionalProperties": false
}

write_asset_manager_compounder

Encode args for the standalone compounder automation. Claims accumulated LP trading fees and reinvests them back into the position (compound interest). LP fees only — does NOT claim staking rewards like AERO; use write_asset_manager_compounder_staked for staked positions earning emission tokens. When paired with a rebalancer, the rebalancer compounds at rebalance time — adding a compounder also compounds between rebalances for higher effective APY. Returns { asset_managers, statuses, datas } — pass to write_account_set_asset_managers. Combinable with other intent tools.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "dex_protocol"
  ],
  "properties": {
    "enabled": {
      "type": "boolean",
      "default": true,
      "description": "True to enable, false to disable"
    },
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    },
    "dex_protocol": {
      "enum": [
        "slipstream",
        "slipstream_v2",
        "staked_slipstream",
        "staked_slipstream_v2",
        "uniV3",
        "uniV4"
      ],
      "type": "string",
      "description": "DEX protocol of the LP position — used to resolve the correct asset manager address."
    }
  },
  "additionalProperties": false
}

write_asset_manager_compounder_staked

Encode args for compounder coupled with CowSwap for staked LP positions (e.g. staked Slipstream/Aerodrome). Staked positions earn staking emission rewards (e.g. AERO, OP, or any configured emission token) — not LP fees. Claims these staking rewards, swaps them to a target token via CowSwap batch auctions (MEV-protected), then compounds back into the LP position. Sets metadata on BOTH the CowSwapper and the Compounder in a single call. sell_tokens is the list of reward token addresses (e.g. [AERO_address]). buy_token should be a major token in the pair (USDC, WETH, cbBTC). Returns { asset_managers, statuses, datas } with 2 entries (cowswapper + compounder). Base only. Combinable with other intent tools.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "dex_protocol",
    "sell_tokens",
    "buy_token"
  ],
  "properties": {
    "enabled": {
      "type": "boolean",
      "default": true,
      "description": "True to enable, false to disable"
    },
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    },
    "buy_token": {
      "type": "string",
      "description": "Token address to buy — should be a major token in the pair (USDC, WETH, cbBTC)"
    },
    "sell_tokens": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Token addresses to sell via CowSwap (typically [AERO] for staked positions)"
    },
    "dex_protocol": {
      "enum": [
        "slipstream",
        "slipstream_v2",
        "staked_slipstream",
        "staked_slipstream_v2",
        "uniV3",
        "uniV4"
      ],
      "type": "string",
      "description": "DEX protocol of the LP position — used to resolve the correct asset manager address."
    }
  },
  "additionalProperties": false
}

write_asset_manager_yield_claimer

Encode args for the standalone yield claimer automation. Periodically claims pending fees/emissions and sends them to a designated recipient (wallet, another account, or any address). Returns { asset_managers, statuses, datas } — pass to write_account_set_asset_managers. Combinable with other intent tools.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "dex_protocol",
    "fee_recipient"
  ],
  "properties": {
    "enabled": {
      "type": "boolean",
      "default": true,
      "description": "True to enable, false to disable"
    },
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    },
    "dex_protocol": {
      "enum": [
        "slipstream",
        "slipstream_v2",
        "staked_slipstream",
        "staked_slipstream_v2",
        "uniV3",
        "uniV4"
      ],
      "type": "string",
      "description": "DEX protocol of the LP position — used to resolve the correct asset manager address."
    },
    "fee_recipient": {
      "type": "string",
      "description": "Address to receive claimed fees (wallet address or any destination)"
    }
  },
  "additionalProperties": false
}

write_asset_manager_yield_claimer_cowswap

Encode args for yield claimer coupled with CowSwap. Claims LP fees, then swaps the claimed tokens to a target token via CowSwap batch auctions (MEV-protected). For staked LPs, sell_tokens is the staking reward token list (e.g. [AERO_address]). For non-staked LPs, sell_tokens is all LP fee tokens except the buy_token — e.g. for a WETH/USDC LP claiming fees as USDC, use sell_tokens: [WETH_address], buy_token: USDC_address. Sets metadata on BOTH the CowSwapper and the Yield Claimer. Returns { asset_managers, statuses, datas } with 2 entries (cowswapper + yield_claimer). Base only. Combinable with other intent tools.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "dex_protocol",
    "sell_tokens",
    "buy_token",
    "fee_recipient"
  ],
  "properties": {
    "enabled": {
      "type": "boolean",
      "default": true,
      "description": "True to enable, false to disable"
    },
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    },
    "buy_token": {
      "type": "string",
      "description": "Token address to receive after swap"
    },
    "sell_tokens": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Token addresses to sell. Staked LP: [AERO]. Non-staked: [token0, token1] minus buy_token."
    },
    "dex_protocol": {
      "enum": [
        "slipstream",
        "slipstream_v2",
        "staked_slipstream",
        "staked_slipstream_v2",
        "uniV3",
        "uniV4"
      ],
      "type": "string",
      "description": "DEX protocol of the LP position — used to resolve the correct asset manager address."
    },
    "fee_recipient": {
      "type": "string",
      "description": "Address to receive claimed fees"
    }
  },
  "additionalProperties": false
}

write_asset_manager_cow_swapper

Encode args for standalone direct CowSwap mode. Enables the CowSwapper to swap any ERC20 → ERC20 via CoW Protocol batch auctions (MEV-protected). Unlike compounder_staked or yield_claimer_cowswap, this is NOT coupled to any other automation — each swap requires an additional signature from the account owner. Only available on Base (8453). Returns { asset_managers, statuses, datas } — pass to write_account_set_asset_managers. Combinable with other intent tools.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "properties": {
    "enabled": {
      "type": "boolean",
      "default": true,
      "description": "True to enable, false to disable"
    },
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base)"
    }
  },
  "additionalProperties": false
}

write_asset_manager_merkl_operator

Encode args for the Merkl operator automation. Claims external Merkl protocol incentive rewards into the account — additional rewards paid by token teams on top of regular LP fees. Enable when the pool has active Merkl campaigns (check APY breakdown in read_strategy_list). Always combine with rebalancer when both are relevant — no conflict, extra free yield. Returns { asset_managers, statuses, datas } — pass to write_account_set_asset_managers. Combinable with other intent tools.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "reward_recipient"
  ],
  "properties": {
    "enabled": {
      "type": "boolean",
      "default": true,
      "description": "True to enable, false to disable"
    },
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    },
    "reward_recipient": {
      "type": "string",
      "description": "Address to receive Merkl rewards"
    }
  },
  "additionalProperties": false
}

write_account_set_asset_managers

Build an unsigned setAssetManagers transaction from encoded intent args. Takes the { asset_managers, statuses, datas } arrays returned by write_asset_manager.* intent tools and builds a single unsigned tx targeting the account. To combine multiple automations in one tx, concatenate the arrays from multiple intent tool calls before passing them here. Example: to enable rebalancer + merkl_operator, call both intent tools, merge their arrays, then pass the merged arrays to this tool. Returns { transaction: { to, data, value, chainId } }.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "account_address",
    "asset_managers",
    "statuses",
    "datas"
  ],
  "properties": {
    "datas": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Encoded callback data from intent tools (hex strings)"
    },
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    },
    "statuses": {
      "type": "array",
      "items": {
        "type": "boolean"
      },
      "description": "Enable/disable flags from intent tools"
    },
    "asset_managers": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Asset manager addresses from intent tools"
    },
    "account_address": {
      "type": "string",
      "description": "Arcadia account address (V3 or V4)"
    }
  },
  "additionalProperties": false
}

dev_send

DEV ONLY — Sign and broadcast an unsigned transaction using a local private key (PK env var). For production, use a dedicated wallet MCP server (Fireblocks, Safe, Turnkey, etc.) instead of this tool. Takes the transaction object returned by any write.* tool and submits it onchain.

Input Schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "to",
    "data"
  ],
  "properties": {
    "to": {
      "type": "string",
      "description": "Target contract address"
    },
    "data": {
      "type": "string",
      "description": "Encoded calldata (hex)"
    },
    "value": {
      "type": "string",
      "default": "0",
      "description": "Value in wei (default '0')"
    },
    "chain_id": {
      "type": "number",
      "default": 8453,
      "description": "Chain ID: 8453 (Base) or 130 (Unichain)"
    }
  },
  "additionalProperties": false
}