@pgnio/helios-mcp 0.0.0-stage → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/README.md +44 -2
  2. package/dist/chunk-EIAUO3XE.mjs +2955 -0
  3. package/dist/chunk-NCF7ASJB.mjs +2986 -0
  4. package/dist/chunk-NWGWXYTS.mjs +2964 -0
  5. package/dist/cli.d.mts +1 -0
  6. package/dist/cli.d.ts +1 -0
  7. package/dist/cli.js +2968 -0
  8. package/dist/cli.mjs +24 -0
  9. package/dist/index.d.mts +2138 -0
  10. package/dist/index.d.ts +2138 -0
  11. package/dist/index.js +3043 -0
  12. package/dist/index.mjs +52 -0
  13. package/docs/ai-agent-indicators/00_index.txt +210 -0
  14. package/docs/ai-agent-indicators/activity_ratio.txt +166 -0
  15. package/docs/ai-agent-indicators/activity_zscore.txt +166 -0
  16. package/docs/ai-agent-indicators/bayesian_overbought.txt +134 -0
  17. package/docs/ai-agent-indicators/directional_efficiency.txt +134 -0
  18. package/docs/ai-agent-indicators/hfi.txt +172 -0
  19. package/docs/ai-agent-indicators/hfi_weights.txt +124 -0
  20. package/docs/ai-agent-indicators/hmi.txt +305 -0
  21. package/docs/ai-agent-indicators/hmi_velocity.txt +155 -0
  22. package/docs/ai-agent-indicators/hurst_exponent.txt +136 -0
  23. package/docs/ai-agent-indicators/macd_divergence.txt +133 -0
  24. package/docs/ai-agent-indicators/macd_histogram.txt +145 -0
  25. package/docs/ai-agent-indicators/macd_signal.txt +119 -0
  26. package/docs/ai-agent-indicators/market_structure.txt +201 -0
  27. package/docs/ai-agent-indicators/poc.txt +131 -0
  28. package/docs/ai-agent-indicators/poc_distance.txt +129 -0
  29. package/docs/ai-agent-indicators/regime.txt +225 -0
  30. package/docs/ai-agent-indicators/rsi_divergence.txt +145 -0
  31. package/docs/ai-agent-indicators/squeeze_duration.txt +115 -0
  32. package/docs/ai-agent-indicators/squeeze_energy.txt +128 -0
  33. package/docs/ai-agent-indicators/support_resistance.txt +169 -0
  34. package/docs/ai-agent-indicators/tf_alignment.txt +165 -0
  35. package/docs/ai-agent-indicators/trend_interpretation.txt +98 -0
  36. package/docs/ai-agent-indicators/trend_strength.txt +134 -0
  37. package/docs/ai-agent-indicators/value_area_position.txt +142 -0
  38. package/docs/ai-agent-indicators/volatility_clustering.txt +160 -0
  39. package/docs/ai-agent-indicators/volatility_squeeze.txt +169 -0
  40. package/docs/ai-agent-indicators/volume_change_point.txt +151 -0
  41. package/docs/ai-agent-indicators/vwap.txt +133 -0
  42. package/docs/ai-agent-indicators/vwap_zscore.txt +154 -0
  43. package/docs/ai-agent-indicators/weighted_rsi.txt +148 -0
  44. package/docs/ai-agent-mcp/00_index.txt +110 -0
  45. package/docs/ai-agent-mcp/01_auth/00_overview.txt +51 -0
  46. package/docs/ai-agent-mcp/01_auth/01_tools.txt +94 -0
  47. package/docs/ai-agent-mcp/01_auth/02_data_contracts.txt +38 -0
  48. package/docs/ai-agent-mcp/01_auth/03_decision_rules.txt +25 -0
  49. package/docs/ai-agent-mcp/01_auth/04_failures_and_recovery.txt +46 -0
  50. package/docs/ai-agent-mcp/02_account/00_overview.txt +29 -0
  51. package/docs/ai-agent-mcp/02_account/01_tools.txt +67 -0
  52. package/docs/ai-agent-mcp/02_account/02_data_contracts.txt +34 -0
  53. package/docs/ai-agent-mcp/02_account/03_decision_rules.txt +17 -0
  54. package/docs/ai-agent-mcp/02_account/04_failures_and_recovery.txt +17 -0
  55. package/docs/ai-agent-mcp/03_market/00_overview.txt +27 -0
  56. package/docs/ai-agent-mcp/03_market/01_tools.txt +102 -0
  57. package/docs/ai-agent-mcp/03_market/02_data_contracts.txt +39 -0
  58. package/docs/ai-agent-mcp/03_market/03_decision_rules.txt +22 -0
  59. package/docs/ai-agent-mcp/03_market/04_failures_and_recovery.txt +18 -0
  60. package/docs/ai-agent-mcp/04_trading/00_overview.txt +25 -0
  61. package/docs/ai-agent-mcp/04_trading/01_tools.txt +123 -0
  62. package/docs/ai-agent-mcp/04_trading/02_data_contracts.txt +42 -0
  63. package/docs/ai-agent-mcp/04_trading/03_decision_rules.txt +30 -0
  64. package/docs/ai-agent-mcp/04_trading/04_failures_and_recovery.txt +25 -0
  65. package/docs/ai-agent-mcp/05_ledger/00_overview.txt +31 -0
  66. package/docs/ai-agent-mcp/05_ledger/01_tools.txt +80 -0
  67. package/docs/ai-agent-mcp/05_ledger/02_data_contracts.txt +46 -0
  68. package/docs/ai-agent-mcp/05_ledger/03_decision_rules.txt +44 -0
  69. package/docs/ai-agent-mcp/05_ledger/04_failures_and_recovery.txt +24 -0
  70. package/package.json +66 -3
