Skip to content

Investigate issue sell amount does not cover fee #856

@gabrielfior

Description

@gabrielfior

Uncaught exception: An unexpected error occurred: HTTP error 400: {"errorType":"SellAmountDoesNotCoverFee","description":"The sell amount for the sell order is lower than the fee.","data":{"fee_amount":"0x46e20680"}}

Agent - prophet-gpt4omini-omen-29258670-bj7vf"

https://console.cloud.google.com/logs/query;cursorTimestamp=2025-08-18T12:40:36.032890272Z;duration=PT1H;query=resource.labels.namespace_name%3D%22agents%22%0Aresource.labels.container_name%3D%22main%22%0Alabels.%22k8s-pod%2Fagent_job%22%3D%22true%22%0Aseverity%3DERROR%0ANOT%20%22OutOfFundsError%22%0ANOT%20%22ResourceWarning:%20%22%0ANOT%20%22DeprecationWarning%22%0A%20timestamp%3E%3D%222025-08-15T14:38:27.641Z%22%20%0A%20--timestamp%3C%3D%222025-08-18T15:38:27.641Z%22%20%0A%20severity%3E%3DDEFAULT%0Atimestamp%3D%222025-08-18T12:40:36.032890272Z%22%0AinsertId%3D%22sok8v42mtnb6xbhx%22?project=gnosis-ai

exc_info: [
0: "RetryError"
1: "RetryError: RetryError[<Future at 0x7c2d90484e10 state=finished raised UnexpectedResponseError>]"
2: "File "/app/prediction_market_agent/run_agent.py", line 235, in <module>
    APP()
  File "/app/.venv/lib/python3.11/site-packages/typer/main.py", line 338, in __call__
    raise e
  File "/app/.venv/lib/python3.11/site-packages/typer/main.py", line 321, in __call__
    return get_command(self)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/click/core.py", line 1442, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/typer/core.py", line 665, in main
    return _main(
           ^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/typer/core.py", line 197, in _main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/click/core.py", line 1226, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/click/core.py", line 794, in invoke
    return callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/typer/main.py", line 703, in wrapper
    return callback(**use_params)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/app/prediction_market_agent/run_agent.py", line 231, in main
    RUNNABLE_AGENTS[agent]().run(market_type=market_type)
  File "/app/.venv/lib/python3.11/site-packages/prediction_market_agent_tooling/deploy/agent.py", line 595, in run
    self.process_markets(market_type)
  File "/app/.venv/lib/python3.11/site-packages/prediction_market_agent_tooling/deploy/agent.py", line 571, in process_markets
    processed_market = self.process_market(market_type, market)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/langfuse/decorators/langfuse_decorator.py", line 256, in sync_wrapper
    self._handle_exception(observation, e)
  File "/app/.venv/lib/python3.11/site-packages/langfuse/decorators/langfuse_decorator.py", line 520, in _handle_exception
    raise e
  File "/app/.venv/lib/python3.11/site-packages/langfuse/decorators/langfuse_decorator.py", line 254, in sync_wrapper
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/prediction_market_agent_tooling/deploy/agent.py", line 763, in process_market
    placed_trades = self.execute_trades(market, trades)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/langfuse/decorators/langfuse_decorator.py", line 256, in sync_wrapper
    self._handle_exception(observation, e)
  File "/app/.venv/lib/python3.11/site-packages/langfuse/decorators/langfuse_decorator.py", line 520, in _handle_exception
    raise e
  File "/app/.venv/lib/python3.11/site-packages/langfuse/decorators/langfuse_decorator.py", line 254, in sync_wrapper
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/prediction_market_agent_tooling/deploy/agent.py", line 696, in execute_trades
    id = market.buy_tokens(
         ^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/prediction_market_agent_tooling/markets/omen/omen.py", line 233, in buy_tokens
    return self.place_bet(
           ^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/prediction_market_agent_tooling/markets/omen/omen.py", line 217, in place_bet
    return binary_omen_buy_outcome_tx(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/prediction_market_agent_tooling/markets/omen/omen.py", line 748, in binary_omen_buy_outcome_tx
    return omen_buy_outcome_tx(
           ^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/tenacity/__init__.py", line 336, in wrapped_f
    return copy(f, *args, **kw)
           ^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/tenacity/__init__.py", line 475, in __call__
    do = self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/tenacity/__init__.py", line 376, in iter
    result = action(retry_state)
             ^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/tenacity/__init__.py", line 419, in exc_check
    raise retry_exc from fut.exception()"
]
exp_details: "UnexpectedResponseError: An unexpected error occurred: HTTP error 400: {"errorType":"SellAmountDoesNotCoverFee","description":"The sell amount for the sell order is lower than the fee.","data":{"fee_amount":"0x46e20680"}}"
}
level: "ERROR"
levelname: "ERROR"
message: "2025-08-18 12:40:36.027 | ERROR    | prediction_market_agent_tooling.loggers:_handle_exception:79 - Uncaught exception: An unexpected error occurred: HTTP error 400: {"errorType":"SellAmountDoesNotCoverFee","description":"The sell amount for the sell order is lower than the fee.","data":{"fee_amount":"0x46e20680"}}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions