@black-market/sdk 0.12.0 → 0.14.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.
Files changed (57) hide show
  1. package/README.md +96 -96
  2. package/dist/lifecycle/index.d.ts +3 -1
  3. package/dist/lifecycle/index.d.ts.map +1 -1
  4. package/dist/lifecycle/index.js +3 -1
  5. package/dist/lifecycle/index.js.map +1 -1
  6. package/dist/lifecycle/lens.d.ts +409 -0
  7. package/dist/lifecycle/lens.d.ts.map +1 -0
  8. package/dist/lifecycle/lens.js +30 -0
  9. package/dist/lifecycle/lens.js.map +1 -0
  10. package/dist/lifecycle/mining.d.ts +47 -0
  11. package/dist/lifecycle/mining.d.ts.map +1 -0
  12. package/dist/lifecycle/mining.js +89 -0
  13. package/dist/lifecycle/mining.js.map +1 -0
  14. package/dist/lifecycle/planner.d.ts.map +1 -1
  15. package/dist/lifecycle/planner.js +121 -78
  16. package/dist/lifecycle/planner.js.map +1 -1
  17. package/dist/lifecycle/presets.d.ts +3 -0
  18. package/dist/lifecycle/presets.d.ts.map +1 -1
  19. package/dist/lifecycle/presets.js +1 -0
  20. package/dist/lifecycle/presets.js.map +1 -1
  21. package/dist/lifecycle/progress.d.ts +51 -1
  22. package/dist/lifecycle/progress.d.ts.map +1 -1
  23. package/dist/lifecycle/progress.js +149 -73
  24. package/dist/lifecycle/progress.js.map +1 -1
  25. package/dist/lifecycle/rpc.d.ts +14 -4
  26. package/dist/lifecycle/rpc.d.ts.map +1 -1
  27. package/dist/lifecycle/rpc.js +171 -12
  28. package/dist/lifecycle/rpc.js.map +1 -1
  29. package/dist/lifecycle/simulation.d.ts +5 -3
  30. package/dist/lifecycle/simulation.d.ts.map +1 -1
  31. package/dist/lifecycle/simulation.js +137 -115
  32. package/dist/lifecycle/simulation.js.map +1 -1
  33. package/dist/lifecycle/snapshot.d.ts +8 -0
  34. package/dist/lifecycle/snapshot.d.ts.map +1 -0
  35. package/dist/lifecycle/snapshot.js +79 -0
  36. package/dist/lifecycle/snapshot.js.map +1 -0
  37. package/dist/lifecycle/types.d.ts +27 -5
  38. package/dist/lifecycle/types.d.ts.map +1 -1
  39. package/dist/lifecycle/types.js.map +1 -1
  40. package/docs/launch-lifecycle.md +627 -1495
  41. package/docs/reference.md +365 -0
  42. package/examples/.env.example +3 -2
  43. package/examples/README.md +171 -552
  44. package/examples/launch-example-support.ts +11 -3
  45. package/examples/launch-example.ts +1 -1
  46. package/examples/launch-lifecycle-smoke.ts +1 -1
  47. package/package.json +1 -1
  48. package/src/lifecycle/index.ts +5 -1
  49. package/src/lifecycle/lens.ts +42 -0
  50. package/src/lifecycle/mining.ts +80 -0
  51. package/src/lifecycle/planner.ts +122 -73
  52. package/src/lifecycle/presets.ts +4 -0
  53. package/src/lifecycle/progress.ts +132 -59
  54. package/src/lifecycle/rpc.ts +163 -13
  55. package/src/lifecycle/simulation.ts +134 -106
  56. package/src/lifecycle/snapshot.ts +72 -0
  57. package/src/lifecycle/types.ts +24 -6
