Skip to content

Gateway controllers return incorrect data in GET /bot-orchestration/{bot_name}/history #132

@fengtality

Description

@fengtality

Description

The GET /bot-orchestration/{bot_name}/history endpoint returns incorrect data for Gateway-related controllers (AMM/LP strategies like Meteora CLMM).

Issues

1. Trade Fee schema shows incorrect token

The trade_fee.flat_fees[].token field shows the base asset (e.g., PERCOLATOR) instead of the native currency (e.g., SOL). Transaction fees on Solana are paid in SOL, not in the base token.

2. Only RANGE trades are returned

The endpoint only returns RANGE trade types, which correspond to positions being opened and closed. This misses the actual trading activity within the LP position.

This is the reason Hummingbot has a separate lphistory command instead of history for LP strategies - the standard history format doesn't capture LP-specific data correctly.

Example Response

curl -X 'GET' \
  'http://localhost:8000/bot-orchestration/blah-20260304-155319/history?days=0&verbose=false&timeout=30' \
  -H 'accept: application/json'
{
  "status": "success",
  "response": {
    "success": true,
    "data": {
      "data": {
        "trades": [
          {
            "market": "meteora/clmm",
            "trade_id": "5zCCyPKspk6kawk9Z2T7PMyW9GSVwSSShLgYDSc2dYKV2XAcxoAHBzjeoyBWT4vWj2iSqpLBwqAHZ2mm8Jk8M1XF",
            "price": "0.000011",
            "quantity": "345171.910192",
            "symbol": "PERCOLATOR-SOL",
            "trade_type": "RANGE",
            "base_asset": "PERCOLATOR",
            "quote_asset": "SOL",
            "raw_json": {
              "trade_fee": {
                "flat_fees": [
                  {
                    "token": "PERCOLATOR",  // ❌ Should be "SOL" (native currency)
                    "amount": "0.00007963700000000001"
                  }
                ]
              }
            }
          }
        ]
      }
    }
  }
}

Expected Behavior

  1. trade_fee.flat_fees[].token should reflect the actual fee token (native currency like SOL for Solana)
  2. Consider adding an lphistory endpoint or extending the history endpoint to return LP-specific data (fees earned, impermanent loss, etc.)

Environment

  • Controller type: Gateway LP controller (e.g., conf_generic.lp_rebalancer_PERCOLATOR.yml)
  • Connector: meteora/clmm

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions