MCPcopy Create free account
hub / github.com/ccxt/ccxt / parse_market

Method parse_market

python/ccxt/deepcoin.py:448–568  ·  view source on GitHub ↗
(self, market: dict)

Source from the content-addressed store, hash-verified

446 return self.parse_markets(dataResponse)
447
448 def parse_market(self, market: dict) -> Market:
449 #
450 # spot markets
451 #
452 # {
453 # "instType": "SPOT",
454 # "instId": "A-USDT",
455 # "uly": "",
456 # "baseCcy": "A",
457 # "quoteCcy": "USDT",
458 # "ctVal": "1",
459 # "ctValCcy": "",
460 # "listTime": "0",
461 # "lever": "1",
462 # "tickSz": "0.0001",
463 # "lotSz": "0.001",
464 # "minSz": "0.5",
465 # "ctType": "",
466 # "alias": "",
467 # "state": "live",
468 # "maxLmtSz": "7692307",
469 # "maxMktSz": "7692307"
470 # }
471 #
472 # swap markets
473 #
474 # {
475 # "instType": "SWAP",
476 # "instId": "ZORA-USDT-SWAP",
477 # "uly": "",
478 # "baseCcy": "ZORA",
479 # "quoteCcy": "USDT",
480 # "ctVal": "1",
481 # "ctValCcy": "",
482 # "listTime": "0",
483 # "lever": "20",
484 # "tickSz": "0.00001",
485 # "lotSz": "1",
486 # "minSz": "1685",
487 # "ctType": "",
488 # "alias": "",
489 # "state": "live",
490 # "maxLmtSz": "10000000",
491 # "maxMktSz": "10000000"
492 # }
493 #
494 id = self.safe_string(market, 'instId')
495 type = self.safe_string_lower(market, 'instType')
496 spot = (type == 'spot')
497 swap = (type == 'swap')
498 baseId = self.safe_string(market, 'baseCcy')
499 quoteId = self.safe_string(market, 'quoteCcy', '')
500 settleId = None
501 settle = None
502 base = self.safe_currency_code(baseId)
503 quote = self.safe_currency_code(quoteId)
504 symbol = base + '/' + quote
505 isLinear = None

Callers

nothing calls this directly

Calls 9

safe_stringMethod · 0.80
safe_string_lowerMethod · 0.80
safe_dict_2Method · 0.80
string_maxMethod · 0.80
parse_numberMethod · 0.80
string_gtMethod · 0.80
safe_numberMethod · 0.80
safe_currency_codeMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected