Repository navigation
draft: final zero-seed launch reads, response contract v7 - #191
Open
moodysalem wants to merge 21 commits into
Open
moodysalem wants to merge 21 commits into
moodysalem wants to merge 21 commits into
Conversation
EKU-1523 preparation only; route/query integration follows. No handoff or release clearance. Co-Authored-By: Paperclip <noreply@paperclip.ing>
Use screened local manifests, repeatable-read snapshots and separate Core principal/creator ledgers; hosted support remains disabled. Verify actual handlers against emitted local indexer replay, reorg/repair/idempotency and concurrent snapshot consistency. Co-Authored-By: Paperclip <noreply@paperclip.ing>
Co-Authored-By: Paperclip <noreply@paperclip.ing>
The edge cache folds integer-like path segments, so a path parameter must mean the same thing in every hex or decimal spelling. Declare the launch chainId as an int64 integer and accept the pool id as any hex or decimal uint256, which keeps the launch routes inside the cache-key contract.
Format the launch sources, drop assertions the linter flags as unnecessary, pin the replay to the rebased indexer head, and insert the API replay cases whether the indexer harness closes its describe as `});` or across lines.
moodysalem
force-pushed
the
eku-827/launch-endpoints
branch
from
October 19, 2026 17:06
230afd4 to
661351c
Compare
moodysalem
marked this pull request as ready for review
October 19, 2026 17:19
The indexed launch now carries decay_factor, a literal Q0.64 per-second multiplier. fee_schedule.fee_rate follows the contract's normalized exponential: powQ64 square-and-multiply flooring after every Q64 multiply, final + floor((initial - final) * (b^t - b^D) / (2^64 - b^D)). The response gains fee_schedule.decay_factor, so the contract version becomes zero-seed-launch-api/v2. Re-pin the local instances and ABI to evm-contracts b1cbb1c and the indexer replay harness to its matching head. Tests reproduce the contract's fee rows, chord counterexamples and all-second digests at six rates, and the replay checks the served rate against the indexer's SQL fee_at.
Move the launch reads to the forward-only ZeroSeedLaunch and its periphery at evm-contracts 4f1a306, over indexer schema zero-seed-launch-index/v2. The response schema version is now zero-seed-launch-api/v3: - quote_token.kind distinguishes native ETH (address 0, token0, 18 decimals, no ERC-20 metadata) from an ERC-20 quote. - fee_schedule.decay_factor is replaced by the fixed-base Q128 table with a 600 s half-life; the TypeScript fee reproduces all 25,212 rows of the protocol's independent all-second vectors. - creator is the owner at creation, owner the current transferable fee holder, controller the periphery; only periphery-controlled launches of the pinned instances are served. - Claims are periphery payouts linked to the extension ledger event of the same transaction, counted once. A new owners endpoint lists transfers and the list accepts an owner filter. The replay runner pins the new indexer head and fixture and checks every handler against the chain state of each block, including a reorg across transfers; its golden output is committed as a machine-readable example.
…nch schema v4)
ZeroSeedLaunch at evm-contracts 40af6cb takes the quote per launch
(LaunchParameters.quoteToken) instead of a constructor quote, and installs
at most the requested supply, minting the remainder to address(0).
- LaunchSummary gains supply {requested, installed, sink, sink_holder},
validated (0 < installed <= requested, sink = requested - installed)
before serving; principal.installed_supply is removed.
- The instance manifest carries no quote. A launch is served only when its
own quote is native ETH or an ERC-20 in a reviewed list bound by chain,
address and runtime codehash; list SQL screens on it before pagination.
Hosted lists stay empty and hosted reads stay disabled.
- Queries read indexer schema zero-seed-launch-index/v3; ABI pins follow
40af6cb.
- The replay runner pins the updated indexer harness and fixture, and the
golden is regenerated from the actual handlers as v4.
Describe the requested/installed/sink supply, the removal of principal.installed_supply, the reviewed ERC-20 quote list and the replay pins and commands, and keep the launch tests lint-clean.
…r fees The protocol now accepts every uint64 creator fee rate (2^64 - 1, just under 100%, is the maximum) and drops FeeTooHigh() from the interface. The response shape is unchanged, so the contract stays zero-seed-launch-api/v4. - Re-pin the ZeroSeedLaunch ABI (sha256 efae9388...e41e) and the local replay instance (extension 0x511b...6d8b, periphery 0x2f0b...ef64 and their runtime hashes); the periphery ABI and the local quote are unchanged. - Fee fields (initial_fee, final_fee and both fee_rates) are validated as canonical decimal uint64 strings. An indexed swap fee rate above 2^64 - 1 was previously served as is; it now fails as 500 like an out-of-range schedule fee, never wrapped or truncated. OpenAPI documents the range. - Re-pin the emitted-state replay to indexer c78a48e (fixture sha256 09d77457...4fcc), which adds two launches created normally at the maximum rate: native 2^64 - 1 -> 0.3% over 3600 s and ERC-20 flat at 2^64 - 1. The replay checks that the served instance equals the fixture's, that both launches serve 2^64 - 1 exactly (schedule, phase, swap rates, exact-input net floor(gross / 2^64), exact-output paid calculated * 2^64, ledgers and claims) and that a stored fee of 2^64 fails as 500. - Regenerate the golden responses with both launches and test them, and unit-test the whole uint64 range and malformed fee encodings.
…llation evm-contracts 43d6628 installs the exact largest token0 liquidity the requested supply pays for; the shared helper it used before floored lower * upper / 2^128 first and installed less at low prices. The API serves the indexed liquidity and Core's position delta and never recomputes the installation, so the response contract stays v4. A sink of "0" is now possible when the requested supply is exactly installable. - Re-pin the local instance (extension, periphery and their runtimes) and the emitted-state replay to indexer 91a7036 (fixture sha256 ec308953...e7d9), which adds two ERC-20 token0 launches at low-price geometry: 1e30 over ticks -88080384..-85983232 at spacing 524288 (liquidity 115073586432, sink 8589236567713153558) and an int128-scale supply over the full width at spacing 1 with no sink. - The replay checks both against the chain after every block, their exact served supply and liquidity, list order, creator/owner filters and quote screening; regenerate the golden responses with both and test them.
…is 00140 main applied 00139_mev_capture_v21, so the unapplied zero-seed launch migration was renumbered to 00140 with an unchanged schema. The replay fixture and its SHA-256 are unchanged.
The replacement ZeroSeedLaunch revision (evm-contracts 3d6378f) replaces the fee duration with a uint64 Q32.32 decayRateX32 toward a long-run floor. fee_schedule becomes a union on model, the fee model of the launch's deployment pin: fixed_base_duration_v1 keeps the v4 schedule and math unchanged; tick_rate_v2 serves decay_rate_x32 as a decimal string, a display half-life from an exact integer constant, the saturation second and phases before_trading_start, decaying, at_floor and constant, with no end time. Instance pins carry the model and the list/detail SQL screens it. Malformed indexed schedules fail as 500. The TypeScript mirror is checked against the contract's frozen v7 vectors, and the emitted-state replay runner now runs the indexer's harness for each fee model and writes a golden response set for each.
Drop the fixed-base and earlier tick-rate fee models, their pins, vectors and goldens. Launches now carry the logo, every LaunchParameters field as exact decimal strings, the derived spacing and aligned bounds, a trading status and market data (price, market cap, raised, sold share, trade count). The list spans chains with status, owner and creator filters, market-cap ordering, offset paging and totals. Claims are one row per extension claim with the periphery owner and recipient attached. Tests use the frozen 853b608 vectors.
replay.postgres.test.ts builds a loopback Postgres with the indexer's own migrations, processors and DAO from its 853b608 local anvil chain and checks every route against the raw logs and recorded chain state, including logos, claims counted once, owner history, list filters, a reorg and an identical second replay. It replaces the harness-splicing runner and writes the v6 golden responses.
Adds market.volume (|quote delta| summed over every LaunchSwapped, raw quote units) and market.volume_usd, list order_by volume, sold_share and trade_count ranked in SQL over the whole filtered set, and list aggregates: per-quote raw totals, a USD total over priced launches only and the count of launches left out of it.
…ters The indexer now follows each launch token named by LaunchCreated and refuses a creation whose mints were not stored first, so the replay builds its filters with logStreamFilters and groups logs with the addresses loadKnownAddresses returns. The v7 golden is regenerated against indexer 4a2587e; only source.indexer_commit changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current state (head
75ee5be)Draft. Do not merge or deploy. It reads the indexer tables of EkuboProtocol/indexer#246 at
4a2587e.zero-seed-launch-api/v7. The v5 fixed-base and tick-rate models, vectors, goldens and replay scripts are removed.GET /launches.chainId(optional, across chains),status=all|trading|upcoming,owner(current owner),creator.order_by=market_cap|volume|sold_share|trade_count|created, applied in SQL over the whole filtered set before paging.market_capandvolumerank priced launches by USD first, then fall back to quote amount, as the interface does.aggregatescover the same filtered set:launch_count,trade_count, and per-(chain, quote) rawvolumeandmarket_cap. USD totals add up only priced launches, and reportexcluded_launch_count. Different quote tokens are never summed together.offset/limit, withtotalandtotals{all,trading,upcoming}.GET /launches/{chainId}/{poolId}.logo_url: null when empty or not valid UTF-8, otherwise raw and never fetched.range).volume_usd, raised, sold share, trade count)./swaps,/claims,/owners. Paged byafter_event_id. Claims have one row per extension claim, with the periphery owner and recipient, plus totals.Verification (local)
format:check,lintandtypecheckpass.bun test: 220 pass, 12 skip, 0 fail.replay.postgres.test.tsagainst local Postgres: 1 test, 2,600 checks.4a2587eand replays its anvil chain block by block, reading every route through the app.