Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    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 )
    also, the source code will be open to the licensees, so you will be able to investigate yourself as well
    athenawisdoms
    @athenawisdoms
    @kroitor Thats very good! Has any pricing information been released yet? I am still a student, hoping for an affordable price
    Igor Kroitor
    @kroitor

    Has any pricing information been released yet?

    The pricing is very close to this: https://github.com/ccxt/ccxt/issues/56#issuecomment-527194069

    I am still a student, hoping for an affordable price

    If you take part in developing and supporting it after the release – you can get a free CCXT bRO license.

    hivemall
    @hivemall
    hey @kroitor what is recmd install for python after reviewing the repo. i checkout the last tag and now?
    pip install . from root dir or from root/python dir ? both have setup.cfg file
    hivemall
    @hivemall
    i did from the latter, was fine so far
    athenawisdoms
    @athenawisdoms
    @kroitor What is your recommendation for writing an app that can handle the high concurrency workloads associated with subscribing to many WS servers in CCXT Pro? Will you choose Python or Node for this role?
    Igor Kroitor
    @kroitor
    @hivemall it is usually pip -e path/to/ccxt/repo/python (ending with the python folder, if you want to install from git, otherwise just run pip install ccxt)
    @athenawisdoms technically, the performance is pretty much the same between WS+py vs WS+js – both use the same underlying bsd socket mechanisms (built into the OS)
    Igor Kroitor
    @kroitor
    @Mr-Robot88 hey ) I finally got an answer from ByteTrade on market orders – indeed, it has to submit a zero price for market orders, so I've uploaded a fix to CCXT and it should work normally as of CCXT 1.22.46. Let me know if you still have issues after updating to the most recent version. Thx again!
    F. Eugene Aumson
    @feuGeneA

    Coinbase Pro sent out an email saying all clients need to be using Server Name Indication, in their TLS negotiation, or else they'll be denied access. how can i confirm that ccxt supports SNI?

    i did find ccxt/ccxt#2193 , which implies that it should "just work", but i'd like a more explicit confirmation

    Igor Kroitor
    @kroitor
    @feuGeneA technically, the SNI is handled by the SSL/TLS negotiation, which is a functionality that is introduced with 3rd-party libraries, like openssl and built-in lower-level protocols. CCXT operates on a higher level, so it does not differentiate between these transports. Thus, if SNI works on your system/environment in general – it will work with CCXT as well.
    F. Eugene Aumson
    @feuGeneA
    @kroitor i see thank you for your reply
    Igor Kroitor
    @kroitor
    you're welcome)
    Igor Kroitor
    @kroitor
    @hollylisa_gitlab i didn't have the time to debug it yet, but will do my best to get to it asap