ccxt / ccxt

A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading API with support for more than 100 bitcoin/altcoin exchanges
https://docs.ccxt.com
MIT License
33.19k stars 7.55k forks source link

anxpro v2 metadata does not have min order sizes but they are available via the v3 api #3692

Closed npomfret closed 5 years ago

npomfret commented 6 years ago

The min order sizes for anxpro markets are available: https://anxpro.com/api/3/currencyStatic. This data comes from the v3 api, but it is valid for the current v2 implementation.

It has 2 sections. The first bit looks like this:

{
  "currencyStatic": {
    "currencies": {
      ...
      "LTC": {
        "decimals": 8,
        "minOrderSize": 0.1,
        "maxOrderSize": 10000000,
        "displayDenominator": 1,
        "summaryDecimals": 1,
        "displayUnit": "LTC",
        "symbol": "Ł",
        "type": "CRYPTO",
        "confirmationThresholds": [
          {
            "confosRequired": 6
          }
        ],
        "networkFee": 0.02,
        "engineSettings": {
          "depositsEnabled": true,
          "withdrawalsEnabled": true,
          "displayEnabled": true,
          "mobileAccessEnabled": true
        },
        "minOrderValue": 0.01,
        "maxOrderValue": 100000000,
        "urlPrefix": "litecoin:",
        "maxMarketOrderValue": 1200,
        "maxMarketOrderSize": 1200,
        "digitalCurrencyType": "SATOSHI",
        "assetDivisibility": 0,
        "assetIcon": "/images/currencies/crypto/LTC.svg"
      }

You can infer the min order sizes for each market, they differ for bid and ask orders. In the example shown, for the LTCBTC, the min bid size is 0.1LTC, and the min ask size would be 0.01BTC. Is it possible to model this in ccxt?

You can also get the network withdrawal fee from here.

The next bit if this static contains market information. It looks like this:

    "currencyPairs": {
      ...
      "LTCBTC": {
        "priceDecimals": 5,
        "engineSettings": {
          "tradingEnabled": true,
          "displayEnabled": true,
          "cancelOnly": true,
          "verifyRequired": false,
          "restrictedBuy": false,
          "restrictedSell": false
        },
        "minOrderRate": 0.001,
        "maxOrderRate": 1,
        "displayPriceDecimals": 8,
        "tradedCcy": "LTC",
        "settlementCcy": "BTC",
        "preferredMarket": "BITFINEX",
        "chartEnabled": true,
        "simpleTradeEnabled": false
      }

You can set the market.active flag using the engineSettings. The price precision is also available.

npomfret commented 5 years ago

@kroitor (same question as https://github.com/ccxt/ccxt/issues/3618) can we mix api versions in an implementation?

Looks like the anxpro v3 api has some good new features (such as the enhanced metadata described above), but it has no market data api calls.

kroitor commented 5 years ago

@npomfret yes, we can, see how that is done in binance.js for example, or in bittrex.js. The properties of interest are api, urls and the sign() method. Let me know if you have any questions on that.

npomfret commented 5 years ago

@kroitor got it, thanks - https://github.com/ccxt/ccxt/pull/4616