Bläddra i källkod

another grid trader fix

Lukas Goldschmidt 1 dag sedan
förälder
incheckning
8b36b27788
3 ändrade filer med 21 tillägg och 3 borttagningar
  1. 9 0
      AGENTS.md
  2. 10 1
      strategies/AGENTS.md
  3. 2 2
      strategies/grid_trader.py

+ 9 - 0
AGENTS.md

@@ -57,6 +57,15 @@ TRADER-MCP is structured in three layers:
 
 - See `strategies/AGENTS.md` for shared strategy-folder rules and strategy-specific notes such as `grid_trader` shape and rebuild behavior.
 
+## Wiki References
+
+- [Trader MCP](/home/lucky/wiki/entities/trader-mcp.md) for the project-level overview.
+- [Grid Trader](/home/lucky/wiki/entities/grid-trader.md) for the full-grid rebuild contract.
+- [Dumb Trader](/home/lucky/wiki/entities/dumb-trader.md) for the side-only execution contract.
+- [Trend Follower](/home/lucky/wiki/entities/trend-follower.md) for the compatibility alias.
+- [Exposure Protector](/home/lucky/wiki/entities/exposure-protector.md) for the defensive rebalancing contract.
+- [Grid Trading](/home/lucky/wiki/concepts/grid-trading.md), [Mean Reversion](/home/lucky/wiki/concepts/mean-reversion.md), [Inventory Rebalancing](/home/lucky/wiki/concepts/inventory-rebalancing.md), and [Side-Only Execution](/home/lucky/wiki/concepts/side-only-execution.md) for the underlying concepts.
+
 ---
 
 ## Failure Model

+ 10 - 1
strategies/AGENTS.md

@@ -58,10 +58,19 @@ The code in `strategies/*.py` should stay focused on strategy behavior. Shared m
 
 ---
 
+## Wiki References
+
+- [Grid Trader](/home/lucky/wiki/entities/grid-trader.md) for the implementation page.
+- [Mean Reversion](/home/lucky/wiki/concepts/mean-reversion.md) and [Grid Trading](/home/lucky/wiki/concepts/grid-trading.md) for the strategy concepts.
+- [Inventory Rebalancing](/home/lucky/wiki/concepts/inventory-rebalancing.md) for the inventory-bias concept.
+- [Dumb Trader](/home/lucky/wiki/entities/dumb-trader.md) and [Side-Only Execution](/home/lucky/wiki/concepts/side-only-execution.md) for the side-only execution contract.
+- [Exposure Protector](/home/lucky/wiki/entities/exposure-protector.md) for the companion defensive strategy.
+
+---
+
 ## Future Strategy Sections
 
 - `dumb_trader`: TODO
 - `trend_follower`: TODO
 - `exposure_protector`: TODO
 - any new strategy: document its own shape, sizing, and restart invariants here
-

+ 2 - 2
strategies/grid_trader.py

@@ -726,7 +726,7 @@ class Strategy(Strategy):
             quote_symbol: max(float(quote_total or 0.0), 0.0),
         }
 
-        spendable_total = self._resource_total_for_side(side, base_total, quote_total) * 0.995
+        spendable_total = self._resource_total_for_side(side, base_total, quote_total)
         total_cost = 0.0
         planned_orders = []
         skipped = []
@@ -1120,7 +1120,7 @@ class Strategy(Strategy):
         target_buy = int((planned_grid.get("counts") or {}).get("buy") or 0)
         target_sell = int((planned_grid.get("counts") or {}).get("sell") or 0)
         balance_shape_inconclusive = bool(self.state.get("balance_shape_inconclusive"))
-        # Shape means side counts here. Exact ids are handled by the tracked-order path below.
+        # Shape means the best funded per-side grid, not a fixed paired layout.
         grid_not_as_expected = current_buy != target_buy or current_sell != target_sell
 
         if balance_shape_inconclusive: