Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception after submitting an order #14

Closed
BrelKsiba opened this issue Nov 22, 2021 · 4 comments
Closed

Exception after submitting an order #14

BrelKsiba opened this issue Nov 22, 2021 · 4 comments

Comments

@BrelKsiba
Copy link

BrelKsiba commented Nov 22, 2021

I have a loop in which I am checking some conditions. Once these conditions verified, I am submitting an order.

Very few times where the submit function is called without an error but most of the time I have the following exception.

result = client.submit(transaction_group1, wait=True)
File "D:\Programs\lib\site-packages\tinyman\v1\client.py", line 34, in submit
raise Exception(json.loads(e.args[0])['message']) from None
File "D:\Programs\lib\json_init_.py", line 346, in loads
return _default_decoder.decode(s)
File "D:\Programs\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "D:\Programs\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Any idea about the root cause of this non deterministic behavior resulting to this exception?
Many Thanks

@fergalwalsh
Copy link
Contributor

It would be very helpful if you could modify D:\Programs\lib\site-packages\tinyman\v1\client.py", line 34, to print e and e.args so we can understand what is being returned in this case.
We assumed it was always some JSON but it seems this is not the case.

@BrelKsiba
Copy link
Author

BrelKsiba commented Nov 23, 2021

after adding print (e) and print (e.args) as suggested, I get the following:

TransactionPool.Remember: transaction ETIWFPB5AI3V4XI6VZGTADCQ4ZIUEDTPWA74PK7SVQY3JJOTFUWA: underflow on subtracting 6122893675 from sender amount 522767870
('TransactionPool.Remember: transaction ETIWFPB5AI3V4XI6VZGTADCQ4ZIUEDTPWA74PK7SVQY3JJOTFUWA: underflow on subtracting 6122893675 from sender amount 522767870',)

looks like related to numbers after decimals in the amount_in. may be I have to round it?

@rgpayne
Copy link

rgpayne commented Dec 16, 2021

i was getting the same error when attempting to initiate a swap while having 0 of an asset. user error in my case

@fergalwalsh
Copy link
Contributor

Error handling fixed in a3025d7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants