# Crypto streaming code not available: subscribe\_crypto\_trades not found

**URL:** <https://forum.alpaca.markets/t/crypto-streaming-code-not-available-subscribe-crypto-trades-not-found/8032>\
**Category:** Alpaca Trading\
**Created:** [January 15, 2022, 10:12pm UTC](https://forum.alpaca.markets/t/crypto-streaming-code-not-available-subscribe-crypto-trades-not-found/8032 "2022-01-15T22:12:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![OnePunch](https://avatars.discourse-cdn.com/v4/letter/o/e79b87/32.png) [@OnePunch](https://forum.alpaca.markets/u/OnePunch)\
**Post date:** [January 15, 2022, 10:12pm UTC](https://forum.alpaca.markets/t/crypto-streaming-code-not-available-subscribe-crypto-trades-not-found/8032/1 "2022-01-15T22:12:04Z")

</div>

Hi,

I’d like to find code examples for streaming crypto. Hoever, I didn’ find any.

I wonder if there is a function of subscribe\_crypto\_trades inside the Stream class.

Thanks.

````auto

import logging

from alpaca_trade_api.stream import Stream

log = logging.getLogger( __name__ )

async def print_trade(t):
    print('trade', t)

async def print_quote(q):
    print('quote', q)

async def print_trade_update(tu):
    print('trade update', tu)

async def print_crypto_trade(t):
    print('crypto trade', t)

def main():
    logging.basicConfig(level=logging.INFO)
    feed = 'iex' # <- replace to SIP if you have PRO subscription
    stream = Stream(data_feed=feed, raw_data=True)
    stream.subscribe_trade_updates(print_trade_update)
    stream.subscribe_trades(print_trade, 'AAPL')
    stream.subscribe_quotes(print_quote, 'IBM')
    stream.subscribe_crypto_trades(print_crypto_trade, 'BTCUSD')

    @stream.on_bar('MSFT')
    async def _(bar):
        print('bar', bar)

    @stream.on_status("*")
    async def _(status):
        print('status', status)

    @stream.on_luld('AAPL', 'MSFT')
    async def _(luld):
        print('LULD', luld)

    stream.run()

if __name__ == " __main__":
    main()```
````

---

<div class="post-metadata">

**Author:** ![Hittkar\_Gill](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/hittkar_gill/32/3994_2.png) [@Hittkar\_Gill](https://forum.alpaca.markets/u/Hittkar_Gill)\
**Post date:** [April 21, 2022, 5:51pm UTC](https://forum.alpaca.markets/t/crypto-streaming-code-not-available-subscribe-crypto-trades-not-found/8032/2 "2022-04-21T17:51:54Z")

</div>

Hi,

Thank you for contributing! We have a dedicated discord focused solely on Crypto related queries with an active community and more engagement. Feel free to join via the invite link below;

> **[Join the Alpaca Markets Discord Server!](https://discord.com/invite/dQUT9FqS)**
>
> Check out the Alpaca Markets community on Discord - hang out with 186 other members and enjoy free voice and text chat.

Best,

---

<div class="post-metadata">

**Author:** ![rossjeremyd](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@rossjeremyd](https://forum.alpaca.markets/u/rossjeremyd)\
**Post date:** [August 29, 2023, 11:58am UTC](https://forum.alpaca.markets/t/crypto-streaming-code-not-available-subscribe-crypto-trades-not-found/8032/3 "2023-08-29T11:58:06Z")

</div>

Is there still an invite for the discord? Could you share as that link says it is invalid.
