Live App: https://binance.github.io/crypto-trade-analyzer
π Important: Please review our Terms of Use and License before using this tool.
π Updates: See the Changelog for recent changes and version history.
Identify the most cost-efficient exchange by comparing spend and receive amounts from simulated order execution, using real-time order book data and fees.
- Multi-Exchange Support: Compare trade results across Binance, Bybit, Coinbase, and OKX.
- Configurable Order Inputs: Spot Market Orders, with order size configurable in either the base or quote asset, and symbols selectable from any available on the chosen exchange.
- Live OrderBooks side-by-side: Live streaming of order books from multiple exchanges.
- Trade Cost (Spend) Simulation: Simulate order execution to calculate the total trade cost, taking into account slippage and trading fees.
- Trade Receive Simulation: Simulate order execution to calculate the net amount received from a trade.
- Realistic Fee Modeling: Take into account taker fees, user tiers, and trading pair discounts.
- Tick Size Normalization: This tool queries exchanges' APIs for the trading pair's tick size (minimum price increment), then normalizes all order books to the largest tick size for fair and consistent price comparisons across exchanges.
- Live Best Exchange Badge: Automatically highlight the best exchange for your specific trade.
- Smart Startup Selection of Order Inputs: On first tool load, to better reflect real-life trading behavior:
- Trading Pair: Random selection from a predefined list of popular cross-exchange pairs.
- Order size: Random selection within a realistic, market-based range.
- Order side: Probabilistic selection of the BUY/SELL side based on market sentiment derived from short-term candlesticks.
| Exchange | Spot Trading | Fee Tiers | Token Discounts |
|---|---|---|---|
| Binance | β | β | β (BNB) |
| Bybit | β | β | β |
| Coinbase | β | β | β |
| OKX | β | β | β |
- Node.js
18.xor higher npm,pnpm, oryarn
# Clone the repository
git clone https://github.com/binance/crypto-trade-analyzer.git
# Navigate to project directory
cd crypto-trade-analyzer
# Install dependencies
npm install
# Start development server
npm run dev# Start development server with hot reload
npm run dev
# Build for production
npm run build
# Preview production build locally
npm run preview
# Run ESLint
npm run lint
# Format code with Prettier
npm run format- Frontend: React and TypeScript (Vite)
- Styling: Tailwind CSS
- Code Quality: ESLint, Prettier, Husky, lint-staged
- WebSocket: Native WebSocket connections for real-time data
- State Management: React hooks
Cached entries share a common shape:
tsβ timestamp (ms) used for freshness checksdataβ the cached valuemetaβ optional metadata (e.g.,source,etag,version)
Notes
- If
localStorageis unavailable (private mode/restricted contexts), the app falls back gracefully and refetches as needed.- Stablecoins are returned 1:1 to USD and typically arenβt cached.
- No ads, remarketing, or personalization (explicitly disabled).
- No fingerprinting or cross-site identifiers from our code.
- No analytics tracking if Do Not Track (DNT) is enabled.
- No emails, names, wallet addresses, exchange account IDs, order IDs, or other sensitive identifiers are persisted.
- No custom cookies for analytics.
This app uses Google Analytics 4 (GA4) to understand usage patterns and improve UX.
- The analytics runs client-side; events go directly from your browser to GA4.
- The appβs own caching and preferences live in your browserβs storage.
| Event name | When it fires | Properties sent |
|---|---|---|
page_view |
Page load / route change | page_location, page_path, page_title |
trading_pair_selected |
You pick a trading pair | trading_pair, base, quote, ts |
exchanges_selected |
You change selected exchanges | exchanges, ts |
calc_performed |
A comparison run completes | trading_pair, side, quantity, selected_exchanges, best_exchange, best_exchange_account_prefs, best_exchange_cost_breakdown, ts |
calc_latency |
Cost-calc latency is measured | exchange, ms, bucket |
orderbook_push_latency |
Order-book push latency is measured | exchange, ms, bucket |
exchange_status |
An exchange connector goes up/down | exchange, status, reason, down_duration_ms, ts |
The app uses the browserβs storage to reduce API calls and speed up startup.
| Purpose | Key pattern | Value shape | TTL |
|---|---|---|---|
| USD price cache | usdconv:v1:<ASSET> (e.g. usdconv:v1:BTC) |
{"ts": <ms>, "data": <number>, "meta": {"source": "<api>"}} |
60s (configurable) |
| Pair list (all) | pairdir:v1:pairs:<ex1,ex2,...> |
{"ts": <ms>, "data": Array<Pair>} |
30 min (configurable) |
| Pair list with supported exchanges | pairdir:v1:pairsWithEx:<ex1,ex2,...> |
{"ts": <ms>, "data": Array<PairWithExchanges>} |
30 min (configurable) |
| Market signals cache | marketsignals:v1:candles:global:hours:<HOURS> (e.g. marketsignals:v1:candles:global:hours:24) |
{"ts": <ms>, "data": [{<hour1 candle data>}, ...]} |
1 hr (configurable) |
| Per-exchange user settings | ACCOUNT_SETTINGS_STORAGE_KEY |
Record<ExchangeId, { userTier: string; tokenDiscount: boolean }> |
No expiry |
| Google Analytics consent | GA4_ANALYTICS_CONSENT_KEY |
granted | denied |
No expiry |
-
Consent & events implementation:
src/utils/analytics.ts. -
To ship without analytics, donβt load GA and/or pre-set:
localStorage.setItem('GA4_ANALYTICS_CONSENT_KEY', 'denied');
The tool uses a few public APIs to stay lightweight and up-to-date:
-
Pairs per exchange:
- CoinPaprika is used to retrieve trading pairs for most exchanges.
These results are normalized to
BASE/QUOTEand cached inlocalStorage. - Coinbase special case: we query Coinbase Exchangeβs own REST API (
/products) instead of CoinPaprika. CoinPaprikaβs data source is still based on the old βCoinbase Proβ, which lists pairs not tradable onapi.exchange.coinbase.com.
Using Coinbaseβs official endpoint ensures the list of pairs always matches the real, unauthenticated market data API we use elsewhere.
- CoinPaprika is used to retrieve trading pairs for most exchanges.
These results are normalized to
-
USD price equivalents: We fetch coin to USD conversion rates from CryptoCompare and CoinGecko. Price results are cached for 60s to reduce API usage and improve responsiveness.
-
Market Signals:
To generate a realistic default order side (BUY or SELL), the app uses Coindeskβs Market Data API. It fetches recent hourly open/close prices and computes short-term sentiment by analyzing price movements. The model blends long-term and recent interval ratios to derive probabilistic BUY/SELL weights. These results are cached briefly and used only for startup defaults β they never override explicit user choices.
ββ src/
β ββ app/
β β ββ components/ # Reusable UI components
β β ββ hooks/ # React hooks (e.g., useExchangeEngine)
β β ββ icons/ # Icon components/assets
β β ββ pages/ # Application pages
β β ββ providers/ # Context providers
β β ββ App.tsx # App shell
β β ββ types.ts # App-level types
β ββ core/ # Interfaces, order-book & fee config
β ββ exchanges/ # Exchange adapters (binance, bybit, coinbase, okx, β¦)
β ββ utils/ # Bucketize, formatting, helpersWe welcome contributions! Here's how to get started:
- Fork the repository and create a feature branch
- Make your changes
- Run
npm run formatandnpm run lint - Open a pull request
To add support for a new exchange, implement the following interface:
watchLivePair()/unwatchLivePair()β manage WS and local book with resynconLiveBook()β push book updates to the UIgetPairSymbol()β standardized trading pair mappinggetTickSize()β REST once; cache per (exchange, trading pair)calculateCost()β call the shared calculator (bucket first ifpriceBucketis provided)disconnect()β clean shutdown
- Follow TypeScript best practices
- Use meaningful commit messages
- Ensure all CI checks pass
The application respects exchange API rate limits through:
- WebSocket connections for real-time data (preferred)
- Safe reconnection with jitter/backoff
- Request throttling for REST API calls
- Local caching to minimize API requests
This tool is designed for educational and research purposes. Trading cryptocurrencies involves significant risk, and past performance does not guarantee future results. Always verify costs independently before making trades. Exchange fees and policies may change without notice. You may view the full disclaimer in the Terms of Use.
This project is licensed under the Binance Source-Available and Non-Commercial License v1.0.
You may view the full text in the LICENSE file.
{ "ts": 1731345678901, // timestamp (ms) "data": 123.45, // cached value "meta": { "source": "coingecko" }, // optional metadata }