Receiving real-time data from multiple exchanges over a single websocket


Hi. This post is intended for people looking to easily consume real-time data from various exchanges

**TLDR**

* **opensource self-hosted** service (ie: you run it wherever you want AND **I’m not trying to steal your API keys** since you don’t need to provide them to me)
* it lets you define custom ws endpoints
* it can **multiplex informations from multiple exchanges over a single ws** and present data in a unified way (for example you can ask to receive *USDT-BTC order books* from *Binance* & *BTC-ETH trades* from *OKEx* over a single ws if you want to)
* support for Binance, Bittrex, Poloniex, Kucoin, OKEx
* source available [here](https://github.com/aloysius-pgast/crypto-exchanges-gateway)
* ugly demo video showing how to define custom stream available [here](https://www.youtube.com/watch?v=_LfLLT693AM&feature=youtu.be)

https://i.redd.it/uhaxlp6vcj511.png

A demo website is also available [here](https://mpe-demo.crazyme.net/) in case you want to play with the ws multiplexing without going through the installation process

Have fun

View Source

View Reddit by a-pendergast

Day 4: I will repost this guide daily until available solutions like SegWit & order batching are mass adopted, the mempool is empty once again, and transaction fees are low. ARE YOU PART OF THE SOLUTION? News: Unconfirmed TX’s @ 174K, more exchanges adding SegWit, Core prioritizes SegWit GUI


**NOTE** Just a daily repost because original OP [/u/Bastiat](https://www.reddit.com/user/Bastiat) seems to be offline (due to holidays I guess). However, this is quite important as I see much misinformation on which exchanges use segwit or not.
Please upvote for awareness.

**BACKGROUND**

Subhan Nadeem has pointed out that:

[If every transaction in the Bitcoin network was a SegWit transaction today, blocks would contain up to 8,000 transactions, and the 138,000 unconfirmed transaction backlog would disappear instantly. Transaction fees would be almost non-existent once again](https://hackernoon.com/bitcoin-owners-you-need-to-do-these-two-things-right-now-a73122dd23d4).

A few thousand bitcoin users from /r/Bitcoin switching to making their next transactions SegWit transactions will help take pressure off the network now, and together we can encourage exchanges/wallets to rapidly deploy SegWit for everyone ASAP. Let’s make it happen. You can help by taking one or more of the action steps below.
___________________

**ACTION STEPS**

1. If your favorite wallet has not yet implemented SegWit, kindly ask them to do so immediately. In the meantime start using a wallet that has already implemented SegWit.
2. If your favorite exchange has not yet implemented SegWit, try to avoid making any further purchases of bitcoin at that exchange and politely inform them that if they do not enable SegWit within 30-days they will lose your business. Sign-up for an account at a SegWit deployed exchange now and initiate the verification process so you’ll be ready to bail
3. Help educate newcomers to bitcoin about the transaction issue, steer them towards SegWit wallets from day one, and encourage them to avoid ever purchasing bitcoin through non-SegWit ready exchanges that are harming bitcoin

**IMPORTANT NOTE**: The mempool is currently overflowing. If you are a long-term holder and really have no reason to move your bitcoins at this time, wait until the mempool starts to clear and transaction fees go down before moving your bitcoins to a SegWit address or SegWit friendly exchange

__________________________

**SELECTED TOP EXCHANGES BY SEGWIT & BATCHING STATUS**

There are 2 different Segwit address formats.

* p2sh – starting with a “3…”
* bech32 – starting “bc1…”

Not many wallets/exchanges support bech32 yet and will claim the address is invalid if you try to send to it. bech32 (“native Segwit”) is a mildly better solution compared to p2sh.

| **Exchange** | **Batching Status** | **Segwit (p2sh)** | **Send to bech32** |
|—————|———————|——————-|———————|
| Binance | **Yes** | No | No |
| Bitfinex | **Yes** | No | No |
| Bitonic | ? | No | No |
| Bitstamp | **Yes** | **Yes** | No |
| Bittrex | **Yes** | ? | ? |
| Coinbase/GDAX | No | No | No |
| Gemini | No | No | No |
| HitBTC | **Yes** | **Yes** | ? |
| Huboi | ? | ? | ? |
| Kraken | No | **Yes** | ? |
| LocalBitcoins | No | ? | ? |
| OKEx | ? | ? | ? |
| Poloniex | ? | **Yes** | ? |
| QuadrigaCX | **Yes** | **Yes** | ? |
| Shapeshift | **Yes** | No | No |

[Source 1](https://bitcoincore.org/en/segwit_adoption/)

[Source 2](https://www.reddit.com/r/Bitcoin/comments/7kherf/what_exchanges_batch_there_withdrawal_txs_to_save/)
___________________

**WALLETS**

Make sure you have a SegWit capable wallet installed and ready to use for your next bitcoin transaction

| SegWit Enabled Wallets | Wallet Type |
|————————|————-|
| Ledger Nano S | Hardware |
| Trezor | Hardware |
| Electrum | Desktop |
| Armory | Desktop |
| Edge | iOS |
| GreenAddress | iOS |
| BitWallet | iOS |
| Samourai | Android |
| GreenBits | Android |
| Electrum | Android |

______________________

**TODAY’s NEWS/DEVELOPMENTS/VICTORIES**

– [Core is considering prioritizing SegWit GUI in the Core Wallet and pushing out an update fast without waiting for other features](https://www.reddit.com/r/Bitcoin/comments/7lc1n9/latest_bitcoin_core_irc_meeting_segwit_wallet_is/)
– [An Exodus Wallet representative has said they will not enable SegWit for now](https://www.reddit.com/r/Bitcoin/comments/7lcm1t/exodus_response_as_to_why_they_havent_adopted/)
– [Largest exchange in Brazil implemented withdraws using Segwit](https://www.reddit.com/r/Bitcoin/comments/7lgxnc/largest_exchange_in_brazil_implemented_withdraws/)

______________________

**MEMPOOL/SEGWIT STATISTICS**

– [BitInfoCharts.com – Average Transaction Fees](https://bitinfocharts.com/comparison/bitcoin-transactionfees.html#3m) – $42USD per Tx
– [Blockchain.info – Unconfirmed Transactions](https://blockchain.info/unconfirmed-transactions) – 174K Unconfirmed Tx’s
– [SegWit Charts](http://segwit.party/charts/) – 13% SegWit Tx’s

______________________

**FAQs**

If I’m a HODLer, will it help to send my BTC to a SegWit address now?

– No, just get ready now so that your NEXT transaction will be to a SegWit wallet. Avoid burdening the network with any unneccessary transactions for now.

Can you please tell me how to move my bitcoins to SegWit address in Bitcoin core wallet? Does the sender or receiver matter?

– The Bitcoin core wallet does not yet have a GUI for its SegWit functionality. Download Electrum v3.0.3 to generate a SegWit address.

A transaction between two SegWit addresses is a SegWit transaction.

A transaction sent from a SegWit address to a non-SegWit address is a SegWit transaction.

A transaction sent from a non-SegWit address to a SegWit address is NOT a SegWit transaction. You can send a SegWit Transaction if the sending address is a SegWit address.

[Source](https://howtotoken.com/explained/send-bitcoin-faster-cheaper-SegWit-transactions)

So what address can I send to safely, there is so much confusion?

– As of right now…

| **Non-Segwit Transactions** | | |
|————————-|——————–|——————————|
| **non-Segwit address** | to… | |
| | non-Segwit address | **OK** |
| | 3….. (Segwit) | **OK** |
| | bc1…. (Segwit) | No (no support for them yet) |
| **Segwit Transactions** | | |
| **3… address (Segwit)** | to… | |
| | non-Segwit address | **OK** |
| | 3….. (Segwit) | **OK** |
| | bc1…. (Segwit) | No (no support for them yet) |
| **bc1… address (Segwit)** | to… | |
| | non-Segwit address | **OK** |
| | 3….. (Segwit) | **OK** |
| | bc1…. (Segwit) | **OK** |

What wallet are you using to “batch your sends”? And how can I do that?

– Using Electrum, the “Tools” menu option: “Pay to many”.

Just enter your receive addresses and the amounts for each, and you can send multiple transactions for nearly the price of one.

Why doesn’t the Core Wallet yet support SegWit?

– The Core Wallet supports SegWit, but its GUI doesn’t. The next update will likely have GUI support built-in

Why isn’t a large exchange like Coinbase SegWit ready & deployed when much smaller exchanges already are? Why do they default to high fees? Where is the leadership there?

– Draw your own conclusions based on their own words:

[March 2016 – Coinbase CEO Brian Armstrong has reservations about Core](https://blog.coinbase.com/what-happened-at-the-satoshi-roundtable-6c11a10d8cdf)

[Dec 2017 – Coinbase is STILL working on Segwit](https://blog.coinbase.com/bitcoin-segwit-update-3ab0484e4526)

____________________

**SEGWIT BLOG GUIDES**

– [HowToToken.com – How To Send Bitcoin Faster And Cheaper Over SegWit Transactions](https://howtotoken.com/explained/send-bitcoin-faster-cheaper-SegWit-transactions/)

______________________

**PREVIOUS DAY’S THREADS**

There’s lots of excellent info in the comments of the previous threads:

– Day 1: [If every Bitcoin tx was a SegWit tx today, we’d have 8,000 tx blocks & the tx backlog would disappear. Tx fees would be almost non-existent once again. THE NEXT BITCOIN TX YOU MAKE, MAKE IT A SegWit TX. DOWNLOAD A SegWit COMPATIBLE WALLET AND OPEN A SegWit COMPATIBLE EXCHANGE ACCOUNT RIGHT NOW](https://www.reddit.com/r/Bitcoin/comments/7kyzxn/if_every_bitcoin_tx_was_a_SegWit_tx_today_wed/?utm_content=comments&utm_medium=user&utm_source=reddit&utm_name=frontpage)
– Day 2: [I will repost this guide daily until available solutions like Segwit & order batching are adopted, the mempool is empty once again, and transaction fees are low. You can help. Take action today](https://www.reddit.com/r/Bitcoin/comments/7l9tda/day_2_i_will_repost_this_guide_daily_until/)
– Day 3: [I will repost this guide daily until available solutions like SegWit & order batching are mass adopted, the mempool is empty once again, and transaction fees are low. ARE YOU PART OF THE SOLUTION? News: Unconfirmed TX’s @ 274K, more exchanges/wallets adding SegWit, Core prioritizes SegWit GUI](https://www.reddit.com/r/Bitcoin/comments/7ljpf5/day_3_i_will_repost_this_guide_daily_until/)

View Reddit by psycongorooView Source