Imported from wrightpt/proxmox-k8s-public (
nextjs-market/apps/operations-dashboard/src/app/trading/AGENTS.md). Install upstream withnpx skills add wrightpt/proxmox-k8s-public --skill trading. Copyright stays with the author.
AGENTS.md — Trading Dashboard
This directory owns the /trading operations dashboard surface at ops.3xmr.com/trading.
The page is authenticated in production, so local source and API routes are usually the fastest
way to understand the experience.
What This Page Is For
- Present paper/live trading strategy state in a client-safe way.
- Make the daily operating posture obvious: actionable, managing open risk, stale, or waiting.
- Show strategy thesis, evidence, guardrails, and raw telemetry together.
- Avoid language that promises profit. Use "validated", "candidate", "paper", "paused", and "risk controls" precisely.
Strategy Language For Agents
Translate "highest return possible" as "highest durable after-cost expected return for the risk taken." The dashboard should make it easy to compare expectancy, drawdown, freshness, regime state, liquidity, and operational readiness. It should not reward a strategy for trading more often unless the additional trades improve validated expectancy after costs.
Daily operation means daily evaluation, PnL marking, risk-state refresh, and a clear decision label. A no-trade day with a good reason is a successful product state.
Key Files
page.tsx— thin route wrapper.TradingOverviewClient.tsx— dashboard presentation.strategy-insights.ts— pure strategy playbook, status, summary, and execution logic.strategy-insights.test.ts— node:test coverage for the pure logic._helpers.ts— formatting helpers shared with positions/executions tabs.- API source:
src/app/api/internal/trading/overview/route.ts. - ClickHouse source:
src/services/clickhouse/analytics.ts. - Strategy doc:
nextjs-market/apps/operations-dashboard/docs/TRADING_STRATEGY_PRESENTATION.md.
Hyperliquid Live Trading (/hyperliquid)
A new top-level page dedicated to live perp-futures positions on Hyperliquid mainnet.
What it shows:
- Open positions (symbol, side, size, entry price, mark price, unrealized PnL)
- Current funding rate (1h and 8h equivalent)
- Cumulative funding collected since position open
- Margin used, liquidation price, account value
Key files:
src/app/hyperliquid/page.tsx— client dashboard with SWR polling (30s)src/app/api/internal/hyperliquid/positions/route.ts— API route queryinganalytics.hyperliquid_positionssrc/services/clickhouse/analytics.ts—getHyperliquidPositions()query functionsrc/components/DashboardNav.tsx— nav link
Bot-side sync job:
services/xmr-market-data/src/jobs/hyperliquid_position_sync.py— runs every 5 min, fetches position state viaHyperliquidExecutor, writes to ClickHouse- Table:
analytics.hyperliquid_positions(ReplacingMergeTree, partitioned monthly, 5-year TTL)
Bot-Side Documentation (services/xmr-market-data)
The strategies displayed here are produced by the Python paper-trader at
services/xmr-market-data/. When you need bot-side context:
- Variant taxonomy & lineage —
services/xmr-market-data/docs/STRATEGY_REGISTRY.md. Authoritative for whichstrategy_namestrings exist and what each adds. Update both this file'sstrategy-insights.tsand the bot's STRATEGY_REGISTRY when promoting a variant. - Term definitions (variant vs candidate vs challenger; carry vs edge vs funding) —
services/xmr-market-data/docs/GLOSSARY.md. - Bot architecture & "Adding a New Variant" recipe —
services/xmr-market-data/AGENTS.md. - ClickHouse schema is owned by
services/xmr-market-data/src/xmr_funding_carry/storage.py:SCHEMA_DDLand re-exported by the job facade for compatibility. Coordinate any schema changes with the bot side before changinganalytics.ts.
Adding Or Changing A Strategy
- Add or update the strategy playbook in
strategy-insights.ts. - Include client narrative, trade rule, risk controls, evidence, docs, and
maxSignalAgeHours. - Add/adjust tests in
strategy-insights.test.ts. - Update
docs/TRADING_STRATEGY_PRESENTATION.mdif the strategy is client-visible. - Keep paused/suspended strategies visible as risk-management evidence, not as trade candidates.
Current Strategy Posture
funding_carry_z30d_15_krakenis the main client-ready paper candidate.funding_carry_z30d_15_kraken_v2_short_tais a paper-only challenger for comparing short-entry RSI/MACD confirmation against the v1 control.funding_carry_z7d_15_20venue_medianis suspended after the May 2026 regime shift.funding_carry_baselineis useful as an educational/research control, not the primary pitch.- Hyperliquid delta-neutral funding carry (
hyperliquid_mainnet) is now live (not paper). Currently running a manual sleeve: long XMR-PERP to collect funding (+0.0035%/h). The infrastructure is in place for multi-asset sizing once forward-paper validation clears. Seeservices/xmr-market-data/docs/PERP_STRATEGY_ENGINE_PLAN.md.
Verification
From nextjs-market/apps/operations-dashboard:
pnpm exec tsx --test src/app/trading/strategy-insights.test.ts
pnpm exec tsc --noEmit --pretty false
Use pnpm dev:local for a local Next.js server on port 3003 when visual QA is needed.
Safety Rules
- Do not add a "trade now" or live execution action without explicit risk gates, audit logging, idempotency, venue health checks, and a kill switch.
- Do not read
.env,.mcp.json, credentials, Talos configs, or wallet material to work on this UI. - Cluster changes still go through GitOps. Do not manually
kubectl applymanaged resources. - Daily trading means daily review. A no-trade decision is a valid bot outcome.
- Never present "highest return" without the cost/risk qualifier: after fees, slippage, funding, liquidity, venue risk, and operational risk.
