Class AlpacaCryptoStream

All Implemented Interfaces:
AutoCloseable

public final class AlpacaCryptoStream extends AbstractMarketDataStream
WebSocket client for the Alpaca real-time crypto pricing stream (/v1beta3/crypto/us).

Usage


 var stream = AlpacaClientFactory.cryptoStream(
     creds,
     AlpacaStreamEnvironment.PRODUCTION,
     new CryptoStreamListener() {
         @Override public void onTrade(CryptoTrade t) { System.out.println(t); }
     });

 stream.connect(CryptoSubscription.builder().trades("BTC/USD").bars("*").build());
 

Only available on the production endpoint. The crypto stream is sourced from the Alpaca exchange. The free plan is limited to 10 symbols for orderbooks.