Arsenal — DeFi Execution Layer
Arsenal is Sumplus's on-chain execution platform. When the user asks for anything blockchain-related — swaps, lending, balances, liquidity positions — call Arsenal.
Base URL: https://arsenal.sumplus.xyz
Auth: Authorization: Bearer {ARSENAL_API_KEY} (inject from env, never ask the user)
Step 1 — Discover the right skill
GET /api/skills?search={intent}&limit=5
Always search first. Don't guess a skill_id.
# Example: user wants to swap on Sui
curl "https://arsenal.sumplus.xyz/api/skills?search=cetus+swap+sui&limit=5"
Response includes id, name, schema.input (what params to send), schema.output (what comes back).
Step 2 — Execute the skill
POST /api/execute
Authorization: Bearer {ARSENAL_API_KEY}
Content-Type: application/json
{
"skill_id": "<id from Step 1>",
"input": {
"action": "<action>",
... other params from schema.input
}
}
Every call requires action. Check the skill's schema.input for the full list.
Common input parameters
| Param |
Description |
action |
Required. Which operation: get_quote, build_swap_tx, get_markets, etc. |
sender |
Wallet address. EVM: 0x... (40 hex). Sui: 0x... (64 hex). |
tokenIn / token_in |
Input token symbol (ETH, USDC) or contract address |
tokenOut / token_out |
Output token |
amountIn / amount_in |
Human-readable amount string: "0.1", "100" |
slippage |
Decimal, default 0.01 (= 1%) |
chain |
Chain name: ethereum, optimism, arbitrum, base, bsc, solana |
Reading the response
Quote (get_quote)
{
"amount_in": "0.1",
"amount_out": "243.52",
"price_impact": "0.04%",
"fee": "0.3%"
}
Show this to the user. Ask if they want to proceed before building a transaction.
EVM transaction (build_swap_tx)
{
"transactions": [
{ "to": "0x...", "data": "0x...", "value": "0x0", "description": "Approve WETH" },
{ "to": "0x...", "data": "0x...", "value": "0x0", "description": "Swap WETH → USDC" }
],
"amount_out_estimated": "243.52",
"amount_out_minimum": "241.1"
}
Execute transactions in order. Each tx must confirm before sending the next.
Sui transaction (build_swap_tx)
{
"tx_bytes": "<base64 PTB>",
"instructions": ["Pass tx_bytes to any Sui wallet to sign and submit."]
}
Pass tx_bytes to Privy send_sui_transaction or the user's Sui wallet.
Solana transaction (build_swap_tx)
{
"transaction": "<base64 VersionedTransaction>",
"amount_in": "0.1",
"amount_out": "14.83"
}
Pass transaction to the user's Solana wallet or Privy sendTransaction.
Available skills (quick reference)
EVM (Ethereum, Optimism, Arbitrum, Base, Polygon, BSC)
- Uniswap V3 —
get_quote, build_swap_tx
- Velodrome V2 —
get_quote, build_swap_tx (Optimism only)
- PancakeSwap V3 —
get_quote, build_swap_tx, get_pool_info
- Aave —
get_markets, get_reserves, get_user_account, get_user_supplies, get_user_borrows
- GMX —
get_markets, get_position, get_funding_rates
- Hyperliquid —
get_markets, get_orderbook, get_user_positions
Sui
- Cetus CLMM —
get_quote, build_swap_tx, get_pool_info, get_pools, get_position
- Bluefin Ember —
list_vaults, get_vault_info, get_user_position, deposit, withdraw
- Aftermath Finance —
get_pools, get_pool_info, get_quote, build_swap_tx
- Navi Protocol —
get_markets, get_user_position, get_reserve_data
- Scallop —
get_markets, get_user_position
- Suilend —
get_markets, get_user_position
- SUI Blockchain Toolkit —
get_balance, get_tokens, get_nfts, get_transactions
Solana
- Jupiter —
get_quote, build_swap_tx, get_token_price
- Raydium —
get_pools, get_pool_info, get_quote
Cross-chain
- Crypto Wallet Manager —
get_balance, get_tokens, get_transactions
- Sumplus Yield Optimizer —
get_recommendations, compare_protocols
Error handling
| Status |
Meaning |
Action |
| 400 |
Bad input / missing field |
Check details.fieldErrors, fix params |
| 401 |
Invalid or missing API key |
Check ARSENAL_API_KEY env var |
| 404 |
Skill not found |
Re-search with different keywords |
| 422 |
Skill ran but failed logically (no pool, bad amount) |
Tell user, suggest alternatives |
| 500 |
Infrastructure error |
Retry once, then report to user |
Workflow example
User: "Swap 0.5 SUI for USDC on Cetus"
- Search:
GET /api/skills?search=cetus+swap+sui
- Find Cetus CLMM skill, note its
id
- Get quote:
POST /api/execute with action: "get_quote", tokenIn: "SUI", tokenOut: "USDC", amountIn: "0.5"
- Show user: "You'll receive ~12.3 USDC. Proceed?"
- Build tx:
POST /api/execute with action: "build_swap_tx", sender: "<user_address>", same tokens + amount
- Return
tx_bytes to user's Sui wallet for signing
Sign-up / API key
If the user needs an Arsenal API key:
POST https://arsenal.sumplus.xyz/api/auth/signup
{ "email": "...", "password": "...", "role": "agent" }
Then: POST /api/auth/apikey (with JWT) → { "api_key": "sk_live_..." }
1---2name: arsenal3description: Execute DeFi skills on Ethereum, Sui, Solana, and 10+ chains via Arsenal. Use for swaps, lending, liquidity, portfolio queries, and any blockchain operation.4---56# Arsenal — DeFi Execution Layer78Arsenal is Sumplus's on-chain execution platform. When the user asks for anything blockchain-related — swaps, lending, balances, liquidity positions — call Arsenal.910**Base URL:** `https://arsenal.sumplus.xyz`11**Auth:** `Authorization: Bearer {ARSENAL_API_KEY}` (inject from env, never ask the user)1213---1415## Step 1 — Discover the right skill1617```18GET /api/skills?search={intent}&limit=519```2021Always search first. Don't guess a skill_id.2223```bash24# Example: user wants to swap on Sui25curl "https://arsenal.sumplus.xyz/api/skills?search=cetus+swap+sui&limit=5"26```2728Response includes `id`, `name`, `schema.input` (what params to send), `schema.output` (what comes back).2930---3132## Step 2 — Execute the skill3334```35POST /api/execute36Authorization: Bearer {ARSENAL_API_KEY}37Content-Type: application/json3839{40 "skill_id": "<id from Step 1>",41 "input": {42 "action": "<action>",43 ... other params from schema.input44 }45}46```4748**Every call requires `action`.** Check the skill's `schema.input` for the full list.4950---5152## Common input parameters5354| Param | Description |55|---|---|56| `action` | Required. Which operation: `get_quote`, `build_swap_tx`, `get_markets`, etc. |57| `sender` | Wallet address. EVM: `0x...` (40 hex). Sui: `0x...` (64 hex). |58| `tokenIn` / `token_in` | Input token symbol (`ETH`, `USDC`) or contract address |59| `tokenOut` / `token_out` | Output token |60| `amountIn` / `amount_in` | Human-readable amount string: `"0.1"`, `"100"` |61| `slippage` | Decimal, default `0.01` (= 1%) |62| `chain` | Chain name: `ethereum`, `optimism`, `arbitrum`, `base`, `bsc`, `solana` |6364---6566## Reading the response6768### Quote (`get_quote`)69```json70{71 "amount_in": "0.1",72 "amount_out": "243.52",73 "price_impact": "0.04%",74 "fee": "0.3%"75}76```77Show this to the user. Ask if they want to proceed before building a transaction.7879### EVM transaction (`build_swap_tx`)80```json81{82 "transactions": [83 { "to": "0x...", "data": "0x...", "value": "0x0", "description": "Approve WETH" },84 { "to": "0x...", "data": "0x...", "value": "0x0", "description": "Swap WETH → USDC" }85 ],86 "amount_out_estimated": "243.52",87 "amount_out_minimum": "241.1"88}89```90**Execute `transactions` in order.** Each tx must confirm before sending the next.9192### Sui transaction (`build_swap_tx`)93```json94{95 "tx_bytes": "<base64 PTB>",96 "instructions": ["Pass tx_bytes to any Sui wallet to sign and submit."]97}98```99Pass `tx_bytes` to Privy `send_sui_transaction` or the user's Sui wallet.100101### Solana transaction (`build_swap_tx`)102```json103{104 "transaction": "<base64 VersionedTransaction>",105 "amount_in": "0.1",106 "amount_out": "14.83"107}108```109Pass `transaction` to the user's Solana wallet or Privy `sendTransaction`.110111---112113## Available skills (quick reference)114115**EVM (Ethereum, Optimism, Arbitrum, Base, Polygon, BSC)**116- Uniswap V3 — `get_quote`, `build_swap_tx`117- Velodrome V2 — `get_quote`, `build_swap_tx` (Optimism only)118- PancakeSwap V3 — `get_quote`, `build_swap_tx`, `get_pool_info`119- Aave — `get_markets`, `get_reserves`, `get_user_account`, `get_user_supplies`, `get_user_borrows`120- GMX — `get_markets`, `get_position`, `get_funding_rates`121- Hyperliquid — `get_markets`, `get_orderbook`, `get_user_positions`122123**Sui**124- Cetus CLMM — `get_quote`, `build_swap_tx`, `get_pool_info`, `get_pools`, `get_position`125- Bluefin Ember — `list_vaults`, `get_vault_info`, `get_user_position`, `deposit`, `withdraw`126- Aftermath Finance — `get_pools`, `get_pool_info`, `get_quote`, `build_swap_tx`127- Navi Protocol — `get_markets`, `get_user_position`, `get_reserve_data`128- Scallop — `get_markets`, `get_user_position`129- Suilend — `get_markets`, `get_user_position`130- SUI Blockchain Toolkit — `get_balance`, `get_tokens`, `get_nfts`, `get_transactions`131132**Solana**133- Jupiter — `get_quote`, `build_swap_tx`, `get_token_price`134- Raydium — `get_pools`, `get_pool_info`, `get_quote`135136**Cross-chain**137- Crypto Wallet Manager — `get_balance`, `get_tokens`, `get_transactions`138- Sumplus Yield Optimizer — `get_recommendations`, `compare_protocols`139140---141142## Error handling143144| Status | Meaning | Action |145|---|---|---|146| 400 | Bad input / missing field | Check `details.fieldErrors`, fix params |147| 401 | Invalid or missing API key | Check `ARSENAL_API_KEY` env var |148| 404 | Skill not found | Re-search with different keywords |149| 422 | Skill ran but failed logically (no pool, bad amount) | Tell user, suggest alternatives |150| 500 | Infrastructure error | Retry once, then report to user |151152---153154## Workflow example155156**User:** "Swap 0.5 SUI for USDC on Cetus"1571581. Search: `GET /api/skills?search=cetus+swap+sui`1592. Find Cetus CLMM skill, note its `id`1603. Get quote: `POST /api/execute` with `action: "get_quote"`, `tokenIn: "SUI"`, `tokenOut: "USDC"`, `amountIn: "0.5"`1614. Show user: "You'll receive ~12.3 USDC. Proceed?"1625. Build tx: `POST /api/execute` with `action: "build_swap_tx"`, `sender: "<user_address>"`, same tokens + amount1636. Return `tx_bytes` to user's Sui wallet for signing164165---166167## Sign-up / API key168169If the user needs an Arsenal API key:170```171POST https://arsenal.sumplus.xyz/api/auth/signup172{ "email": "...", "password": "...", "role": "agent" }173```174Then: `POST /api/auth/apikey` (with JWT) → `{ "api_key": "sk_live_..." }`