@@ -0,0 +1,365 @@
1
+ # Launch SDK reference
2
+
3
+ Use the [launch guide](launch-lifecycle.md) for the end-to-end flow and the
4
+ [runner reference](../examples/README.md) for environment and recovery artifacts.
5
+ This page covers SDK **0.14.0** addresses, limits, wire formats, fees, and diagnostics.
6
+
7
+ ## Deployed infrastructure
8
+
9
+ Robinhood Chain mainnet is **4663**. Resolve the graph with `getAddresses(4663)`;
10
+ `robinhoodLaunchApplication` contains the launch constants. Do not copy an old core
11
+ address from a saved example. The current core was created at block **82,880,313**;
12
+ start historical log queries there, in chunks of at most **10M blocks**.
13
+
14
+ | SDK field / export | Address |
15
+ | --- | --- |
16
+ | `launchOrchestrator` / `UFG_ORCHESTRATOR_ADDRESS` | `0x91560876033d568d25CDe98C78c33ff8FC43962c` |
17
+ | `launchImplementationRegistry` | `0xB2B0f9F36617810D67b8fC175153Aa10024C1358` |
18
+ | `launchFeeOwnerRegistry` | `0x64b5ca1f21B8E84305b0e4D847924dca39Eb1fcb` |
19
+ | `UFG_LAUNCH_PROXY_ADDRESS` | `0xf6673d859DE03eB74A0b01696Edb97f941dFD0CA` |
20
+ | `UFG_TREASURY_FACTORY_ADDRESS` | `0x26Aa5D52134c8E6c4C01E9fb53A7568c0C64901F` |
21
+ | `UFG_UPSTREAM_FACTORY_ADDRESS` | `0xA170b5A58C111334A7237F2Ea2c428ec5022f68E` |
22
+
23
+ `getKnownLifecycleDeployment`, `getKnownLifecycleProfile`, and
24
+ `listKnownLifecycleProfiles` are pure selectors keyed by chain/core. Unknown
25
+ identities return no preset. Use `readLifecycleProfiles` for live admission;
26
+ its `offset` / `limit` are bigint, defaulting to `0n` / `100n`.
27
+ Registry enumeration uses `profileCount`, `profileIds`, `adapterCount`, `adapterIds`;
28
+ selected registration/topology/eligibility use `profile`, `adapter`, `profileTopology`, `requireEligible`.
29
+
30
+ Local chain **31337** and workbench **46631** have zero launch addresses until configured.
31
+ Set `LAUNCH_ORCHESTRATOR`, `LAUNCH_IMPLEMENTATION_REGISTRY`, and
32
+ `LAUNCH_FEE_OWNER_REGISTRY` from one deployment. Address overrides are read once on
33
+ import: bare names, then `VITE_`, then `NEXT_PUBLIC_`. Client factories prefer explicit
34
+ `rpcUrl`, then `RPC_URL`, then the chain endpoint; always select the intended chain.
35
+
36
+ ## Check protocol limits
37
+
38
+ These are structural maxima, not a guarantee that activation fits gas.
39
+
40
+ | Item | Limit |
41
+ | --- | --- |
42
+ | Markets | 1–16 |
43
+ | Positions | At most 32 total; each profile can impose a smaller per-market bound |
44
+ | Ordered opening buys | At most 64 |
45
+ | Funding output assets | At most 8, unique ascending addresses |
46
+ | Fee assets | 1–8, unique ascending addresses; each policy sums to 10,000 bps |
47
+ | V4 markets sharing a quote | One across all V4 hooks, fees, and topologies |
48
+ | Individual market `config` | At most 16,384 bytes (16 KiB) |
49
+ | Individual swap-funding `data` | At most 16,384 bytes (16 KiB) |
50
+ | Whole transaction calldata | Optional `limits.maxCalldataBytes`; no default overall byte cap |
51
+ | ERC20 supply without rewards | Positive uint256 |
52
+ | ERC20 supply with rewards | Positive, at most `10^77` raw units |
53
+ | ERC404 supply | Positive uint96 |
54
+ | Token name / symbol / metadata URI | 1–128 / 1–32 / 0–2,048 UTF-8 bytes |
55
+ | Initial executor bounty | 0–1,000 bps; UFG requires 0 |
56
+ | Gas-envelope caps | Positive uint64 bigint |
57
+ | Gas headroom | `headroomBps`: 0–10,000; default 1,500 |
58
+ | Robinhood simulation-used gas | `maxSimulationGas`: default 50,000,000 aggregate |
59
+
60
+ Use `LIFECYCLE_MAX_ERC404_SUPPLY` and `LIFECYCLE_MAX_REWARD_ERC20_SUPPLY` for the
61
+ exported supply bounds. Market token budgets equal total minted supply; position
62
+ maxima equal each market budget. Any unused mint remainder burns before buys.
63
+
64
+ ## Encode plans and profile commitments
65
+
66
+ `@black-market/sdk/lifecycle` is the browser-safe lifecycle subpath. General pricing
67
+ helpers such as `deriveLaunchPoolRecipe` come from `@black-market/sdk`.
68
+ Use `serializeLaunchPlan` / `parseLaunchPlan` for decimal-string bigint JSON.
69
+ `encodeLaunchPlan` encodes `LaunchPlanV1`; `hashLaunchPlan` commits the full economics.
70
+ `hashLaunchIdentity` commits chain/core/creator/nonce. Mode and prepare batching are
71
+ execution metadata outside the plan tuple; retain them alongside the exact plan.
72
+
73
+ | Commitment helpers | Meaning |
74
+ | --- | --- |
75
+ | `encodeLaunchEnvelope`, `decodeLaunchEnvelope` | `LaunchEnvelopeV2`: digests, versions, capabilities, treasury, author, bounds, graph |
76
+ | `encodeLaunchBounds`, `decodeLaunchBounds`, `hashLaunchBounds` | Five bounds: spacing min/max, position max, oracle cardinality max, fee-mode flags |
77
+ | `hashLifecycleProfile` | Stable profile identity; excludes deployed instance addresses |
78
+ | `hashLaunchDependencies` | Chain/core/registry/registrar and exact dependency graph/runtime commitments |
79
+ | `hashPoolBoundV4MarketCommitment` | Per-pool constructor economics; canonical prefix with zero hook salt |
80
+
81
+ The registry admission EIP-712 domain is `Black Market Launch Registry`, version `2`.
82
+ Profile/dependency/market domains are `black-market.launch-profile.v2`,
83
+ `black-market.v4-dependencies.v2`, and `black-market.pool-bound-market-economics.v1`.
84
+ Profile retirement prevents new/pending source binding; it does not rewrite active
85
+ fee terms or disable stable-author credits.
86
+
87
+ ## Choose a market codec
88
+
89
+ | Market | Outer / inner version | Encode / decode |
90
+ | --- | --- | --- |
91
+ | Canonical Abyss | `configVersion: 1`; canonical profile 0–3 | `encodeAbyssLifecycleMarketConfig`, `decodeAbyssLifecycleMarketConfig` |
92
+ | Shared V4 | `configVersion: 4`, `version: 4` | `encodeV4LifecycleMarketConfig`, `decodeV4LifecycleMarketConfig` |
93
+ | Historical pool-bound V4 | `configVersion: 5`, `version: 5`; matching historical graph required | `encodePoolBoundV4LifecycleMarketConfig`, `decodePoolBoundV4LifecycleMarketConfig` |
94
+ | Current pool-bound V4 | `configVersion: 6`, `version: 6` | Same explicit pool-bound codecs |
95
+
96
+ Shared config4 support does not imply a shipped mainnet shared-V4 offering.
97
+ Abyss config commits profile/fee/oracle/opening price and ordered tick/liquidity/token-max positions.
98
+ V4 positions also carry salt. All initial positions require zero quote deposit.
99
+
100
+ ## Pool-bound V4, version 6
101
+
102
+ Match `V4_POOL_BOUND_LIFECYCLE_CONFIG_SCHEMA_V6`; historical version 5 uses
103
+ `V4_POOL_BOUND_LIFECYCLE_CONFIG_SCHEMA_V5`. Config6 inserts `minimumHookFeePips`
104
+ (uint24) and `feeSensitivityPipsSecondsPerTick` (uint32) immediately after
105
+ `hookFeePips` (maximum). `hookSalt` precedes `profileId`. Copy treasury, protocol
106
+ fee denominator, stable beneficiary, and terms digest from the selected profile.
107
+ Choose `developerFeeBps` explicitly, including zero, within both profile/protocol ceilings.
108
+ `externalLiquidityDisabled: false` permits third-party liquidity after opening;
109
+ launch liquidity stays permanently locked.
110
+
111
+ `validatePoolBoundHookFees` requires integer `0 <= minimum <= maximum <= 1,000,000`
112
+ pips and sensitivity `0..4,294,967,295` fee-pips × seconds/tick.
113
+ The fixed hook charges `floor(amount × hookFeePips / 1,000,000)`; storing minimum
114
+ and sensitivity does not make it dynamic. The Dynamic Fee Hook uses positive
115
+ quote-per-base tick velocity: `minimum + floor(positiveTickChange × sensitivity /
116
+ elapsedSeconds)`, capped at maximum. Quiet/falling prices, zero elapsed time, or
117
+ zero sensitivity use minimum. Dynamic requires LP fee **0**, developer fee **0**.
118
+
119
+ `encodePoolBoundHookParameters` requires explicit config version: config5 uses an
120
+ 18-word V1 constructor; config6 uses a **20-word / 640-byte** V2 constructor.
121
+ `readPoolBoundHookDeployment` verifies the typed deployer, creation chunks, constructor,
122
+ salt, and predicted hook. `buildPoolBoundHookDeploymentTransaction` builds optional
123
+ permissionless predeployment only; it does not create/open a market.
124
+
125
+ `fixedFeePoolHookV1Abi`, `poolHookDeployerV1Abi`, and `poolFeeCollectorFactoryV1Abi`
126
+ are config5 contracts. Config6 uses `fixedFeePoolHookConfigV6Abi`,
127
+ `poolHookDeployerConfigV6Abi`, and `poolFeeCollectorFactoryConfigV6Abi`.
128
+ `validateV4LifecycleMarket` checks terms, schema, topology, and bounds;
129
+ `validateV4LifecycleOracle` checks the registered oracle against the envelope.
130
+
131
+ UFG adds a canonical dynamic tuple via `encodeUfgLaunchConfig`:
132
+ `abi.encode((uint16,uint16,address[]))`, including the leading `0x20` offset.
133
+ `decodeUfgLaunchConfig` rejects alternate encodings and extra bytes;
134
+ `hashUfgLaunchConfig` hashes the tuple. Config6 appends typed `ufgLaunchConfig`
135
+ for UFG profiles only; Abyss carries no UFG tail. Full plan hashes bind auxiliary
136
+ tails; hook-constructor economics hashes bind the zero-salt prefix only.
137
+
138
+ ## Choose a fee tier
139
+
140
+ One million pips is 100%; 10,000 pips is 1%. Basis points use a 10,000 denominator.
141
+ Canonical Abyss supports these `ABYSS_FEE_TIERS`:
142
+
143
+ | Fee pips | Trading fee | Tick spacing |
144
+ | --- | --- | --- |
145
+ | 100 | 0.01% | 1 |
146
+ | 500 | 0.05% | 10 |
147
+ | 3000 | 0.30% | 60 |
148
+ | 10000 | 1% | 200 |
149
+ | 20000 | 2% | 400 |
150
+ | 50000 | 5% | 1000 |
151
+ | 100000 | 10% | 2000 |
152
+ | 150000 | 15% | 3000 |
153
+
154
+ V4 spacing is constrained by the selected profile, not this Abyss table. LP fee,
155
+ hook fee, protocol share, executor bounty, author royalty, and owner/reward/burn
156
+ splits are separate values. The example's 3000/60 is not the venue's sole fee tier.
157
+
158
+ ## Account for Nitro compute and poster gas
159
+
160
+ On chain 4663, the SDK reads ArbSys (`0x64`) `arbOSVersion` and ArbGasInfo (`0x6c`)
161
+ `getMaxTxGasLimit` / `getMaxBlockGasLimit` at the pinned block. ArbSys returns
162
+ 55 + logical version; raw must be at least 105. `limits.arbOSVersion` reports the
163
+ logical version. The minimum validated compute getter is `executionGasCeiling`.
164
+ Failed getters cannot fall back to the large header gas limit or a hard-coded 32M.
165
+
166
+ `transactionGasCeiling`, when set, is the minimum complete-envelope chain/RPC/account
167
+ restriction. It is separate from compute. NodeInterface (`0xc8`)
168
+ `gasEstimateL1Component` estimates poster allocation once for the next final
169
+ transaction, using its exact sender/target/calldata/value at the same block.
170
+ Compute-only calibration and fresh poster allocation size the immediate envelope
171
+ before native validation. `step.computeGasRequired` retains a separable compute
172
+ observation, never the old poster charge or provisional budget. A fresh poster
173
+ quote is combined once when that command becomes next. Both unvalidated sizing
174
+ and the final exact pass use affordable pinned envelopes; validation:false does
175
+ not disable Nitro's upfront funds check. The final pass uses exactly returned gas.
176
+ Sizing starts with per-call ceilings because unused gas is refunded between calls.
177
+ Only a genuine upfront-funds refusal permits one second unvalidated sizing attempt
178
+ with the budget shared across the sequence. Other failures do not retry; the final
179
+ exact validated pass is never replayed.
180
+
181
+ A tight payer balance can cover smaller exact staged envelopes yet not the
182
+ discovery margin. This may return `failureCategory: "affordability"` even though
183
+ the underlying launch could fit. The refused RPC exposes no successful-prefix
184
+ results; the SDK does not invent them or add more metering attempts.
185
+
186
+ Suffix steps are marked `provisional: true` and have no transaction estimate:
187
+ their conservative complete budgets check sequence feasibility, bounded across
188
+ the pinned affordable remaining balance. `buildNextTransaction` never reuses
189
+ those budgets as estimates; it freshly quotes and proves only the next command.
190
+
191
+ On Nitro, `estimate.posterGas` / `posterFee` are buffered allocations **inside**
192
+ `gasLimit`; `dataFeeIncludedInGas` is true, `dataFee` is zero, and `totalFee` equals
193
+ `gasLimit × gasPrice`. Do not add poster fees a second time. Custom `estimateDataFee`
194
+ is rejected on Nitro; generic EVM clients can use it for an external fee.
195
+ `feeConfidence` distinguishes `execution-and-data` from `execution-only` estimates.
196
+ Initial legacy gas price is the greater of fresh RPC recommendation and twice pinned
197
+ base fee. Reviewed immediate envelopes retain their exact held gas/price.
198
+
199
+ HMM atomic/activation sizing adds one forwarding target of
200
+ `4,250,000 + 500,000 × (HMM markets - 1)` gas. Staged packing estimates 14.5M per HMM
201
+ market and 16M per other market before measurement. These are sizing inputs, not
202
+ fixed transaction fees or proof that every permitted topology fits.
203
+
204
+ ## Cache static reads and inspect timing
205
+
206
+ | `LifecycleRpcClient` option | Behavior |
207
+ | --- | --- |
208
+ | `supportsReadBatching: true` | Opt into at most eight concurrent SDK reads per invocation; set only when your transport batches concurrent requests. |
209
+ | `sessionCache: createLifecycleSessionCache()` | Caller-owned reuse of SDK-selected static reads at one pin; successful deployment/backend observations also survive across blocks. Without it, those observations belong to the supplied client object. |
210
+ | `onDiagnostic(event)` | Local opt-in stage/RPC timing listener; no automatic console output or telemetry. |
211
+
212
+ Call `sessionCache.invalidate()` on wallet/chain switches and after each confirmed
213
+ transaction to discard pinned static values. Session deployment/backend facts are
214
+ keyed by chain and account where applicable and live until the session owner is
215
+ discarded. `sessionCache.block` is readonly `{ number, hash }` or undefined.
216
+ Planning pins retain the actual RPC L2 block number and header hash. EVM
217
+ `BLOCKNUMBER`/`BLOCKHASH`, including Multicall3's metadata getters, expose L1 values
218
+ on Nitro and are not L2 pin sources.
219
+ Balances, allowances, current progress, receipts, nonces, policy callbacks, and
220
+ stateful execution proof stay fresh. Session caching does not extend admission.
221
+
222
+ One RPC L2 header supplies number, hash, timestamp, gas limit and base fee.
223
+ The initial Multicall3 call uses that explicit L2 block and includes native balance,
224
+ funding/progress and Nitro getters. Independent getters are aggregated with no
225
+ minimum-count threshold. Runtime code is attested once per
226
+ session. The optional preset `launchLens` remains unset until deployment; once set,
227
+ one `launchLensAbi.snapshot` call replaces dependent token/hook/market/funding reads
228
+ inside that aggregate. The deployed preset `hookSaltMiner` replaces local mining
229
+ during combined preparation; every returned winner is verified locally.
230
+
231
+ Diagnostic events carry `stage`, `phase`, optional `durationMs`, `queueMs`,
232
+ `requestId`, allowlisted RPC `method`, and cache `hits` / `misses` / `reuses`.
233
+ Queue time is separate from request time; request IDs are local sequences.
234
+ Events omit URLs, addresses, parameters/results, signatures, calldata, and raw errors.
235
+ Listener failures cannot change planning behavior. Inspect normal admission fields
236
+ for success; a completed timing stage alone does not prove execution.
237
+
238
+ ## Stable author APIs and V3 fees
239
+
240
+ `developerBeneficiary` / envelope `beneficiary` is stable `authorId`.
241
+ Registry `authorPayout(authorId)` controls the live payout/controller; zero is unknown.
242
+ Registry admin or current payout/controller can update a known payout. Every helper
243
+ authenticates membership via registry core → core fee factory → factory `isHub`.
244
+
245
+ | Helper | Inputs beyond `{ client, registry, authorId }` |
246
+ | --- | --- |
247
+ | `readLifecycleAuthor` | None; returns core/factory, payout, hub count, pinned context. |
248
+ | `readAuthorHubs` | Optional bigint `offset`, `limit` (default 0/100; limit 1–100). |
249
+ | `readDeveloperFees` | `hub`, optional `assets`; reports supported/claimable/reserved and frozen source terms. |
250
+ | `buildSetAuthorPayoutTransaction` | `payout`, `account`, bigint `chainId`; requires controller/admin. |
251
+ | `buildClaimDeveloperFeesTransaction` | `hub`, `asset`, `account`, bigint `chainId`; payout fixed by registry. |
252
+ | `buildClaimDeveloperFeesPageTransaction` | Bigint `offset`, `limit` (1–10), optional `assets`, `account`, bigint `chainId`. |
253
+ | `decodeDeveloperClaimReceipt` | `{ receipt, transaction }`, using the exact returned claim transaction context. |
254
+
255
+ Unsigned claim builders return chain/from/to/data/value; the application owns gas,
256
+ signing, submission, and receipts. Explicit page assets are sorted unique nonzero
257
+ addresses, at most eight; empty selects each hub's actual assets.
258
+ Decode each row: **0 paid, 1 zero, 2 unsupported, 3 failed**. Cursor completion is
259
+ separate from payment success. Retry failed rows with enough gas; a successful
260
+ outer receipt can contain failures. A direct claim lacking its payment event is
261
+ `unobserved`, not a reported zero payment.
262
+
263
+ Use `lifecycleFeeHubAbi` for `claimAndSplit()`, which takes **no arguments**. Harvest deducts executor
264
+ bounty, splits owner/rewards/burn with dust allocation, then reserves developer
265
+ fees from attributable owner fees. Frozen terms and policy survive fee-owner changes;
266
+ old credits stay with the credited owner. `claimOwnerFees(asset, recipient)` withdraws
267
+ owner credits without harvesting. `claimDeveloperFees(authorId, asset)` resolves live
268
+ payout and has no recipient parameter. Owners can set executor bounty up to 1,000 bps.
269
+ Dividend tokens also permit a separate owner-set dividend bounty up to 1,000 bps;
270
+ self-claims receive full gross. Staking claims have no dividend payout bounty.
271
+
272
+ ## HMM fields and migration
273
+
274
+ `HmmLaunchConfig` contains `strategyShareBps` (0–10,000) and the strategy tuple.
275
+ `encodeHmmLaunchTail` / `decodeHmmLaunchTail` use **16 static words / 512 bytes**.
276
+ `validateHmmLaunchConfig` checks these 15 fields in wire order:
277
+
278
+ | Field | Unit / bound |
279
+ | --- | --- |
280
+ | `bidWidth`, `askWidth` | Tick spacings; positive int24 |
281
+ | `gap` | Tick spacings; nonnegative int24 |
282
+ | `staleAfterSeconds` | Positive uint32 seconds |
283
+ | `staleDisplacement` | Tick spacings; positive int24 |
284
+ | `minQuoteDeploy` | Raw quote uint256, including zero |
285
+ | `minQuoteHarvest` | Positive raw quote uint256 |
286
+ | `minTokenHarvest` | Positive raw token uint256, covered by both token caps |
287
+ | `resalePremiumBps` | 0–5,000 bps |
288
+ | `maxAsks` | 1–8 |
289
+ | `maxAskTokenExposure` | Raw token amount, covers asks and harvest; at most uint128 max |
290
+ | `maxAcquiredInventory` | Raw token amount, covers harvest; at most uint128 max |
291
+ | `premiumDecaySeconds` | Uint32 seconds; zero disables decay |
292
+ | `maxBidQuote` | Positive raw quote bid principal, at most uint128 max |
293
+ | `referenceDeviation` | Tick spacings; nonnegative int24 |
294
+
295
+ `defaultHmmLaunchConfig` requires `tokenBudget`, `quoteAsset`, `maxBidQuote`, and
296
+ `referenceDeviation`. Defaults: share 50%, widths 5/5, gap 1, stale 86,400 seconds /
297
+ 5 spacings, resale premium 500 bps, four asks, decay off. Token harvest/exposure/
298
+ inventory defaults are budget/100,000, budget/10, and budget. WETH deploy/harvest
299
+ thresholds are 0.0005/0.005 WETH; six-decimal USDG uses 1/10 USDG. Other quotes
300
+ require explicit raw `minQuoteDeploy` / `minQuoteHarvest`; decimals must match.
301
+
302
+ **HMM V1 → V2:** rebuild unstarted plans with current profile IDs/graphs, explicit
303
+ `maxBidQuote` / `referenceDeviation`, and a newly encoded 512-byte tail; re-mine and
304
+ re-prove. Old 448-byte tails and removed V1 hook enum members have no aliases.
305
+ Submitted V1 plans and active V1 markets keep their original contracts: use matching
306
+ legacy tooling, not mutated V2 plans. The SDK does not upgrade existing markets.
307
+
308
+ ## Run owned-fixture and API checks
309
+
310
+ From the checkout root, `pnpm test` runs offline tests and `pnpm examples` performs
311
+ read-only deployed discovery. The following checks require separate infrastructure;
312
+ run write-capable checks only with explicit permission on disposable services.
313
+
314
+ ### UFG owned-fork check
315
+
316
+ Run Anvil and the test in separate terminals; stop Anvil afterward:
317
+
318
+ ```sh
319
+ anvil --fork-url https://rpc.mainnet.chain.robinhood.com/ \
320
+ --chain-id 4663 --port 8561 --gas-limit 100000000 --silent
321
+ pnpm build
322
+ UFG_FORK_RPC_URL=http://127.0.0.1:8561 node test/integration/ufg-launch.fork.mjs
323
+ ```
324
+
325
+ This executes atomic/staged UFG contracts on the owned fork and restores snapshots.
326
+ It does not certify native Nitro metering. It needs no production key.
327
+
328
+ ### Owned lifecycle fixture
329
+
330
+ Provide Solidity-exported `manifest.json` and `sdk-plans.json` for an owned graph.
331
+ The manifest must set `fixtureOnly: true` and mark its `executionLimits` with the
332
+ `controlled-local-measurement` scope required by the [fixture runner](../examples/launch-lifecycle-smoke.ts).
333
+ These filenames are command inputs, not files shipped by the SDK.
334
+
335
+ ```sh
336
+ LAUNCH_LIFECYCLE_RPC_URL=http://127.0.0.1:18555 \
337
+ LAUNCH_LIFECYCLE_FORK_RPC_URL=http://127.0.0.1:18556 \
338
+ LAUNCH_LIFECYCLE_ALLOW_LOCAL_EXECUTION=1 \
339
+ node examples/launch-lifecycle-smoke.ts manifest.json sdk-plans.json
340
+ ```
341
+
342
+ The source and fork endpoints must be distinct owned loopback RPCs. For the chain
343
+ boundary test, also set `LAUNCH_LIFECYCLE_MANIFEST` and `LAUNCH_LIFECYCLE_FIXTURES`
344
+ to those input paths and run `node --test test/lifecycle-chain.test.mjs` with the
345
+ same environment. Do not pass a mainnet deployment manifest as a writable fixture.
346
+
347
+ ### HTTP API integration
348
+
349
+ Provide an abyss-api instance with PostgreSQL session migrations applied, upload-session
350
+ routes, the selected chain enabled, and the current launch verifying contract configured.
351
+ The attribution domain is `Abyss Launch Attribution`, version `1`; signed deadlines
352
+ must be future timestamps at most 15 minutes away. The service's launch-factory
353
+ configuration must point to the selected orchestrator.
354
+
355
+ ```sh
356
+ LAUNCH_API_TEST_URL=http://127.0.0.1:18763 pnpm test:api
357
+ # Writes metadata sessions on an owned disposable loopback service:
358
+ LAUNCH_API_TEST_URL=http://127.0.0.1:18763 \
359
+ LAUNCH_API_TEST_PRIVATE_KEY="$DISPOSABLE_TEST_PRIVATE_KEY" pnpm test:api:write
360
+ ```
361
+
362
+ `LAUNCH_API_TEST_CHAIN_ID` defaults to 4663; `LAUNCH_API_TEST_ORCHESTRATOR` defaults
363
+ to `getAddresses(4663).launchOrchestrator`. The write suite needs an explicitly
364
+ supplied disposable key, not a funded production key. These tests do not create a
365
+ token or prove image/publication/indexing; the operator owns database cleanup.
@@ -2,7 +2,7 @@
2
2
  # Step 1: node examples/<case>.ts plans/reviews and saves artifacts; no signing or writes.
