Order of Trades in Coinbase Advanced Trade API Websockets

Hey everyone,

Using the market_trades channel of the Coinbase Advanced Trade API websockets, I’ve noticed that the first trade in the array appears to be the most recent. Can someone confirm if this is accurate, or provide insights into the order of trades in the array? Your help is appreciated!

Thanks!

Hi @gioto! Thank you for being part of the forum community.
Can you please add more context to the question, specifically for the second part of it? Looking forward to your response.

Hi!
I’m currently working with the Coinbase WebSocket API and subscribing to the market_trades channel. I’ve received responses in the following format:

{
    'channel': 'market_trades',
    'timestamp': '2024-02-01T22:55:23.206423898Z',
    'sequence_num': 28,
    'events': [
        {
            'type': 'update',
            'trades': [
                {
                    'product_id': 'ETH-USD',
                    'trade_id': '492762795',
                    'price': '2293.78',
                    'size': '0.00624309',
                    'time': '2024-02-01T22:55:23.167679Z',
                    'side': 'SELL'
                },
                {
                    'product_id': 'ETH-USD',
                    'trade_id': '492762794',
                    'price': '2293.75',
                    'size': '0.04149173',
                    'time': '2024-02-01T22:55:23.167679Z',
                    'side': 'SELL'
                }
            ]
        }
    ]
}

I’m seeking clarification on whether it is guaranteed that the trades vector will consistently have, in its first position, the trade with the largest trade_id .