@black-market/sdk 0.14.1 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -7
- package/dist/lifecycle/authors.js +2 -2
- package/dist/lifecycle/authors.js.map +1 -1
- package/dist/lifecycle/auto-compound.d.ts +21 -0
- package/dist/lifecycle/auto-compound.d.ts.map +1 -0
- package/dist/lifecycle/auto-compound.js +34 -0
- package/dist/lifecycle/auto-compound.js.map +1 -0
- package/dist/lifecycle/calibration.d.ts +2 -4
- package/dist/lifecycle/calibration.d.ts.map +1 -1
- package/dist/lifecycle/calibration.js +1 -26
- package/dist/lifecycle/calibration.js.map +1 -1
- package/dist/lifecycle/deployments/auto-compound-dynamic-pool-v1-20261028.d.ts +73 -0
- package/dist/lifecycle/deployments/auto-compound-dynamic-pool-v1-20261028.d.ts.map +1 -0
- package/dist/lifecycle/deployments/auto-compound-dynamic-pool-v1-20261028.js +75 -0
- package/dist/lifecycle/deployments/auto-compound-dynamic-pool-v1-20261028.js.map +1 -0
- package/dist/lifecycle/deployments/auto-compound-static-pool-v1-20261028.d.ts +73 -0
- package/dist/lifecycle/deployments/auto-compound-static-pool-v1-20261028.d.ts.map +1 -0
- package/dist/lifecycle/deployments/auto-compound-static-pool-v1-20261028.js +75 -0
- package/dist/lifecycle/deployments/auto-compound-static-pool-v1-20261028.js.map +1 -0
- package/dist/lifecycle/gas-profile.d.ts +39 -0
- package/dist/lifecycle/gas-profile.d.ts.map +1 -0
- package/dist/lifecycle/gas-profile.js +193 -0
- package/dist/lifecycle/gas-profile.js.map +1 -0
- package/dist/lifecycle/index.d.ts +6 -4
- package/dist/lifecycle/index.d.ts.map +1 -1
- package/dist/lifecycle/index.js +6 -4
- package/dist/lifecycle/index.js.map +1 -1
- package/dist/lifecycle/markets.d.ts +2 -0
- package/dist/lifecycle/markets.d.ts.map +1 -1
- package/dist/lifecycle/markets.js +30 -3
- package/dist/lifecycle/markets.js.map +1 -1
- package/dist/lifecycle/opening-buys.d.ts +13 -0
- package/dist/lifecycle/opening-buys.d.ts.map +1 -0
- package/dist/lifecycle/opening-buys.js +171 -0
- package/dist/lifecycle/opening-buys.js.map +1 -0
- package/dist/lifecycle/planner.d.ts +6 -9
- package/dist/lifecycle/planner.d.ts.map +1 -1
- package/dist/lifecycle/planner.js +175 -265
- package/dist/lifecycle/planner.js.map +1 -1
- package/dist/lifecycle/presets.d.ts +10 -3
- package/dist/lifecycle/presets.d.ts.map +1 -1
- package/dist/lifecycle/presets.js +13 -1
- package/dist/lifecycle/presets.js.map +1 -1
- package/dist/lifecycle/progress.d.ts +1 -1
- package/dist/lifecycle/progress.d.ts.map +1 -1
- package/dist/lifecycle/progress.js +21 -20
- package/dist/lifecycle/progress.js.map +1 -1
- package/dist/lifecycle/rpc.d.ts +25 -30
- package/dist/lifecycle/rpc.d.ts.map +1 -1
- package/dist/lifecycle/rpc.js +63 -81
- package/dist/lifecycle/rpc.js.map +1 -1
- package/dist/lifecycle/snapshot.d.ts.map +1 -1
- package/dist/lifecycle/snapshot.js +2 -4
- package/dist/lifecycle/snapshot.js.map +1 -1
- package/dist/lifecycle/transactions.d.ts +29 -6
- package/dist/lifecycle/transactions.d.ts.map +1 -1
- package/dist/lifecycle/transactions.js +62 -27
- package/dist/lifecycle/transactions.js.map +1 -1
- package/dist/lifecycle/types.d.ts +55 -122
- package/dist/lifecycle/types.d.ts.map +1 -1
- package/dist/lifecycle/types.js +3 -3
- package/dist/lifecycle/types.js.map +1 -1
- package/dist/lifecycle/ufg.d.ts +1 -1
- package/dist/lifecycle/ufg.d.ts.map +1 -1
- package/dist/lifecycle/ufg.js +4 -8
- package/dist/lifecycle/ufg.js.map +1 -1
- package/docs/launch-lifecycle.md +110 -78
- package/docs/lifecycle-gas-profiles.md +90 -0
- package/docs/reference.md +99 -47
- package/examples/.env.example +0 -3
- package/examples/README.md +14 -11
- package/examples/launch-example-support.ts +4 -9
- package/examples/launch-example.ts +30 -36
- package/examples/launch-lifecycle-smoke.ts +11 -21
- package/examples/launch.ts +8 -11
- package/package.json +1 -1
- package/src/lifecycle/authors.ts +2 -2
- package/src/lifecycle/auto-compound.ts +38 -0
- package/src/lifecycle/calibration.ts +3 -23
- package/src/lifecycle/deployments/auto-compound-dynamic-pool-v1-20261028.ts +77 -0
- package/src/lifecycle/deployments/auto-compound-static-pool-v1-20261028.ts +77 -0
- package/src/lifecycle/gas-profile.ts +186 -0
- package/src/lifecycle/index.ts +6 -4
- package/src/lifecycle/markets.ts +25 -3
- package/src/lifecycle/opening-buys.ts +157 -0
- package/src/lifecycle/planner.ts +168 -247
- package/src/lifecycle/presets.ts +15 -1
- package/src/lifecycle/progress.ts +19 -20
- package/src/lifecycle/rpc.ts +58 -68
- package/src/lifecycle/snapshot.ts +2 -4
- package/src/lifecycle/transactions.ts +69 -27
- package/src/lifecycle/types.ts +60 -99
- package/src/lifecycle/ufg.ts +4 -8
- package/dist/lifecycle/fork.d.ts +0 -15
- package/dist/lifecycle/fork.d.ts.map +0 -1
- package/dist/lifecycle/fork.js +0 -36
- package/dist/lifecycle/fork.js.map +0 -1
- package/dist/lifecycle/simulation.d.ts +0 -18
- package/dist/lifecycle/simulation.d.ts.map +0 -1
- package/dist/lifecycle/simulation.js +0 -754
- package/dist/lifecycle/simulation.js.map +0 -1
- package/src/lifecycle/fork.ts +0 -36
- package/src/lifecycle/simulation.ts +0 -689
package/dist/lifecycle/ufg.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { decodeFunctionResult, encodeFunctionData, keccak256, stringToHex, zeroAddress } from "viem";
|
|
2
2
|
import { lifecycleErc20Abi } from "./abi.js";
|
|
3
3
|
import { ufgLaunchProxyV1Abi, ufgTreasuryFactoryV1Abi } from "./ufg-abi.js";
|
|
4
|
-
import {
|
|
4
|
+
import { buildLifecycleCommands } from "./transactions.js";
|
|
5
5
|
import { decodeAbyssLifecycleMarketConfig, encodeAbyssLifecycleMarketConfig, decodePoolBoundV4LifecycleMarketConfig } from "./markets.js";
|
|
6
6
|
import { getKnownLifecycleProfile, KnownLifecycleProfile } from "./presets.js";
|
|
7
|
-
import { LifecycleFundingKind, LifecycleTokenKind, LifecycleRewardMode
|
|
7
|
+
import { LifecycleFundingKind, LifecycleTokenKind, LifecycleRewardMode } from "./schema.js";
|
|
8
8
|
import { LifecyclePlanningError } from "./types.js";
|
|
9
9
|
import { buildUfgFeeAssetPolicies, encodeUfgLaunchConfig, hashUfgLaunchConfig, isUfgProfile, UFG_DYNAMIC_ADAPTER_ID, UFG_FIXED_ADAPTER_ID, UFG_FIXED_PROFILE_ID, UFG_LAUNCH_PROXY_ADDRESS, UFG_TREASURY_FACTORY_ADDRESS, ufgPlanPrincipal } from "./ufg-config.js";
|
|
10
10
|
export { UFG_LAUNCH_PROXY_ADDRESS, UFG_TREASURY_FACTORY_ADDRESS, UFG_UPSTREAM_FACTORY_ADDRESS, UFG_ORCHESTRATOR_ADDRESS, UFG_FIXED_PROFILE_ID, UFG_DYNAMIC_PROFILE_ID, UFG_FIXED_ADAPTER_ID, UFG_DYNAMIC_ADAPTER_ID, isUfgProfile, ufgLaunchConfigComponents, encodeUfgLaunchConfig, decodeUfgLaunchConfig, hashUfgLaunchConfig, validateUfgLaunchConfig, ufgLaunchNonce, buildUfgFeeAssetPolicies } from "./ufg-config.js";
|
|
11
|
-
/** Offline proxy-specific
|
|
11
|
+
/** Offline proxy-specific intent checks. Registry, transfers and reserve behavior are enforced on-chain. */
|
|
12
12
|
export function validateUfgLaunchPlan(plan, config, predictedToken) {
|
|
13
13
|
try {
|
|
14
14
|
ufgPlanPrincipal(plan);
|
|
@@ -56,11 +56,7 @@ export function buildUfgLaunchTransactions(options) {
|
|
|
56
56
|
const { plan, config } = options;
|
|
57
57
|
const principal = ufgPlanPrincipal(plan);
|
|
58
58
|
encodeUfgLaunchConfig(config);
|
|
59
|
-
return
|
|
60
|
-
const data = transaction.kind === "atomic" ? encodeFunctionData({ abi: ufgLaunchProxyV1Abi, functionName: "launchAtomic", args: [plan, config] })
|
|
61
|
-
: transaction.kind === "begin" ? encodeFunctionData({ abi: ufgLaunchProxyV1Abi, functionName: "beginLaunch", args: [plan, LifecycleMode.Staged, config] }) : transaction.data;
|
|
62
|
-
return { ...transaction, from: principal, to: UFG_LAUNCH_PROXY_ADDRESS, data, calldataBytes: (data.length - 2) / 2 };
|
|
63
|
-
});
|
|
59
|
+
return buildLifecycleCommands(options, { account: principal, config });
|
|
64
60
|
}
|
|
65
61
|
export function buildUfgCancelTransaction({ plan, preparedMarkets = 0 }) {
|
|
66
62
|
const data = encodeFunctionData({ abi: ufgLaunchProxyV1Abi, functionName: "cancelLaunch", args: [plan] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ufg.js","sourceRoot":"","sources":["../../src/lifecycle/ufg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAgB,MAAM,MAAM,CAAC;AACnH,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5E,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ufg.js","sourceRoot":"","sources":["../../src/lifecycle/ufg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAgB,MAAM,MAAM,CAAC;AACnH,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,gCAAgC,EAAE,gCAAgC,EAAE,sCAAsC,EAAE,MAAM,cAAc,CAAC;AAC1I,OAAO,EAAE,wBAAwB,EAAE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E,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACxI,CAAC;AACD,yGAAyG;AACzG,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,MAA0B,EAAE,KAAc;IAC9E,MAAM,IAAI,GAAG,kBAAkB,CAAC,EAAE,GAAG,EAAE,uBAAuB,EAAE,YAAY,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC7G,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,4BAA4B,EAAE,IAAI,EAAE,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC5H,MAAM,QAAQ,GAAG,oBAAoB,CAAC,EAAE,GAAG,EAAE,uBAAuB,EAAE,YAAY,EAAE,YAAY,EAAE,IAAI,EAAE,MAAuB,EAAE,CAAC,CAAC;IACnI,OAAO,QAAQ,KAAK,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;AACzD,CAAC"}
|
package/docs/launch-lifecycle.md
CHANGED
|
@@ -18,6 +18,7 @@ staking, or dividends. A pool profile selects the admitted venue/hook implementa
|
|
|
18
18
|
| Dynamic V4 | `V4DynamicFeePool` | Oracle-velocity fee between minimum and maximum; LP and developer fees 0. |
|
|
19
19
|
| HMM V2 | `V4HmmFixedPool`, `V4HmmDynamicPool` | Auxiliary fee-funded bids/asks; LP and developer fees 0; explicit risk guards. |
|
|
20
20
|
| UFG | Abyss QUOTE/QUOTE_ORACLE or `V4UfgFixedPool`, `V4UfgDynamicPool` | Treasury route; ERC20 without rewards; quote-only fees, executor bounty 0. |
|
|
21
|
+
| Auto-compounding | `V4AutoCompoundStaticPool`, `V4AutoCompoundDynamicPool` | Net hook fees fund permanently locked full-range liquidity; both fee modes; LP and developer fees 0. |
|
|
21
22
|
|
|
22
23
|
SDK presets are the source of supported profiles and deployment wiring. Profiles
|
|
23
24
|
registered after this release appear with a subsequent SDK update.
|
|
@@ -188,15 +189,15 @@ examples; it does not predict the impact of a $100 or $1,000 buy.
|
|
|
188
189
|
A larger buy traverses ranges and can acquire a large share of supply.
|
|
189
190
|
|
|
190
191
|
`prepareAndPlanLifecycleLaunch({ buySlippageBps: 50 })` derives every ordered buy's
|
|
191
|
-
minimum from
|
|
192
|
+
minimum from the covered exact local curve model or native diagnostic output:
|
|
192
193
|
|
|
193
194
|
```text
|
|
194
|
-
minTokenOut = floor(
|
|
195
|
-
50 bps: floor(
|
|
195
|
+
minTokenOut = floor(tokenOut × (10000 - buySlippageBps) / 10000)
|
|
196
|
+
50 bps: floor(tokenOut × 9950 / 10000)
|
|
196
197
|
```
|
|
197
198
|
|
|
198
|
-
|
|
199
|
-
bps and applies only before begin;
|
|
199
|
+
Native calibration requires activation in the complete executed sequence. The
|
|
200
|
+
option accepts 0–9,999 bps and applies only before begin; omission preserves minima.
|
|
200
201
|
A 1-wei minimum is effectively unprotected. Never submit the diagnostic draft.
|
|
201
202
|
A Kyber conversion minimum protects ETH→quote output, not quote→launch-token output.
|
|
202
203
|
|
|
@@ -204,7 +205,7 @@ A Kyber conversion minimum protects ETH→quote output, not quote→launch-token
|
|
|
204
205
|
Its `slippageBps` accepts 1–9,999 (default 50). It may stop a buy early; check partial
|
|
205
206
|
fills and refunds. It does not calculate minimum token output.
|
|
206
207
|
`estimateLaunchInitialBuy` is a pure single-position estimate, not a model of
|
|
207
|
-
multi-band traversal, prior buys, or hook execution. Use
|
|
208
|
+
multi-band traversal, prior buys, or hook execution. Use the ordered model or native calibration.
|
|
208
209
|
Final valuation uses the retained supply after burn and the observed post-buy price.
|
|
209
210
|
|
|
210
211
|
## Build the plan
|
|
@@ -319,80 +320,78 @@ saved deadline or replace committed conversion bytes after begin.
|
|
|
319
320
|
|
|
320
321
|
Staging is not rollback. A begun plan remains begun after its deadline until cancelled.
|
|
321
322
|
Activation cannot be split into separate position mints or buys.
|
|
322
|
-
|
|
323
|
+
An atomic request is a preference: conservative capacity bounds or an actual atomic capacity failure may select staged. Explicit staged stays staged. No markets or buys are removed. Review and persist returned `planned.mode`.
|
|
323
324
|
|
|
324
325
|
| Operation | Options type / purpose |
|
|
325
326
|
| --- | --- |
|
|
326
|
-
| `prepareAndPlanLifecycleLaunch` | `PrepareAndPlanLifecycleLaunchOptions`: `client`, `account`, `plan`, `mode`; optional `ufg: { config }`, `buySlippageBps`, `
|
|
327
|
+
| `prepareAndPlanLifecycleLaunch` | `PrepareAndPlanLifecycleLaunchOptions`: `client`, `account`, `plan`, `mode`; optional `ufg: { config }`, `buySlippageBps`, `limits`, `fork`, `receipts`, `confirmations`, `signal`, `onProgress`, topology opt-outs. |
|
|
327
328
|
| `planLaunch` | `PlanLaunchOptions`: same execution context, including optional `ufg: { config }` and `signal`; re-admits an already-finalized plan without changing salts/minima. |
|
|
328
329
|
| `simulateLaunchPlan` | `client`, `planned`; optional `limits`, `fork`, `receipts`, `confirmations`, `signal`. |
|
|
329
330
|
| `readLaunchProgress` | `client`, `planned`; optional `receipts`, `confirmations`, `signal`. |
|
|
330
|
-
| `buildNextTransaction` | Progress options, plus optional `action`, `limits`, `fork`, `
|
|
331
|
+
| `buildNextTransaction` | Progress options, plus optional `action`, `limits`, `fork`, `reviewedTransaction`. |
|
|
331
332
|
|
|
332
333
|
`buildLaunchTransactions` compiles unsigned commands; it does not prove execution.
|
|
333
|
-
Persist `serializeLaunchPlan(planned.plan)`, mode
|
|
334
|
-
references, and UFG config if applicable. `parseLaunchPlan` restores bigint values.
|
|
334
|
+
Persist `serializeLaunchPlan(planned.plan)`, returned `planned.mode`, confirmation policy,
|
|
335
|
+
receipt references, and UFG config if applicable. `parseLaunchPlan` restores bigint values.
|
|
335
336
|
Do not serialize the entire `PlannedLaunch`, which can contain live limit callbacks.
|
|
336
337
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
No semantic, HTTP or cancellation failure retries, and the final exact validated
|
|
355
|
-
pass never retries or changes its returned gas.
|
|
338
|
+
Every launch step uses the native total transaction ceiling:32M on4663, including
|
|
339
|
+
poster gas. Approvals omit gas/fees for wallet preparation. Covered Robinhood
|
|
340
|
+
ArbOS61 templates use capacity bounds and exact local ordered-buy math, never
|
|
341
|
+
component-sized gas limits. Their evidence is `profiled` / `not-run`, not a receipt.
|
|
342
|
+
Conversion-carrying begin/atomic and consuming activation require exact native
|
|
343
|
+
execution. Unknown coverage or uncertain activation gets full-sequence execution
|
|
344
|
+
before begin. Explicit `simulateLaunchPlan` always executes; a generic fork is not Nitro proof.
|
|
345
|
+
|
|
346
|
+
Review checks the complete sequence, not just a successful prefix. There is no
|
|
347
|
+
SDK-invented 50M aggregate cap. A caller `maxSimulationGas` still tightens policy;
|
|
348
|
+
incomplete execution proof refuses admission. A refused full review cannot begin
|
|
349
|
+
a new launch. Only the immediate command receives final gas/price/estimate/admission.
|
|
350
|
+
Suffix metrics remain provisional; build-next admits only the canonical next command
|
|
351
|
+
at its fresh native-ceiling budget, never reusing a provisional estimate.
|
|
352
|
+
|
|
353
|
+
See [capacity, native/fork evidence and migration](lifecycle-gas-profiles.md)
|
|
354
|
+
for exact proof fields, upfront affordability and the public capacity-bound helper.
|
|
356
355
|
|
|
357
356
|
Review the returned final plan/hash, aligned price, burn, retained supply, fees,
|
|
358
357
|
ordered buy outputs/minima, funding, refunds, and complete gas envelope. A fresh
|
|
359
|
-
`buildNextTransaction`
|
|
360
|
-
|
|
358
|
+
`buildNextTransaction` admits the immediate next step as canonical progress advances.
|
|
359
|
+
The wallet owns sending-RPC preparation; `submissionClient` has been removed.
|
|
361
360
|
|
|
362
|
-
`planned.transactions[0]`
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
361
|
+
`planned.transactions[0]` contains exact immediate `from/to/data/value` and, for
|
|
362
|
+
launch commands, native-ceiling `gas` and current `gasPrice`. Approvals omit both.
|
|
363
|
+
There is no fixed wallet nonce; the wallet assigns it. The plan identity nonce is unchanged.
|
|
364
|
+
The envelope is reusable, but its block-bound admission is historical, not permission
|
|
366
365
|
to sign later. Pass it as `reviewedTransaction` for fresh immediate admission after
|
|
367
|
-
review or recovery. This is
|
|
366
|
+
review or recovery. This is not a second user review gate.
|
|
368
367
|
Reuse `planned.progress` for the same result's display instead of reading progress
|
|
369
368
|
independently beside the plan.
|
|
370
369
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
enlarges it or switches mode.
|
|
370
|
+
`fixedFinalEnvelope` and `LifecycleFinalEnvelope` are removed. A reviewed launch gas
|
|
371
|
+
that differs from the native ceiling refuses with `STALE_REVIEWED_GAS`; re-review,
|
|
372
|
+
never silently rewrite it. A lower caller complete-envelope cap refuses rather than
|
|
373
|
+
shrinking gas. Held prices below the pinned fee floor also refuse without bumping.
|
|
374
|
+
On Nitro the floor is max(ArbGasInfo L2 price, header base fee); twice base fee is
|
|
375
|
+
fresh recommendation headroom only. Reserve value plus ceiling×price, without
|
|
376
|
+
adding poster fees again. Actual activation capacity refusal asks the user to
|
|
377
|
+
reduce positions/pools; a large conservative bound alone is not such a refusal.
|
|
380
378
|
|
|
381
379
|
On chain4663, one RPC L2 header pins the invocation. Token prediction, native/token
|
|
382
|
-
balances, allowances, launch progress
|
|
380
|
+
balances, allowances, launch progress, Nitro getters and prices share one Multicall3 call
|
|
383
381
|
at that explicit L2 block. Further independent stages use one aggregate, even for
|
|
384
382
|
one or two reads. Multicall3's block-number/hash getters expose L1 values on Nitro
|
|
385
383
|
and must not select the L2 pin.
|
|
386
384
|
The same pin survives salt mining and buy calibration; there are no final chain or
|
|
387
385
|
canonical-header guard reads. Receipt confirmation/reorg checks remain.
|
|
388
386
|
|
|
389
|
-
|
|
390
|
-
replay. Poster allocation
|
|
391
|
-
|
|
392
|
-
|
|
387
|
+
Required native execution validates the exact calldata once; there is no later
|
|
388
|
+
exact-gas replay. Poster allocation comes from the same-review price tuple and a
|
|
389
|
+
local size bound, not a per-transaction oracle. Build-next encodes only its canonical
|
|
390
|
+
next command, preserving normal/UFG calldata and original/clipped batch spans.
|
|
393
391
|
|
|
394
392
|
Multicall3 runtime, Nitro backend capability and account-code observations are
|
|
395
|
-
retained for the caller's session.
|
|
393
|
+
retained for the caller's session. Chain identity is observed once per bound client;
|
|
394
|
+
recreate the client on chain changes. Financial state and required proof stay fresh.
|
|
396
395
|
The 4663 preset uses the deployed `hookSaltMiner`; returned salts are verified
|
|
397
396
|
locally. Its deployed `launchLens` supplies dependent progress, market, balance
|
|
398
397
|
and hook-mining reads in the same initial aggregate. Callers need no lens
|
|
@@ -401,15 +400,14 @@ configuration. See [read caching](reference.md#cache-static-reads-and-inspect-ti
|
|
|
401
400
|
## Sign and confirm
|
|
402
401
|
|
|
403
402
|
Call `buildNextTransaction` before **every signature**, including approvals and
|
|
404
|
-
cancellation.
|
|
405
|
-
|
|
406
|
-
`from/to/data/value/nonce/gas/gasPrice` with a matching explicit viem chain.
|
|
403
|
+
cancellation. Pass `reviewedTransaction` to hold the same gas/fee and intent, not a
|
|
404
|
+
wallet nonce. Send the exact returned `from/to/data/value/gas/gasPrice`.
|
|
407
405
|
`confirmations` defaults to 1; choose and retain your policy before begin.
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
406
|
+
The wallet owns its queue, nonce assignment and sending-RPC preparation. Unrelated
|
|
407
|
+
pending transactions are not an SDK confirmation-safety refusal. Retain the actual
|
|
408
|
+
submitted nonce and let the wallet advance locally; unknown reload recovery may
|
|
409
|
+
need one host-owned queue read, never a per-plan nonce gate. Check the active wallet
|
|
410
|
+
account/provider chain after asynchronous work, and never automatically replay a write.
|
|
413
411
|
The following local-account loop signs only when explicitly called by your application.
|
|
414
412
|
Use a new owner-only journal path inside a private directory; on reload, restore the
|
|
415
413
|
original plan and receipt references before calling it. Journal records contain secrets.
|
|
@@ -437,7 +435,7 @@ export async function executeLaunch(
|
|
|
437
435
|
confirmations: planned.confirmations, ufg: planned.ufg, receipts });
|
|
438
436
|
for (;;) {
|
|
439
437
|
const next = await buildNextTransaction({
|
|
440
|
-
client, planned, receipts,
|
|
438
|
+
client, planned, receipts,
|
|
441
439
|
});
|
|
442
440
|
if (!next) {
|
|
443
441
|
const progress = await readLaunchProgress({ client, planned, receipts });
|
|
@@ -448,29 +446,21 @@ export async function executeLaunch(
|
|
|
448
446
|
}
|
|
449
447
|
return { progress, activationHash };
|
|
450
448
|
}
|
|
451
|
-
|
|
449
|
+
const approval = next.kind === "approve" || next.kind === "approve-reset";
|
|
450
|
+
if (!next.admission?.admitted || !approval && (next.gas === undefined || next.gasPrice === undefined)) {
|
|
452
451
|
throw new Error("Immediate transaction is not admitted");
|
|
453
452
|
}
|
|
454
|
-
const
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
const dataFee = next.estimate?.dataFee;
|
|
459
|
-
if (next.nonce === undefined || BigInt(nonce) !== next.nonce || dataFee === undefined
|
|
460
|
-
|| pendingBalance < next.value + next.gas * next.gasPrice + dataFee) {
|
|
461
|
-
throw new Error("Pending nonce or complete affordability changed; revalidate");
|
|
462
|
-
}
|
|
453
|
+
const request = await wallet.prepareTransactionRequest({
|
|
454
|
+
chain: wallet.chain, account: wallet.account,
|
|
455
|
+
to: next.to, data: next.data, value: next.value, gas: next.gas, gasPrice: next.gasPrice,
|
|
456
|
+
});
|
|
463
457
|
const [address] = await wallet.getAddresses();
|
|
464
458
|
if (wallet.chain.id !== next.chainId || await wallet.getChainId() !== next.chainId
|
|
465
|
-
|| await client.getChainId() !== next.chainId
|
|
466
459
|
|| address?.toLowerCase() !== next.from.toLowerCase()
|
|
467
460
|
|| wallet.account.address.toLowerCase() !== planned.account.toLowerCase()) {
|
|
468
461
|
throw new Error("Wallet account or chain changed");
|
|
469
462
|
}
|
|
470
|
-
const raw = await wallet.signTransaction(
|
|
471
|
-
chain: wallet.chain, account: wallet.account, nonce,
|
|
472
|
-
to: next.to, data: next.data, value: next.value, gas: next.gas, gasPrice: next.gasPrice,
|
|
473
|
-
});
|
|
463
|
+
const raw = await wallet.signTransaction(request);
|
|
474
464
|
const hash = keccak256(raw);
|
|
475
465
|
await record({ transactionId: next.id, kind: next.kind, hash, raw });
|
|
476
466
|
const sent = await client.sendRawTransaction({ serializedTransaction: raw });
|
|
@@ -483,7 +473,7 @@ export async function executeLaunch(
|
|
|
483
473
|
throw new Error("Reverted or replaced transaction; reconcile before continuing");
|
|
484
474
|
}
|
|
485
475
|
receipts.push({ transactionHash: hash, confirmations: planned.confirmations,
|
|
486
|
-
observedBlockNumber: receipt.blockNumber, observedBlockHash: receipt.blockHash });
|
|
476
|
+
nonce: BigInt(request.nonce), observedBlockNumber: receipt.blockNumber, observedBlockHash: receipt.blockHash });
|
|
487
477
|
if (next.kind === "atomic" || next.kind === "activate") activationHash = hash;
|
|
488
478
|
await record({ receipts, activationHash });
|
|
489
479
|
}
|
|
@@ -494,7 +484,7 @@ A send timeout is ambiguous: the hash may already be mined. Stop, query the save
|
|
|
494
484
|
hash, and reconcile pending nonce/receipt state; do not automatically resend.
|
|
495
485
|
For an interactive review delay, pass the previously displayed command as
|
|
496
486
|
`reviewedTransaction` to a fresh `buildNextTransaction` before signing.
|
|
497
|
-
That
|
|
487
|
+
That revalidates the same immediate intent at its held gas/fee; the wallet owns its nonce.
|
|
498
488
|
|
|
499
489
|
Completion has **four checks**: receipt confirmed → markets active → metadata
|
|
500
490
|
published → API indexed. A successful transaction alone does not establish the last two.
|
|
@@ -665,6 +655,48 @@ exit fee; this is not a guaranteed USD floor. Accrued pool fees are not collecte
|
|
|
665
655
|
backing. Inspect collection failure events as well as receipt success; a fork check
|
|
666
656
|
needed at least 750k gas for `collect()`, not a universal mainnet gas limit.
|
|
667
657
|
|
|
658
|
+
## Configure auto-compounding
|
|
659
|
+
|
|
660
|
+
Select `V4AutoCompoundStaticPool` for a fixed hook fee or
|
|
661
|
+
`V4AutoCompoundDynamicPool` for the existing minimum/maximum/sensitivity schedule.
|
|
662
|
+
Both use pool-bound config6, LP fee **0**, developer fee **0**, and either
|
|
663
|
+
`feeMode: 0` (InputToken) or `feeMode: 1` (QuoteOnly).
|
|
664
|
+
|
|
665
|
+
```ts
|
|
666
|
+
import {
|
|
667
|
+
getAddresses, getKnownLifecycleProfile, KnownLifecycleProfile,
|
|
668
|
+
encodeAutoCompoundTail, type AutoCompoundConfigV1,
|
|
669
|
+
} from "@black-market/sdk";
|
|
670
|
+
|
|
671
|
+
const preset = getKnownLifecycleProfile({
|
|
672
|
+
chainId: 4663, orchestrator: getAddresses(4663).launchOrchestrator,
|
|
673
|
+
key: KnownLifecycleProfile.V4AutoCompoundStaticPool,
|
|
674
|
+
})!;
|
|
675
|
+
const autoCompoundConfig: AutoCompoundConfigV1 = { compoundShareBps: 5000 };
|
|
676
|
+
console.log(preset.profile.id, encodeAutoCompoundTail(autoCompoundConfig));
|
|
677
|
+
```
|
|
678
|
+
|
|
679
|
+
The 50% share is illustrative, not a recommended allocation. Put
|
|
680
|
+
`autoCompoundConfig` in `V4PoolBoundLifecycleMarketConfigV6`; the market encoder
|
|
681
|
+
appends the canonical **64-byte** version/share tail automatically. Shares may be
|
|
682
|
+
0–10,000 bps. Missing tails, wrong versions, extra bytes, nonzero LP/developer fees,
|
|
683
|
+
or invalid shares fail locally before funding. Copy the selected preset's exact
|
|
684
|
+
profile ID, terms, beneficiary, treasury, denominator and deployment graph.
|
|
685
|
+
|
|
686
|
+
Use the ordinary `prepareAndPlanLifecycleLaunch` flow to mine and admit the full
|
|
687
|
+
market config. The compound share is part of the hook's constructor commitment:
|
|
688
|
+
changing it requires a newly mined salt and reviewed plan. The retired profiles
|
|
689
|
+
are not selectable. [Pinned identities and codecs](reference.md#auto-compounding-profiles)
|
|
690
|
+
include the recorded readback and read-only verification command.
|
|
691
|
+
|
|
692
|
+
The hook owns its new full-range liquidity permanently; the non-compounding
|
|
693
|
+
remainder follows the launch's normal fee-asset policies. It burns the allocated
|
|
694
|
+
launch-token fees and uses quote fees to buy and compound. Every post-opening swap
|
|
695
|
+
performs compounding in `afterSwap`; insufficient gas reverts with
|
|
696
|
+
`CompoundOutOfGas()` rather than silently skipping work. Do not cap swap gas below
|
|
697
|
+
`eth_estimateGas`. Launch transactions retain the SDK's native ceiling; these new
|
|
698
|
+
templates require exact execution admission, not uncalibrated fixed-hook capacity bounds.
|
|
699
|
+
|
|
668
700
|
<a id="0100-release-hmm-v2-only"></a>
|
|
669
701
|
## Configure HMM V2
|
|
670
702
|
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Lifecycle gas, capacity, execution evidence and RPC budgets
|
|
2
|
+
|
|
3
|
+
Version 0.15.0 separates the native transaction ceiling, conservative capacity bounds, exact curve quotes and actual execution proof. A local quote or submitted hash is not an execution receipt.
|
|
4
|
+
|
|
5
|
+
## One native ceiling, not component-sized gas
|
|
6
|
+
|
|
7
|
+
Every launch command (begin, prepare, activate, atomic and cancel) uses the chain's native total transaction ceiling. On Robinhood4663 this is `ROBINHOOD_NATIVE_TRANSACTION_GAS_LIMIT = 32_000_000n`, also exposed as `getKnownLifecycleDeployment({ chainId, orchestrator }).nativeTransactionGasLimit`. The32M includes poster gas. Other chains retain their resolved generic ceiling.
|
|
8
|
+
|
|
9
|
+
Unused gas is refunded. The payer must still reserve `value + gasLimit * gasPrice` upfront. The SDK never shrinks the ceiling to accommodate a tight balance, adds poster gas to32M, or retries with a smaller envelope. Approvals/reset approvals are not launch steps: their returned `gas`, `gasPrice` and estimates are omitted for wallet preparation.
|
|
10
|
+
|
|
11
|
+
A reviewed launch gas differing from the ceiling is stale and refuses with `STALE_REVIEWED_GAS`; re-review rather than silently rewriting it. A caller complete-envelope cap below the ceiling refuses too. `fixedFinalEnvelope`, `LifecycleFinalEnvelope`, stored compute-sizing hints and unvalidated gas-sizing retries are removed.
|
|
12
|
+
|
|
13
|
+
## Capacity selects the mode, not the gas limit
|
|
14
|
+
|
|
15
|
+
`computeLifecycleLaunchGasBounds({ plan, predictedToken, ufg?, headroomBps? })` returns conservative `atomicComputeGasUpperBound` and `activationComputeGasUpperBound`, excluding poster gas, or undefined for unknown coverage. The versioned model accounts for token/reward creation, actual UFG proxy/treasury route, market/position work, ordered buys, NFT minting and HMM forwarding overhead. UFG route overhead is independent of market profile names.
|
|
16
|
+
|
|
17
|
+
An atomic request is a preference. A conservative atomic bound plus poster allocation above the ceiling selects staged; explicit staged remains staged. An actual atomic capacity failure can also select staged with fresh full-sequence admission. Review and persist returned `planned.mode`, not the requested mode. No positions, markets or buys are dropped.
|
|
18
|
+
|
|
19
|
+
A large conservative activation upper bound is uncertainty, not proof of overflow. Uncertain activation receives exact full-sequence execution before begin. An actual activation capacity failure returns `capacityConstraint: "activation"` and asks the user to reduce positions/pools; staging cannot split activation. For example, an independently observed24-position activation fit32M despite a larger conservative upper bound, while a32-position deep Abyss activation needed a47.48M minimum successful envelope. Neither observation licenses a universal count-only hard cap.
|
|
20
|
+
|
|
21
|
+
## Which admission path runs
|
|
22
|
+
|
|
23
|
+
| Command | Covered direct plan with proven-fit activation | Plan containing an aggregator conversion |
|
|
24
|
+
| --- | --- | --- |
|
|
25
|
+
| Approval/reset | Wallet prepares gas/fees | Wallet prepares gas/fees |
|
|
26
|
+
| Begin | Conditional template admission | Exact native execution of the conversion |
|
|
27
|
+
| Prepare markets/hooks | Conditional template admission | Conditional admission when isolated after begin |
|
|
28
|
+
| Activate and opening buys | Conditional admission and exact local curve math | Exact native execution consuming conversion funding |
|
|
29
|
+
| Atomic launch | Conditional admission and exact local curve math | Exact native execution of the complete transaction |
|
|
30
|
+
| Cancel | Conditional admission | Conditional admission when isolated |
|
|
31
|
+
|
|
32
|
+
A conversion review proves the complete staged sequence through activation in one validated `eth_simulateV1` call, with every launch call at32M. Unknown template/currency coverage, another chain/ArbOS epoch or uncertain activation also uses real execution. A refused full review cannot authorize a new begin from a successful prefix; already-started recovery and cancellation remain available. Explicit `simulateLaunchPlan` always requests execution. A generic EVM fork is not Nitro protocol proof.
|
|
33
|
+
|
|
34
|
+
Unknown curve behavior retains a separate provisional, unvalidated buy-output diagnostic at the same ceiling before protecting minima. It is not gas sizing, final admission or a retry. The final protected commitment still requires its exact execution. There is no SDK-invented50M aggregate window; explicit `maxSimulationGas` policies remain enforced against complete observed work without prefix admission.
|
|
35
|
+
|
|
36
|
+
### Honest result fields
|
|
37
|
+
|
|
38
|
+
- Conditional admission: `backend/confidence: "profiled"`, `executionProof: "not-run"`, `protocolFit: "profiled"`. `gasProfile` carries `version`, capacity `bounds` and local `initialBuys`, not per-step estimates or fabricated receipts.
|
|
39
|
+
- The immediate fixed-ceiling budget is `simulation.estimate`, with `feeConfidence: "native-ceiling-and-data"` and no invented `gasUsed`. Approval budgets are absent.
|
|
40
|
+
- Successful exact native execution reports `backend: "eth_simulateV1"`, `executionProof: "proved"`, `protocolFit: "proved"` after required postconditions.
|
|
41
|
+
- Only an immediate launch command receives final gas/price/estimate/admission. Exact suffix steps remain `provisional: true` with no executable estimate. Build-next constructs only the canonical next command at a fresh pin; it never treats a suffix observation as an estimate.
|
|
42
|
+
|
|
43
|
+
## Retained empirical evidence
|
|
44
|
+
|
|
45
|
+
`robinhood-4663-arbos61-v1` covers shipped Abyss configuration-v1 and the calibrated fixed/dynamic V4 configuration-v6 templates, including HMM/UFG, on ArbOS61 with an EOA payer and known release quote implementations. Auto-compounding presets are not covered by these capacity bounds and require exact execution. This is capacity coverage, not a currency admission allowlist. Unknown currencies remain supported through exact execution; smart-account proof is not claimed.
|
|
46
|
+
|
|
47
|
+
Research retained176 lifecycle receipts, including75 successful current-template atomic/activation observations with opening buys. Isolated forks extend depth, buys and combinations; failed CREATE2 cases were not counted as successful coverage. One Abyss and one fixed-V4 historical native/fork calibration matched compute exactly (19,272,603 and18,130,251 gas), while minimum successful envelopes were higher (20,527,230 and19,356,279). These two calibrations do not establish general Anvil/Nitro equivalence. Compute and poster components remain separate. Profiles are empirical capacity bounds, never transaction gas sizing or proof about arbitrary upgrades/future ArbOS rules.
|
|
48
|
+
|
|
49
|
+
## Exact ordered opening-buy math
|
|
50
|
+
|
|
51
|
+
`computeLifecycleOpeningBuys({ plan, predictedToken })` follows all liquidity bands, prior buys, initialized zero-net ticks, bitmap boundaries, both currency directions, LP/opening-hook fees, partial fills and integer output floors. HMM opening work occurs after initial buys. V4's zero price-limit sentinel resolves locally to the contract-defined directional limit without changing calldata; Abyss still rejects zero.
|
|
52
|
+
|
|
53
|
+
Covered `buySlippageBps` protection uses `floor(tokenOut * (10000 - bps) / 10000)`. A zero floor rejects, never becomes1. Independent parity matched token output, quote spent and final square-root price across97 native/fork cases, including both directions, overlapping bands and gaps. Portable historical vectors and focused rounding/sentinel cases live under `test/fixtures/lifecycle-opening-buys.json` and `test/lifecycle-opening-buys.test.mjs`. These conditional curve quotes do not prove conversion, funding or wallet submission.
|
|
54
|
+
|
|
55
|
+
## One same-review Nitro price observation
|
|
56
|
+
|
|
57
|
+
The initial L2-pinned aggregate includes `ArbGasInfo.getPricesInWei`. There are no per-transaction `NodeInterface.gasEstimateL1Component` calls or separate4663 `eth_gasPrice` calls. Tuple element1 supplies L1 per-byte price; element5 supplies L2 price. Fresh gas price is max(L2 price, twice header base fee). A held price must meet max(L2 price, header base fee), but is not bumped to the fresh recommendation.
|
|
58
|
+
|
|
59
|
+
For empty-access-list EOA legacy calldata of `D` bytes:
|
|
60
|
+
|
|
61
|
+
```text
|
|
62
|
+
N = D + 384
|
|
63
|
+
B = N + 8 * floor(N / 1024) + 64
|
|
64
|
+
posterFeeBound = B * l1PricePerByte
|
|
65
|
+
posterGas = 2 * ceil(posterFeeBound / l2GasPrice)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
The local serialization/Brotli bound and2x allocation are conservative, not an observation of the eventual compressed signature or a promise about future L1 prices. Poster stays inside32M. `dataFeeIncludedInGas` is true, `dataFee` is zero and `totalFee = gasLimit * gasPrice`; never add poster fee again.
|
|
69
|
+
|
|
70
|
+
## 0.15.0 caller migration
|
|
71
|
+
|
|
72
|
+
- Wallet nonce is absent from unsigned `LifecycleTransaction`; `LaunchPlanV1.nonce` remains its domain identity. Let the wallet assign send nonce. Learn actual nonce from wallet/transaction, retain optional exact `LifecycleReceiptReference.nonce`, and advance the wallet-owned queue locally. A supplied nonce mismatch refuses receipt attribution. Portable journals use decimal strings, not JSON numbers.
|
|
73
|
+
- Progress has no confirmed/head/pending account nonce gates. Unrelated pending transactions are queued by the wallet, not an SDK confirmation-safety refusal. Planning/build-next make no `eth_getTransactionCount`; unknown reload recovery may need one host-owned read.
|
|
74
|
+
- `BuildNextTransactionOptions.submissionClient` and proof `transportPreflight` are removed. Keep wallet account/provider-chain checks and never automatically replay an ambiguous write.
|
|
75
|
+
- Retain each bound client; chain identity is read at most once per client object. Recreate the client after wallet/chain changes. Cache invalidation does not repoint an existing client to another chain.
|
|
76
|
+
- Persist selected `planned.mode`. Handle approval envelopes without gas/fees, `STALE_REVIEWED_GAS`, actionable activation capacity refusal, optional `simulation.estimate` and capacity-only `gasProfile.bounds`. Remove `gasProfile.estimates` and `computeGasRequired` usage.
|
|
77
|
+
- Economic review schema v2 separates `local-exact-curve` from `simulated-execution`; consume `initialBuy.reviewedBuys`, not assumed receipt fields. `transactionGasEstimate` is removed; unsigned compilation and preparation packing remain available.
|
|
78
|
+
|
|
79
|
+
## Observed recording-transport budgets
|
|
80
|
+
|
|
81
|
+
The same historical, already-protected plans and explicit 200M aggregate policy use deterministic recording-transport block/state/execution responses, without requesting buy recalibration. This is RPC counting, not live admission. Both commitments remain unchanged. Counts exclude wallet preparation/send, polling and supplied receipt/transaction/canonicality reads, which vary with confirmation policy.
|
|
82
|
+
|
|
83
|
+
| Case | Version | Prepare/review | Each build-next | Prepare + first build | Prepare + all builds |
|
|
84
|
+
| --- | --- | ---: | ---: | ---: | ---: |
|
|
85
|
+
| Conversion historical plan (`0xf05…fe98fe98`, four builds) | 0.14.1 | 12 | 8 | 20 | 44 |
|
|
86
|
+
| Same conversion plan | 0.15.0 | 7 | 3 | 10 | 19 |
|
|
87
|
+
| Direct NativeWrap historical plan (`0x4cbc…85231`, three builds) | 0.14.1 | 12 | 8 | 20 | 36 |
|
|
88
|
+
| Same direct plan | 0.15.0 | 5 | 2 | 7 | 11 |
|
|
89
|
+
|
|
90
|
+
The conversion case retains six native simulation RPCs across review/builds because its historical currencies are outside capacity coverage: one session capability, one full review and four next-step proofs. The covered direct case drops six simulation RPCs to zero. Both cases have one total chain read and zero account-nonce, separate gas-price or per-transaction poster-oracle reads. Cold costs include session attestations/capability; warm counts are not cold totals. These are SDK-only figures, not whole-application telemetry.
|