@battlegrid/mcp-server 32.0.22 → 32.0.24
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.
- package/README.md +18 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/skills/EXPORT.json +7 -7
- package/skills/battlegrid-agent-management/SKILL.md +34 -20
- package/skills/battlegrid-arena-play/SKILL.md +1 -1
- package/skills/battlegrid-radar-deployment/SKILL.md +2 -2
- package/skills/battlegrid-strategy-doctor/SKILL.md +12 -7
- package/skills/battlegrid-trade-analysis/SKILL.md +44 -17
- package/skills/battlegrid-trade-proposal/SKILL.md +49 -48
package/README.md
CHANGED
|
@@ -38,6 +38,24 @@ Seeing package `31.x` alongside handshake `battlegrid@33.x` — the package **be
|
|
|
38
38
|
|
|
39
39
|
**What this changes for you:** nothing about how you call anything. Upgrading the package no longer waits on a server deploy, and a server deploy no longer strands you on a package that names the wrong contract — reconnect and the announcement follows. **Contract breaking-change notes are no longer keyed to package versions**, since a contract move is no longer a release here; the v11-and-earlier notes below are kept as history, and the live vocabulary is always discovery.
|
|
40
40
|
|
|
41
|
+
## Contract history — v129.1 (the activity feed names only events that happen)
|
|
42
|
+
|
|
43
|
+
**Not breaking.** v129.1 is the contract on top of v129. No input acceptance moves and no served page changes.
|
|
44
|
+
Reconnect the proxy, or restart it, so discovery reads the new schemas.
|
|
45
|
+
|
|
46
|
+
### Narrowed output — a shape you read has fewer members
|
|
47
|
+
|
|
48
|
+
- **`get_agent_activity_feed`**'s `eventType` no longer lists `AGENT_UPDATED`, `EARLY_ENTRY_SUBMITTED`,
|
|
49
|
+
`GRID_SUBMITTED_VIA_TELEGRAM` or `GRID_UPDATED_VIA_TELEGRAM`. Nothing records them and no stored event carries one,
|
|
50
|
+
so no row you could read changes. The historical values older rows carry — `MULTI_AGENT_DISPATCHED`,
|
|
51
|
+
`AGENT_OUTCOMPETED`, `AGENT_WON_COMPETITION`, `REASSESSMENT_TRIGGERED`, `AGENT_BLOCKED_NO_ALLOCATION` — are still
|
|
52
|
+
served.
|
|
53
|
+
|
|
54
|
+
### Corrected descriptions
|
|
55
|
+
|
|
56
|
+
`get_agent_activity_feed` no longer names an "updated" lifecycle event. `get_radar_activity`'s `filter` input states
|
|
57
|
+
that `FIRES` keeps each fire's disposition and its evaluation outcome, which is what it has returned since v127.
|
|
58
|
+
|
|
41
59
|
## Contract history — v129 (every record list takes one time window)
|
|
42
60
|
|
|
43
61
|
**Breaking at v129: `get_public_agent_realized_trades` renames its `timeframe` input to `window`, and sixteen list
|
package/dist/index.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ import { Client, StreamableHTTPClientTransport } from '@modelcontextprotocol/cli
|
|
|
47
47
|
* being asked. Move it for a change to THIS package — a proxy fix, a dependency bump, a docs
|
|
48
48
|
* correction. Never move it to track the server.
|
|
49
49
|
*/
|
|
50
|
-
export declare const PACKAGE_VERSION = "32.0.
|
|
50
|
+
export declare const PACKAGE_VERSION = "32.0.24";
|
|
51
51
|
export declare const DEFAULT_URL = "https://mcp.battlegrid.trade/mcp";
|
|
52
52
|
export interface EnvConfig {
|
|
53
53
|
apiKeys: string[];
|
package/dist/index.js
CHANGED
|
@@ -49,7 +49,7 @@ import { Client, SdkHttpError, StreamableHTTPClientTransport } from '@modelconte
|
|
|
49
49
|
* being asked. Move it for a change to THIS package — a proxy fix, a dependency bump, a docs
|
|
50
50
|
* correction. Never move it to track the server.
|
|
51
51
|
*/
|
|
52
|
-
export const PACKAGE_VERSION = '32.0.
|
|
52
|
+
export const PACKAGE_VERSION = '32.0.24';
|
|
53
53
|
export const DEFAULT_URL = 'https://mcp.battlegrid.trade/mcp';
|
|
54
54
|
const MAX_RETRIES = 3;
|
|
55
55
|
const RETRY_DELAYS_MS = [2000, 4000, 8000];
|
package/package.json
CHANGED
package/skills/EXPORT.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"generator": "battlegrid-app/server/scripts/export-mcp-skills.mjs",
|
|
3
|
-
"contractVersion": "
|
|
3
|
+
"contractVersion": "129.0.0",
|
|
4
4
|
"files": {
|
|
5
|
-
"battlegrid-agent-management/SKILL.md": "
|
|
5
|
+
"battlegrid-agent-management/SKILL.md": "18c635d512ba0b9e17df11d157adff5aed0bd8cc0bfa32df3e53b5e9d3453e45",
|
|
6
6
|
"battlegrid-agent-management/references/agent-stage-examples.md": "dffcc353d61dfc7b5bb6a2b3077fc6bf8c760a34c287cafb3b59b99306f24195",
|
|
7
|
-
"battlegrid-arena-play/SKILL.md": "
|
|
7
|
+
"battlegrid-arena-play/SKILL.md": "ec55a4ed41f4e54a66ddc66ef3e9e9c87c31986e83f1d66c2ae91f3557bad514",
|
|
8
8
|
"battlegrid-arena-play/references/entry-stage-examples.md": "0223f3743171ff213e943789d27590b2f65648398e85e10cd24938d5eb6af665",
|
|
9
9
|
"battlegrid-market-analysis/SKILL.md": "fcbe98e30e1edce39bb170c224cdf20181934f62b5f3a26b293787c70eeb6229",
|
|
10
10
|
"battlegrid-officers/SKILL.md": "3fd59ec301d1492c956fbdb4368fef61f29abd137f02f49a6172351c7a563309",
|
|
11
11
|
"battlegrid-officers/references/officer-stage-examples.md": "ef46ba26f4b36c9964b5bde95fdf98e5952c3786b77be5f136056cac792f0aec",
|
|
12
|
-
"battlegrid-radar-deployment/SKILL.md": "
|
|
12
|
+
"battlegrid-radar-deployment/SKILL.md": "b344cd3d2051153115ce9840606e6a08a140f704d5da6a10fca18d81c3796be6",
|
|
13
13
|
"battlegrid-radar-deployment/references/arena-stage-examples.md": "d27cfed1f4663f267c4a7ecebe4a6e65a450fc74bd14ce8987fb61af5bbf2ca5",
|
|
14
14
|
"battlegrid-radar-deployment/references/radar-stage-examples.md": "13fc3f55d91d3da9754e1ed7fb27493b7b7ba4d40a6a7e8d1ee0365f90ea10de",
|
|
15
15
|
"battlegrid-strategy-authoring/SKILL.md": "39cfa46b1f640e6800edb7e85a8f2c4b6b8786cddf71bb8244d172a44fc11d75",
|
|
16
16
|
"battlegrid-strategy-authoring/references/strategy-stage-examples.md": "f10ecdc91f3660a708eee7a7bacefce2acbb46c9cf7e0ac1454bd54f839f39fd",
|
|
17
|
-
"battlegrid-strategy-doctor/SKILL.md": "
|
|
17
|
+
"battlegrid-strategy-doctor/SKILL.md": "f15bce81a95b3cc6f1e8ebf3008ec56f7d100f74a5e3e85fc46cdd26554ed807",
|
|
18
18
|
"battlegrid-strategy-examples/SKILL.md": "9d18bf0e4bf85a28508e2881a4cdf77b823ec831e7cec5d82f82dc251402f41c",
|
|
19
19
|
"battlegrid-strategy-examples/references/playbooks.md": "a9464789df2e762faf9dbd7845101564bc1847cd193f709f8ac4b6bff08f09dd",
|
|
20
20
|
"battlegrid-strategy-examples/references/recipes.md": "806aae0b4842408f6e6ed3e108293073f4f31d1c27fa419ad57df9e1134f23e7",
|
|
21
21
|
"battlegrid-strategy-examples/references/tradingview-ports.md": "c62ce72b741abe5a92e1dec6615f26b19a54959aa1d29542518cd9a189390b98",
|
|
22
|
-
"battlegrid-trade-analysis/SKILL.md": "
|
|
23
|
-
"battlegrid-trade-proposal/SKILL.md": "
|
|
22
|
+
"battlegrid-trade-analysis/SKILL.md": "66bd5d057f7b933bff32192305e761c11e004512fd5d867c0ec2cd3dcd19ffda",
|
|
23
|
+
"battlegrid-trade-proposal/SKILL.md": "8e20ce1206ae51f1f87c6e940c8b7ed2798dcd2dfc8d9a2f82adf1a4d0817313"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: battlegrid-agent-management
|
|
3
|
-
description: Commission and govern the player's intelligence agents — interview and create one against a committed strategy and an approved model, change its configuration and risk limits, rebind it to another strategy, halt and resume it, archive and reactivate it, and act on its live positions (close, or move
|
|
3
|
+
description: Commission and govern the player's intelligence agents — interview and create one against a committed strategy and an approved model, change its configuration and risk limits, rebind it to another strategy, halt and resume it, archive and reactivate it, and act on its live positions (close one, or move its stop or take-profit outside the platform ratchet). Activate whenever the player wants a new agent, wants to change, pause, restart, retire or revive an existing one, asks what an agent is allowed to risk, or wants to intervene in a position an agent has open.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Agent Management
|
|
@@ -158,8 +158,8 @@ again only on their word.
|
|
|
158
158
|
### 4. Lifecycle verbs: read first, state the radius, then confirm
|
|
159
159
|
|
|
160
160
|
Every one of a draft commit (an edit or a rebind), halt, resume, activate and archive runs this
|
|
161
|
-
shape. The reads (`get_agent_budget`, `
|
|
162
|
-
`
|
|
161
|
+
shape. The reads (`get_agent_budget`, `list_user_active_positions`, `get_agent_automation_status`,
|
|
162
|
+
`get_agent_performance`, `get_agent_thought_log`) need no confirm and
|
|
163
163
|
cost nothing but a call — do them first, always.
|
|
164
164
|
|
|
165
165
|
State the blast radius **from server fields, as numbers**, before the confirm form:
|
|
@@ -244,23 +244,37 @@ partial config and never echo a read config back unchanged: the agent's read sha
|
|
|
244
244
|
the axis (`strategyTimeframe` and `regimeTimeframe` are strategy-derived and refused as unknown
|
|
245
245
|
keys). The commit holds the configuration to the same risk rules the agent form's Save applies.
|
|
246
246
|
|
|
247
|
-
### 7.
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
247
|
+
### 7. Position management: read, close, move the stop or the take-profit
|
|
248
|
+
|
|
249
|
+
1. **Read first.** `list_user_active_positions` serves each open position's `decisionId`, its live
|
|
250
|
+
`effectiveStopLoss` and `effectiveTakeProfit`, the mark and the trailing state. Those are the
|
|
251
|
+
only inputs a write needs. Never take a write's inputs from `get_position_audit_history` — it
|
|
252
|
+
is history, not the live position — and never ask the player for an order id.
|
|
253
|
+
2. **Close.** `close_agent_position({ decisionId, confirm: true })` is irreversible: it submits a
|
|
254
|
+
reduce-only market order and realizes the P&L. Present the position, its unrealized P&L and its
|
|
255
|
+
protections, and confirm before calling. An exchange rejection comes back as a typed trading
|
|
256
|
+
error — report it; a success means the close order was *accepted*.
|
|
257
|
+
3. **Move the stop, the take-profit, or both.**
|
|
258
|
+
`override_agent_protection({ decisionId, stopLossPrice?, takeProfitPrice? })` — send only the
|
|
259
|
+
leg the player is moving; no order id. A stop must sit on the loss side of the live mark and a
|
|
260
|
+
take-profit on its profit side: a level the mark has already crossed would fill on arrival, so
|
|
261
|
+
the server refuses it as `level-crossed`, naming the mark.
|
|
262
|
+
4. **What automation does after a move.** Trailing, break-even and time decay keep running and only
|
|
263
|
+
ever tighten from the new stop: a tighter stop stands until a mover beats it, a looser stop holds
|
|
264
|
+
only until an automated candidate beats it, a break-even that already committed never returns,
|
|
265
|
+
and time decay steps from the new stop. A moved take-profit changes nothing the movers compute —
|
|
266
|
+
they keep reading the signal's take-profit.
|
|
267
|
+
5. **Confirm before every write, and read the result leg by leg.** For each leg, name the current
|
|
268
|
+
level → the requested level and the direction (closer to or further from price). Say, in words,
|
|
269
|
+
that the change **moves the stop outside the platform's protective ratchet** — that is exactly
|
|
270
|
+
what the tool is for — and what automation does afterwards (step 4). Present the current
|
|
271
|
+
protection first, then the requested levels, then those sentences. The answer's `success` is
|
|
272
|
+
true only when every requested leg committed. `level-crossed`, `mark-unavailable` and
|
|
273
|
+
`rate-limited` refused the whole request and wrote nothing; on `level-crossed` report the mark
|
|
274
|
+
it names and, when the player's intent is to exit now, offer `close_agent_position` — never
|
|
275
|
+
retry the same level. Under `dispatched`, read `stopLoss` and `takeProfit` on their own: only a
|
|
276
|
+
`committed` leg moved, a `queued` stop is recorded and will apply, and every other outcome names
|
|
277
|
+
why that leg did not move — do not assume the write landed.
|
|
264
278
|
|
|
265
279
|
These tools carry no consent gate on either door: they are ownership-gated and behave identically
|
|
266
280
|
in chat and through an external MCP client. Your confirm is interaction, never authorization —
|
|
@@ -151,7 +151,7 @@ player's, and the attribution is part of what was scored.
|
|
|
151
151
|
`reasoning` is null when no record describes the current picks — say that rather than
|
|
152
152
|
reconstructing one, and a pick missing from `reasoning.picks` is one the player chose.
|
|
153
153
|
`list_my_market_grid_entries` is the history across sessions. An agent's decisions are a different
|
|
154
|
-
record, `
|
|
154
|
+
record, `get_agent_thought_log`.
|
|
155
155
|
|
|
156
156
|
## On the arena's session page
|
|
157
157
|
|
|
@@ -17,8 +17,8 @@ no slot shape, no condition union and no resolution type. Never carry a fact fro
|
|
|
17
17
|
and never describe them as one thing with two modes.
|
|
18
18
|
|
|
19
19
|
**Deployments are the autonomous trading switches.** An agent has no trading mode of its own: it
|
|
20
|
-
trades a coin on its own only where a Radar policy puts it on duty, and
|
|
21
|
-
|
|
20
|
+
trades a coin on its own only where a Radar policy puts it on duty, and an entry the player queues
|
|
21
|
+
needs no deployment. An Arena deployment enters an agent into a preset's sessions and grants
|
|
22
22
|
**no** trade permission — to have an agent trade a coin on its own, deploy it on Radar.
|
|
23
23
|
|
|
24
24
|
## The five failures this flow exists to prevent
|
|
@@ -57,8 +57,12 @@ Three reads, and they are not interchangeable:
|
|
|
57
57
|
— they describe different stages and merging them invents a cause.
|
|
58
58
|
- Render every code through its display meta. A raw `NO_ENTRY_CONDITION` or `OPEN_POSITION_CONFLICT` on
|
|
59
59
|
screen is a system identifier leaking into an explanation.
|
|
60
|
-
- **`get_agent_decision_context`
|
|
61
|
-
|
|
60
|
+
- **`get_agent_decision_context` reads the decision behind an OPEN position.** It is keyed by coin
|
|
61
|
+
and answers only for the agent position open on it; for a coin with nothing open it is `null`, so
|
|
62
|
+
it never explains a trade that did not happen. For "why did nothing happen on SOL", read
|
|
63
|
+
`list_gate_blocks` for the pre-model refusals on that coin, and for a Radar coin
|
|
64
|
+
`get_radar_activity_summary` for its causes, then `get_radar_close_decisions` for the bars it
|
|
65
|
+
decided.
|
|
62
66
|
- **`get_agent_coin_qualification` answers the forward-looking half.** The reason codes above say
|
|
63
67
|
why an agent did NOT trade in the past; this says whether a coin would route for it RIGHT NOW,
|
|
64
68
|
and which gate stops it — the strategy's entry condition, candidate levels, the ATR% volatility
|
|
@@ -80,11 +84,12 @@ Three reads, and they are not interchangeable:
|
|
|
80
84
|
or `ORPHANED` it is not — the agent runs a materialized copy at its own `strategyRevision` — so
|
|
81
85
|
name the binding state beside the definition rather than letting current rules read as running
|
|
82
86
|
ones.
|
|
83
|
-
- **
|
|
84
|
-
|
|
85
|
-
- `
|
|
86
|
-
distinct from whether the trades made money
|
|
87
|
-
|
|
87
|
+
- **A gate block carries the evaluation that refused it** in its `decisionRecord` — read it there
|
|
88
|
+
when the block's reason needs the evaluation behind it; there is no id to follow to another read.
|
|
89
|
+
- `list_signal_logs` narrowed by `agentId` when the question is whether the signals fired, as
|
|
90
|
+
distinct from whether the trades made money: its `summary` counts the evaluations and entries, and a
|
|
91
|
+
failed row's `rejection` names why its order was refused. `list_agent_trades` narrowed by `agentId`,
|
|
92
|
+
`get_agent_thought_log` and `get_agent_activity_feed` for what did happen.
|
|
88
93
|
- **`get_agent_conviction_calibration` honours `readiness`.** An `INSUFFICIENT_DATA` calibration
|
|
89
94
|
carries no win rate — report that there is not yet enough history, never a rate derived from a
|
|
90
95
|
handful of trades.
|
|
@@ -14,7 +14,7 @@ Start with where the money is, always, even when the question is narrower — a
|
|
|
14
14
|
means nothing without the whole.
|
|
15
15
|
|
|
16
16
|
- `get_account_state` for the account total.
|
|
17
|
-
- `get_agent_budget` for each agent's capital at risk
|
|
17
|
+
- `get_agent_budget` for each agent's capital at risk.
|
|
18
18
|
|
|
19
19
|
Then state a **reconciliation line**: the account total against the sum of its parts. If they
|
|
20
20
|
agree, say they agree. **If they do not, state the gap as a gap** — name the amount and say you
|
|
@@ -32,18 +32,46 @@ Not "what were its returns" — whether it did *the thing it was told to do*.
|
|
|
32
32
|
gate — and its trade levels with the ATR floor, not the agent's overlay prose. Read `bindingState` too: at `SYNCING` or `ORPHANED` the agent evaluates a materialized copy
|
|
33
33
|
at its own `strategyRevision`, and judging it against the strategy's current revision measures it
|
|
34
34
|
by rules it is not running.
|
|
35
|
-
- `get_agent_performance` and `
|
|
36
|
-
|
|
35
|
+
- `get_agent_performance` and `list_agent_trades` narrowed by `agentId` — judge against that mandate. Its
|
|
36
|
+
`summary` and `resultSummary` cover the agent's whole scope on the player's account, not the page.
|
|
37
|
+
- `get_trade_outcome_by_decision` (a trade row's `decisionId`) / `get_trade_chart` when a specific trade
|
|
38
|
+
needs explaining: the outcome carries the fills, fees, slippage, leverage, duration and exit label. A
|
|
37
39
|
measurable trade's `tradeExcursion` reads in R: `mfeR` and `maeR` (the best and worst it reached),
|
|
38
40
|
`exitR`, and `giveBackR` (what it surrendered between its peak and the close). `exitEfficiency` is
|
|
39
41
|
a union — branch on its `state` before reading `efficiencyPercent`. All of them are gross of
|
|
40
42
|
costs; `netPnl` is the after-fee figure.
|
|
41
|
-
- The record around the trades: `
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
happened), and `get_agent_explorer` for where the agent stands
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
- The record around the trades: `get_agent_thought_log` (an agent's decisions), `get_signal_log` (a
|
|
44
|
+
trade's reasoning and its pipeline), `list_my_market_grid_entries` / `get_my_market_grid_entry` (an
|
|
45
|
+
arena entry's reasoning — `agentId` for one agent's entries, none for every entry),
|
|
46
|
+
`get_agent_activity_feed` (what happened), and `get_agent_explorer` for where the agent stands
|
|
47
|
+
among public agents.
|
|
48
|
+
- `list_signal_logs` narrowed by `agentId` when the question is whether the agent's signals are
|
|
49
|
+
working, as distinct from whether its trades made money: its `summary` counts the evaluations and
|
|
50
|
+
the entries, and a failed row's `rejection` names why its order was refused.
|
|
51
|
+
|
|
52
|
+
### What past decisions would have done
|
|
53
|
+
|
|
54
|
+
A question about a skip, an unfilled entry, or "if it had traded, would we be up?" is answered from
|
|
55
|
+
the platform's recorded forward marks, never from today's price.
|
|
56
|
+
|
|
57
|
+
- Select the decisions with `list_signal_logs`, then read each one's `get_signal_debrief` (the row's
|
|
58
|
+
`agentId`, and its `id` as `logId`). When the question is the agent-wide pattern rather than named
|
|
59
|
+
decisions, read `get_agent_decision_quality`.
|
|
60
|
+
- **Never mark a past decision against a current price.** A market-context read, a live mark or any
|
|
61
|
+
price read now answers a different question. The debrief's marks are anchored at the decision
|
|
62
|
+
(`decisionAnchor`) and, for a closed trade, at the exit (`exitAnchor`).
|
|
63
|
+
- SKIP and UNFILLED figures (`grossOfCosts: true`) are counterfactual and gross of fees, slippage and
|
|
64
|
+
funding. Quote them as recorded marks — what the market did — never as money the agent made, lost
|
|
65
|
+
or left on the table.
|
|
66
|
+
- While `verdict` is null the call is undecided: quote the RESOLVED rows' `signedReturnPct`,
|
|
67
|
+
`favorableExcursionPct` and `adverseExcursionPct` as recorded, name each PENDING row's `maturesAt`
|
|
68
|
+
as when that window completes, and claim neither a stop-out, a target hit nor a profit.
|
|
69
|
+
- While the verdict is pending, whether the staged stop or target was reached is read from
|
|
70
|
+
`planOutcome` on that decision's `list_signal_logs` row, and from nothing else. Never turn a
|
|
71
|
+
return or an excursion in the debrief into a stop-out or a target hit.
|
|
72
|
+
- A non-null verdict is reported by its label in words, beside the server's `verdictDetail`.
|
|
73
|
+
- A `{ debrief: null }` result is **UNDETERMINED** for that decision: say the read gave none, and
|
|
74
|
+
never estimate it another way.
|
|
47
75
|
|
|
48
76
|
**Name the blemishes.** A verdict with no flaw in it is not a verdict, it is a summary. The trade
|
|
49
77
|
that went against the mandate, the streak, the position held past its thesis — say it. A player
|
|
@@ -53,17 +81,16 @@ reading a clean report about a messy account learns nothing.
|
|
|
53
81
|
|
|
54
82
|
- `list_user_active_positions` for everything at once: it carries the live mark and P&L
|
|
55
83
|
(`markPrice`, `unrealizedPnlUsd`, `roePct`) — check `pricingStatus` and `generatedAtMs` before
|
|
56
|
-
calling a mark current.
|
|
57
|
-
|
|
58
|
-
distance to a trigger from it.
|
|
84
|
+
calling a mark current. Every position is served once, in `positions`, naming its `agentId` and
|
|
85
|
+
`marketGridSessionId`; `agents` carries each agent's group figures.
|
|
59
86
|
- For each open position, report its protections **and how far the live mark sits from each
|
|
60
87
|
trigger** — a stop is a number the player cannot act on; "3.1% from the stop" is one they can.
|
|
61
|
-
- `
|
|
62
|
-
`
|
|
63
|
-
the exchange is unreachable; report that as UNDETERMINED, never as no orders.
|
|
88
|
+
- `list_agent_open_orders` is the platform's record of each agent order, naming its `decisionId` and
|
|
89
|
+
the venue's `exchangeOrderId` and `cloid`. `get_open_orders` reads the exchange directly — slower,
|
|
90
|
+
and it fails when the exchange is unreachable; report that as UNDETERMINED, never as no orders.
|
|
64
91
|
- `get_deployment_policy` / `get_radar_deployment` when the protection state comes from standing
|
|
65
|
-
policy rather than the position itself. `
|
|
66
|
-
|
|
92
|
+
policy rather than the position itself. `list_gate_blocks` when something looks like it should
|
|
93
|
+
have fired and did not.
|
|
67
94
|
|
|
68
95
|
## 4. Automation health — unprompted
|
|
69
96
|
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: battlegrid-trade-proposal
|
|
3
|
-
description: Find
|
|
3
|
+
description: Find a trade for one of the player's agents and, on the player's consent, queue it to execute at the agent's next strategy-bar close. Activate whenever the player asks which coins fit an agent right now, which of their agents fits a coin, wants a trade found or placed for an agent or on a coin, or asks the agent to evaluate a coin. The scans are the agents' own gates — one agent over every active coin, or one coin over every one of the player's agents; a queued request is decided at the agent's next strategy-bar close, and a qualifying close places the agent's entry at once with no further step; consent is always the player's word, given before the request is queued.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Trade Proposal
|
|
7
7
|
|
|
8
|
-
You are finding
|
|
9
|
-
step below reads what the server decided and puts it to the player in their terms;
|
|
10
|
-
re-sorts a list, re-derives a verdict, or
|
|
8
|
+
You are finding a trade for an agent the player configured and, once the player consents, queueing
|
|
9
|
+
it. Every step below reads what the server decided and puts it to the player in their terms;
|
|
10
|
+
nothing here re-sorts a list, re-derives a verdict, or queues on the player's behalf without their
|
|
11
|
+
word. No decision waits for the player afterwards: consent comes before the queue, and a qualifying
|
|
12
|
+
close executes.
|
|
11
13
|
|
|
12
14
|
## 0. What is already held — before anything else
|
|
13
15
|
|
|
14
|
-
- `
|
|
15
|
-
- A
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
- `list_user_active_positions` first, every time.
|
|
17
|
+
- A queued request holds the player's request slot for that coin, and a placing or live position its
|
|
18
|
+
position slot, across **all** their agents. **Never queue on a coin the player already holds a
|
|
19
|
+
live position on** — say why, and name the position that holds it.
|
|
18
20
|
|
|
19
21
|
## 1. When the player names a coin and not an agent — choose the agent
|
|
20
22
|
|
|
@@ -46,15 +48,23 @@ re-sorts a list, re-derives a verdict, or approves on the player's behalf.
|
|
|
46
48
|
- A refused scan (`RATE_LIMITED`) is a refusal: say the scan was refused and when it can be retried
|
|
47
49
|
(`retryAfterSeconds`). Never say "nothing fits".
|
|
48
50
|
|
|
49
|
-
## 3.
|
|
51
|
+
## 3. Confirm, then queue the request
|
|
50
52
|
|
|
51
|
-
-
|
|
52
|
-
|
|
53
|
+
- **Confirm with the player before queueing.** Name the agent, the coin and the bar it will be
|
|
54
|
+
decided on, and say that a qualifying close places the agent's entry at once, sized by the agent's
|
|
55
|
+
own risk budget, with no further step. Ask, and queue only on their yes.
|
|
56
|
+
- **The player's own words can already be the consent.** "Trade SOL with Atlas at its next close" is
|
|
57
|
+
consent: queue without asking again. So is a standing instruction the player gave you to trade for
|
|
58
|
+
them. Interest is not consent — "what fits SOL right now?" is a question, so report the fit and ask
|
|
59
|
+
whether to trade it.
|
|
60
|
+
- `propose_entry_decision` **only** on that consent, and only on the coins the player named, or on
|
|
61
|
+
the top qualifying row when they asked for the best fit. One coin per call.
|
|
53
62
|
- **The call does not decide.** It registers a request against the agent's next strategy-bar close
|
|
54
63
|
and returns immediately; no model runs and nothing is spent. The agent reads that bar on its
|
|
55
64
|
settled close, through the same path its radar deployments use.
|
|
56
|
-
- `userMessage` is the player's own words for the turn
|
|
57
|
-
request; a retry with the same key replays
|
|
65
|
+
- `userMessage` is the player's own words for the turn; it is recorded in the conversation and read
|
|
66
|
+
by no model. Mint a **fresh UUID** `idempotencyKey` per request; a retry with the same key replays
|
|
67
|
+
the recorded result and never registers a second one.
|
|
58
68
|
- **One pending request per coin.** A second is refused with `CONFLICT` / `REQUEST_PENDING` — read
|
|
59
69
|
the one that exists with `get_entry_request` rather than asking again.
|
|
60
70
|
|
|
@@ -64,18 +74,19 @@ re-sorts a list, re-derives a verdict, or approves on the player's behalf.
|
|
|
64
74
|
(`barStart`), when the answer is due (`decidesBy`), and the deadline past which that bar can no
|
|
65
75
|
longer be decided (`windowEndsAt`). `decidesBy` and `windowEndsAt` are different instants — a bar
|
|
66
76
|
that has already settled is decided at the next sweep, seconds away.
|
|
67
|
-
- Say where the answer will appear: on the delegation card in this conversation
|
|
68
|
-
|
|
69
|
-
|
|
77
|
+
- Say where the answer will appear: on the delegation card in this conversation. Nothing further is
|
|
78
|
+
needed from the player; the card carries the answer to them when the bar closes, and a qualifying
|
|
79
|
+
close's entry is already being placed by then.
|
|
70
80
|
- When the player asks what the agent decided, read the request's conversation with
|
|
71
81
|
`get_trade_conversation({ conversationId })`, using the id the `queued` result carried. It serves
|
|
72
82
|
the whole transcript in stored order — the queued card, the agent's reasoning, its thesis and
|
|
73
|
-
setups, the
|
|
83
|
+
setups, the entry card naming the decision and the position it placed, a no-trade with its reason
|
|
84
|
+
and next coins, or a close answer.
|
|
74
85
|
- `get_entry_request` re-reads a request until it is answered — including while its close has fired
|
|
75
|
-
and the decision is being composed
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
the answer is in the conversation.
|
|
86
|
+
and the decision is being composed, and past its deadline until its overdue answer lands.
|
|
87
|
+
`cancel_entry_request` withdraws it only while it still awaits its close; once the close has fired
|
|
88
|
+
it is `NOT_FOUND`, and the answer arrives in the conversation. Both are `NOT_FOUND` once it has
|
|
89
|
+
been answered or cancelled, and that is the honest record: the answer is in the conversation.
|
|
79
90
|
- `type: "error"` — the block, with its remedy: `OPEN_POSITION_CONFLICT` means a position already
|
|
80
91
|
holds the slot (see step 0) and nothing was queued; `LLM_CREDITS_EXHAUSTED` means top up when
|
|
81
92
|
`topupAvailable` is true; `ENTRIES_PAUSED` means the platform has paused new entries while market
|
|
@@ -84,25 +95,20 @@ re-sorts a list, re-derives a verdict, or approves on the player's behalf.
|
|
|
84
95
|
itself once the data is back: ask again then, under a fresh `idempotencyKey` — the same key only
|
|
85
96
|
replays this refusal. A refused request (`RATE_LIMITED`) is a refusal with its retry-after.
|
|
86
97
|
Never "nothing to do".
|
|
87
|
-
- `type: "recommendation"` and `type: "no_trade"` arrive only as the **replay** of a request made
|
|
88
|
-
before the queued contract shipped. Report them as step 5 describes and do not expect them from a
|
|
89
|
-
fresh call.
|
|
90
98
|
|
|
91
|
-
## 5. When the answer arrives —
|
|
99
|
+
## 5. When the answer arrives — report it
|
|
92
100
|
|
|
93
|
-
|
|
94
|
-
delegation card in this conversation, carrying the player's Accept and Decline. `accept_entry_decision`
|
|
95
|
-
and `cancel_entry_decision` remain yours for the external and Telegram doors, and on the web only on
|
|
96
|
-
the player's explicit typed word — never inferred from interest, agreement, or a question about the
|
|
97
|
-
trade.
|
|
101
|
+
Every request that is not withdrawn is answered exactly once, in the conversation.
|
|
98
102
|
|
|
99
|
-
- A decided close produces one of:
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
- A decided close produces one of: an **entry** — the thesis, the setups and the entry card naming
|
|
104
|
+
the decision and the position it placed, which is already executing; a no-trade with the reason
|
|
105
|
+
and the next coins worth asking about; a refusal, `close_refused`, which names the gate that failed
|
|
106
|
+
when the close did not qualify and none when it qualified and the radar's own gates stopped its
|
|
107
|
+
fire; `close_missed`, naming the bar, when its window passed with no sweep; a bar the agent's own
|
|
108
|
+
radar deployment decided first; or an error carrying the engine's block, with nothing entered,
|
|
109
|
+
when admission refused the qualifying close's fire — `ENTRIES_PAUSED` while new entries are
|
|
110
|
+
paused, an account block, a halted agent, a position already held — or `EVALUATION_FAULTED` when
|
|
111
|
+
the decision that fired did not finish.
|
|
106
112
|
- A bar the agent's own radar deployment decided first is reported from that deployment's decision,
|
|
107
113
|
never decided again. It arrives as `close_fired_by_radar` — a trade taken in full — only when the
|
|
108
114
|
deployment's fire enqueued a trade decision. Otherwise it arrives as what stopped that fire, and
|
|
@@ -111,14 +117,9 @@ trade.
|
|
|
111
117
|
its hourly cap, post-close suppression, a decision already running on the coin — arrives as
|
|
112
118
|
`close_refused` with no gate, because the close qualified and nothing was entered; and a close
|
|
113
119
|
whose coin another agent's fire took arrives as `close_claimed_by_radar`.
|
|
114
|
-
- On
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
because the player asked you to "find a trade" — finding is not approving. `get_entry_decision`
|
|
121
|
-
re-reads the row if the conversation moved on before they answered.
|
|
122
|
-
- Only a conversational decision awaits the player: radar fires and arena challenge reactions
|
|
123
|
-
execute on their own. `list_entry_decisions` with `status: PENDING` lists the ones still waiting
|
|
124
|
-
for an agent.
|
|
120
|
+
- On an entry, read the decision with `get_entry_decision` and state the direction, the entry, stop
|
|
121
|
+
and take-profit levels, the position size, the **`convictionPercent`**, and the position's state —
|
|
122
|
+
placing, working, open, rejected or expired. No conviction floor is applied on this surface: the
|
|
123
|
+
conviction is the agent's own reading, and the player's consent was the gate.
|
|
124
|
+
- Open positions, once filled, are `list_user_active_positions`'s; closing one happens only on the
|
|
125
|
+
player's word.
|