@arcnow/mcp 0.1.2 → 0.2.0

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
@@ -23,16 +23,19 @@ npx -y @arcnow/mcp --allow-writes # can spend, if ARCNOW_PRIVATE_KEY is in the
23
23
  ```
24
24
 
25
25
  Every client below runs that same command with `ARCNOW_MCP_NETWORK` set. The
26
- examples say `arc-mainnet`, where [arcnow.io](https://arcnow.io) is live.
27
- *The currently published server still ships the previous, testnet-only preset
28
- and refuses `arc-mainnet` by name; mainnet lands in the next release until
29
- then use `arc-testnet`.*
26
+ examples say `arc-mainnet`, where [arcnow.io](https://arcnow.io) is live — Arc
27
+ mainnet, chain 5042. `arc-testnet` is the rehearsal network: the same contracts
28
+ at other addresses, with test funds. With the variable unset the server starts
29
+ on `arc-testnet`, so nobody is pointed at real money by omission.
30
30
 
31
31
  **Write mode, in every client:** add `--allow-writes` to the arguments and put
32
32
  the signing key **in a file** the server reads through `ARCNOW_PRIVATE_KEY_FILE`
33
33
  — never the key itself in a client config, which gets committed and
34
- screenshotted. Read-only needs no key at all. Every variable is in
35
- [Configuration](#configuration); [`examples/`](examples) has both shapes.
34
+ screenshotted. Read-only needs no key at all. **On `arc-mainnet` every write is
35
+ real money**: the spend caps below are what bounds a mistake, and the server
36
+ says so at startup and in every session. Every variable is in
37
+ [Configuration](#configuration); [`examples/`](examples) has both shapes — the
38
+ writes-enabled one on `arc-testnet`, as a rehearsal.
36
39
 
37
40
  ### Claude Code
38
41
 
@@ -206,13 +209,13 @@ Nine read tools, always published. Six write tools, published only on opt-in.
206
209
  | tool | what it answers |
207
210
  | --- | --- |
208
211
  | `arcnow_network` | Which chain, which contracts, which graduation venues, whether a v4 router is configured for graduated tokens, **and which mode this server is in**. The first call of any session that might trade. |
209
- | `arcnow_quote_tokens` | The quote tokens a launch may use — native USDC and the ERC-20s the quote registry allowlists, such as EURC — each with its symbol, name, decimals, address, whether it is native, its launch fee in its own units, whether the registry accepts it now, and **this server's spend cap for it**. At most three `eth_call`s. On a chain with no quote registry (the 2.x contracts Arc testnet ran until the multi-quote reset), it says so, shows the error, and lists the network's own quote-token metadata with nothing known to be accepted. |
212
+ | `arcnow_quote_tokens` | The quote tokens a launch may use — native USDC and the ERC-20s the quote registry allowlists, such as EURC — each with its symbol, name, decimals, address, whether it is native, its launch fee in its own units (zero on both networks: launching is free, and the figure is read from the registry rather than assumed), whether the registry accepts it now, and **this server's spend cap for it**. At most three `eth_call`s. On a chain with no quote registry, it says so, shows the error, and lists the network's own quote-token metadata with nothing known to be accepted. |
210
213
  | `arcnow_list_tokens` | Recent launches, newest first, from the launchpad's `Launched` log, back to the block it was deployed in. Reports the block window it actually covered — see [the SDK gap](#what-made-a-clean-surface-awkward). |
211
- | `arcnow_token` | One token in full: metadata, **its quote token** (address, symbol, decimals, native or ERC-20), its curve's parameters (`r0Wad`, `y0Wad`), curve state, price, progress, and **where it trades now** — its curve, its v4 pool (with the router, whether it reaches the pool, the PoolManager, the pool's LP fee and what the fee hook holds accrued), or nowhere. Takes a token *or* a curve address. |
212
- | `arcnow_quote_buy` | What an amount of the token's quote (`quoteIn`) would buy, wherever the token trades. On a curve: tokens out, the 1% fee and exactly who receives it, the average fill price, minimum-out floors at four tolerances. In a pool: a quote that says it is a pool quote, with arcnow.io's 1% and the pool's own LP fee apart, the average fill against the pool's spot price, and the price impact. |
214
+ | `arcnow_token` | One token in full: metadata, **its quote token** (address, symbol, decimals, native or ERC-20), its curve's parameters (`r0Wad`, `y0Wad`), curve state, price, progress, and **where it trades now** — its curve, its v4 pool (with the router, whether it reaches the pool, the PoolManager, what a trade there costs — the hook's 0.80% and the pool's 0.20% LP fee, read off the pool — how the hook splits its part, and what it holds accrued), or nowhere. Takes a token *or* a curve address. |
215
+ | `arcnow_quote_buy` | What an amount of the token's quote (`quoteIn`) would buy, wherever the token trades. On a curve: tokens out, the 1% fee split four ways — creator, platform, referrer, protocol — with exactly who receives each share, the average fill price, minimum-out floors at four tolerances. In a pool: a quote that says it is a pool quote, with the fee hook's 0.80% and the pool's own 0.20% LP fee apart (1.00% in all, both read off the pool), the hook's three-way split, the average fill against the pool's spot price, and the price impact. |
213
216
  | `arcnow_quote_sell` | The same for a sell — plus, on a curve, that selling needs no approval, ever, and in a pool, that it does, and how much the holder has approved already. |
214
- | `arcnow_quote_launch` | What a launch in a given `quote` (native USDC by default, or an ERC-20 by symbol or address) would cost before anything is spent, split into the flat fee and the initial buy's own trade fee, with the predicted token and curve addresses. |
215
- | `arcnow_platform` | A platform's fee split, its default migrator and its curve template — every share printed both as bps of the fee and as a percentage of a trade. |
217
+ | `arcnow_quote_launch` | What a launch in a given `quote` (native USDC by default, or an ERC-20 by symbol or address) would cost before anything is spent: the launch fee the registry reports (zero — launching is free), the initial buy and its own trade fee, with the predicted token and curve addresses. |
218
+ | `arcnow_platform` | A platform's four-way fee split, its default migrator and its curve template — every share printed both as bps of the fee and as a percentage of a trade. |
216
219
  | `arcnow_list_platforms` | The registry's actual enumeration. Complete, unlike the token list. |
217
220
 
218
221
  The read tools are the valuable part. An assistant that can answer *what is this
@@ -227,13 +230,16 @@ mistake that costs money:
227
230
  reports an *average fill price* next to the spot price, and the tool
228
231
  descriptions tell the model to quote rather than multiply.
229
232
  - **A share of the fee is not a share of the trade.** 3000 bps of the fee is
230
- 0.30% of a trade. Both are printed, every time.
233
+ 0.30% of a trade. Both are printed, every time. The fee has **four parties** —
234
+ creator, platform, referrer, protocol; arcnow.io's own split is 3000 / 3500 /
235
+ 1000 / 2500 — and no developer share: no tool takes a `developer`.
231
236
  - **Graduated and migrated are different states.** A curve can have stopped
232
237
  trading permanently while its pool was never created, and then the token
233
238
  trades *nowhere*. That is reported as its own thing, with the rescue named.
234
239
  - **A pool quote is not a curve quote.** It says so, and it names two charges,
235
- not one: arcnow.io's 1%, taken in the pool's quote by the fee hook, and the pool's own
236
- Uniswap LP fee on top.
240
+ not one: the fee hook's **0.80%**, taken in the pool's quote and split creator /
241
+ platform / protocol, and the pool's own **0.20%** Uniswap LP fee 1.00% in all,
242
+ the same as the curve charged. Both rates are read off the pool, never assumed.
237
243
 
238
244
  ### Write
239
245
 
@@ -272,8 +278,8 @@ set a boolean — but does make the assertion explicit in the transcript.
272
278
  Zero means "fill me at any price", which on a public mempool is a donation,
273
279
  so it has to be typed rather than omitted.
274
280
  5. **Nothing that does not apply.** A curve trade pays the sender and has no
275
- `recipient`; a pool swap has no `referrer` or `developer` and cannot graduate
276
- anything, so `gasLimit` guards nothing there. Each is **refused** on the
281
+ `recipient`; a pool swap has no `referrer` and cannot graduate anything, so
282
+ `gasLimit` guards nothing there. Each is **refused** on the
277
283
  venue it does not exist on, before anything is quoted or sent — never
278
284
  silently dropped. The SDK refuses the same things; this server says so first.
279
285
  6. **The report.** Each tool states the exact cost and the exact effect, and
@@ -311,15 +317,21 @@ four tools work across that line. Three states, told apart out loud:
311
317
  | state | quote | buy / sell |
312
318
  | --- | --- | --- |
313
319
  | on its curve | a curve quote, as before | through the curve; `recipient` refused |
314
- | graduated **and** migrated | a pool quote, labelled as one | through arcnow.io's router; `gasLimit`, `referrer`, `developer` refused |
320
+ | graduated **and** migrated | a pool quote, labelled as one | through arcnow.io's router; `gasLimit`, `referrer` refused |
315
321
  | graduated, **not** migrated | refused: tradeable nowhere until `migrate()` | refused, naming `arcnow_migrate` |
316
322
 
317
323
  **What a pool quote contains.** The SDK prices a pool trade by simulating the
318
324
  real swap through the router, so the figures are the real fill with two charges
319
- inside them. The quote takes them back out and names each: arcnow.io's 1%, which
320
- the fee hook takes in the pool's quote, and the pool's own LP fee the pool key's `fee`, in
321
- hundredths of a bip which Uniswap charges on top. It shows the average fill
322
- price, the pool's spot price, and the price impact between them. The SDK has no
325
+ inside them. The quote takes them back out and names each: the fee hook's 0.80%,
326
+ which it takes in the pool's quote and splits creator 5000 / platform 1875 /
327
+ protocol 3125 bps (a pool swap has no referrer), and the pool's own 0.20% LP fee
328
+ the pool key's `fee`, in hundredths of a bip which Uniswap charges and the
329
+ pool's liquidity keeps. 1.00% in all, the same as the curve. Every rate comes
330
+ from the SDK's `Pool.fees()`, which reads the hook's `feeBps()` and
331
+ `feeConfigOf()` and the key; this server holds no fee constant, so a pool whose
332
+ key carries another LP fee is reported at the fee it carries. It shows the
333
+ average fill price, the pool's spot price, and the price impact between them.
334
+ The SDK has no
323
335
  reader for a pool's price, so the spot price is the SDK's own quote of a
324
336
  probe buy with both fees taken out — 0.000001 of an 18-decimal quote, or 10,000 raw
325
337
  units of a smaller one (0.01 EURC), so the fees' raw-unit rounding stays below one
@@ -362,32 +374,35 @@ decoded contract error or revert *failed on-chain*. `RpcFailure` *could not
362
374
  reach the chain*: the public endpoint rate-limits, and that says nothing about
363
375
  the token.
364
376
 
365
- ### One curve
377
+ ### One curve, on two networks
366
378
 
367
379
  arcnow.io has one bonding curve — the constant-product curve,
368
- `arcnow/bonding-curve@3.x.x`, priced in a quote token, with parameters `r0Wad`
380
+ `arcnow/bonding-curve@4.x.x`, priced in a quote token, with parameters `r0Wad`
369
381
  (the virtual quote reserve at launch, in WAD) and `y0Wad` (the virtual token
370
382
  reserve at launch) — launched through one contract stack, and a fee hook,
371
- `arcnow/arc-now-fee-hook@3.x.x`, that
372
- accrues each fee as a PoolManager claim and pays it out at the start of a later
373
- swap.
383
+ `arcnow/arc-now-fee-hook@4.x.x`, that takes its 0.80% in the pool, accrues each
384
+ fee as a PoolManager claim and pays it out at the start of a later swap. The same
385
+ build is live on Arc mainnet (`arc-mainnet`) and Arc testnet (`arc-testnet`), at
386
+ different addresses; a token address from one means nothing on the other, and
387
+ the server's instructions say which network a session is on.
374
388
 
375
389
  - **Nothing a tool prints names a curve kind or a stack.** There is one of
376
390
  each. `arcnow_token` prints the curve's own parameters, and a pool trade
377
391
  reports the fees it paid out from earlier trades (`FeesDistributed`) apart
378
392
  from the trader's fill.
379
393
  - **Any other version is refused by name, and never priced.** A curve or a
380
- platform of another version — the 2.x contracts Arc testnet ran until the
381
- multi-quote reset and the retired linear curve, `@1.x.x`, included —
382
- is the SDK's `UnknownCurveVersion`, naming the version, before any quote or
383
- send. A fee hook of another version is `UnknownHookVersion`, and its accrual
384
- is not read.
394
+ platform of another version — the retired multi-quote stack, `@3.x.x`, which
395
+ carried a developer share and whose data was wiped; the `@2.x.x` contracts
396
+ before it; the retired linear curve, `@1.x.x` is the SDK's
397
+ `UnknownCurveVersion`, naming the version, before any quote or send. A fee hook
398
+ of another version — the `@3.x.x` hook that charged 1% in the pool included —
399
+ is `UnknownHookVersion`, and neither its accrual nor its rates are read.
385
400
  - **An address that is not a curve is refused by name.** The SDK's
386
401
  `AddressIsNotACurve` for an arcnow.io token's address is followed to its curve;
387
402
  for anything else — an ordinary ERC-20, an account, nothing at all — it is the
388
403
  refusal, saying the address is not an arcnow.io token either.
389
404
  - **`arcnow_list_tokens` reads the one launchpad**, back to the block its stack
390
- was deployed in (61,911,405 on Arc testnet).
405
+ was deployed in (21,179,866 on Arc mainnet, 62,386,232 on Arc testnet).
391
406
 
392
407
  ---
393
408
 
@@ -399,7 +414,7 @@ where an operator's decisions belong. See
399
414
 
400
415
  | variable | default | what it does |
401
416
  | --- | --- | --- |
402
- | `ARCNOW_MCP_NETWORK` | `arc-testnet` | The network preset. `arc-mainnet` is **refused at startup, by name** arcnow.io is not deployed to one, and this server will not invent an address. |
417
+ | `ARCNOW_MCP_NETWORK` | `arc-testnet` | The network preset: `arc-mainnet` (Arc mainnet, chain 5042, where arcnow.io is live — **real money**) or `arc-testnet` (the rehearsal, chain 5042002). Both come from the SDK's `networks.json`; a name it does not know refuses to start, naming the two it does. The default is the rehearsal on purpose. |
403
418
  | `ARCNOW_MCP_NETWORK_FILE` | unset | A path to a JSON document in the SDK's `CustomNetwork` shape, for a deployment no preset names — a local anvil stack, or a stack deployed onto a fork. **Mutually exclusive with a preset name.** See [below](#a-network-the-sdk-has-no-preset-for). |
404
419
  | `ARCNOW_RPC_URL` | the preset's endpoint | Override the endpoint. Redacted of credentials before it is ever printed. |
405
420
  | `ARCNOW_MCP_ALLOW_WRITES` | unset | `1` enables the write tools. `--allow-writes` does the same. |
@@ -422,7 +437,9 @@ in EURC. So every quote token has its own cap, in its own units:
422
437
  - `ARCNOW_MCP_MAX_SPEND_USDC` caps native USDC, and defaults to `100`.
423
438
  - `ARCNOW_MCP_MAX_SPEND_<SYMBOL>` caps each other quote — `ARCNOW_MCP_MAX_SPEND_EURC=50`
424
439
  is 50 EURC. The symbol is upper-cased; a character that is not a letter or a
425
- digit is written `_`.
440
+ digit is written `_`. The cap is matched to the network's own token by
441
+ address: on `arc-mainnet` that is EURC at `0xbEf5f6d5…`, on `arc-testnet` at
442
+ `0x89b50855…`, each read from the preset.
426
443
 
427
444
  It fails closed, four ways:
428
445
 
@@ -439,8 +456,8 @@ It fails closed, four ways:
439
456
  - **Two quote tokens of the network sharing a symbol refuses to start** it: one
440
457
  variable cannot mean two caps.
441
458
 
442
- What counts: a launch spends its `totalCost` — the launch fee plus the initial
443
- buy, in the launch's quote; a buy spends its `quoteIn`. For an ERC-20 quote the
459
+ What counts: a launch spends its `totalCost` — the initial buy plus any launch
460
+ fee (zero on both networks), in the launch's quote; a buy spends its `quoteIn`. For an ERC-20 quote the
444
461
  SDK approves exactly that spend, so the same check covers the approve. The
445
462
  caller's own `maxTotalCost` is read in the same quote. The startup banner,
446
463
  `arcnow_network` and `arcnow_quote_tokens` show every cap, and
@@ -450,7 +467,7 @@ caller's own `maxTotalCost` is read in the same quote. The startup banner,
450
467
  ### A network the SDK has no preset for
451
468
 
452
469
  `ARCNOW_MCP_NETWORK_FILE=/path/to/network.json` points the server at a
453
- deployment by its addresses — a local anvil stack, or the 3.x stack this
470
+ deployment by its addresses — a local anvil stack, or the stack this
454
471
  repository's fork proof deploys onto a fork of Arc testnet:
455
472
 
456
473
  ```json
