cryptofeed icon indicating copy to clipboard operation
cryptofeed copied to clipboard

BITDOTCOM missing BTC-USDT-PERP

Open weaming opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe. no

Describe the solution you'd like add endpoints described in page https://www.bit.com/docs/en-us/linear_futures.html

Describe alternatives you've considered none

Additional context

Try this demo, the commented line will not run successfully

from decimal import Decimal

from cryptofeed import FeedHandler
from cryptofeed.defines import BITDOTCOM, TICKER


async def ticker(t, receipt_timestamp):
    if t.timestamp is not None:
        assert isinstance(t.timestamp, float)
    assert isinstance(t.exchange, str)
    assert isinstance(t.bid, Decimal)
    assert isinstance(t.ask, Decimal)
    print(f'Ticker received at {receipt_timestamp}: {t}')


def main():
    f = FeedHandler()
    # f.add_feed(BITDOTCOM, channels=[TICKER], symbols=['FIL-USDT-PERP'], callbacks={TICKER: ticker})
    f.add_feed(BITDOTCOM, channels=[TICKER], symbols=['BTC-USD-PERP'], callbacks={TICKER: ticker})
    f.run()


if __name__ == '__main__':
    main()

weaming avatar Sep 22 '22 16:09 weaming

And, there are two instrument will generate same symbol BTC-USD-PERP, but one is inverse perpetual.

I suggest the inverse one use the symbol format BTC-PERP, the other one use BTC-USD-PERP which use USD as margin.

weaming avatar Sep 22 '22 16:09 weaming