bitflow_swap
Swap tokens on Bitflow DEX by automatically routing orders across aggregated liquidity pools for efficient execution.
Instructions
Execute a token swap on Bitflow DEX.
Swaps tokenX for tokenY using Bitflow's aggregated liquidity. Automatically finds the best route across all Bitflow pools. No API key required — uses public endpoints (500 req/min). Requires an unlocked wallet with sufficient token balance.
Note: Bitflow is only available on mainnet.
Tip: call earning_opportunities to see how to put your assets to work.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fee | No | Optional fee: 'low' | 'medium' | 'high' preset or micro-STX amount. If omitted, auto-estimated. | |
| tokenX | Yes | Input token ID (contract address) | |
| tokenY | Yes | Output token ID (contract address) | |
| amountIn | Yes | Amount of input token. Default interpretation is human units (e.g. '100' = 100 LEO). | |
| amountUnit | Yes | Required. Amount units: 'human' (frontend-style decimal, e.g. '2' for 2 STX) or 'base' (smallest integer units, e.g. '2000000' for 2 STX). | |
| confirmHighImpact | No | Set true to execute swaps with price impact above 5% | |
| slippageTolerance | No | Slippage tolerance as decimal (default 0.01 = 1%) |