@parabolicfamily/mcp 0.1.7 → 0.1.8
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 +36 -2
- package/dist/chains.js +8 -1
- package/dist/chains.js.map +1 -1
- package/dist/coins.d.ts +38 -3
- package/dist/coins.js +54 -4
- package/dist/coins.js.map +1 -1
- package/dist/curve.d.ts +2 -1
- package/dist/curve.js +2 -1
- package/dist/curve.js.map +1 -1
- package/dist/docs.js +9 -4
- package/dist/docs.js.map +1 -1
- package/dist/parabolic.d.ts +103 -3
- package/dist/parabolic.js +254 -33
- package/dist/parabolic.js.map +1 -1
- package/dist/quote-unit.d.ts +77 -0
- package/dist/quote-unit.js +122 -0
- package/dist/quote-unit.js.map +1 -0
- package/dist/restapi.d.ts +22 -0
- package/dist/restapi.js +44 -3
- package/dist/restapi.js.map +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +35 -6
- package/dist/server.js.map +1 -1
- package/dist/subgraph.d.ts +18 -6
- package/dist/subgraph.js +13 -1
- package/dist/subgraph.js.map +1 -1
- package/dist/ticker.d.ts +97 -0
- package/dist/ticker.js +109 -0
- package/dist/ticker.js.map +1 -0
- package/package.json +2 -2
- package/src/chains.ts +8 -1
- package/src/coins.ts +67 -5
- package/src/curve.ts +2 -1
- package/src/docs.ts +10 -5
- package/src/parabolic.ts +264 -34
- package/src/quote-unit.ts +153 -0
- package/src/restapi.ts +51 -3
- package/src/server.ts +40 -6
- package/src/subgraph.ts +22 -4
- package/src/ticker.ts +148 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Parabolic MCP server
|
|
2
2
|
|
|
3
|
-
A small [Model Context Protocol](https://modelcontextprotocol.io) server for **Parabolic**,
|
|
3
|
+
A small [Model Context Protocol](https://modelcontextprotocol.io) server for **Parabolic**, a bonding-curve token launchpad on Arc and Robinhood Chain. It lets AI agents (Claude Code, Cursor, custom ERC-8004 agents) discover coins, quote curve trades with the contract's exact math, and build **unsigned** transactions, without a browser.
|
|
4
4
|
|
|
5
5
|
**What it never does:** hold keys, sign, send or broadcast transactions, custody funds, or accept private keys, seed phrases or session tokens as input. Every `build_*` tool returns `{ to, data, value, chainId }` for the caller's own wallet to sign. Quotes are read from chain at call time and can move before a transaction lands.
|
|
6
6
|
|
|
@@ -14,6 +14,14 @@ npx -y @parabolicfamily/mcp # starts the server on stdio
|
|
|
14
14
|
|
|
15
15
|
The ABIs ship with the package, so it works offline against any Arc RPC you point it at.
|
|
16
16
|
|
|
17
|
+
## What changed in 0.1.8
|
|
18
|
+
|
|
19
|
+
One tool, `parabolic.check_ticker`, and nothing else moved: every call that worked in 0.1.7 works unchanged.
|
|
20
|
+
Given a ticker it asks the Parabolic site whether a coin already carries it on **any** chain the site serves
|
|
21
|
+
and whether `<ticker>.parabolic.family` is free. It is advice and not a gate — nothing on chain enforces a
|
|
22
|
+
unique symbol — and the hostname is the one exclusive thing, held by the oldest coin with that ticker. The
|
|
23
|
+
ticker is normalised the way the site normalises it, so an impossible one is refused before a request is spent.
|
|
24
|
+
|
|
17
25
|
## What changed in 0.1.7 (for an existing consumer: nothing has to)
|
|
18
26
|
|
|
19
27
|
0.1.7 makes the server chain-aware. **Every call that worked in 0.1.6 works unchanged and means the same
|
|
@@ -150,12 +158,14 @@ Arguments are strict: a key a tool does not know fails with `Unrecognized key` i
|
|
|
150
158
|
| `parabolic.agent_status` | `{ address }`. Whether the wallet holds an ERC-8004 agent identity on Arc's `IdentityRegistry` (`balanceOf`), how many it holds, and the registry address and chain. On a chain where Arc has published no registry the answer is that fact, with `registered` and `identities` null. |
|
|
151
159
|
| `parabolic.build_register_agent_tx` | `{ from, metadataURI? }` → unsigned `IdentityRegistry.register(metadataURI)` (no value). The registry mints the ERC-721 identity to the signer, so `from` is the wallet that sends it, and returns the agent id; read it from the `Transfer` log in the receipt. `metadataURI` is a pointer to the agent's metadata stored as `tokenURI` and may be empty. Warns when the wallet already holds an identity. |
|
|
152
160
|
| `parabolic.protocol_stats` | Subgraph totals (launches, graduations, trades, volume, fees, daily series) plus the factory's live launch fee, curve preset, snipe-tax terms and contract addresses. |
|
|
161
|
+
| `parabolic.check_ticker` | `{ ticker }`. Whether a Parabolic coin already carries the ticker on **any** chain the site serves, and whether `<ticker>.parabolic.family` is free, read from the site's own route (`/api/v1/studio/ticker` on `PARABOLIC_API_URL`'s site). **Advice, not a gate**: nothing on chain enforces a unique symbol, so `free: false` lists what exists (`taken[]`, each with a `ref` for `get_coin`) and does not stop a launch. The hostname is the one exclusive thing and belongs to the oldest coin carrying the ticker (`hostFree`). A name on the site's reserved list comes back as `reserved` and is not a coin. The ticker is normalised the way the site does it (A-Z and 0-9, case and punctuation ignored, 2 to 10 characters); one outside that is refused before the site is asked. Call it before `build_launch_tx`. |
|
|
153
162
|
| `parabolic.docs` | The adopted parameters, curve mechanics, verified Arc facts and this server's configuration, as text. |
|
|
154
163
|
|
|
155
164
|
Every tool above also takes an optional `chain` (see "What changed in 0.1.7"), and every coin argument
|
|
156
165
|
takes a reference: `0x…` for a coin on this server's chain, `rhc:0x…` for one elsewhere. A wallet argument
|
|
157
166
|
(`recipient`, `buyer`, `creator`, `from`, `agent_status`'s `address`) stays a plain address — a wallet is
|
|
158
|
-
the same person on every EVM chain.
|
|
167
|
+
the same person on every EVM chain. `check_ticker` accepts `chain` like the others and its verdict still
|
|
168
|
+
covers every chain the site serves, because a ticker taken elsewhere is a collision the moment a link is shared.
|
|
159
169
|
|
|
160
170
|
Resources: `parabolic://docs/parameters` (same text as `parabolic.docs`) and `parabolic://coins/{address}` (same JSON as `parabolic.get_coin`; the address may be a reference).
|
|
161
171
|
|
|
@@ -221,6 +231,29 @@ The result is `kind: "register_agent"`: one unsigned `tx` to the registry carryi
|
|
|
221
231
|
registry mints to `msg.sender`. Once it lands, `parabolic.list_coins` with `pair: "Agents"` keeps the
|
|
222
232
|
coins launched from that wallet, and the site tags them `[ Agent ]`.
|
|
223
233
|
|
|
234
|
+
Check a ticker before launching under it:
|
|
235
|
+
|
|
236
|
+
```json
|
|
237
|
+
{ "name": "parabolic.check_ticker", "arguments": { "ticker": "$para" } }
|
|
238
|
+
```
|
|
239
|
+
```json
|
|
240
|
+
{
|
|
241
|
+
"ticker": "PARA", "asked": "$para",
|
|
242
|
+
"chain": { "id": 5042, "key": "arc", "name": "Arc" },
|
|
243
|
+
"scope": "every chain the Parabolic site serves, not only this server's chain",
|
|
244
|
+
"free": false,
|
|
245
|
+
"taken": [{ "chain": { "id": 5042, "key": "arc", "name": "Arc" }, "name": "Parabolic", "address": "0x552F…4073", "ref": "0x552F…4073", "page": "https://www.parabolic.family/coin/0x552F…4073" }],
|
|
246
|
+
"reserved": null,
|
|
247
|
+
"host": "para.parabolic.family", "hostFree": false,
|
|
248
|
+
"message": "$PARA already trades on Arc as \"Parabolic\". Nothing on chain stops a second coin using it; para.parabolic.family belongs to the oldest coin carrying the ticker.",
|
|
249
|
+
"notes": ["Advice, not a gate: …", "…"]
|
|
250
|
+
}
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
`free: true` comes back with `taken: []` and `hostFree: true`, and a name on the site's reserved list as
|
|
254
|
+
`reserved: { name }`. Nothing here is a lock: the verdict is what the site's board holds at the moment of
|
|
255
|
+
asking, and it lags the site's indexer by however far that is behind.
|
|
256
|
+
|
|
224
257
|
## Notes on the mechanics
|
|
225
258
|
|
|
226
259
|
- Curve math is a port of `ParabolicBondingCurve` / `ParabolicBondingCurveMath` (and of `web/lib/curve.ts`): fee legs are taken off the buy input separately, the constant product is priced on `getReserves()`, and a buy that would take more than `sellableTokens()` is clamped to the last sellable tokens, charged the grossed-up price and refunded the rest; that buy graduates the coin, so give it extra gas. Sells take the fee off the gross quote output and close once the curve is ready to graduate.
|
|
@@ -246,6 +279,7 @@ src/
|
|
|
246
279
|
chain.ts viem RPC wrapper (batched HTTP) behind a small Rpc interface
|
|
247
280
|
subgraph.ts GraphQL client and Coin/Protocol shapes
|
|
248
281
|
coins.ts coin summaries, sorting
|
|
282
|
+
ticker.ts check_ticker's rule: the site's normalisation, its verdict shape, the sentence
|
|
249
283
|
config.ts PARABOLIC_* environment
|
|
250
284
|
abi.ts loads abi/*.json
|
|
251
285
|
docs.ts parameters + Arc facts text
|
package/dist/chains.js
CHANGED
|
@@ -11,7 +11,14 @@ import { getAddress, isAddress } from "viem";
|
|
|
11
11
|
export const CHAINS = {
|
|
12
12
|
5042: { id: 5042, key: "arc", prefix: "", name: "Arc", native: { name: "USDC", symbol: "USDC", decimals: 18, dollar: true }, explorer: "https://explorer.arc.io", testnet: false, live: true },
|
|
13
13
|
5042002: { id: 5042002, key: "arc-testnet", prefix: "", name: "Arc Testnet", native: { name: "USDC", symbol: "USDC", decimals: 18, dollar: true }, explorer: "https://testnet.arcscan.app", testnet: true, live: true },
|
|
14
|
-
|
|
14
|
+
// Deployed 19 Sep 2026 (contracts/deployments/4663.json), and its gas asset filled in here on 20 Sep. ETH
|
|
15
|
+
// at 18 decimals is the scale the deploy MEASURED against the WETH9 that chain's own PositionManager names
|
|
16
|
+
// and wrote into `config.nativeDecimals`, not a figure taken from a doc; `dollar: false` is why no balance
|
|
17
|
+
// or launch fee on this chain may be reported as money in dollars. The Blockscout instance is the one the
|
|
18
|
+
// chain lists and the one contracts/scripts/verify-arcscan.sh has on record. `live` stays false here because
|
|
19
|
+
// this package has no `DEPLOYMENTS` entry for the chain: it is a chain a reference can name, not one an
|
|
20
|
+
// unconfigured server can read.
|
|
21
|
+
4663: { id: 4663, key: "rhc", prefix: "rhc", name: "Robinhood Chain", native: { name: "Ether", symbol: "ETH", decimals: 18, dollar: false }, explorer: "https://robinhoodchain.blockscout.com", testnet: false, live: false },
|
|
15
22
|
8453: { id: 8453, key: "base", prefix: "base", name: "Base", testnet: false, live: false },
|
|
16
23
|
1: { id: 1, key: "eth", prefix: "eth", name: "Ethereum", testnet: false, live: false },
|
|
17
24
|
56: { id: 56, key: "bnb", prefix: "bnb", name: "BNB Chain", testnet: false, live: false },
|
package/dist/chains.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chains.js","sourceRoot":"","sources":["../src/chains.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAgB,MAAM,MAAM,CAAC;AAyC3D;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,MAAM,GAA8B;IAC/C,IAAI,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,yBAAyB,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE;IAC9L,OAAO,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,6BAA6B,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE;IACvN,IAAI,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE;
|
|
1
|
+
{"version":3,"file":"chains.js","sourceRoot":"","sources":["../src/chains.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAgB,MAAM,MAAM,CAAC;AAyC3D;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,MAAM,GAA8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E,OAAO,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACzE,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,SAAS,CAAC,GAAQ;IAChC,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,EAAE,CAAC;IACjD,OAAO,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC;AAC3D,CAAC;AAED,+FAA+F;AAC/F,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,OAAe,EAA6C,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC"}
|
package/dist/coins.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Address } from "viem";
|
|
2
|
+
import { type QuoteBlock } from "./quote-unit.js";
|
|
2
3
|
import type { GqlCoin } from "./subgraph.js";
|
|
3
4
|
export type StatusKey = "climbing" | "graduated";
|
|
4
5
|
export declare const SORT_KEYS: readonly ["trending", "new", "near_graduation", "market_cap"];
|
|
@@ -9,9 +10,19 @@ export type CoinSummary = {
|
|
|
9
10
|
name: string;
|
|
10
11
|
ticker: string;
|
|
11
12
|
creator: Address;
|
|
12
|
-
|
|
13
|
+
/**
|
|
14
|
+
* What the coin's money is called — the asset's own symbol, whatever it is.
|
|
15
|
+
*
|
|
16
|
+
* It was the literal union `"USDC" | "EURC"` until 20 September 2026, which is Arc's two answers written
|
|
17
|
+
* into a type: every coin on any other chain was reported to an agent as an EURC while every figure beside
|
|
18
|
+
* it was right, and src/restapi.ts had to cast a real symbol back through it to compile.
|
|
19
|
+
*/
|
|
20
|
+
pair: string;
|
|
13
21
|
pairToken: Address;
|
|
22
|
+
/** Read from the asset's own `decimals()`, or from the chain's gas asset. Never derived from `pairToken`. */
|
|
14
23
|
quoteDecimals: number;
|
|
24
|
+
/** What the money IS: whether it is a dollar, what kind of asset it is, who issues it. See src/quote-unit.ts. */
|
|
25
|
+
quote: QuoteBlock;
|
|
15
26
|
status: StatusKey;
|
|
16
27
|
/** Quote raised on the curve (net of fees), whole units; for a graduated coin the threshold it crossed. */
|
|
17
28
|
raised: string;
|
|
@@ -36,7 +47,22 @@ export type CoinSummary = {
|
|
|
36
47
|
source: "subgraph" | "api" | "chain";
|
|
37
48
|
};
|
|
38
49
|
export declare const isNative: (pairToken: string) => boolean;
|
|
39
|
-
|
|
50
|
+
/**
|
|
51
|
+
* The scale a coin's quote amounts are written at, from the only two sources that have ever read it.
|
|
52
|
+
*
|
|
53
|
+
* This was `isNative(pairToken) ? 18 : 6` — Arc's own two answers, typed out, and the same pair of literals
|
|
54
|
+
* web/lib/data.ts and bot/src/chain.ts carried until 18 September 2026. The 18 is right only where the gas
|
|
55
|
+
* token is an 18-decimal dollar, and the 6 is right only for EURC on Arc: USDC is a **6-decimal ERC-20** on
|
|
56
|
+
* Base, Ethereum and BNB, all three of them chains on the plan, so every `raisedRaw` and `thresholdRaw` this
|
|
57
|
+
* produced there was out by a factor of a trillion — inside calldata an agent signs, with nothing to say so.
|
|
58
|
+
*
|
|
59
|
+
* `indexed` is the coin's own `Coin.quoteDecimals`, which the indexer writes at launch from the factory's
|
|
60
|
+
* re-read of the asset's `decimals()` — the chain's answer for *that launch*. Without it, a gas-asset quote
|
|
61
|
+
* falls back to the chain registry, whose figures were read off the chain when the chain was added. Neither
|
|
62
|
+
* available means **nothing is returned**: a caller must refuse a figure it cannot scale rather than pick a
|
|
63
|
+
* number (docs/20-multichain.md §3).
|
|
64
|
+
*/
|
|
65
|
+
export declare function quoteDecimalsOf(pairToken: string, indexed: number | null | undefined, chainId: number): number | undefined;
|
|
40
66
|
/** Curve progress in percent with three decimals, capped at 100. */
|
|
41
67
|
export declare const progressPct: (raised: bigint, threshold: bigint) => number;
|
|
42
68
|
/**
|
|
@@ -47,6 +73,15 @@ export declare function dayStats(g: GqlCoin, now: number, quoteDecimals: number)
|
|
|
47
73
|
volume24h: number;
|
|
48
74
|
change24h: number;
|
|
49
75
|
};
|
|
50
|
-
|
|
76
|
+
/**
|
|
77
|
+
* A subgraph row as a coin summary.
|
|
78
|
+
*
|
|
79
|
+
* `chainId` is the chain the subgraph is indexing, and it is required because the scale of the row's amounts
|
|
80
|
+
* is not inferable from the row: `Coin.quoteDecimals` when the endpoint carries it (subgraph 0.3.0 and later),
|
|
81
|
+
* and otherwise that chain's gas asset for a native-quoted coin. A row nothing can scale **throws**, because
|
|
82
|
+
* every figure below it — raised, threshold, price, volume — would be wrong by orders of magnitude and would
|
|
83
|
+
* look entirely ordinary.
|
|
84
|
+
*/
|
|
85
|
+
export declare function summaryFromGql(g: GqlCoin, now?: number, chainId?: number, knownDecimals?: number): CoinSummary;
|
|
51
86
|
/** Pure sort used by list_coins; `near_graduation` ranks climbing coins by progress and puts graduated ones last. */
|
|
52
87
|
export declare function sortCoins(list: CoinSummary[], sort: SortKey): CoinSummary[];
|
package/dist/coins.js
CHANGED
|
@@ -1,9 +1,30 @@
|
|
|
1
1
|
import { formatUnits, getAddress } from "viem";
|
|
2
|
+
import { chainFor } from "./chains.js";
|
|
2
3
|
import { NATIVE_QUOTE } from "./config.js";
|
|
3
4
|
import { toNumber } from "./curve.js";
|
|
5
|
+
import { quoteBlock, quoteUnitByAddress, quoteUnitOf } from "./quote-unit.js";
|
|
4
6
|
export const SORT_KEYS = ["trending", "new", "near_graduation", "market_cap"];
|
|
5
7
|
export const isNative = (pairToken) => pairToken.toLowerCase() === NATIVE_QUOTE;
|
|
6
|
-
|
|
8
|
+
/**
|
|
9
|
+
* The scale a coin's quote amounts are written at, from the only two sources that have ever read it.
|
|
10
|
+
*
|
|
11
|
+
* This was `isNative(pairToken) ? 18 : 6` — Arc's own two answers, typed out, and the same pair of literals
|
|
12
|
+
* web/lib/data.ts and bot/src/chain.ts carried until 18 September 2026. The 18 is right only where the gas
|
|
13
|
+
* token is an 18-decimal dollar, and the 6 is right only for EURC on Arc: USDC is a **6-decimal ERC-20** on
|
|
14
|
+
* Base, Ethereum and BNB, all three of them chains on the plan, so every `raisedRaw` and `thresholdRaw` this
|
|
15
|
+
* produced there was out by a factor of a trillion — inside calldata an agent signs, with nothing to say so.
|
|
16
|
+
*
|
|
17
|
+
* `indexed` is the coin's own `Coin.quoteDecimals`, which the indexer writes at launch from the factory's
|
|
18
|
+
* re-read of the asset's `decimals()` — the chain's answer for *that launch*. Without it, a gas-asset quote
|
|
19
|
+
* falls back to the chain registry, whose figures were read off the chain when the chain was added. Neither
|
|
20
|
+
* available means **nothing is returned**: a caller must refuse a figure it cannot scale rather than pick a
|
|
21
|
+
* number (docs/20-multichain.md §3).
|
|
22
|
+
*/
|
|
23
|
+
export function quoteDecimalsOf(pairToken, indexed, chainId) {
|
|
24
|
+
if (typeof indexed === "number" && Number.isInteger(indexed) && indexed > 0 && indexed <= 36)
|
|
25
|
+
return indexed;
|
|
26
|
+
return isNative(pairToken) ? chainFor(chainId)?.native?.decimals : undefined;
|
|
27
|
+
}
|
|
7
28
|
/** Curve progress in percent with three decimals, capped at 100. */
|
|
8
29
|
export const progressPct = (raised, threshold) => (threshold <= 0n ? 0 : Math.min(100, Number((raised * 100000n) / threshold) / 1000));
|
|
9
30
|
const dayOf = (sec) => Math.floor(sec / 86_400);
|
|
@@ -22,22 +43,51 @@ export function dayStats(g, now, quoteDecimals) {
|
|
|
22
43
|
const change24h = ref > 0 && current > 0 ? ((current - ref) / ref) * 100 : 0;
|
|
23
44
|
return { volume24h, change24h };
|
|
24
45
|
}
|
|
25
|
-
|
|
46
|
+
/**
|
|
47
|
+
* A subgraph row as a coin summary.
|
|
48
|
+
*
|
|
49
|
+
* `chainId` is the chain the subgraph is indexing, and it is required because the scale of the row's amounts
|
|
50
|
+
* is not inferable from the row: `Coin.quoteDecimals` when the endpoint carries it (subgraph 0.3.0 and later),
|
|
51
|
+
* and otherwise that chain's gas asset for a native-quoted coin. A row nothing can scale **throws**, because
|
|
52
|
+
* every figure below it — raised, threshold, price, volume — would be wrong by orders of magnitude and would
|
|
53
|
+
* look entirely ordinary.
|
|
54
|
+
*/
|
|
55
|
+
export function summaryFromGql(g, now = Math.floor(Date.now() / 1000), chainId = 5042, knownDecimals) {
|
|
26
56
|
const native = isNative(g.pairToken);
|
|
27
|
-
|
|
57
|
+
/* `knownDecimals` is the scale a caller has ALREADY read off the chain, and it is the authoritative one.
|
|
58
|
+
`get_coin` reads the curve and the subgraph in one `Promise.all`, so when the indexed row carries no scale
|
|
59
|
+
and this package's registry cannot name the asset, the answer is nonetheless sitting in the caller's hand
|
|
60
|
+
— it scales `volumeQuote` with it on the next line. Without this parameter that row was thrown away and
|
|
61
|
+
the tool reported it as unscalable, which treated the symptom of a scale it did not need to look for. */
|
|
62
|
+
const quoteDecimals = knownDecimals ?? quoteDecimalsOf(g.pairToken, g.quoteDecimals, chainId);
|
|
63
|
+
if (quoteDecimals === undefined) {
|
|
64
|
+
throw new Error(native
|
|
65
|
+
? `Coin ${g.id} is quoted in the gas token of chain ${chainId} and neither the indexer nor this package's chain registry says how many decimals it has, so its figures cannot be scaled`
|
|
66
|
+
: `Coin ${g.id} is quoted in ${g.pairToken} and the indexer does not carry its quoteDecimals (subgraph 0.3.0 or later), so its figures cannot be scaled`);
|
|
67
|
+
}
|
|
28
68
|
const graduated = g.status !== "CLIMBING";
|
|
29
69
|
const raisedRaw = BigInt(g.raised);
|
|
30
70
|
const thresholdRaw = BigInt(g.graduationThreshold);
|
|
31
71
|
const { volume24h, change24h } = dayStats(g, now, quoteDecimals);
|
|
72
|
+
const gas = chainFor(chainId)?.native;
|
|
73
|
+
/* The asset by its ADDRESS first, because that is what the subgraph carries and what a deploy approves. The
|
|
74
|
+
shortened-address string below is a display fallback for an asset this package has not been told about —
|
|
75
|
+
and until 20 September 2026 it was fed into `quoteUnitOf`, a SYMBOL lookup, which no shortened address can
|
|
76
|
+
ever match: USDG, a dollar, was published to every model as `dollar: false`. */
|
|
77
|
+
const byAddress = native ? undefined : quoteUnitByAddress(g.pairToken, chainId);
|
|
78
|
+
const quoteSymbol = native ? gas?.symbol ?? "" : byAddress?.symbol ?? `${g.pairToken.slice(0, 6)}\u2026${g.pairToken.slice(-4)}`;
|
|
32
79
|
return {
|
|
33
80
|
address: getAddress(g.id),
|
|
34
81
|
curve: getAddress(g.curve),
|
|
35
82
|
name: g.name,
|
|
36
83
|
ticker: g.symbol,
|
|
37
84
|
creator: getAddress(g.deployer),
|
|
38
|
-
|
|
85
|
+
// The chain's own asset, not Arc's two. `symbol` is on the subgraph's Coin only for the coin itself, so an
|
|
86
|
+
// ERC-20 quote falls back to its address until the caller resolves it on chain (src/parabolic.ts).
|
|
87
|
+
pair: quoteSymbol,
|
|
39
88
|
pairToken: getAddress(g.pairToken),
|
|
40
89
|
quoteDecimals,
|
|
90
|
+
quote: quoteBlock(byAddress ?? quoteUnitOf(quoteSymbol, chainId), getAddress(g.pairToken), quoteDecimals, native),
|
|
41
91
|
status: graduated ? "graduated" : "climbing",
|
|
42
92
|
raised: formatUnits(graduated ? thresholdRaw : raisedRaw, quoteDecimals),
|
|
43
93
|
raisedRaw: graduated ? thresholdRaw : raisedRaw,
|
package/dist/coins.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coins.js","sourceRoot":"","sources":["../src/coins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAgB,MAAM,MAAM,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"coins.js","sourceRoot":"","s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AAG,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC;QAC9I,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC;QACtD,eAAe,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC,WAAW,IAAI,MAAM,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC;QAC7H,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS;KAChD,CAAC;IACF,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;AAClC,CAAC"}
|
package/dist/curve.d.ts
CHANGED
|
@@ -80,7 +80,8 @@ export declare const graduationSplit: (reservedTokens: bigint, phantomQuote: big
|
|
|
80
80
|
*/
|
|
81
81
|
export declare function snipeTaxBpsAt(elapsedSeconds: bigint, windowSeconds: bigint, startBps: bigint, feeBps: bigint, creatorTaxBps: bigint): bigint;
|
|
82
82
|
export declare const toNumber: (v: bigint, decimals?: number) => number;
|
|
83
|
-
/** Spot market cap in whole quote units for `supply` at the current curve price
|
|
83
|
+
/** Spot market cap in whole quote units for `supply` at the current curve price. `quoteDecimals` is the quote
|
|
84
|
+
* asset's own, read off it by the caller (src/parabolic.ts `readQuoteAsset`) and never derived from a flag. */
|
|
84
85
|
export declare const marketCap: (quoteReserve: bigint, tokenReserve: bigint, supply: bigint, quoteDecimals?: number) => number;
|
|
85
86
|
/** Market cap at the price the v4 pool is seeded with: (phantomQuote + graduationThreshold) / reservedTokens. */
|
|
86
87
|
export declare const graduationMarketCap: (phantomQuote: bigint, graduationThreshold: bigint, reservedTokens: bigint, supply: bigint, quoteDecimals?: number) => number;
|
package/dist/curve.js
CHANGED
|
@@ -104,7 +104,8 @@ export function snipeTaxBpsAt(elapsedSeconds, windowSeconds, startBps, feeBps, c
|
|
|
104
104
|
return bps > ceiling ? ceiling : bps;
|
|
105
105
|
}
|
|
106
106
|
export const toNumber = (v, decimals = TOKEN_DECIMALS) => Number(formatUnits(v, decimals));
|
|
107
|
-
/** Spot market cap in whole quote units for `supply` at the current curve price
|
|
107
|
+
/** Spot market cap in whole quote units for `supply` at the current curve price. `quoteDecimals` is the quote
|
|
108
|
+
* asset's own, read off it by the caller (src/parabolic.ts `readQuoteAsset`) and never derived from a flag. */
|
|
108
109
|
export const marketCap = (quoteReserve, tokenReserve, supply, quoteDecimals = TOKEN_DECIMALS) => tokenReserve === 0n ? 0 : toNumber((quoteReserve * supply) / tokenReserve, quoteDecimals);
|
|
109
110
|
/** Market cap at the price the v4 pool is seeded with: (phantomQuote + graduationThreshold) / reservedTokens. */
|
|
110
111
|
export const graduationMarketCap = (phantomQuote, graduationThreshold, reservedTokens, supply, quoteDecimals = TOKEN_DECIMALS) => reservedTokens === 0n ? 0 : toNumber(((phantomQuote + graduationThreshold) * supply) / reservedTokens, quoteDecimals);
|
package/dist/curve.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"curve.js","sourceRoot":"","sources":["../src/curve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,SAAS,EAA0B,MAAM,MAAM,CAAC;AAE3F;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,GAAG,GAAG,MAAO,CAAC;AAC3B,MAA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AAC,QAAQ,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IACjD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;AAC7C,CAAC,CAAC;AAEF,oIAAoI;AACpI,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAE,SAAkB,EAAE,GAAW,EAAE,WAAmB,EAAE,KAAc,EAAO,EAAE;IACpH,MAAM,gBAAgB,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IAC3D,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC5E,OAAO,SAAS,CAAC,mBAAmB,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;AACnL,CAAC,CAAC"}
|
package/dist/docs.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ARC_MEMO_DEFAULT, ENV_VARS, USDC_VIEW, chainName } from "./config.js";
|
|
2
2
|
import { chainFor } from "./chains.js";
|
|
3
|
+
import { defaultQuoteOf } from "./quote-unit.js";
|
|
3
4
|
import { endpointHost } from "./format.js";
|
|
4
5
|
/**
|
|
5
6
|
* Adopted product parameters (adopted 2026-09-06, graduation threshold revised to $8,000 on 2026-09-16; published
|
|
@@ -18,11 +19,14 @@ export function docsText(config) {
|
|
|
18
19
|
// Which chain family, from the registry rather than from a pair of written ids: everything in the Arc block
|
|
19
20
|
// below is Arc's own, and an id comparison here is the same kind of hardcoded chain fact this file is losing.
|
|
20
21
|
const onArc = chain?.key === "arc" || chain?.key === "arc-testnet";
|
|
22
|
+
const quote = defaultQuoteOf(config.chainId);
|
|
21
23
|
const gas = chain?.native ? `${chain.native.symbol}${chain.native.dollar ? " (itself a dollar, so a figure in it is a figure in dollars)" : " (not a dollar: a figure in it is not a figure in dollars)"}` : "not read from this chain in this repo, so nothing here prices it";
|
|
22
24
|
return [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
// "curves priced in dollars" was written in both branches until 20 Sep 2026, which is true of every asset
|
|
26
|
+
// Parabolic has ever been quoted in and is not a property of a curve. The chain's own default asset says it.
|
|
27
|
+
`PARABOLIC — bonding-curve token launchpad on ${chainName(config.chainId)}; each curve is priced in one quote asset${quote === undefined
|
|
28
|
+
? ", read it from the coin's curve (`pairToken`)"
|
|
29
|
+
: `, which on this chain is ${quote.symbol}${quote.dollar ? " (a dollar)" : " (NOT a dollar: never put a $ in front of a figure counted in it)"}${chain?.native?.symbol === quote.symbol ? " and is also the gas asset" : ", not the gas token"}`}`,
|
|
26
30
|
"parabolic.family · contact@parabolic.family · the people's launchpad; the goal is the betterment of the community.",
|
|
27
31
|
"Category: bonding-curve launchpad (pump.fun / fomo.family), not a fundraising venue. Non-custodial: every launch and trade is a wallet-signed transaction; no custody, no warranties, no advice; coins are user-created and experimental.",
|
|
28
32
|
"",
|
|
@@ -72,7 +76,8 @@ export function docsText(config) {
|
|
|
72
76
|
"THIS SERVER",
|
|
73
77
|
`- Chain: ${chainName(config.chainId)} (${config.chainId}), RPC ${endpointHost(config.rpcUrl)}.`,
|
|
74
78
|
`- Factory: ${set(config.factory)} · Memo router: ${set(config.memoRouter)} · Subgraph: ${config.subgraphUrl ? endpointHost(config.subgraphUrl) : "(not configured)"} · EURC: ${set(config.eurc)} · Hook: ${config.hook ?? "(read from factory)"} · Launch config id: ${config.launchConfigId}.`,
|
|
75
|
-
"- Tools: parabolic.list_coins, parabolic.get_coin, parabolic.quote_buy, parabolic.quote_sell, parabolic.build_buy_tx, parabolic.build_sell_tx, parabolic.build_launch_tx, parabolic.protocol_stats, parabolic.agent_status, parabolic.build_register_agent_tx, parabolic.docs. Resources: parabolic://docs/parameters, parabolic://coins/{address}.",
|
|
79
|
+
"- Tools: parabolic.list_coins, parabolic.get_coin, parabolic.quote_buy, parabolic.quote_sell, parabolic.build_buy_tx, parabolic.build_sell_tx, parabolic.build_launch_tx, parabolic.protocol_stats, parabolic.agent_status, parabolic.build_register_agent_tx, parabolic.check_ticker, parabolic.docs. Resources: parabolic://docs/parameters, parabolic://coins/{address}.",
|
|
80
|
+
"- check_ticker asks the Parabolic site (PARABOLIC_API_URL's site, route /api/v1/studio/ticker) whether a coin already carries a symbol on any chain the site serves and whether <ticker>.parabolic.family is free. Advice, not a gate: nothing on chain enforces a unique symbol. The hostname is the one exclusive thing and belongs to the oldest coin with the ticker.",
|
|
76
81
|
"- It never holds keys, signs, sends or broadcasts. build_* tools return unsigned { to, data, value, chainId } for the caller's wallet. Quotes are read from chain at call time and can move before a transaction lands.",
|
|
77
82
|
`- build_launch_tx: with PARABOLIC_MEMO_ROUTER set and devBuy > 0 it returns one ParabolicMemoRouter.launchAndBuy transaction (creatorFeeRecipient zero, minTokensOut from the curve math on the launch config's phantom quote, value = launch fee + devBuy)${config.memoRouter ? " (router configured)" : " (router not configured here)"}; otherwise factory.launchToken plus, for a devBuy, the two-step plan (buy calldata to send to the new curve).`,
|
|
78
83
|
"- The factory ABI has no enumeration function; listing uses the subgraph when set, otherwise Parabolic's public read API (PARABOLIC_API_URL), and a TokenLaunched log scan of the factory only when both are unavailable.",
|
package/dist/docs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.js","sourceRoot":"","sources":["../src/docs.ts"],"names":[],"mappings":"AAAA,OAAO,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