trade
Installation
SKILL.md
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.