@rushr/mcp 0.2.0 → 0.3.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.
package/README.md CHANGED
@@ -6,7 +6,7 @@ A local [MCP](https://modelcontextprotocol.io) server that lets any MCP client (
6
6
 
7
7
  It trades two kinds of tokens:
8
8
  - **Graduated tokens** trade on Uniswap, through the Universal Router.
9
- - **PONS tokens still on their bonding curve** trade on the curve directly. Rushr's 0.25% fee is then a second, plain ETH transfer to the Rushr treasury, sent after the trade confirms (see [Curve trades](#curve-trades)).
9
+ - **PONS tokens still on their bonding curve** trade on the curve directly. Rushr's 1% fee is then a second, plain ETH transfer to the Rushr treasury, sent after the trade confirms (see [Curve trades](#curve-trades)).
10
10
 
11
11
  The trading logic and its guards come from [Talos](../agents/examples/test-agent), Rushr's own test agent.
12
12
 
@@ -28,6 +28,10 @@ The trading logic and its guards come from [Talos](../agents/examples/test-agent
28
28
  | `delete_callout` | Deletes one of your own callouts. |
29
29
  | `journal` | Lists outcomes worth remembering, newest first: positions the agent fully sold (realized PnL, hold time) and how its calls moved since posting. |
30
30
 
31
+ ## Cashback
32
+
33
+ 30% of the Rushr fee an agent pays comes back to its own wallet, sent every Sunday (UTC) from the Rushr treasury Safe. Nothing to claim or sign. `my_status` shows `cashback`: earned, paid, and the next payout with its date, in ETH and USD. The same is at `GET /v1/me/cashback` with the agent's API key.
34
+
31
35
  ## Journal
32
36
 
33
37
  `buy`, `sell` and `post_callout` also return a `journal` entry, and the `journal` tool lists outcomes later. Each entry is a small, stable record an agent can save to its memory (for example with [Memoria](https://www.memoriaagent.site)):
@@ -163,7 +167,7 @@ Every buy passes these checks before anything is signed:
163
167
  - chain 4663;
164
168
  - `tx.to` is the Universal Router;
165
169
  - the value and amount match the request;
166
- - the fee is at most 25 bps;
170
+ - the fee is at most 1% (100 bps);
167
171
  - approvals go only to the token or Permit2;
168
172
  - there is no follow-up transaction;
169
173
  - and the simulation succeeded.
@@ -172,7 +176,7 @@ Every buy passes these checks before anything is signed:
172
176
  - the calldata is the curve's `buy` or `sell` with the requested amount, paying out to this wallet;
173
177
  - buys send exactly the requested ETH, and sells send none;
174
178
  - approvals (sells only) are `token.approve(curve)`;
175
- - the fee follow-up is a plain transfer to the Rushr treasury Safe `0x2Ae062C61A757b66D3039154a6e965aa48Cd75F3`, of exactly the quoted fee, at most 25 bps of the trade's ETH side;
179
+ - the fee follow-up is a plain transfer to the Rushr treasury Safe `0x2Ae062C61A757b66D3039154a6e965aa48Cd75F3`, of exactly the quoted fee, at most 1% of the trade's ETH side;
176
180
  - and the simulation succeeded.
177
181
  - **Deadline:** a Uniswap build within 30 seconds of its deadline is refused; quote again. Curve builds have no deadline.
178
182
 
package/dist/index.js CHANGED
@@ -342,7 +342,8 @@ var TRADE_ADDRESSES = {
342
342
  // ../trade/src/config.ts
343
343
  import { getAddress, isAddress } from "viem";
344
344
  var RUSHR_TREASURY = "0x2Ae062C61A757b66D3039154a6e965aa48Cd75F3";
345
- var BETA_FEE_BPS = 25;
345
+ var STANDARD_FEE_BPS = 100;
346
+ var CASHBACK_SHARE_BPS = 3e3;
346
347
  var RUSHR_TOKEN = "0xa8ceeeb747fcf136947c35c5de6187ee90d6bfed";
347
348
  var RUSHR = 10n ** 18n;
348
349
  var HOLDER_TIERS = [
@@ -351,10 +352,10 @@ var HOLDER_TIERS = [
351
352
  { min: 1000000n * RUSHR, discountBps: 1e3 }
352
353
  ];
353
354
  var DEFAULT_TRADE_CONFIG = {
354
- feeBps: BETA_FEE_BPS,
355
- // beta rate; STANDARD_FEE_BPS after the beta
355
+ feeBps: STANDARD_FEE_BPS,
356
356
  referralDiscountBps: 1e3,
357
357
  referrerShareBps: 2e3,
358
+ cashbackShareBps: CASHBACK_SHARE_BPS,
358
359
  holderTiers: HOLDER_TIERS,
359
360
  rushrToken: RUSHR_TOKEN,
360
361
  feeRecipient: RUSHR_TREASURY,
@@ -384,7 +385,7 @@ var PERMIT2 = TRADE_ADDRESSES.permit2.toLowerCase();
384
385
  var CHAIN_ID = TRADE_ADDRESSES.chainId;
385
386
  var SELECTOR_ERC20_APPROVE = "0x095ea7b3";
386
387
  var SELECTOR_PERMIT2_APPROVE = "0x87517c45";
387
- var MAX_FEE_BPS = 25;
388
+ var MAX_FEE_BPS = 100;
388
389
  function vetBuild(b, side, token, amountIn, opts = {}) {
389
390
  if (isPairCurve(b)) return vetPairCurveBuild(b, side, token, amountIn, { trader: opts.trader, curveOnChain: opts.curveOnChain, requireSimulation: opts.requireSimulation });
390
391
  if (!b.tx) throw new GuardError("refused_unsafe_build", "refusing to sign: the build has no transaction", { problems: ["tx is null"] });
@@ -948,13 +949,20 @@ var Rushr = class {
948
949
  const key = w.apiKey();
949
950
  const me = key ? await this.d.api("GET", "/v1/agents/me").catch(() => null) : null;
950
951
  const h = me?.member?.handle ?? handle2;
951
- const [holdings, pnl, rank, callouts, fees] = await Promise.all([
952
+ const [holdings, pnl, rank, callouts, fees, cashback] = await Promise.all([
952
953
  this.d.api("GET", `/wallets/${w.address.toLowerCase()}/holdings`, { auth: false }).then((r) => (r.holdings ?? []).map((x) => ({ token: x.token, symbol: x.symbol, amount: x.amount_ui, valueUsd: num2(x.value_usd), costUsd: num2(x.cost_basis_usd), unrealizedUsd: num2(x.unrealized_usd), realizedUsd: num2(x.realized_usd) }))).catch((e) => ({ error: errText(e) })),
953
954
  this.d.api("GET", `/wallets/${w.address.toLowerCase()}/pnl`, { auth: false }).then((r) => r.summary ? { realizedUsd: num2(r.summary.realized_usd), unrealizedUsd: num2(r.summary.unrealized_usd), volumeUsd: num2(r.summary.volume_usd), trades: r.summary.trades ?? null, tokens: r.summary.tokens_traded ?? null, lastTradeAt: r.summary.last_trade_at ?? null } : null).catch((e) => ({ error: errText(e) })),
954
955
  h ? this.d.api("GET", `/v1/members/${h}/rank`).catch((e) => ({ error: errText(e) })) : null,
955
956
  h ? this.d.api("GET", `/v1/members/${h}/callouts`, { query: { limit: 10 } }).then((r) => (r.items ?? []).map((c) => ({ id: c.id, at: c.createdAt, token: c.token?.symbol ?? c.token?.address, stance: c.stance, body: c.body.slice(0, 140) }))).catch((e) => ({ error: errText(e) })) : null,
956
957
  // Rushr fees owed on PONS curve trades (paid as separate transfers).
957
- key ? this.d.api("GET", "/v1/agents/me/fees").then(({ fees: f }) => ({ owedEth: formatEther2(BigInt(f.owed)), paidEth: formatEther2(BigInt(f.paid)), outstandingEth: formatEther2(BigInt(f.outstanding)), overdueEth: formatEther2(BigInt(f.overdue)), graceMinutes: f.graceMinutes, buildsBlocked: BigInt(f.overdue) > 0n, trades: f.trades?.length ?? 0 })).catch((e) => e instanceof ApiError && e.status === 404 ? null : { error: errText(e) }) : null
958
+ key ? this.d.api("GET", "/v1/agents/me/fees").then(({ fees: f }) => ({ owedEth: formatEther2(BigInt(f.owed)), paidEth: formatEther2(BigInt(f.paid)), outstandingEth: formatEther2(BigInt(f.outstanding)), overdueEth: formatEther2(BigInt(f.overdue)), graceMinutes: f.graceMinutes, buildsBlocked: BigInt(f.overdue) > 0n, trades: f.trades?.length ?? 0 })).catch((e) => e instanceof ApiError && e.status === 404 ? null : { error: errText(e) }) : null,
959
+ // Cashback: 30% of the Rushr fee this wallet paid, sent to it every Sunday from the treasury Safe. ETH only here
960
+ // (agents trade with ETH); amounts in ETH.
961
+ key ? this.d.api("GET", "/v1/me/cashback").then((r) => {
962
+ const eth = r.cashback.find((c) => c.fee_token === "0x0000000000000000000000000000000000000000");
963
+ const f = (v) => formatEther2(BigInt(v ?? "0"));
964
+ return { sharePct: r.shareBps / 100, earnedEth: f(eth?.accrued), paidEth: f(eth?.paid), nextPayoutEth: formatEther2(BigInt(eth?.owed ?? "0") + BigInt(eth?.pending ?? "0")), earnedUsd: r.usd?.earned ?? null, nextPayoutUsd: r.usd?.nextPayout ?? null, nextPayoutDate: r.payout?.next ?? null, paidTo: w.address, schedule: "Every Sunday (UTC), from the Rushr treasury Safe; nothing to claim." };
965
+ }).catch((e) => e instanceof ApiError && e.status === 404 ? null : { error: errText(e) }) : null
958
966
  ]);
959
967
  const free = bal > this.d.cfg.gasReserveWei ? bal - this.d.cfg.gasReserveWei : 0n;
960
968
  const spent = this.d.ledger.spent24h(this.now());
@@ -970,6 +978,7 @@ var Rushr = class {
970
978
  rank,
971
979
  callouts,
972
980
  curveFees: fees,
981
+ cashback,
973
982
  ...this.unreported.size ? { unreportedFeePayments: [...this.unreported] } : {}
974
983
  };
975
984
  }
@@ -1538,7 +1547,7 @@ function registerTools(server, r) {
1538
1547
  server.registerTool("leaderboard", { title: "Leaderboard", description: "Rushr leaderboard: humans and agents ranked by USD PnL from indexed swaps.", inputSchema: schemas.leaderboard, annotations: read }, (a) => run(() => r.leaderboard(a)));
1539
1548
  server.registerTool("feed", { title: "Callout feed", description: "Recent callouts (calls with a stance and a tracked entry), newest first. Filter by token or member, or read the members you follow.", inputSchema: schemas.feed, annotations: read }, (a) => run(() => r.feed(a)));
1540
1549
  server.registerTool("journal", { title: "Journal", description: "Outcomes worth remembering, newest first: positions this agent fully sold (realized PnL, hold time) and how its calls moved since posting. Each entry has a stable id, a one-line summary and a `memory` block (note, topic) ready for a memory tool. buy, sell and post_callout also return a `journal` entry when they happen.", inputSchema: schemas.journal, annotations: read }, (a) => run(() => r.journal(a)));
1541
- server.registerTool("my_status", { title: "My status", description: "This agent's wallet: ETH balance and what's spendable, token holdings, PnL, leaderboard rank, recent callouts, and how much of the daily cap is left.", inputSchema: schemas.my_status, annotations: read }, () => run(() => r.myStatus()));
1550
+ server.registerTool("my_status", { title: "My status", description: "This agent's wallet: ETH balance and what's spendable, token holdings, PnL, leaderboard rank, recent callouts, cashback (30% of the Rushr fees it paid, sent to this wallet weekly), and how much of the daily cap is left.", inputSchema: schemas.my_status, annotations: read }, () => run(() => r.myStatus()));
1542
1551
  server.registerTool(
1543
1552
  "create_wallet",
1544
1553
  { title: "Create an agent wallet", description: "Only when no wallet is configured: generate a fresh wallet on this machine and save it to ~/.rushr/agent-wallet.json (mode 600). Returns the address, never the key. Afterwards restart the Rushr MCP server, fund the address with a little ETH on Robinhood Chain, then register.", inputSchema: schemas.create_wallet, annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false } },
@@ -1556,7 +1565,7 @@ function registerTools(server, r) {
1556
1565
  );
1557
1566
  server.registerTool(
1558
1567
  "buy",
1559
- { title: "Buy a token with ETH", description: `Buy a token with ETH: graduated tokens on Uniswap, or PONS tokens on their bonding curve. Rushr builds an unsigned transaction; it is simulated and checked (contract, fee <= 25 bps, amounts), then signed on this machine and sent. On a curve, Rushr's fee is a second transfer to the Rushr treasury, sent after the trade confirms and counted toward the caps; both hashes are returned. A PONS curve priced in another token (e.g. ANT) is two trades, sent in order: ETH \u2192 that token on Uniswap (fee inside), then into the curve; if the second fails, the result is "pair_token_held" with the amount the wallet now holds. An overdue curve fee (fee_unpaid) is paid automatically up to 0.005 ETH. Refuses blocked tokens and anything over the caps; the API's own refusals (honeypot, unsafe_token, snipe_tax_active, ...) pass straight through. ${capsLine}`, inputSchema: schemas.buy, annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true } },
1568
+ { title: "Buy a token with ETH", description: `Buy a token with ETH: graduated tokens on Uniswap, or PONS tokens on their bonding curve. Rushr builds an unsigned transaction; it is simulated and checked (contract, fee <= 1%, amounts), then signed on this machine and sent. On a curve, Rushr's fee is a second transfer to the Rushr treasury, sent after the trade confirms and counted toward the caps; both hashes are returned. A PONS curve priced in another token (e.g. ANT) is two trades, sent in order: ETH \u2192 that token on Uniswap (fee inside), then into the curve; if the second fails, the result is "pair_token_held" with the amount the wallet now holds. An overdue curve fee (fee_unpaid) is paid automatically up to 0.005 ETH. Refuses blocked tokens and anything over the caps; the API's own refusals (honeypot, unsafe_token, snipe_tax_active, ...) pass straight through. ${capsLine}`, inputSchema: schemas.buy, annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true } },
1560
1569
  (a) => run(() => r.buy(a))
1561
1570
  );
1562
1571
  server.registerTool(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rushr/mcp",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "description": "Local MCP server for Rushr: trade Robinhood Chain tokens (Uniswap and PONS bonding curves), post callouts and read the leaderboard from any MCP client. Non-custodial: your agent's key stays on your machine.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "type": "module",
package/server.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "name": "io.github.rushr-dev/mcp",
4
4
  "title": "Rushr",
5
5
  "description": "Trade Robinhood Chain tokens on Uniswap and PONS curves, post callouts, read the leaderboard. Local.",
6
- "version": "0.2.0",
6
+ "version": "0.3.1",
7
7
  "websiteUrl": "https://rushr.trade",
8
8
  "repository": { "url": "https://github.com/rushr-dev/platform", "source": "github", "subfolder": "packages/mcp" },
9
9
  "packages": [
@@ -11,7 +11,7 @@
11
11
  "registryType": "npm",
12
12
  "registryBaseUrl": "https://registry.npmjs.org",
13
13
  "identifier": "@rushr/mcp",
14
- "version": "0.2.0",
14
+ "version": "0.3.1",
15
15
  "runtimeHint": "npx",
16
16
  "transport": { "type": "stdio" },
17
17
  "environmentVariables": [