question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[QUESTION]: Have the symbols changed for crypto streaming endpoints

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

What is your question?

I see the documentation about the symbol change from v1beta1 to v1beta2:

The symbol format has been changed. E.g. BTCUSD is changed to BTC/USD.

For historical queries this is working as expected:

{Symbol,TimeUtc,Open,High,Low,Close,Volume,Vwap,TradeCount},
{BTC/USD,19/09/2022 05:01:00,18812,18812...

However, I only receive data from the streaming client with the non-slashed symbol eg. BTCUSD:

{"i":413958052,"x":"CBSE","z":"","p":18430.91,"s":0.00104478,"c":[],"tks":"S","T":"t","S":"BTCUSD","t":"2022-09-19T09:05:09.257973Z"}
{"i":413958054,"x":"CBSE","z":"","p":18431.86,"s":0.00233386,"c":[],"tks":"S","T":"t","S":"BTCUSD","t":"2022-09-19T09:05:09.257973Z"}
{"i":413958053,"x":"CBSE","z":"","p":18431.84,"s":0.01727787,"c":[],"tks":"S","T":"t","S":"BTCUSD","t":"2022-09-19T09:05:09.257973Z"}
{"i":413958059,"x":"CBSE","z":"","p":18432.82,"s":0.001,"c":[],"tks":"S","T":"t","S":"BTCUSD","t":"2022-09-19T09:05:09.416291Z"}

Is this as expected? It doesn’t seem to correspond with the examples in the alpaca documentation

thanks

Anything else?

Alpaca.Markets v6.1.3

var alpacaCryptoStreamingClient = Environments.Live.GetAlpacaCryptoStreamingClient(new SecretKey(ApiKey, ApiSecret));
await alpacaCryptoStreamingClient.ConnectAndAuthenticateAsync();
var subscription = alpacaCryptoStreamingClient.GetTradeSubscription("BTCUSD");
subscription.Received += Console.WriteLine;
await alpacaCryptoStreamingClient.SubscribeAsync(subscription);

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
OlegRacommented, Sep 19, 2022

@markns I’ve found the root cause. Unfortunately, you are unable to work around it on your side. I’ll publish the updated NuGet packages late evening today or early morning tomorrow (European time) after more testing. The root cause of “missing” trades after replacing the URL is serialization format changing. In the previous v1beta1 version of the stream, the x (exchange) field is mandatory for trades/quotes/order books but in the new v1beta2 it just does not exists.

I will publish the version with hotfix and in the next release, I’ll mark these properties as obsolete if needed.

1reaction
marknscommented, Sep 19, 2022

Hmm, I’m afraid I’m not getting any data for either BTC/USD or BTCUSD with the following code:

            const string symbol = "BTC/USD"; // BTCUSD
            var configuration = new AlpacaCryptoStreamingClientConfiguration()
            {
                SecurityId = new SecretKey(ApiKey, ApiSecret),
                ApiEndpoint = new Uri("wss://stream.data.alpaca.markets/v1beta2/crypto")
            };
            var alpacaCryptoStreamingClient = configuration.GetClient();
            await alpacaCryptoStreamingClient.ConnectAndAuthenticateAsync();
            var subscription = alpacaCryptoStreamingClient.GetTradeSubscription(symbol);
            subscription.Received += Console.WriteLine;
            await alpacaCryptoStreamingClient.SubscribeAsync(subscription);
Read more comments on GitHub >

github_iconTop Results From Across the Web

Binance API list all symbols with their names from a public ...
Binance API list all symbols with their names from a public endpoint - Stack Overflow.
Read more >
Crypto Trading | Alpaca Docs
With the introduction of crypto pairs some APIs have changed how certain fields return data, particularly the symbol key which will now include...
Read more >
Manual · ccxt/ccxt Wiki
Overview. The ccxt library is a collection of available crypto exchanges or exchange classes. Each class implements the public and private API for...
Read more >
Recent Marketing API Changes - LinkedIn
We have updated the description of the HEALTH_MATTERS symbol explaining the current policy for rejecting Ads with this reason.
Read more >
CoinMarketCap API Documentation
The CoinMarketCap API is a suite of high-performance RESTful JSON endpoints that are specifically designed to meet the mission-critical demands of ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found