question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[wavesexchange] KeyError: 'EGG/WAVES'

See original GitHub issue
  • OS: Ubuntu Ubuntu 20.04.4 LTS
  • Programming Language version: Python 3.9.6
  • CCXT version: 1.79.95
import ccxt
from loguru import logger
from ccxt.base.errors import (BaseError, ExchangeError, AuthenticationError, PermissionDenied,
                              AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, BadResponse,
                              NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder,
                              OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable,
                              OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError,
                              DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance,
                              InvalidNonce, RequestTimeout)


logger.add('Logs/ccxt_trading_desk.py_log_{time}.log',
           format='{time:HH:mm:ss!UTC} {message}',
           rotation='100 MB', delay=True, filter='ccxt_trading_desk')


@logger.catch
def execute_trade():
    symbol = 'Waves Ducks/WAVES'
    order_type = 'limit'
    side = 'buy'
    amount = 1.10874978
    price = 5.14397851

    waves_exch = ccxt.wavesexchange({
        'apiKey': **********,
        'secret': **********,
    })

    try:
        waves_exch.verbose = True
        submission_report = waves_exch.createOrder(
            symbol, order_type, side, amount, price, {'feeAsset':'WX'})
    except (BaseError, ExchangeError, AuthenticationError, PermissionDenied,
            AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, BadResponse,
            NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder,
            OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable,
            OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection,
            RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout) as error:

        return ('error', {'error': str(error)})
    except Exception as crash_report:
        logger.exception(crash_report)
        return ('error', {'error': str(crash_report)})
    else:
        return ('ok', submission_report)


@logger.catch
def main():
    return execute_trade()


if __name__ == '__main__':
    main()

fetch Request: wavesexchange POST https://matcher.waves.exchange/matcher/orderbook RequestHeaders: {'Accept': 'application/json', 'Content-Type': 'application/json', 'User-Agent': 'python-requests/2.26.0', 'Accept-Encoding': 'gzip, deflate'} RequestBody: {"senderPublicKey":"************","matcherPublicKey":"9cpfKN9suPNvfeUNphzxXMjcnn974eme8ZhWUjaktzU5","assetPair":{"amountAsset":"C1iWsKGqLwjHUndiQ7iXpdmPum9PeCDFfyXBdJJosDRS","priceAsset":""},"orderType":"buy","price":514397851,"amount":110874978,"timestamp":1650473255988,"expiration":1652892455988,"matcherFee":7074571,"signature":"5Vgs6mbdZJv5Ce9mdobT6fppXr6bKn5WVDbzP6mGG5jMB5jgcA2eSScwctgvY5SwPm9n1bctAAKuXtLcdHjNNie8","version":3,"matcherFeeAssetId":"Atqv59EYzjFGuitKVnMRk6H8FukjoV3ktPorbEys25on"}

