Skip to content

Position_executor - When stopped with keep_position true doesn't show on /executor/positions #115

@rapcmia

Description

@rapcmia

Describe the bug

When testing #114 using position executor and close it with keep_position=true to recheck if it correctly records position held, observed that it returns empty or zero amounts

/executors/positions/summary ❌

curl -u admin:admin http://localhost:8000/executors/positions/summary | jq
{
  "total_positions": 0,
  "total_realized_pnl": 0.0,
  "positions": []
}
logs: not found related error on logs

/executors/positions/connector/trading_pair ❌

curl -u admin:admin "http://localhost:8000/executors/positions/hyperliquid_perpetual/XYZ:AMZN-USD" | jq
{
  "trading_pair": "XYZ:AMZN-USD",
  "connector_name": "hyperliquid_perpetual",
  "account_name": "master_account",
  "buy_amount_base": 0.0,
  "buy_amount_quote": 0.0,
  "sell_amount_base": 0.0,
  "sell_amount_quote": 0.0,
  "net_amount_base": 0.0,
  "buy_breakeven_price": null,
  "sell_breakeven_price": null,
  "matched_amount_base": 0.0,
  "unmatched_amount_base": 0.0,
  "position_side": "FLAT",
  "realized_pnl_quote": 0.0,
  "unrealized_pnl_quote": null,
  "executor_count": 0,
  "executor_ids": [],
  "last_updated": null
}
logs: not found related error on logs

The sample response below return the expected responses under grid_executor (sell/short). However, they fail to do so when using position_executor.

#### sample response from grid_strike

curl -u admin:admin -H "X-Note: crosschecking with main branch" "http://localhost:8000/executors/positions/hyperliquid_perpetual/HYPE-USD" | jq
{
  "trading_pair": "HYPE-USD",
  "connector_name": "hyperliquid_perpetual",
  "account_name": "master_account",
  "buy_amount_base": 0.0,
  "buy_amount_quote": 0.0,
  "sell_amount_base": 1.32,
  "sell_amount_quote": 44.2508,
  "net_amount_base": -1.32,
  "buy_breakeven_price": null,
  "sell_breakeven_price": 33.52333333333333,
  "matched_amount_base": 0.0,
  "unmatched_amount_base": 1.32,
  "position_side": "SHORT",
  "realized_pnl_quote": 0.0,
  "unrealized_pnl_quote": null,
  "executor_count": 1,
  "executor_ids": [
    "6rKMuUPztpoDB2BohdJtMuJw1MeWQBRFJ6phiH5XeGBp"
  ],
  "last_updated": "2026-01-28T07:11:38.297774"

  ...trimmed...
  • The executor/{executor_id} custom_info return data for held_position_orders (tested two executors)
  • These data are not aggregated and correctly displayed on executor/positions/summary returns empty
  • For executor/positions/connector/trading_pair, returns flat zero values

Steps to reproduce bug

  1. open position_executor and close with keep_position true
  2. check executor/positions/summary and ../connector/trading_pair
  3. Compare with grid_executor

Test logs: 28012026_main.log

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