Skip to content

Orca - Unified CLMM position-info returns 500 instead of 404 when position is closed or missing #631

@rapcmia

Description

@rapcmia

Describe the bug

This issue was spotted while testing CLMM position flows through the unified endpoint from hummingbot/condor#76 and #630. After a position was closed, a follow-up request to /trading/clmm/position-info using connector=orca should have returned a clear not-found response, but the API returned a 500 internal server error.

Image
  • From logs, the Orca lookup first reports that the position cannot be fetched (which is expected for a closed or missing position), but then the unified route throws a second error while trying to build the HTTP error response. Because of
    that second failure, users see a generic 500 instead of a helpful 404, which makes troubleshooting and client handling harder.
    2026-05-11 19:10:49,854 - handlers.dex.pools - ERROR - Error closing position: 500, message='No transaction hash returned from Gateway', url='http://localhost:8000/gateway/clmm/close'
    Traceback (most recent call last):
      File "/home/eddga/hummingbot/condor/76/handlers/dex/pools.py", line 3418, in handle_pos_close_execute
        result = await client.gateway_clmm.close_position(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            connector=connector, network=network, position_address=position_address
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        )
        ^
      File "/home/eddga/hummingbot/condor/76/.venv/lib/python3.13/site-packages/hummingbot_api_client/routers/gateway_clmm.py", line 208, in close_position
        return await self._post("/gateway/clmm/close", json=request_data)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/eddga/hummingbot/condor/76/.venv/lib/python3.13/site-packages/hummingbot_api_client/routers/base.py", line 83, in _post
        raise aiohttp.ClientResponseError(
        ...<5 lines>...
        )
    aiohttp.client_exceptions.ClientResponseError: 500, message='No transaction hash returned from Gateway', url='http://localhost:8000/gateway/clmm/close'
    

Steps to reproduce

  • Run Gateway on port 15888 with Orca on solana-mainnet-beta
  • Close an Orca CLMM position (or use a position address that is no longer active)
  • Call GET /trading/clmm/position-info?connector=orca&chainNetwork=solana-mainnet-beta&positionAddress=<closed_or_missing_position>
  • Observe that the API returns 500 Internal Server Error instead of an expected 404 Not Found
  • Check logs and observe both messages: Orca position fetch failure followed by `Cannot read properties of undefined (reading 'notFound')

Release version

dev-2.15

Type of installation

Source

Attach required files

n/a

Metadata

Metadata

Assignees

No one assigned

    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