Stream latest prices

Hi all,

I have been able to get the latest prices from Balancer pools with this query:

const client = new ApolloClient({ uri: kovanUrl, cache: new InMemoryCache()});

const pricesQuery = { latestPrices { id asset pricingAsset poolId { id } price block } };

  client.query({ query: gql(pricesQuery)}).then(data => console.log("Prices data: ", data)).catch(err => { console.log("Error fetching prices data: ", err) });

However, I would like to subscribe to the latest prices and get the prices updates.

I have read the Apollo documentation

and it seems that it is possible to do it. What changes do I need to do to the query to be able to subscribe to the latestPrices price updates?

Thanks in advance,

Jordi

you should come to discord and ask this in #dev

1 Like

I will do it, Thanks!

I created a message thread in discord

Not sure if it is the right place.

Thanks