Skip to content
This repository was archived by the owner on Mar 20, 2024. It is now read-only.

Too large values in dataframe if trying to 'swap' 1000 USDC #2

Open
smypmsa opened this issue Oct 20, 2022 · 0 comments
Open

Too large values in dataframe if trying to 'swap' 1000 USDC #2

smypmsa opened this issue Oct 20, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@smypmsa
Copy link
Owner

smypmsa commented Oct 20, 2022

Code fails if we try get amounts for 1000 USDC.

Traceback (most recent call last):
  File "/Users/antonsauchyk/PycharmProjects/DEX-prices-monitor_GIT/venv/lib/python3.9/site-packages/pandas/core/ops/array_ops.py", line 143, in na_arithmetic_op
    result = expressions.evaluate(op, left, right)
  File "/Users/antonsauchyk/PycharmProjects/DEX-prices-monitor_GIT/venv/lib/python3.9/site-packages/pandas/core/computation/expressions.py", line 233, in evaluate
    return _evaluate(op, op_str, a, b)  # type: ignore
  File "/Users/antonsauchyk/PycharmProjects/DEX-prices-monitor_GIT/venv/lib/python3.9/site-packages/pandas/core/computation/expressions.py", line 68, in _evaluate_standard
    return op(a, b)
TypeError: unsupported operand type(s) for -: 'str' and 'int'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/antonsauchyk/PycharmProjects/DEX-prices-monitor_GIT/main.py", line 132, in <module>
    df_tokens['arbitrage_result'] = round((df_tokens['max_amount_for_token'] - SWAP_TOKEN_AMOUNT) / \
  File "/Users/antonsauchyk/PycharmProjects/DEX-prices-monitor_GIT/venv/lib/python3.9/site-packages/pandas/core/ops/common.py", line 65, in new_method
    return method(self, other)
  File "/Users/antonsauchyk/PycharmProjects/DEX-prices-monitor_GIT/venv/lib/python3.9/site-packages/pandas/core/ops/__init__.py", line 343, in wrapper
    result = arithmetic_op(lvalues, rvalues, op)
  File "/Users/antonsauchyk/PycharmProjects/DEX-prices-monitor_GIT/venv/lib/python3.9/site-packages/pandas/core/ops/array_ops.py", line 190, in arithmetic_op
    res_values = na_arithmetic_op(lvalues, rvalues, op)
  File "/Users/antonsauchyk/PycharmProjects/DEX-prices-monitor_GIT/venv/lib/python3.9/site-packages/pandas/core/ops/array_ops.py", line 150, in na_arithmetic_op
    result = masked_arith_op(left, right, op)
  File "/Users/antonsauchyk/PycharmProjects/DEX-prices-monitor_GIT/venv/lib/python3.9/site-packages/pandas/core/ops/array_ops.py", line 112, in masked_arith_op
    result[mask] = op(xrav[mask], y)
TypeError: unsupported operand type(s) for -: 'str' and 'int'
@smypmsa smypmsa added the bug Something isn't working label Oct 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant