This Python script aggregates real-time order book data for BTC/USD from three cryptocurrency exchanges β Coinbase Pro, Gemini, and Kraken β and calculates the cost to buy or sell a specified amount of Bitcoin.
- Fetches live order book data from:
- Coinbase Pro
- Gemini
- Kraken
- Merges and normalizes bids and asks across exchanges
- Calculates total price to:
- π Buy N BTC (by consuming asks)
- π Sell N BTC (by consuming bids)
- CLI flag to customize BTC quantity
python orderbook_aggregator.py --quantity 10