@coinrithm/mcp-trading 0.7.5 → 0.7.7
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/CHANGELOG.md +310 -197
- package/README.md +319 -279
- package/dist/agent/cli.js +22 -1
- package/dist/agent/client.d.ts +3 -0
- package/dist/agent/client.js +11 -0
- package/dist/agent/decision.d.ts +12 -0
- package/dist/agent/decision.js +10 -0
- package/dist/agent/decisionProbe.d.ts +17 -0
- package/dist/agent/decisionProbe.js +70 -0
- package/dist/agent/decisionValidator.js +23 -0
- package/dist/agent/engine.d.ts +4 -1
- package/dist/agent/engine.js +7 -1
- package/dist/agent/observe.js +118 -6
- package/dist/agent/prompt.d.ts +3 -1
- package/dist/agent/prompt.js +114 -27
- package/dist/agent/providerCapabilities.d.ts +20 -0
- package/dist/agent/providerCapabilities.js +67 -0
- package/dist/agent/providers.d.ts +29 -1
- package/dist/agent/providers.js +50 -25
- package/dist/agent/resolve.d.ts +12 -0
- package/dist/agent/resolve.js +82 -3
- package/dist/agent/runner.js +113 -8
- package/dist/agent/skill.js +6 -0
- package/dist/agent/skillValidator.js +7 -0
- package/dist/agent/state.d.ts +5 -0
- package/dist/agent/state.js +20 -0
- package/dist/agent/strictLint.js +14 -0
- package/dist/agent/templates.js +6 -0
- package/dist/agent/types.d.ts +34 -1
- package/dist/agent/types.js +10 -0
- package/dist/agent/version.d.ts +1 -1
- package/dist/agent/version.js +1 -1
- package/dist/client.d.ts +1 -0
- package/dist/client.js +10 -0
- package/dist/http.js +21 -0
- package/dist/tools.d.ts +1 -0
- package/dist/tools.js +66 -10
- package/package.json +1 -1
package/dist/tools.js
CHANGED
|
@@ -492,6 +492,34 @@ export function compactPublicPmWhales(data, limit) {
|
|
|
492
492
|
: data.trades;
|
|
493
493
|
return { ...data, trades };
|
|
494
494
|
}
|
|
495
|
+
// Crypto movers rows arrive as {ucid, symbol, name, slug, change24h,
|
|
496
|
+
// currentPrice} with the numerics as STRINGS (backend SQL fn passthrough).
|
|
497
|
+
// Coerce so a brain never string-compares "9.5" > "12"; drop the internal
|
|
498
|
+
// ucid. A row that fails coercion passes through untouched — honesty over
|
|
499
|
+
// polish, same rule as every other compactor here.
|
|
500
|
+
export function compactPublicCryptoMovers(data) {
|
|
501
|
+
if (!Array.isArray(data))
|
|
502
|
+
return data;
|
|
503
|
+
return data.map((row) => {
|
|
504
|
+
if (!isJsonRecord(row))
|
|
505
|
+
return row;
|
|
506
|
+
const change = Number(row.change24h);
|
|
507
|
+
const price = Number(row.currentPrice);
|
|
508
|
+
return {
|
|
509
|
+
// coinId IS the ucid the rest of the tool surface takes (get_candles,
|
|
510
|
+
// get_market_context, the futures quote/open path). Carrying it through
|
|
511
|
+
// is not cosmetic: without it the caller has to re-derive the coin from
|
|
512
|
+
// the SYMBOL via resolve_symbol, and symbols collide across listings —
|
|
513
|
+
// the round-trip can land on a different coin than the one that moved.
|
|
514
|
+
coinId: row.ucid,
|
|
515
|
+
symbol: row.symbol,
|
|
516
|
+
name: row.name,
|
|
517
|
+
slug: row.slug,
|
|
518
|
+
change24hPct: Number.isFinite(change) ? change : row.change24h,
|
|
519
|
+
priceUsd: Number.isFinite(price) ? price : row.currentPrice,
|
|
520
|
+
};
|
|
521
|
+
});
|
|
522
|
+
}
|
|
495
523
|
const MATCH_PAIR_FIELDS = [
|
|
496
524
|
"matchId",
|
|
497
525
|
"confidence",
|
|
@@ -943,16 +971,16 @@ export function registerTools(server, client) {
|
|
|
943
971
|
}, async ({ runId, agentTrace }, extra) => present(await client.exportLedger({ runId }, requestKey(extra), agentTrace)));
|
|
944
972
|
server.registerTool("get_arena_leaderboard", {
|
|
945
973
|
title: "Get Agent Arena leaderboard",
|
|
946
|
-
description: "The public Agent Arena
|
|
947
|
-
"
|
|
948
|
-
"
|
|
949
|
-
"
|
|
950
|
-
"
|
|
951
|
-
"
|
|
952
|
-
"
|
|
953
|
-
"
|
|
954
|
-
"
|
|
955
|
-
"
|
|
974
|
+
description: "The public Agent Arena across spot, futures, and prediction markets. " +
|
|
975
|
+
"The response publishes the arena-ranking-v1 contract: five decided " +
|
|
976
|
+
"trades qualify an agent for normal ordering; positive realized PnL is " +
|
|
977
|
+
"weighted by the 95% Wilson win-confidence lower bound; non-positive " +
|
|
978
|
+
"PnL is used directly. Agents below five remain listed after qualified " +
|
|
979
|
+
"agents; fewer than 20 decided trades is a separate small-sample " +
|
|
980
|
+
"warning. Rows carry per-venue results, a 90-day sparkline, badges, " +
|
|
981
|
+
"rankDelta, biggestWinMusd, and a self-reported model label. Pass " +
|
|
982
|
+
"window='today'|'24h'|'7d'|'30d'|'3m'|'all'. Use it to see the field " +
|
|
983
|
+
"and where you stand — pair " +
|
|
956
984
|
"with get_performance (your own scorecard) and get_arena_agent (drill " +
|
|
957
985
|
"into one handle). Public data: agent names + performance only. " +
|
|
958
986
|
PAPER_NOTE,
|
|
@@ -1757,4 +1785,32 @@ export function registerTools(server, client) {
|
|
|
1757
1785
|
outputSchema: API_RESULT_OUTPUT_SCHEMA,
|
|
1758
1786
|
annotations: readOnlyAnnotations("Global prediction-market volume trend"),
|
|
1759
1787
|
}, async () => present(await client.getPublicPmVolumeHistory()));
|
|
1788
|
+
server.registerTool("get_crypto_movers", {
|
|
1789
|
+
title: "Top 24h crypto movers (universe scan)",
|
|
1790
|
+
description: "Free public scan of CoinRithm's tracked crypto universe for the " +
|
|
1791
|
+
"biggest 24h price moves — top gainers or top losers, ordered by " +
|
|
1792
|
+
"24h change percent. Use this to DISCOVER candidates beyond your " +
|
|
1793
|
+
"watchlist (abnormal rapid moves), then deep-analyze each candidate " +
|
|
1794
|
+
"with get_candles (OHLC + indicators) and get_market_context " +
|
|
1795
|
+
"(sentiment, news) before any trade decision. Rows carry coinId, " +
|
|
1796
|
+
"symbol, name, slug, change24hPct and priceUsd; data refreshes on the " +
|
|
1797
|
+
"~60s core price tick. Pass the row's coinId straight to get_candles " +
|
|
1798
|
+
"/ get_market_context — do NOT re-resolve it from the symbol, since " +
|
|
1799
|
+
"symbols collide across listings. No API key required.",
|
|
1800
|
+
inputSchema: {
|
|
1801
|
+
direction: z
|
|
1802
|
+
.enum(["gainers", "losers"])
|
|
1803
|
+
.optional()
|
|
1804
|
+
.describe("Scan direction (default gainers)."),
|
|
1805
|
+
limit: z
|
|
1806
|
+
.number()
|
|
1807
|
+
.int()
|
|
1808
|
+
.min(1)
|
|
1809
|
+
.max(100)
|
|
1810
|
+
.optional()
|
|
1811
|
+
.describe("Rows to return, 1-100 (default 20)."),
|
|
1812
|
+
},
|
|
1813
|
+
outputSchema: API_RESULT_OUTPUT_SCHEMA,
|
|
1814
|
+
annotations: readOnlyAnnotations("Top 24h crypto movers"),
|
|
1815
|
+
}, async ({ direction, limit }) => present(mapSuccessfulBody(await client.getPublicCryptoMovers(direction ?? "gainers", limit ?? 20), compactPublicCryptoMovers)));
|
|
1760
1816
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinrithm/mcp-trading",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.7",
|
|
4
4
|
"mcpName": "io.github.CoinRithm/mcp-trading",
|
|
5
5
|
"description": "CoinRithm paper-trading toolkit: an MCP server (coinrithm-mcp) AND a self-host agent runner (coinrithm-agent) for spot, futures, and prediction markets with a user-minted API key.",
|
|
6
6
|
"type": "module",
|