@@ -502,7 +519,7 @@ token. Gas is always native USDC, whatever a token's quote.
502
519
  `@arcnow/sdk` is published to npm from
503
520
  [arcnow-io/arcnow-io-sdk](https://github.com/arcnow-io/arcnow-io-sdk), one tagged
504
521
  release per version, and this server depends on it at an **exact version** —
505
- `"@arcnow/sdk": "0.1.3"`, never `^0.1.3`. The tool descriptions promise what one
522
+ `"@arcnow/sdk": "0.2.0"`, never `^0.2.0`. The tool descriptions promise what one
506
523
  known SDK does; a range would let `npm install` move the code under them with no
507
524
  commit here saying so. Moving the pin is a pull request.
508
525
 
@@ -511,10 +528,10 @@ commit here saying so. Moving the pin is a pull request.
511
528
  ```json
512
529
  "sdk": {
513
530
  "package": "@arcnow/sdk",
514
- "version": "0.1.3",
531
+ "version": "0.2.0",
515
532
  "integrity": "sha512-…",
516
533
  "public_repo": "arcnow-io/arcnow-io-sdk",
517
- "tag": "v0.1.3",
534
+ "tag": "v0.2.0",
518
535
  "why": ["what this server uses from that SDK, in prose"]
519
536
  }
520
537
  ```
@@ -548,7 +565,8 @@ what can be proved offline:
548
565
  - **A write refuses without the opt-in**, names `--allow-writes` and
549
566
  `ARCNOW_PRIVATE_KEY`, and has sent nothing.
550
567
  - **Both spend ceilings stop a transaction**, on a curve and in a pool, per
551
- quote token; a typo'd cap variable refuses to start; a USDC cap does not apply
568
+ quote token, on either preset mainnet's EURC is capped by its mainnet
569
+ address; a typo'd cap variable refuses to start; a USDC cap does not apply
552
570
  to EURC or the reverse.
553
571
  - **Every amount is labelled with its own quote**, an input with more decimals
554
572
  than its quote is refused, and an ERC-20 approve is reported whether it was
@@ -556,8 +574,13 @@ what can be proved offline:
556
574
  - **The gas trap is handled**, the venues are told apart (a stranded token is
557
575
  refused everywhere with `arcnow_migrate` named), the sell approval is never
558
576
  sent without `approveRouter: true` and never for more than the amount sold,
559
- and the reports say true things: fees broken out, average fill price apart
560
- from spot, graduated apart from migrated.
577
+ and the reports say true things: a curve fee broken out four ways, a pool's
578
+ 0.80% and 0.20% read off the pool and never assumed, a free launch printed
579
+ from the registry's zero, average fill price apart from spot, graduated apart
580
+ from migrated.
581
+ - **Both presets resolve** to the SDK's live deployments, `arc-mainnet` says it
582
+ is real money, and nothing of one network's addresses appears in a report
583
+ about the other.
561
584
  - **The wire works**: a real MCP client against a real MCP server over an
562
585
  in-memory transport.
563
586
 
package/dist/config.d.ts CHANGED
@@ -57,7 +57,15 @@
57
57
  * the network sharing a symbol is a startup error, because their two caps would
58
58
  * be one variable.
59
59
  *
60
- * # A network the SDK has no preset for
60
+ * # Two presets, and a network the SDK has no preset for
61
+ *
62
+ * `ARCNOW_MCP_NETWORK` is `arc-mainnet` — Arc mainnet, chain 5042, where
63
+ * arcnow.io is live and every write spends real money — or `arc-testnet`, the
64
+ * rehearsal network at chain 5042002, which runs the same contracts at other
65
+ * addresses. Both resolve through the SDK's `resolveNetwork`, which is the only
66
+ * source of an address in this server. The default is `arc-testnet`: a server
67
+ * started with no network named should not be pointed at real money by
68
+ * omission.
61
69
  *
62
70
  * `ARCNOW_MCP_NETWORK_FILE` names a JSON document in the SDK's `CustomNetwork`
63
71
  * shape — `rpcUrl`, `chainId`, `contracts`, and optionally `quoteTokens` and
@@ -176,9 +184,10 @@ export declare const DEFAULTS: {
176
184
  readonly network: "arc-testnet";
177
185
  /**
178
186
  * 100 USDC a call. Low enough that a prompt-injected "buy everything" is a
179
- * bounded accident and not a bounded-by-your-balance one; high enough that
180
- * the shipped 2 USDC launch fee plus a real first buy fits under it. An
181
- * operator who means to spend more says so once, at startup, on purpose.
187
+ * bounded accident and not a bounded-by-your-balance one; high enough that a
188
+ * real first buy fits under it (launching itself is free on arcnow.io's
189
+ * networks). An operator who means to spend more says so once, at startup, on
190
+ * purpose — and on arc-mainnet every one of these is real money.
182
191
  *
183
192
  * Native USDC only. Every other quote has NO default: spending it is refused
184
193
  * until the operator names a cap for it.
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AAIH,OAAO,KAAK,EAAE,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AC/D,eAAe,IAAI,MAAM,GAAG,SAAS;IAIrC;;;;OAIG;IACH,WAAW,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS;IAKjE,oEAAoE;IACpE,IAAI,mBAAmB,IAAI,WAAW,CAIrC;IAED,wDAAwD;IACxD,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,QAAQ,IAAI,iBAAiB;IAkB7B,yEAAyE;IACzE,MAAM,IAAI,iBAAiB;CAG5B;AAED,2EAA2E;AAC3E,eAAO,MAAM,QAAQ;;IAEnB;;;;;;;;;OASG;;IAEH;;;;;;OAMG;;;CAGK,CAAC;AAIX;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAU7C;AAoBD;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,EACjD,IAAI,GAAE,SAAS,MAAM,EAAO,EAC5B,QAAQ,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAA6C,GACxE,YAAY,CA+Hd;AA6JD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAgC1D"}
package/dist/config.js CHANGED
@@ -57,7 +57,15 @@
57
57
  * the network sharing a symbol is a startup error, because their two caps would
58
58
  * be one variable.
59
59
  *
60
- * # A network the SDK has no preset for
60
+ * # Two presets, and a network the SDK has no preset for
61
+ *
62
+ * `ARCNOW_MCP_NETWORK` is `arc-mainnet` — Arc mainnet, chain 5042, where
63
+ * arcnow.io is live and every write spends real money — or `arc-testnet`, the
64
+ * rehearsal network at chain 5042002, which runs the same contracts at other
65
+ * addresses. Both resolve through the SDK's `resolveNetwork`, which is the only
66
+ * source of an address in this server. The default is `arc-testnet`: a server
67
+ * started with no network named should not be pointed at real money by
68
+ * omission.
61
69
  *
62
70
  * `ARCNOW_MCP_NETWORK_FILE` names a JSON document in the SDK's `CustomNetwork`
63
71
  * shape — `rpcUrl`, `chainId`, `contracts`, and optionally `quoteTokens` and
@@ -68,7 +76,7 @@
68
76
  */
69
77
  import { readFileSync } from "node:fs";
70
78
  import { privateKeyToAccount } from "viem/accounts";
71
- import { isArcNowError, NATIVE_USDC, QuoteAmount, resolveNetwork } from "@arcnow/sdk";
79
+ import { isArcNowError, NATIVE_USDC, NETWORKS, QuoteAmount, resolveNetwork } from "@arcnow/sdk";
72
80
  /** Bad configuration, phrased for the person who wrote it. */
73
81
  export class ConfigError extends Error {
74
82
  name = "ConfigError";
@@ -180,9 +188,10 @@ export const DEFAULTS = {
180
188
  network: "arc-testnet",
181
189
  /**
182
190
  * 100 USDC a call. Low enough that a prompt-injected "buy everything" is a
183
- * bounded accident and not a bounded-by-your-balance one; high enough that
184
- * the shipped 2 USDC launch fee plus a real first buy fits under it. An
185
- * operator who means to spend more says so once, at startup, on purpose.
191
+ * bounded accident and not a bounded-by-your-balance one; high enough that a
192
+ * real first buy fits under it (launching itself is free on arcnow.io's
193
+ * networks). An operator who means to spend more says so once, at startup, on
194
+ * purpose — and on arc-mainnet every one of these is real money.
186
195
  *
187
196
  * Native USDC only. Every other quote has NO default: spending it is refused
188
197
  * until the operator names a cap for it.
@@ -260,15 +269,9 @@ export function loadConfig(env, argv = [], readFile = (path) => readFileSync(pat
260
269
  + "or the deployment the file describes, and guessing which one gets real addresses wrong.");
261
270
  }
262
271
  const network = namedNetwork ?? DEFAULTS.network;
263
- // Refused here rather than at the first call, so the operator finds out when
264
- // they start the server instead of when a model tries to trade. The SDK
265
- // refuses it too, by name; this is the same refusal, said earlier.
266
- if (networkFile === undefined && network === "arc-mainnet") {
267
- throw new ConfigError("arc-mainnet does not exist. arcnow.io is not deployed to an Arc mainnet, every "
268
- + "address in the SDK's preset for it is null on purpose, and this server will not "
269
- + "invent one. Use arc-testnet, or point ARCNOW_MCP_NETWORK at a network name the "
270
- + "SDK knows.");
271
- }
272
+ // Both presets arc-mainnet, where arcnow.io is live with real money, and
273
+ // arc-testnet, the rehearsal resolve through the SDK, which is the only
274
+ // source of an address here. A name the SDK does not know is refused by it.
272
275
  const networkConfig = networkFile === undefined
273
276
  ? resolvePreset(network)
274
277
  : readNetworkFile(networkFile, readFile);
@@ -350,14 +353,19 @@ export function loadConfig(env, argv = [], readFile = (path) => readFileSync(pat
350
353
  warnings,
351
354
  });
352
355
  }
353
- /** A preset, resolved by the SDK; its refusal said as a configuration error. */
356
+ /**
357
+ * A preset, resolved by the SDK; its refusal said as a configuration error.
358
+ * The SDK's presets are `arc-mainnet` and `arc-testnet` (`NETWORKS`), and the
359
+ * refusal names them so a typo is answered with the two real choices.
360
+ */
354
361
  function resolvePreset(network) {
355
362
  try {
356
363
  return resolveNetwork(network);
357
364
  }
358
365
  catch (cause) {
359
366
  throw new ConfigError(`${network} is not a network the SDK can build a client for: ${describeSdkError(cause)} `
360
- + "Use a preset the SDK knows, or describe the deployment in ARCNOW_MCP_NETWORK_FILE.", { cause });
367
+ + `The presets are ${NETWORKS.join(" and ")}; use one of them, or describe the deployment `
368
+ + "in ARCNOW_MCP_NETWORK_FILE.", { cause });
361
369
  }
362
370
  }
363
371
  /**
@@ -504,6 +512,9 @@ export function startupBanner(config) {
504
512
  : `${cap.format()} per write call (${variable})`}`);
505
513
  });
506
514
  lines.push(" reminder a launch is irreversible and a token's parameters can never be changed.");
515
+ if (config.network === "arc-mainnet") {
516
+ lines.push(" reminder this is Arc MAINNET: every write here spends real money.");
517
+ }
507
518
  }
508
519
  else {
509
520
  lines.push(" to write restart with --allow-writes and a key in ARCNOW_PRIVATE_KEY. The key is "
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAA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B,CAAC"}
package/dist/format.d.ts CHANGED
@@ -25,7 +25,7 @@
25
25
  * @module
26
26
  */
27
27
  import type { Address } from "viem";
28
- import type { Bps, CurveParams, NetworkConfig, QuoteTokenInfo, Tokens } from "@arcnow/sdk";
28
+ import type { Bps, CurveParams, FeeConfig, FeeSplit, NetworkConfig, PoolFees, QuoteTokenInfo, Tokens } from "@arcnow/sdk";
29
29
  import { QuoteAmount } from "@arcnow/sdk";
30
30
  /** The zero address, which on Arc is a real account, not a null. */
31
31
  export declare const ZERO_ADDRESS: "0x0000000000000000000000000000000000000000";
@@ -45,6 +45,35 @@ export declare function quoteLine(token: QuoteTokenInfo): string;
45
45
  export declare function addr(value: string): string;
46
46
  /** A share of the fee, said both ways — the single easiest thing to misread. */
47
47
  export declare function share(bps: Bps, tradeFeeBps: Bps): string;
48
+ /** `0.8%` — a rate in basis points OF THE TRADE, as a percentage of the trade. */
49
+ export declare function bpsPercent(bps: Bps): string;
50
+ /**
51
+ * A v4 LP fee, in hundredths of a bip (pips), said both ways:
52
+ * `0.2% (2000 hundredths of a bip)`.
53
+ */
54
+ export declare function lpFee(pips: number): string;
55
+ /**
56
+ * What a pool trade costs, in one line, from `Pool.fees()`:
57
+ * `1% of the trade in all — 0.8% (80 bps) taken by arcnow.io's fee hook in EURC,
58
+ * plus 0.2% (2000 hundredths of a bip) the pool keeps as its LP fee; the same
59
+ * 1% the curve charged`.
60
+ */
61
+ export declare function poolFeesLine(fees: PoolFees, quote: QuoteTokenInfo): string;
62
+ /** The hook's rate, said for a row: `0.8% of the trade (80 bps), read from the hook`. */
63
+ export declare function hookFeeRate(fees: PoolFees): string;
64
+ /**
65
+ * Where a curve fee goes: the four parties, each with its amount and the address
66
+ * that receives it. An absent referrer is said to go to the platform, because it
67
+ * does.
68
+ */
69
+ export declare function curveFeeSplitSection(fee: QuoteAmount, split: FeeSplit, referrer: string | undefined): string;
70
+ /**
71
+ * How a pool's hook splits its 0.80%: three parties, read off the hook. A pool
72
+ * swap names no referrer, so its share is stated as zero rather than omitted.
73
+ */
74
+ export declare function poolFeeSplitSection(fees: PoolFees): string;
75
+ /** A platform's four-way curve split, one row per party, every share both ways. */
76
+ export declare function curveSplitRows(config: FeeConfig, tradeFee: Bps): [string, string][];
48
77
  /** Graduation progress. `progressBps` is out of 10,000, not out of 100. */
49
78
  export declare function progress(bps: Bps): string;
50
79
  /**
@@ -65,7 +94,7 @@ export declare function priceMove(from: QuoteAmount, to: QuoteAmount): string;
65
94
  export declare function venueOf(migrator: Address, config: NetworkConfig): string;
66
95
  /**
67
96
  * A curve's immutable parameters. arcnow.io has one curve, the constant-product
68
- * `arcnow/bonding-curve@3.x.x`, and the SDK prices no other: `r0Wad` is its
97
+ * `arcnow/bonding-curve@4.x.x`, and the SDK prices no other: `r0Wad` is its
69
98
  * virtual quote reserve at launch, in 18-decimal WAD of its quote token, and
70
99
  * `y0Wad` its virtual token reserve at launch.
71
100
  */
@@ -1 +1 @@
1
- {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC3F,OAAO,EAAE,WAAW,EAAO,MAAM,aAAa,CAAC;AAE/C,oEAAoE;AACpE,eAAO,MAAM,YAAY,EAAG,4CAAqD,CAAC;AAElF,uFAAuF;AACvF,wBAAgB,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAEjD;AAED,sEAAsE;AACtE,wBAAgB,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAGtD;AAED,wBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,mFAAmF;AACnF,wBA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CHANGED
@@ -69,6 +69,93 @@ export function share(bps, tradeFeeBps) {
69
69
  return `${bps.bps} bps of the fee (${bps.percentOfFee()}% of the fee, `
70
70
  + `${bps.percentOfTrade(tradeFeeBps)}% of a trade)`;
71
71
  }
72
+ // ── fees ───────────────────────────────────────────────────────────────────
73
+ //
74
+ // Two venues, two fee shapes, and every report says which it is showing.
75
+ //
76
+ // On a CURVE the trade fee is a flat 1% of the trade, split FOUR ways — creator,
77
+ // platform, referrer, protocol — on the split the token's platform configured.
78
+ // There is no developer share: the earlier stack carried one that nothing used,
79
+ // and it fell to the platform. A share whose address is zero at swap time (no
80
+ // referrer named) is paid to the platform as well.
81
+ //
82
+ // In a POOL the trade costs the same 1.00% in all, but as two charges by two
83
+ // parties: arcnow.io's fee hook takes 0.80% of the trade in the pool's quote and
84
+ // splits it creator / platform / protocol (a pool swap names no referrer), and
85
+ // the pool itself keeps a 0.20% LP fee inside its price, which is Uniswap's and
86
+ // not arcnow.io's. Every pool figure here is the SDK's `Pool.fees()`, read off
87
+ // the hook and the pool key — never a constant of this server.
88
+ /** `0.8%` — a rate in basis points OF THE TRADE, as a percentage of the trade. */
89
+ export function bpsPercent(bps) {
90
+ return `${Number(bps.bps) / 100}%`;
91
+ }
92
+ /**
93
+ * A v4 LP fee, in hundredths of a bip (pips), said both ways:
94
+ * `0.2% (2000 hundredths of a bip)`.
95
+ */
96
+ export function lpFee(pips) {
97
+ return `${pips / 10_000}% (${pips} hundredths of a bip)`;
98
+ }
99
+ /**
100
+ * What a pool trade costs, in one line, from `Pool.fees()`:
101
+ * `1% of the trade in all — 0.8% (80 bps) taken by arcnow.io's fee hook in EURC,
102
+ * plus 0.2% (2000 hundredths of a bip) the pool keeps as its LP fee; the same
103
+ * 1% the curve charged`.
104
+ */
105
+ export function poolFeesLine(fees, quote) {
106
+ return `${bpsPercent(fees.totalBps)} of the trade in all — ${bpsPercent(fees.hookFeeBps)} `
107
+ + `(${fees.hookFeeBps.bps} bps) taken by arcnow.io's fee hook in ${quote.symbol}, plus `
108
+ + `${lpFee(fees.lpFeePips)} the pool keeps as its LP fee, inside its price. Both read off `
109
+ + "the chain: the hook's own feeBps() and the pool key's fee";
110
+ }
111
+ /** The hook's rate, said for a row: `0.8% of the trade (80 bps), read from the hook`. */
112
+ export function hookFeeRate(fees) {
113
+ return `${bpsPercent(fees.hookFeeBps)} of the trade (${fees.hookFeeBps.bps} bps), read from the hook`;
114
+ }
115
+ /**
116
+ * Where a curve fee goes: the four parties, each with its amount and the address
117
+ * that receives it. An absent referrer is said to go to the platform, because it
118
+ * does.
119
+ */
120
+ export function curveFeeSplitSection(fee, split, referrer) {
121
+ return section(`fee split — where the ${money(fee)} goes, four ways`, [
122
+ ["creator", `${money(split.creatorAmount)} → ${addr(split.creator)}`],
123
+ ["platform", `${money(split.platformAmount)} → ${addr(split.platform)} — the residual share, `
124
+ + "plus any share nobody was named for, plus the rounding dust"],
125
+ ["referrer", referrer === undefined
126
+ ? `${money(split.refAmount)} → no referrer given, so this goes to the platform`
127
+ : `${money(split.refAmount)} → ${addr(split.ref)}`],
128
+ ["protocol", `${money(split.protocolAmount)} → ${addr(split.protocol)}`],
129
+ ["developer", "none — the fee has four parties; there is no developer share"],
130
+ ]);
131
+ }
132
+ /**
133
+ * How a pool's hook splits its 0.80%: three parties, read off the hook. A pool
134
+ * swap names no referrer, so its share is stated as zero rather than omitted.
135
+ */
136
+ export function poolFeeSplitSection(fees) {
137
+ const { split } = fees;
138
+ const hook = fees.hookFeeBps;
139
+ return section(`how the fee hook splits its ${bpsPercent(hook)} — read from the hook`, [
140
+ ["creator", share(split.creatorShareBps, hook)],
141
+ ["platform", `${share(split.platformShareBps, hook)} → ${addr(split.platformRecipient)}`],
142
+ ["protocol", `${share(split.protocolShareBps, hook)} → ${addr(split.protocolRecipient)}`],
143
+ ["referrer", `${split.refShareBps.bps} bps — a pool swap names no referrer, so there is no `
144
+ + "referral share here; the LP fee is the pool's own and is not split by anyone"],
145
+ ]);
146
+ }
147
+ /** A platform's four-way curve split, one row per party, every share both ways. */
148
+ export function curveSplitRows(config, tradeFee) {
149
+ return [
150
+ ["creator", share(config.creatorShareBps, tradeFee)],
151
+ ["referrer", `${share(config.refShareBps, tradeFee)} — paid to the platform when a trade `
152
+ + "names no referrer"],
153
+ ["protocol", `${share(config.protocolShareBps, tradeFee)} — protocol-controlled; no platform `
154
+ + "sets it"],
155
+ ["platform", `${share(config.platformShareBps, tradeFee)} — the RESIDUAL: 10000 minus the `
156
+ + "three above, never an input anywhere in the contracts"],
157
+ ];
158
+ }
72
159
  /** Graduation progress. `progressBps` is out of 10,000, not out of 100. */
73
160
  export function progress(bps) {
74
161
  const percent = Number(bps.bps) / 100;
@@ -119,7 +206,7 @@ export function venueOf(migrator, config) {
119
206
  // ── the curve ──────────────────────────────────────────────────────────────
120
207
  /**
121
208
  * A curve's immutable parameters. arcnow.io has one curve, the constant-product
122
- * `arcnow/bonding-curve@3.x.x`, and the SDK prices no other: `r0Wad` is its
209
+ * `arcnow/bonding-curve@4.x.x`, and the SDK prices no other: `r0Wad` is its
123
210
  * virtual quote reserve at launch, in 18-decimal WAD of its quote token, and
124
211
  * `y0Wad` its virtual token reserve at launch.
125
212
  */