A comprehensive tool to analyze liquidity and slippage across multiple decentralized perpetual exchanges. Get real-time market depth analysis and compare execution costs across different platforms.
-
Multi-Exchange Support: Analyze liquidity across 5+ major DEX perpetual platforms
- Hyperliquid
- Paradex
- Extended
- Lighter
- Aster
-
Comprehensive Slippage Analysis: Test multiple order sizes ($1k, $10k, $100k, $500k)
-
Cost Breakdown: See detailed breakdown of:
- Raw slippage (bps)
- Taker fees (bps)
- Total execution cost (bps)
- Effective spread
- Orderbook depth used
-
Smart Rankings:
- Ranking by slippage only
- Ranking by total cost (slippage + fees)
-
Interactive CLI: Simple, user-friendly command-line interface
- Node.js (v14 or higher)
- npm
- Clone the repository:
git clone <your-repo-url>
cd algo-liquidité- Install dependencies:
npm installSimply run the script and it will prompt you for the token:
node slippageTestAll.jsYou'll be asked to enter a token ticker:
Enter token ticker (e.g., sui, btc, eth): sui
Pass the token ticker as a command-line argument:
node slippageTestAll.js sui
node slippageTestAll.js btc
node slippageTestAll.js ethYou can specify which exchanges to analyze:
node slippageTestAll.js sui hyperliquid,paradex
node slippageTestAll.js btc extended,lighter,asterFor each exchange, you'll see:
📊 HYPERLIQUID (Taker fee: 4.5 bps)
Mid: $95000 | Top-of-book spread: 2.1 bps
Size │ Levels (B/S) │ Slippage │ + Fees │ = Total Cost
─────────┼──────────────┼─────────────┼─────────────┼─────────────
$1k │ 2/2 │ 0.52 bps │ 4.5 bps │ 5.02 bps ✅
$10k │ 5/5 │ 2.15 bps │ 4.5 bps │ 6.65 bps ✅
$100k │ 15/14 │ 8.45 bps │ 4.5 bps │ 12.95 bps ✅
$500k │ 35/32 │ 25.30 bps │ 4.5 bps │ 29.80 bps ⚠️
- Levels (B/S): Number of orderbook levels consumed (Buy/Sell)
- Slippage: Pure price impact in basis points
- Fees: Exchange taker fees
- Total Cost: Combined execution cost
- ✅ = Order fully filled |
⚠️ = Partial fill
The tool provides two types of rankings:
- By Slippage Only: Best liquidity (ignoring fees)
- By Total Cost: Best overall execution (including fees)
RANKINGS BY TOTAL COST (Slippage + Fees):
$1k:
🥇 #1 lighter 0.45 bps (slip: 0.45 + fee: 0)
🥈 #2 paradex 0.89 bps (slip: 0.89 + fee: 0)
🥉 #3 hyperliquid 5.02 bps (slip: 0.52 + fee: 4.5)
- Fetches Orderbooks: Retrieves real-time orderbook data from each exchange's API
- Calculates Slippage: Simulates market orders of different sizes
- Measures Impact: Calculates price impact, effective spread, and depth used
- Adds Fees: Incorporates exchange-specific taker fees
- Ranks Results: Provides comparative analysis across platforms
The tool supports any token available on the connected exchanges. Common examples:
- BTC
- ETH
- SOL
- SUI
- APT
- ARB
- AVAX
- And many more...
The tool automatically handles different API endpoint formats for each exchange:
- Hyperliquid: Direct token symbol (e.g.,
BTC) - Paradex:
{TOKEN}-USD-PERPformat - Extended:
{TOKEN}-USDformat - Lighter: Symbol matching via market details
- Aster:
{TOKEN}USDTformat
| Exchange | Taker Fee |
|---|---|
| Hyperliquid | 4.5 bps |
| Extended | 2.5 bps |
| Lighter | 0 bps |
| Aster | 4 bps |
| Paradex | 0 bps |
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - feel free to use this tool for your trading analysis.
This tool is for informational purposes only. Always verify liquidity conditions in real-time before executing large orders. Past liquidity is not indicative of future liquidity.
For issues or feature requests, please open an issue on GitHub.