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.

Uniform `market["type"]` field semantics

See original GitHub issue

The market["type"] field returned by Exchange.fetch_markets() seems to have different semantics across exchanges.

Here is a comparison of the market type literals across 4 exchanges:

Exchange Spot Margin Delivery futures Perpetual swaps Options
Binance ‘spot’ ‘margin’ ‘delivery’ ‘future’ -
FTX ‘spot’ - ‘future’ ‘swap’ -
OKEx ‘spot’ - ‘futures’ ‘swap’ ‘option’
Gate.io ‘spot’ ‘margin’ ‘future’ ‘swap’ 'option

Is there a plan to make the market type part of the public API? Is there an exchange-independent way to determine if a symbol is a delivery future or a swap?

Thanks!

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:9
  • Comments:18 (13 by maintainers)

github_iconTop GitHub Comments

5reactions
frosty00commented, Jan 4, 2022

I’d suggest we call expiring contracts future and swaps swap everywhere

3reactions
mattepozzcommented, Jan 11, 2022

Hello! I noticed another bug related to this issue.

On Binance USDⓈ-M perpetual swaps and delivery futures have the same type: future.

Steps to reproduce:

exchange = ccxt.binanceusdm()
markets = exchange.load_markets()
print(f"BTC/USDT type       = {markets['BTC/USDT']['type']}")
print(f"BTCUSDT_220325 type = {markets['BTCUSDT_220325']['type']}")

# BTC/USDT type       = future
# BTCUSDT_220325 type = future
Read more comments on GitHub >

github_iconTop Results From Across the Web

Using predefined fields | uniforms | React form library for ...
We can handle it in two ways: By replacing the AutoField inside the AutoForm with a desired field. By manipulating the schema using...
Read more >
Data types and semantic types | Community Connectors
Semantic types help to describe the kind of information the data represents. For example, a field with a NUMBER data type may semantically...
Read more >
Social marketing activities (in %, N=422) | Download Scientific ...
The sponsorship of social programs (e.g. in the fields of education, ... and a uniform semantic programme for RM is proposed that links...
Read more >
US Patent Application for METHODS AND SYSTEMS FOR ...
This anchor information may be the uniform resource identifier (URI) or the ... While these attributes may be regarded semantically as identification data ......
Read more >
US20180047072A1 - Trust network effect - Google Patents
22, 2014, and entitled “Secure Area for Apps,” and which is a continuation-in-part of U.S. application ... A query marketType( ) What is...
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