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
    @ManuelSchneid3r another alternative is to do a binary search over time:
    1. start with since = 2010
    2. if it works, traverse from there
    3. if it doesn't work and returns an empty response, adjust the date to 2010+(now-2010)/2
    4. start from (now - 2010)/2, if it works – adjust to a bit a earlier date (shift your date into the past), if it doesn't work and return an empty response – shift your date into the future
    5. repeat until you locate the starting trade for the pair by splitting your search-timerange-adjustment in halves upon each step
    @ManuelSchneid3r one of the above ways should work, let me know if not
    hivemall
    @hivemall
    @kroitor has kraken added support to query the free/used portion of the total amount of a fetchBalance?
    Igor Kroitor
    @kroitor
    @hivemall nope
    @hivemall you can derive it from the other calls, though
    open_orders = exchange.fetch_open_orders(...)
    balance_used_in_orders = sum([o['remaining'] for o in open_orders])
    withdrawals = exchange.fetch_...
    balance_used_in_withdrawals = ...
    ...
    OliverNChalk
    @OliverNChalk
    any update on ccxt pro / websockets?
    Igor Kroitor
    @kroitor
    @OliverNChalk we now have a fully-transpileable repository with 10 exchanges working in js/py/php, going to invite beta-testers from our topmost contributors and will also announce the release date soon after, and we are going to add more exchanges along the way pretty quickly (and also hopefully resolve the integration backlog in ccxt)
    in short, almost there
    Akash Agarwal
    @iAk4zh_twitter
    What causes This request is expired error. My bot works usually but sometimes randomly it gives this error This request is expired current time is xxxxxxx
    Igor Kroitor
    @kroitor
    @iAk4zh_twitter in general, if it works with proper rate limiting most of the time, but fails occasionally – most often that is an error on the exchange-side, when the load balancers fail to serve a request due to high load. However, to tell the exact cause, we need all of the info, as described in the FAQ: https://github.com/ccxt/ccxt/wiki/FAQ and in the CONTRIBUTING guidelines: https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-submit-an-issue
    hivemall
    @hivemall
    @kroitor assume binance or bittrex get hacked, how would i find out first to eg pull out my funds, what endpoint (social: twitter/blog/api) would you query y think is best?
    Igor Kroitor
    @kroitor
    @hivemall subscribe to all possible channels (tg, twitter, fb, whatever) with all exchanges you have funds on, also track crypto news, read btt, watch ccxt repo, etc
    hivemall
    @hivemall
    but bot needs to crawl then, wonder where to start, i try to automate the 'check'
    Igor Kroitor
    @kroitor
    it's quite complicated, i don't know of any code that automates the checking if the exchange is operational or is going to shutdown
    but you could start by creating code that checks the status of the exchange over api where available
    ccxt has fetchStatus for that, and you could also help unify it for the exchanges that have the corresponding endpoints
    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)