3
3
  # Step 2: node examples/<case>.ts --broadcast signs, spends native ETH and publishes.
4
4
  # --broadcast is authorization by design: no economic-review hash prompt/input.
5
- # The computed review hash remains printed and saved as provenance.
5
+ # The computed review hash remains printed and saved with the economic review.
6
6
  # --resume <original-run-dir> continues an existing launch/publication unchanged.
7
7
  # Configure exactly one creator/signer source; leave PRIVATE_KEY blank with a keystore.
8
8
  # Dry runs derive only its public address; no wallet signer is constructed.
@@ -10,6 +10,7 @@ PRIVATE_KEY=
10
10
  # EXAMPLE_KEYSTORE_PATH=/absolute/path/to/owner-only-v3-scrypt-keystore
11
11
  # EXAMPLE_KEYSTORE_PASSWORD=
12
12
  # Required API service root, for quote reads in dry-run and staging/publication in broadcast.
13
+ # Public mainnet service: LAUNCH_API_URL=https://api.abyss.trading
13
14
  LAUNCH_API_URL=
14
15
 
15
16
  # Optional: blank uses the SDK official Robinhood chain-4663 mainnet RPC.
@@ -17,7 +18,7 @@ RPC_URL=
17
18
  # Optional ERC404 NFT metadata base URI that you actually host; blank means empty URI.
18
19
  NFT_BASE_URI=
19
20
 
20
- # Optional native ETH conversion input PER BUY (Kyber Swap funding for WETH/USDG).
21
+ # Optional native ETH input PER BUY: WETH wraps; USDG converts through Kyber.
21
22
  # EXAMPLE_BUY_AMOUNT_WEI=10000000000000
22
23
  # Optional Kyber API origin; unset uses LAUNCH_API_URL. No route/funding fallback.
23
24
  # EXAMPLE_KYBER_API_URL=