trade
Original:🇺🇸 English
Not Translated
Swap/Trade tokens using Fibrous Finance aggregation. Supports Base, Citrea, HyperEVM, and Monad.
1installs
Added on
NPX Install
npx skill4agent add fibrous-finance/fibx-skills tradeSKILL.md Content
Trade / Swap Tokens
Use this skill to exchange one token for another. It uses the Fibrous Finance aggregator to find the best route.
Hard Rules (CRITICAL)
- Pre-Flight Check: Before ANY trade, you MUST run:
npx fibx@latest status- (ensure you have the source token)
npx fibx@latest balance
- Chain Specification:
- If the user mentions a specific chain (e.g., "on Monad", "for my Citrea wallet"), you MUST include the parameter.
--chain <name> - If the user DOES NOT mention a chain, you MUST either:
- Explicitly state the default: "I will perform this trade on Base. Is that correct?"
- OR ask for clarification: "Which chain would you like to trade on? Base, Citrea, HyperEVM, or Monad?"
- If the user mentions a specific chain (e.g., "on Monad", "for my Citrea wallet"), you MUST include the
- Slippage Safety: The default slippage is 0.5%. If you need to change this (e.g., for volatile tokens), you MUST ask the user for confirmation first.
- Approval Limits: The CLI defaults to "Exact Approval" (approves only the amount to be swapped).
- Do NOT use unless the user explicitly requests "infinite approval" or "max approval".
--approve-max
- Do NOT use
- Simulation & Verification: The CLI performs a route check before swapping. If this fails, do not proceed. After swapping, verify the transaction with the skill.
tx-status
Usage
bash
npx fibx@latest trade <amount> <from_token> <to_token> [options]Arguments
| Argument | Description |
|---|---|
| Amount to swap (e.g., |
| Source token symbol ( |
| Destination token symbol ( |
Options
| Option | Description |
|---|---|
| Network: |
| Slippage tolerance in percentage (e.g., |
| Force infinite approval. Use with caution. |
| Output result as JSON. |
Examples
Standard Swap (Base)
User: "Swap 0.1 ETH for USDC"
Agent Actions:
npx fibx@latest statusnpx fibx@latest balancenpx fibx@latest trade 0.1 ETH USDCnpx fibx@latest tx-status <hash>
Swap with Custom Slippage
User: "Swap 1000 DEGEN to ETH with 2% slippage"
Agent Actions:
- Checks info.
- Agent: "Confirming: You want to swap 1000 DEGEN to ETH with 2% slippage. Is this correct?"
- User confirms.
npx fibx@latest trade 1000 DEGEN ETH --slippage 2
Swap on Monad
User: "Buy USDC with 1 MON on Monad"
Agent Actions:
npx fibx@latest status --chain monadnpx fibx@latest trade 1 MON USDC --chain monad
Error Handling
- "No route found": The trade path might not exist or liquidity is too low.
- "Insufficient balance": Check again.
balance - "Slippage exceeded": The price moved unfavorably; suggest retrying with higher slippage (after user confirmation).