trade
Trade / Swap Tokens
Exchange one token for another via Fibrous aggregation. The CLI finds the best route, handles token approvals, simulates the swap, and executes.
Note: Automatically detects and executes Wrap (Native -> Wrapped) and Unwrap (Wrapped -> Native) operations directly via contract calls, bypassing aggregation to save gas.
Prerequisites
- Active session required.
- Sufficient balance of the source token + gas fees.
Rules
- BEFORE any trade, you MUST run
npx fibx@latest statusandnpx fibx@latest balanceto verify connectivity and source token balance. - If the user specifies a chain, you MUST include
--chain <name>. If not specified, default tobaseand state it. - Default slippage is 0.5%. To change it, you MUST ask the user for confirmation before using
--slippage. - The CLI defaults to exact approval for ERC-20 tokens. NEVER use
--approve-maxunless the user explicitly requests it. - AFTER a successful trade, you MUST verify the transaction using
tx-statuswith the same--chainflag.
More from fibrous-finance/fibx-skills
aave
Manage Aave V3 DeFi positions on Base — supply, borrow, repay, withdraw, view markets, and check account health. Includes liquidation safety checks.
26balance
Check wallet balances (native and ERC-20 tokens) on Base, Citrea, HyperEVM, or Monad.
25send
Send native tokens (ETH, cBTC, HYPE, MON) or ERC-20 tokens to an address on Base, Citrea, HyperEVM, or Monad. Simulates before sending.
21authenticate-wallet
Authenticate the fibx CLI wallet via email OTP (Privy) or private key import. Required before any wallet operation (balance, send, trade, aave). Private keys are encrypted at rest with AES-256-GCM.
19tx-status
Check the on-chain status of a transaction and get the block explorer link. Supports Base, Citrea, HyperEVM, and Monad.
14config
View and modify fibx CLI configuration, such as setting custom RPC URLs to avoid rate limits.
9