Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Igor Kroitor
    @kroitor
    apart from that you would probably want to train a deep learning model to fully automate "reading the news"
    hivemall
    @hivemall
    thank you, just did research on binance, lag of twitter vs blogs is 5minutes, will start with some common api endpoints and their blogs, social later
    hivemall
    @hivemall
    and which one for trex to check the status shown here: https://global.bittrex.com/Status
    Q3: how to check market: is btc/usdt active
    athenawisdoms
    @athenawisdoms
    Is CCXT Pro a code library, like ccxt but with a unified WS API to communicate with supported exchanges?
    Igor Kroitor
    @kroitor
    @athenawisdoms yes, exactly, and it's built upon CCXT, because in many cases you need both REST and WS
    Igor Kroitor
    @kroitor

    @hivemall

    You want to use implicit API methods as described in the Manual:

    where to find this api call? https://binance-docs.github.io/apidocs/spot/en/#exchange-information

    You can find it here among implicit API methods: https://github.com/ccxt/ccxt/blob/master/js/binance.js#L206
    The same endpoint is used to load exchange markets from Binance.

    In Python calling that explicit method is done like so:

    exchange.public_get_exchangeinfo()
    exchange.publicGetExchangeInfo()
    
    exchange.loadMarkets() // this will call the same endpoint internally anyway

    and which one for trex to check the status shown here: https://global.bittrex.com/Status

    It's the same story, you need another implicit method: https://github.com/ccxt/ccxt/blob/master/js/bittrex.js#L117

    exchange.v2_get_currencies_getwallethealth()
    exchange.v2GetCurrenciesGetWalletHealth()

    Q3: how to check market: is btc/usdt active

    Use the active flag inside the markets:

    exchange.load_markets()
    print(exchange.markets['BTC/USDT']['active'])
    @hivemall i've added some bittrex endpoints just now, so you might also want to update your ccxt version before you try the above.
    athenawisdoms
    @athenawisdoms
    @kroitor Is the CCXT Pro library a subscription or a one time payment?
    Igor Kroitor
    @kroitor
    @athenawisdoms it will be a monthly or a yearly subscription
    elohim
    @daHIFI_gitlab
    Hopefully they'll have discounts for contributors... ;)

    Hello all, I'm here cause I'd like to add exchange functionality for the SafeTrade Exchange. It's been a long time since I did any JS development, so it's going to be a challenge. The exchange in question is a fork of a project called Peatio, and I was hoping that there may be some other Peatio-derived exchanges already in the library that I could borrow from.

    Anyways, I'm going to be spending some time figuring out how to testing and debugging in IntelliJ. I've already got the Docker image running and have been reading over ccxt contribution docs a lot. Thanks for any suggestions.

    Igor Kroitor
    @kroitor

    @daHIFI_gitlab hi and welcome! )

    I would highly recommend reading through the CONTRIBUTING guidelines very carefully, that will save you a lot of time. In particular:

    In general, it may not be too easy to develop a complete integration from scratch, so I will also suggest looking into how things are done with the other exchanges as well. If you represent SafeTrade or if you are affiliated with the exchange it is also possible to hire the CCXT Dev Team to do the job for you on a commercial basis. That will of course depend on the underlying API and other factors. If that is something you would be interested in – feel free to reach out to me directly at igor@ccxt.trade.

    Don't hesitate if you have any questions

    elohim
    @daHIFI_gitlab
    Thanks. I'm a Python dev, so it's going to take me a while to get accustomed to JS. No affiliation with the exchange though. I was going to write a wrapper for their API, but figured I'd give this a crack since I've been using CCXT in a lot of my modules.
    Igor Kroitor
    @kroitor
    @daHIFI_gitlab no worries, the code in JS is transpiled to Py line-to-line, so we tried to make it as easy for all the devs as possible, regardless of the programming language. Feel free to ask questions here or anywhere you want – I will do my best to give the answers ASAP.
    elohim
    @daHIFI_gitlab
    kk. right now I'm just trying to instantiate the inherited exchange class in node terminal so I can start adding methods.
    athenawisdoms
    @athenawisdoms
    @kroitor After subscribing to the Websocket feed, how challenging is it to forward/re-serve them to multiple clients?
    Igor Kroitor
    @kroitor
    @athenawisdoms it depends on your ws server, so i'd say it is as easy as easy your ws server is. CCXT does not include a ws server, just the client-side stuff, but re-serving should be pretty straightforward anyway.
    Mr-Robot88
    @Mr-Robot88
    Hello there, on bytetrade upon creating a market order I get : NotSupported("Web3 functionality requires Python3 and web3 package installed: https://github.com/ethereum/web3.py"). I installed web3 but to no avail. What is the problem and what can I do to solve it?
    Igor Kroitor
    @kroitor
    @Mr-Robot88 depends on how you configure your environment...
    try running this to check if you have installed web3 properly:
    import web3
    print(web3.__version__)
    Mr-Robot88
    @Mr-Robot88
    Thanks a lot, fixed it!
    Igor Kroitor
    @kroitor
    @Mr-Robot88 you're welcome, let us know if you have further difficulties
    Mr-Robot88
    @Mr-Robot88
    next difficulty is, I get :InvalidOperation: [<class 'decimal.ConversionSyntax'>]. Same as above, a market order. I used the exchange.create_market_sell_order('symbol', amount) command, with amount set to the precision as I found it on bytetrade for the particular symbol.
    Igor Kroitor
    @kroitor
    @Mr-Robot88 if you can make a gist with a short but complete snippet of your code to reproduce the issue including the verbose request/response but without your keys – we will be able to resolve this quicker.
    Mr-Robot88
    @Mr-Robot88
    import ccxt
    
    #BYTETRADE:
    exchange = ccxt.bytetrade ({ #ccxt.exchanges
        'rateLimit': 10000,  
        'options': {
            'adjustForTimeDifference': False,  
        }
    })
    markets = exchange.load_markets()
    
    #(Loaded keys)
    exchange.apiKey = 'xxxxxxx'
    exchange.secret = 'xxxxxxxx'
    
    #Trade:
    exchange.create_market_sell_order('ETH/USDT', 0.0045)
    Output
    ---------------------------------------------------------------------------
    InvalidOperation                          Traceback (most recent call last)
    <ipython-input-33-2b75401ec67e> in <module>
    ----> 1 exchange.create_market_sell_order('ETH/USDT', 0.0045)
    
    ~\Anaconda3\envs\Python3.6Test\lib\site-packages\ccxt\base\exchange.py in create_market_sell_order(self, symbol, amount, params)
       1741 
       1742     def create_market_sell_order(self, symbol, amount, params={}):
    -> 1743         return self.create_order(symbol, 'market', 'sell', amount, None, params)
       1744 
       1745     def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
    
    ~\Anaconda3\envs\Python3.6Test\lib\site-packages\ccxt\bytetrade.py in create_order(self, symbol, type, side, amount, price, params)
        551         quoteId = market['quoteId']
        552         quoteCurrency = self.currency(market['quote'])
    --> 553         priceRounded = self.price_to_precision(symbol, price)
        554         priceChain = self.toWei(priceRounded, 'ether', quoteCurrency['precision']['amount'])
        555         now = self.milliseconds()
    
    ~\Anaconda3\envs\Python3.6Test\lib\site-packages\ccxt\base\exchange.py in price_to_precision(self, symbol, price)
       1200 
       1201     def price_to_precision(self, symbol, price):
    -> 1202         return self.decimal_to_precision(price, ROUND, self.markets[symbol]['precision']['price'], self.precisionMode)
       1203 
       1204     def amount_to_precision(self, symbol, amount):
    
    ~\Anaconda3\envs\Python3.6Test\lib\site-packages\ccxt\base\decimal_to_precision.py in decimal_to_precision(n, rounding_mode, precision, counting_mode, padding_mode)
         53     context.rounding = decimal.ROUND_HALF_UP  # rounds 0.5 away from zero
         54 
    ---> 55     dec = decimal.Decimal(str(n))
         56     precision_dec = decimal.Decimal(str(precision))
         57     string = '{:f}'.format(dec)  # convert to string using .format to avoid engineering notation
    
    InvalidOperation: [<class 'decimal.ConversionSyntax'>]
    Igor Kroitor
    @kroitor
    @Mr-Robot88 I don't think that Bytetrade can support market orders without specifying the price
    since it's a DEX with on-chain settlement
    However, let me check that and I will get back to you shortly.
    Igor Kroitor
    @kroitor
    @Mr-Robot88 it may be an issue in the implementation, will investigate and will resolve this asap.
    Igor Kroitor
    @kroitor
    @Mr-Robot88 does it work for you if you call it with create_order instead of create_market_sell_order with a specified price?
    symbol = 'ETH/USDT'
    ticker = exchange.fetch_ticker(symbol)
    price = ticker['high']
    # --------------------------------- ↓ market sell with a price ↓
    exchange.create_order('ETH/USDT', 'market', 'sell', 0.0045, price)
    Mr-Robot88
    @Mr-Robot88
    did it exactly like you suggested and got this
    ---------------------------------------------------------------------------
    Error                                     Traceback (most recent call last)
    <ipython-input-4-d5d8de860aca> in <module>
          2 ticker = exchange.fetch_ticker(symbol)
          3 price = ticker['high']
    ----> 4 exchange.create_order('ETH/USDT','market', 'sell', 0.0045, price)
    
    ~\Anaconda3\envs\Python3.6Test\lib\site-packages\ccxt\bytetrade.py in create_order(self, symbol, type, side, amount, price, params)
        637         bytestring = self.binary_concat_array(allByteStringArray)
        638         hash = self.hash(bytestring, 'sha256', 'hex')
    --> 639         signature = self.ecdsa(hash, self.secret, 'secp256k1', None, True)
        640         recoveryParam = self.decode(base64.b16encode(self.numberToLE(self.sum(signature['v'], 31), 1)))
        641         mySignature = recoveryParam + signature['r'] + signature['s']
    
    ~\Anaconda3\envs\Python3.6Test\lib\site-packages\ccxt\base\exchange.py in ecdsa(request, secret, algorithm, hash, fixed_length)
       1104             digest = base64.b16decode(encoded_request, casefold=True)
       1105         key = ecdsa.SigningKey.from_string(base64.b16decode(Exchange.encode(secret),
    -> 1106                                                             casefold=True), curve=curve_info[0])
       1107         r_binary, s_binary, v = key.sign_digest_deterministic(digest, hashfunc=hash_function,
       1108                                                               sigencode=ecdsa.util.sigencode_strings_canonize)
    
    ~\Anaconda3\envs\Python3.6Test\lib\base64.py in b16decode(s, casefold)
        265         s = s.upper()
        266     if re.search(b'[^0-9A-F]', s):
    --> 267         raise binascii.Error('Non-base16 digit found')
        268     return binascii.unhexlify(s)
        269 
    
    Error: Non-base16 digit found
    if I specify the price, is it not like a limit order then? So should I do an emulation of limit order? I thought this only applies to cases where the exchange( API)
    doesnt support a market order, which Bytetrade does..
    Igor Kroitor
    @kroitor
    @Mr-Robot88 I think with the existing order hashing algorithms the price has to be specified either way (a zero or another value), i've forwarded this question to the Bytetrade support and will get back to you on this issue when I get their response.
    Mr-Robot88
    @Mr-Robot88
    Thanks a lot for your support, be waiting for their reply
    Mr-Robot88
    @Mr-Robot88
    It seems to me the error is due to the signature being set wrong, perhaps I have inputted incorrectly the secret key parameter? I used the mnemonic given at registration as suggested in the bytetrade API docs.
    Igor Kroitor
    @kroitor
    @Mr-Robot88 yes, that may be the cause, you should use the keypair which is given slightly below the mnemonic on the bytetrade website, i think
    Mr-Robot88
    @Mr-Robot88
    I could not find the keypair and anyway will probably move away from bytetrade until such issues are resolved.
    Igor Kroitor
    @kroitor
    My keypair looks like:
            "apiKey": "swap_elf",
            "secret": "e1ea8e8c4e359..................9cede065b3e0f002863"
    @Mr-Robot88 have you tried to reach out to ByteTrade's techsupport on this?
    They should help you get the key, I believe.
    Mr-Robot88
    @Mr-Robot88
    I just did, thanks!
    Igor Kroitor
    @kroitor
    @Mr-Robot88 ok, plz let me know if you have a followup from them, i will do the same if i get an answer sooner
    Mr-Robot88
    @Mr-Robot88
    will do!
    Igor Kroitor
    @kroitor
    thx
    athenawisdoms
    @athenawisdoms
    @kroitor I have been thinking about managing local orderbooks from WS feeds when CCXT Pro is released. If there are multiple WS clients getting data from the same WS source (same exchange and market), how will we dedupe the redundant data after combining them, taking into account the possibility of missed orderbook updates and different/inconsistent latency)
    Igor Kroitor
    @kroitor
    @athenawisdoms we have solved it already, will provide the docs and a lot of details on how the library works and dispatches the feeds, and we think you will like it )