fetch Response: wavesexchange POST https://matcher.waves.exchange/matcher/orderbook 200 ResponseHeaders: {'Server': 'openresty', 'Date': 'Wed, 20 Apr 2022 16:47:49 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Vary': 'Accept-Encoding', 'x-span-id': '4d5d4faafd7841be', 'x-trace-id': 'cb67ececa32796ab', 'matcher-http-server': 'matcher-1', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Credentials': 'true', 'Access-Control-Allow-Methods': 'GET, POST, OPTIONS, PUT, DELETE', 'Access-Control-Allow-Headers': 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,signature,timestamp', 'Access-Control-Expose-Headers': 'Content-Length,Content-Range', 'Backend': 'unknown', 'Content-Encoding': 'gzip'} ResponseBody: {"success":true,"message":{"version":3,"id":"GK5ox4RfLJFtqjQsCbDmvCya8ZhFVEUQDtF4yYuAJ6C7","sender":"*********","senderPublicKey":"************","matcherPublicKey":"9cpfKN9suPNvfeUNphzxXMjcnn974eme8ZhWUjaktzU5","assetPair":{"amountAsset":"C1iWsKGqLwjHUndiQ7iXpdmPum9PeCDFfyXBdJJosDRS","priceAsset":"WAVES"},"orderType":"buy","amount":110874978,"price":514397851,"timestamp":1650473255988,"expiration":1652892455988,"matcherFee":7074571,"matcherFeeAssetId":"Atqv59EYzjFGuitKVnMRk6H8FukjoV3ktPorbEys25on","signature":"5Vgs6mbdZJv5Ce9mdobT6fppXr6bKn5WVDbzP6mGG5jMB5jgcA2eSScwctgvY5SwPm9n1bctAAKuXtLcdHjNNie8","proofs":["5Vgs6mbdZJv5Ce9mdobT6fppXr6bKn5WVDbzP6mGG5jMB5jgcA2eSScwctgvY5SwPm9n1bctAAKuXtLcdHjNNie8"]},"status":"OrderAccepted"}


   File "/home/machine/.asdf/installs/python/3.9.6/lib/python3.9/site-packages/ccxt/wavesexchange.py", line 1198, in create_order
     return self.parse_order(value, market)
                  β”‚    β”‚           β”‚      β”” {'id': 'C1iWsKGqLwjHUndiQ7iXpdmPum9PeCDFfyXBdJJosDRS/WAVES', 'symbol': 'Waves Ducks/WAVES', 'base': 'EGG', 'quote': 'WAVES', ...
              β”‚    β”‚           β”” {'version': '3', 'id': 'GK5ox4RfLJFtqjQsCbDmvCya8ZhFVEUQDtF4yYuAJ6C7', 'sender': '**********', 'send...
   β”‚    β”” <function wavesexchange.parse_order at 0x7fc9ae73a3a0>
                          β”” ccxt.wavesexchange()
              File "/home/machine/.asdf/installs/python/3.9.6/lib/python3.9/site-packages/ccxt/wavesexchange.py", line 1455, in parse_order
               price = self.price_from_precision(symbol, priceString)
         β”‚    β”‚                    β”‚       β”” '514397851'
                    β”‚    β”‚                    β”” 'EGG/WAVES'
                      β”‚    β”” <function wavesexchange.price_from_precision at 0x7fc9ae739d30>
                    β”” ccxt.wavesexchange()

File "/home/machine/.asdf/installs/python/3.9.6/lib/python3.9/site-packages/ccxt/wavesexchange.py", line 1071, in price_from_precision
      market = self.markets[symbol]
            β”‚    β”‚       β”” 'EGG/WAVES'
  β”‚    β”” {'WAVES/BTC': {'id': 'WAVES/8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS', 'symbol': 'WAVES/BTC', 'base': 'WAVES', 'quote': '...
β”” ccxt.wavesexchange()

   KeyError: 'EGG/WAVES'

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kroitorcommented, Apr 27, 2022

@Maxximiliann ok, it has arrived, please don’t hesitate if anything. Thx!

1reaction
Maxximilianncommented, Apr 27, 2022

@kroitor Looking forward to testing it out and reporting back to you. Thanks again! πŸ˜ƒ

Read more comments on GitHub >

github_iconTop Results From Across the Web

Errors and Debugging | WX.Network - Waves.Exchange
Such errors cause the connection to close. In this example: e is the type of message that stands for "error". 1585148910776 is Unix...
Read more >
Waves exchange initialization issue #7118 - GitHub
I am unable to use waves apis. Is instantiation correct? OS: fedora 30 Programming Language version: python 3.7 CCXT version: 1.29.67Β ...
Read more >
mne.Epochs β€” MNE 1.2.2 documentation - MNE-Python
If none of the provided names match any epoch labels, a KeyError will be raised.
Read more >
neurokit2.ecg.ecg_findpeaks β€” NeuroKit2 0.2.2 documentation
Returns the peak detector function by name def _ecg_findpeaks_findmethod(method): if method in ["nk", "nk2", "neurokit", "neurokit2"]: return ...
Read more >
How to avoid row access by label error in DataFrame?
I have trouble to access rows in DataFrame. My code and the results are asfollows. What's the problem? Please help me. df =...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found