@@ -0,0 +1,110 @@
1
+ ================================================================================
2
+ HELIOS MCP INDEX — AI AGENT REFERENCE
3
+ ================================================================================
4
+ PURPOSE
5
+ One-shot technical reference for the Helios MCP server.
6
+ Audience: agents and engineers.
7
+ Goal: understand tool inventory, scopes, data semantics, and failure rules
8
+ without reading source code.
9
+
10
+ READ ORDER
11
+ 1 01_auth/00_overview.txt
12
+ 2 02_account/00_overview.txt
13
+ 3 03_market/00_overview.txt
14
+ 4 04_trading/00_overview.txt
15
+ 5 05_ledger/00_overview.txt
16
+ 6 ai-agent-indicators/00_index.txt
17
+
18
+ GLOBAL RULES
19
+ - Transport is MCP over stdio.
20
+ - Auth is delegated device/browser approval, not browser-session reuse.
21
+ - Missing session => MCP returns manual login guidance, not silent auth.
22
+ - Backend 401 => local session is stale; clear session and re-login.
23
+ - Do not assume "connected" means every backend call will succeed forever.
24
+ - For market returns:
25
+ percent fields are already percentages
26
+ null means unavailable, not zero
27
+ - For ledger history:
28
+ default history is bounded
29
+ recent fills default to 7d window and limit 100
30
+ full history is NOT returned by default
31
+
32
+ SCOPES
33
+ account:read
34
+ Read wallet state, open positions, open orders, fills, and ledger summary.
35
+
36
+ market:read
37
+ Read market snapshots and symbol detail.
38
+
39
+ orders:write
40
+ Submit trading intents and create TP/SL protection.
41
+
42
+ orders:cancel
43
+ Cancel open orders and delete TP/SL orders.
44
+
45
+ TOOL INVENTORY
46
+ DOCS
47
+ helios_docs_get_index
48
+ helios_docs_get_document
49
+
50
+ AUTH
51
+ helios_auth_start_login
52
+ helios_auth_ensure_login
53
+ helios_auth_poll_login
54
+ helios_auth_whoami
55
+
56
+ PROVIDER
57
+ helios_provider_get_active
58
+ helios_provider_set_active
59
+
60
+ ACCOUNT
61
+ helios_account_get_wallet_state
62
+ helios_portfolio_get
63
+
64
+ MARKET
65
+ helios_market_get_snapshot
66
+ helios_market_get_snapshot_chunk
67
+ helios_market_get_symbol_detail
68
+
69
+ TRADING
70
+ helios_trading_open
71
+ helios_trading_dca
72
+ helios_trading_reverse
73
+ helios_trading_close
74
+ helios_positions_set_tp_sl
75
+ helios_positions_delete_tp_sl
76
+ helios_orders_get_open
77
+ helios_orders_cancel
78
+
79
+ LEDGER
80
+ helios_positions_get_open
81
+ helios_ledger_get_fills
82
+ helios_ledger_get_summary
83
+
84
+ LAYER MAP
85
+ 01_auth
86
+ Delegated login, refresh, stale-session recovery.
87
+
88
+ 02_account
89
+ Current wallet/equity state only.
90
+
91
+ 03_market
92
+ Market snapshot and symbol detail. Indicator formulas live in:
93
+ ai-agent-indicators/
94
+
95
+ 04_trading
96
+ Intent execution, TP/SL management, working-order management.
97
+
98
+ 05_ledger
99
+ Open positions, fills, realized/unrealized PnL context, summary metrics.
100
+
101
+ COMMON MISTAKES
102
+ - Do not skip helios_docs_get_index / helios_docs_get_document when tool or
103
+ indicator semantics are unclear.
104
+ - Do not multiply market percent fields by 100.
105
+ - Do not treat null as zero.
106
+ - Do not treat wallet state as ledger history.
107
+ - Do not treat open orders as positions.
108
+ - Do not assume orders:write implies orders:cancel.
109
+ - Do not assume a connected local session survives backend grant replacement.
110
+ - Do not assume provider defaults; use helios_provider_set_active or pass provider explicitly.
@@ -0,0 +1,51 @@
1
+ ================================================================================
2
+ LAYER: AUTH
3
+ ================================================================================
4
+ PURPOSE
5
+ Establish and maintain a delegated Helios session for an external agent.
6
+
7
+ MODEL
8
+ User creates Helios account manually first.
9
+ Agent does NOT create users.
10
+ Agent starts device login.
11
+ User opens approval URL in browser.
12
+ User authenticates to Helios and approves requested scopes.
13
+ Agent polls for approval and stores delegated tokens locally.
14
+
15
+ WHAT AUTH ENABLES
16
+ account:read -> read wallet, positions, open orders, fills, summary
17
+ market:read -> read market snapshots
18
+ orders:write -> submit intents, set TP/SL
19
+ orders:cancel -> cancel orders, delete TP/SL
20
+
21
+ HOSTED SERVER (helios.pgn.io/mcp, wagmi.pgn.io/mcp)
22
+ Sign-in is done by the AI app itself (OAuth): the user approves Helios once
23
+ when adding the connector, and the app holds and refreshes the tokens.
24
+ The login tools below are not offered there; helios_auth_whoami is.
25
+ If a call fails because the connection expired or was revoked, ask the
26
+ user to reconnect Helios in their AI app.
27
+
28
+ SESSION MODEL
29
+ - access token is short-lived
30
+ - refresh token is stored locally by the MCP server
31
+ - MCP refreshes automatically near expiry
32
+ - backend 401 invalidates local session and forces re-login
33
+
34
+ IMPORTANT
35
+ "connected" means:
36
+ MCP currently has a valid local delegated session
37
+
38
+ "connected" does NOT guarantee:
39
+ every backend request will succeed
40
+ grant still exists forever
41
+ requested scope upgrades have already been approved
42
+
43
+ PRIMARY TOOLS
44
+ helios_auth_start_login
45
+ helios_auth_ensure_login
46
+ helios_auth_poll_login
47
+ helios_auth_whoami
48
+
49
+ READ NEXT
50
+ 01_tools.txt
51
+ 04_failures_and_recovery.txt
@@ -0,0 +1,94 @@
1
+ ================================================================================
2
+ AUTH TOOLS
3
+ ================================================================================
4
+ TOOL: helios_auth_start_login
5
+ WHAT IT DOES
6
+ Starts a brand-new delegated Helios device flow and returns the approval URL
7
+ and device codes needed for browser consent.
8
+ WHEN TO USE IT
9
+ Use when you explicitly want to force a fresh login instead of reusing any
10
+ cached session state.
11
+ INPUT
12
+ clientName: string
13
+ scope: AgentScope[]
14
+ constraints?: record
15
+ OUTPUT
16
+ status: pending
17
+ deviceCode
18
+ userCode
19
+ verificationUri
20
+ verificationUriComplete
21
+ expiresInSeconds
22
+ pollIntervalSeconds
23
+ requestedScope
24
+ startedAt
25
+ actionRequired: true
26
+ loginUrl
27
+ nextStep
28
+ FINALITY
29
+ Starts approval only. It does NOT create a usable session until the request is
30
+ approved and later exchanged via helios_auth_poll_login.
31
+ COMMON PATTERN
32
+ start_login -> browser approval -> poll_login
33
+
34
+ TOOL: helios_auth_ensure_login
35
+ WHAT IT DOES
36
+ Reuses a valid delegated session if one already exists. If not, it starts a
37
+ login flow and returns pending approval instructions.
38
+ WHEN TO USE IT
39
+ Use at the start of an agent loop or before any account/market/trading call
40
+ when you want the MCP server to handle the "reuse vs login" decision.
41
+ INPUT
42
+ clientName?: string
43
+ scope?: AgentScope[]
44
+ constraints?: record
45
+ OUTPUT
46
+ connected state OR pending login state
47
+ DEFAULT_SCOPE
48
+ account:read + market:read when no explicit scope is supplied
49
+ FINALITY
50
+ This is the normal "gatekeeper" auth tool. If it returns connected, the next
51
+ MCP call can proceed. If it returns pending, the agent must complete approval
52
+ before continuing.
53
+ COMMON PATTERN
54
+ ensure_login -> if pending: browser approval -> poll_login -> continue work
55
+
56
+ TOOL: helios_auth_poll_login
57
+ WHAT IT DOES
58
+ Checks whether a pending device request has been approved, rejected, expired,
59
+ or successfully exchanged into an active delegated session.
60
+ WHEN TO USE IT
61
+ Use after start_login or ensure_login returned a pending device flow.
62
+ INPUT
63
+ deviceCode: string
64
+ OUTPUT
65
+ status: connected | pending | rejected | expired | failed
66
+ connected: boolean
67
+ message when not connected
68
+ FINALITY
69
+ This is the step that turns browser approval into a usable delegated session.
70
+ A connected result means account/market/trading tools can now be called.
71
+ COMMON PATTERN
72
+ poll until status becomes connected, rejected, or expired
73
+
74
+ TOOL: helios_auth_whoami
75
+ WHAT IT DOES
76
+ Returns the delegated session currently stored in the MCP server, if any.
77
+ WHEN TO USE IT
78
+ Use for inspection, debugging, status reporting, or to confirm which scopes
79
+ are already active before planning work.
80
+ INPUT
81
+ none
82
+ OUTPUT
83
+ connected
84
+ status
85
+ ownerUserId?
86
+ agentGrantId?
87
+ scope?
88
+ accessTokenExpiresAt?
89
+ lastRefreshedAt?
90
+ FINALITY
91
+ Read-only status check. It does not start login and does not refresh scope.
92
+ DECISION IT ENABLES
93
+ Decide whether to continue normally, call ensure_login, or start a fresh
94
+ delegated login flow.
@@ -0,0 +1,38 @@
1
+ ================================================================================
2
+ AUTH DATA CONTRACTS
3
+ ================================================================================
4
+ START LOGIN RESULT
5
+ status: pending
6
+ deviceCode: string
7
+ userCode: string
8
+ verificationUri: URL
9
+ verificationUriComplete: URL
10
+ expiresInSeconds: integer
11
+ pollIntervalSeconds: integer
12
+ requestedScope: AgentScope[]
13
+ startedAt: ISO-8601
14
+
15
+ SESSION VIEW
16
+ connected: boolean
17
+ status: disconnected | pending | connected | rejected | expired | failed
18
+ ownerUserId?: string
19
+ agentGrantId?: string
20
+ scope?: AgentScope[]
21
+ accessTokenExpiresAt?: ISO-8601
22
+ lastRefreshedAt?: ISO-8601
23
+
24
+ MANUAL LOGIN FIELDS
25
+ actionRequired: true
26
+ loginUrl: string
27
+ nextStep: string
28
+
29
+ TOKEN HANDLING
30
+ - raw accessToken is never returned by MCP tools
31
+ - raw refreshToken is never returned by MCP tools
32
+ - tokens are stored only in local MCP session storage
33
+
34
+ AGENT SCOPES
35
+ account:read
36
+ market:read
37
+ orders:write
38
+ orders:cancel
@@ -0,0 +1,25 @@
1
+ ================================================================================
2
+ AUTH DECISION RULES
3
+ ================================================================================
4
+ USE ensure_login WHEN
5
+ - you want the session if present
6
+ - you are about to call another Helios tool
7
+ - you want a manual approval URL only if needed
8
+
9
+ USE start_login WHEN
10
+ - you explicitly want to force a fresh login flow now
11
+ - you want the approval URL without first checking for an existing session
12
+
13
+ USE poll_login WHEN
14
+ - you already have a deviceCode
15
+ - user has had time to approve in browser
16
+
17
+ USE whoami WHEN
18
+ - you only need local session state
19
+ - you do not want to start a new login flow
20
+
21
+ LOGIN UX RULE
22
+ Approval is manual.
23
+ MCP returns the approval URL.
24
+ User opens it in browser.
25
+ Agent should not assume browser automation is required.
@@ -0,0 +1,46 @@
1
+ ================================================================================
2
+ AUTH FAILURES AND RECOVERY
3
+ ================================================================================
4
+ MISSING SESSION
5
+ Symptom:
6
+ connected = false
7
+ pending login result returned
8
+ Recovery:
9
+ open loginUrl
10
+ approve access
11
+ poll login
12
+
13
+ AUTHORIZATION_PENDING
14
+ Symptom:
15
+ poll_login returns pending
16
+ Recovery:
17
+ wait and poll again
18
+
19
+ ACCESS_DENIED
20
+ Symptom:
21
+ poll_login returns rejected
22
+ Recovery:
23
+ start a new login flow if still needed
24
+
25
+ EXPIRED DEVICE FLOW
26
+ Symptom:
27
+ poll_login returns expired
28
+ Recovery:
29
+ start a new login flow
30
+
31
+ BACKEND 401
32
+ Meaning:
33
+ local session is stale relative to backend
34
+ Recovery:
35
+ MCP clears local session
36
+ new login guidance is returned
37
+
38
+ INVALID JSON FROM BACKEND
39
+ Meaning:
40
+ wrong base URL, proxy error, or undeployed backend path
41
+ Recovery:
42
+ verify HELIOS_IDENTITY_SERVICE_URL / HELIOS_DATA_BRIDGE_URL
43
+
44
+ ENVIRONMENT MATCH RULE
45
+ HELIOS_IDENTITY_SERVICE_URL and HELIOS_DATA_BRIDGE_URL must point to the
46
+ same environment. Mixed environments cause false "connected" states and 401s.
@@ -0,0 +1,29 @@
1
+ ================================================================================
2
+ LAYER: ACCOUNT
3
+ ================================================================================
4
+ PURPOSE
5
+ Return current wallet/equity state for the connected Helios account.
6
+
7
+ THIS LAYER ANSWERS
8
+ - how much capital is available now
9
+ - current account value
10
+ - current margin usage
11
+ - whether Hyperliquid is activated
12
+ - Hyperliquid portfolio state
13
+
14
+ THIS LAYER DOES NOT ANSWER
15
+ - trade history
16
+ - realized PnL history
17
+ - open positions detail by symbol
18
+ - open orders
19
+
20
+ PRIMARY TOOLS
21
+ helios_account_get_wallet_state
22
+ helios_portfolio_get
23
+
24
+ SCOPE
25
+ account:read
26
+
27
+ PROVIDER
28
+ helios_account_get_wallet_state -> hyperliquid only
29
+ helios_portfolio_get -> hyperliquid only
@@ -0,0 +1,67 @@
1
+ ================================================================================
2
+ ACCOUNT TOOLS
3
+ ================================================================================
4
+ TOOL: helios_account_get_wallet_state
5
+ WHAT IT DOES
6
+ Returns the current Hyperliquid wallet snapshot for the connected account.
7
+ WHEN TO USE IT
8
+ Use near the start of every trading cycle before proposing or submitting any
9
+ new risk.
10
+ SCOPE
11
+ account:read
12
+ INPUT
13
+ none
14
+ OUTPUT
15
+ provider: hyperliquid
16
+ accountValue: number
17
+ availableBalance: number
18
+ withdrawable: number
19
+ totalMarginUsed: number
20
+ totalNotionalPosition: number
21
+ crossMarginAccountValue: number
22
+ isActivated: boolean
23
+ fetchedAt: ISO-8601
24
+ FINALITY
25
+ Read-only account state. It does not include fill history, trade quality, or
26
+ position-level structure.
27
+ DECISION IT ENABLES
28
+ - whether the account is activated and tradable
29
+ - how much dry powder exists
30
+ - whether current margin usage is already high
31
+ - whether new trades should be reduced, skipped, or allowed
32
+ DO NOT USE IT FOR
33
+ - determining realized performance
34
+ - reconstructing past trades
35
+ - replacing positions.get_open or ledger.get_summary
36
+
37
+ TOOL: helios_portfolio_get
38
+ WHAT IT DOES
39
+ Returns the Hyperliquid portfolio snapshot (Hyperliquid is the only provider).
40
+ WHEN TO USE IT
41
+ Use when the agent needs explicit provider separation instead of assuming a
42
+ single unified account model.
43
+ SCOPE
44
+ account:read
45
+ INPUT
46
+ provider?: hyperliquid
47
+ If omitted, helios_portfolio_get uses the provider pinned by
48
+ helios_provider_set_active.
49
+ OUTPUT
50
+ provider-specific portfolio payload
51
+ - hyperliquid:
52
+ totalBalance
53
+ availableBalance
54
+ totalMargin
55
+ unrealizedPnl
56
+ positions[]
57
+ protectiveOrders[]
58
+ FINALITY
59
+ Read-only portfolio state. It does not submit trades or mutate exchange
60
+ state.
61
+ DECISION IT ENABLES
62
+ - whether Hyperliquid equity and margin support a new trade
63
+ - whether provider-specific exposure is already present
64
+ DO NOT USE IT FOR
65
+ - fill history
66
+ - cancelling orders
67
+ - assuming parity between provider payload shapes
@@ -0,0 +1,34 @@
1
+ ================================================================================
2
+ ACCOUNT DATA CONTRACTS
3
+ ================================================================================
4
+ WALLET SNAPSHOT
5
+ provider
6
+ literal: hyperliquid
7
+
8
+ accountValue
9
+ numeric total account value
10
+
11
+ availableBalance
12
+ numeric currently available balance
13
+
14
+ withdrawable
15
+ numeric withdrawable/free balance
16
+
17
+ totalMarginUsed
18
+ numeric margin currently in use
19
+
20
+ totalNotionalPosition
21
+ numeric current notional exposure
22
+
23
+ crossMarginAccountValue
24
+ numeric cross-margin account value
25
+
26
+ isActivated
27
+ boolean account activation flag from backend state
28
+
29
+ fetchedAt
30
+ ISO-8601 snapshot time
31
+
32
+ UNITS
33
+ All numeric fields are plain numbers, not strings.
34
+ Currency is backend account currency context, typically USDT-equivalent.
@@ -0,0 +1,17 @@
1
+ ================================================================================
2
+ ACCOUNT DECISION RULES
3
+ ================================================================================
4
+ USE wallet_state WHEN
5
+ - deciding whether any trade is possible now
6
+ - sizing a trade based on available capital
7
+ - checking whether the account is activated/funded
8
+
9
+ DO NOT USE wallet_state FOR
10
+ - realized PnL history
11
+ - whether a symbol position is already open
12
+ - determining which existing order to cancel
13
+
14
+ PAIR WITH
15
+ ledger.get_summary -> realized performance
16
+ positions.get_open -> current open positions
17
+ orders.get_open -> working orders
@@ -0,0 +1,17 @@
1
+ ================================================================================
2
+ ACCOUNT FAILURES AND RECOVERY
3
+ ================================================================================
4
+ MISSING SESSION
5
+ account:read login prompt returned
6
+
7
+ BACKEND 401
8
+ stale session
9
+ MCP clears session and starts fresh account:read login flow
10
+
11
+ PRECONDITION_FAILED
12
+ account state unavailable or user not ready on backend
13
+ usually means missing Hyperliquid context or failed account fetch
14
+
15
+ ZERO VALUES
16
+ accountValue = 0 and availableBalance = 0 can be a real state
17
+ do not assume this is an error
@@ -0,0 +1,27 @@
1
+ ================================================================================
2
+ LAYER: MARKET
3
+ ================================================================================
4
+ PURPOSE
5
+ Deliver a compact, agent-readable market state without screenshots.
6
+
7
+ PRIMARY TOOLS
8
+ helios_market_get_snapshot
9
+ helios_market_get_symbol_detail
10
+
11
+ MODEL
12
+ get_snapshot
13
+ first-pass global market view
14
+ compact matrix for selected, all, or explicit symbols
15
+
16
+ get_symbol_detail
17
+ second-pass deep read for one symbol
18
+
19
+ INDICATOR SOURCE OF TRUTH
20
+ ai-agent-indicators/
21
+
22
+ SCOPE
23
+ market:read
24
+
25
+ FRESHNESS
26
+ Market snapshots are hydrated in Redis and refreshed on a short cadence.
27
+ Read `generatedAt` instead of assuming real-time-by-default.
@@ -0,0 +1,102 @@
1
+ ================================================================================
2
+ MARKET TOOLS
3
+ ================================================================================
4
+ TOOL: helios_market_get_snapshot
5
+ WHAT IT DOES
6
+ Returns one compact market overview payload for selected, all, or explicitly
7
+ requested symbols.
8
+ WHEN TO USE IT
9
+ Use only when the requested market universe is small enough to fit in runtime
10
+ context comfortably.
11
+ SCOPE
12
+ market:read
13
+ INPUT
14
+ scope?: selected | all
15
+ symbols?: string[]
16
+ OUTPUT
17
+ schema: helios.market_snapshot.v1
18
+ view: market_overview
19
+ scope: selected | all | explicit
20
+ symbolCount
21
+ generatedAt
22
+ returnedSymbols
23
+ semantics
24
+ market
25
+ table
26
+ legend
27
+ FINALITY
28
+ Produces one-shot market context. It is best for small selected universes or
29
+ explicit symbol lists, not full-market batch scanning.
30
+ DECISION IT ENABLES
31
+ Build a first-pass shortlist of symbols that deserve deeper drilldown.
32
+ DO NOT USE IT FOR
33
+ Very large full-market scans when runtime token limits are likely to truncate
34
+ the result. Use helios_market_get_snapshot_chunk instead.
35
+
36
+ TOOL: helios_market_get_snapshot_chunk
37
+ WHAT IT DOES
38
+ Returns one bounded chunk of the market overview with pagination metadata.
39
+ WHEN TO USE IT
40
+ Use as the default full-market scan method when the agent needs to analyze the
41
+ whole market universe without overflowing context limits.
42
+ SCOPE
43
+ market:read
44
+ INPUT
45
+ scope?: selected | all
46
+ symbols?: string[]
47
+ offset?: number
48
+ limit?: number (recommended 25; max 100)
49
+ OUTPUT
50
+ schema: helios.market_snapshot_chunk.v1
51
+ view: market_overview_chunk
52
+ scope: selected | all | explicit
53
+ totalSymbolCount
54
+ generatedAt
55
+ offset
56
+ limit
57
+ chunkSymbolCount
58
+ hasMore
59
+ nextOffset?
60
+ returnedSymbols
61
+ semantics
62
+ market
63
+ table
64
+ legend
65
+ FINALITY
66
+ This is the preferred market-scanning tool for large universes. One call is
67
+ not sufficient unless hasMore is false.
68
+ DECISION IT ENABLES
69
+ Scan the full market in stable batches, score or shortlist symbols, then move
70
+ to symbol detail only after the scan is complete.
71
+ COMMON PATTERN
72
+ offset 0 -> analyze chunk -> if hasMore use nextOffset -> repeat until done
73
+
74
+ TOOL: helios_market_get_symbol_detail
75
+ WHAT IT DOES
76
+ Returns expanded detail for a single symbol from the current market dataset.
77
+ WHEN TO USE IT
78
+ Use after a snapshot or chunked snapshot pass has identified a symbol as
79
+ relevant for existing-position management or new-entry evaluation.
80
+ SCOPE
81
+ market:read
82
+ INPUT
83
+ symbol: string
84
+ OUTPUT
85
+ schema: helios.market_symbol_detail.v1
86
+ generatedAt
87
+ symbol
88
+ semantics
89
+ market
90
+ row
91
+ symbolCtx
92
+ changeMap
93
+ metrics
94
+ legend
95
+ FINALITY
96
+ This is the final market-read step before making a concrete trade decision on
97
+ one symbol.
98
+ DECISION IT ENABLES
99
+ - entry timing
100
+ - stop placement quality
101
+ - take-profit context
102
+ - whether to hold, close, or avoid a symbol