Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Hyperliquid ticker stream is throttled #27475

@rtcz

Description

@rtcz

Operating System

WSL

Programming Language

Python

CCXT Version

4.5.26

Description

When using watch_ticker() on hyperliquid the updates take five seconds each. It seems they are not driven by pushing new data. In this case there is no point in using the watch method over fetch method which can provide a fresh data a lot more often.

import asyncio
import logging

import ccxt.pro as ccxtpro


logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)


async def main():
    exchange = ccxtpro.hyperliquid({"newUpdates": True})
    exchange.enableRateLimit = False
    await exchange.load_markets()
    exchange.verbose = True
    symbol = "BTC/USDC:USDC"
    try:
        while True:
            data = await exchange.watch_ticker(symbol)
            logger.info(data)
            # await asyncio.sleep(1)
    except KeyboardInterrupt:
        logger.info("\nShutting down...")
    finally:
        await exchange.close()


if __name__ == "__main__":
    asyncio.run(main())

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions