大神,请问这个错误怎么解决呀?
Closed this issue · 1 comments
2024-03-06 22:17:06.468 | INFO | aevo:sign_order:508 - {'name': 'Aevo Mainnet', 'version': '1', 'chainId': '1'}
Traceback (most recent call last):
File "/Users/jiamu/Documents/AEVO/aevoTrading/aevo_market_price_trade.py", line 89, in
asyncio.run(main())
File "/opt/homebrew/Cellar/python@3.11/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.11/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.11/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/Users/jiamu/Documents/AEVO/aevoTrading/aevo_market_price_trade.py", line 59, in main
response = aevo.rest_create_order(instrument_id=instrument_id, is_buy=False, limit_price=0, quantity=quantity, post_only=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/jiamu/Documents/AEVO/aevoTrading/aevo.py", line 188, in rest_create_order
data, order_id = self.create_order_rest_json(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/jiamu/Documents/AEVO/aevoTrading/aevo.py", line 376, in create_order_rest_json
salt, signature, order_id = self.sign_order(
^^^^^^^^^^^^^^^^
File "/Users/jiamu/Documents/AEVO/aevoTrading/aevo.py", line 510, in sign_order
signable_bytes = keccak(order_struct.signable_bytes(domain=domain))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/jiamu/Documents/AEVO/aevoTrading/eip712_structs.py", line 462, in signable_bytes
result = b"\x19\x01" + domain.hash_struct() + self.hash_struct()
^^^^^^^^^^^^^^^^^^
File "/Users/jiamu/Documents/AEVO/aevoTrading/eip712_structs.py", line 385, in hash_struct
return keccak(b"".join([self.type_hash(), self.encode_value()]))
^^^^^^^^^^^^^^^^^^^
File "/Users/jiamu/Documents/AEVO/aevoTrading/eip712_structs.py", line 313, in encode_value
encoded_values.append(typ.encode_value(self.values[name]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/jiamu/Documents/AEVO/aevoTrading/eip712_structs.py", line 40, in encode_value
return self._encode_value(value)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/jiamu/Documents/AEVO/aevoTrading/eip712_structs.py", line 101, in _encode_value
return Uint(160).encode_value(v)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/jiamu/Documents/AEVO/aevoTrading/eip712_structs.py", line 40, in encode_value
return self._encode_value(value)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/jiamu/Documents/AEVO/aevoTrading/eip712_structs.py", line 210, in _encode_value
value.to_bytes(
OverflowError: int too big to convert
这个是交易所的API有些问题,有时候直接用市价单无法挂单。建议出问题的停一下,手动平一下仓再试。