Indexer: treat TimeCurve buyFor as Buy; enrich with ETH/USDM pay metadata #67
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:open_issues
agents
agent:security_audit
agent:verify
area
timecurve
arena
arena-v2
audit
block:feature_review
block:security
bug
contracts
design
devops
docs
documentation
enhancement
epic
feature
frontend
indexer
low priority
megaeth
operations
ops
performance
QA
qa checklist
referrals
removal
security
smart-contracts
tech-debt
testing
time-arena
timecurve
visual-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/yieldomega#67
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Issue #65 added
TimeCurve.buyFor(companionTimeCurveBuyRouter) so CL8Y can be paid from the router while the buyer receives the sameBuyevent and CHARM/WarBow accounting as a normalbuy. OptionalTimeCurveBuyRouter.BuyViaKumbayalogs pay kind and amounts for observability.Goals
Parity with normal buys — Index
buyFor-driven purchases so they appear in the same pipelines as today’sBuyevents (sameTimeCurveBuylog shape:buyer= participant,charmWad,amount, fees, timer fields, etc.). Do not drop or mis-attribute buys becausemsg.senderon the sale contract was the router.Enrichment for multi-asset entry — Persist additional fields (or a sidecar row / JSON column) when the tx is attributable to
TimeCurveBuyRouter.buyViaKumbaya(decodeBuyViaKumbaya+ same-txBuycorrelation by tx hash / log index):Buyasamount), optional implied input fromBuyViaKumbaya/ swap logs if stable for analytics later.Schema / API — Extend internal models and any public API that exposes buys so downstream surfaces can optionally show “paid via router (ETH/USDM)” without breaking existing CL8Y-only consumers (defaults / nulls for legacy rows).
Acceptance criteria
buyFortxs produce the same canonical buy records asbuy(correct buyer,amount, CHARM, indexer invariants).BuyViaKumbayais present in the same tx asBuy, store ETH vs USDM (and any agreed numeric fields) for later UX/analytics.docs/testing/invariants-and-business-logic.mdtest map).References
contracts/src/TimeCurve.sol—buyFor,Buyeventcontracts/src/TimeCurveBuyRouter.sol—BuyViaKumbayaindexer/decoders and persist layer for TimeCurvementioned in issue #66
Companion: frontend single-tx
buyViaKumbayawiring — https://gitlab.com/PlasticDigits/yieldomega/-/issues/66Cross-link: Replace the placeholder “frontend issue” in the description with issue #66.
changed the description
mentioned in commit
5eaf345725mentioned in commit
2a89c4941e@brouie Please verify the indexer fix for #67 (merged to
mainin5eaf345).What changed
BuyViaKumbayais decoded and stored inidx_timecurve_buy_router_kumbaya(idempotent ontx_hash, log_index).ADDRESS_REGISTRYJSON may include optionalTimeCurveBuyRoutersoeth_getLogsingests router events (empty string = omit from filter).GET /v1/timecurve/buys(x-schema-version1.8.0) left-joins matching rows and adds optional fields when the same tx has a correlated sidecar:entry_pay_asset(eth|stable) androuter_attested_gross_cl8y(from the router event). Legacy / CL8Y-only buys omit these keys.docs/integrations/kumbaya.md,docs/indexer/design.md,docs/testing/invariants-and-business-logic.md,skills/README.md,.cursor/skills/yieldomega-guardrails/SKILL.md. Issue description updated to link #66 for the frontend companion.Checklist for you
idx_timecurve_buy_router_kumbayaexists.TimeCurveBuyRouterinADDRESS_REGISTRY_PATHto the deployed router; restart ingestion; confirm router logs appear in the table after abuyViaKumbayatx.GET /v1/timecurve/buysreturnsentry_pay_asset/router_attested_gross_cl8yfor those txs and omits them for ordinarybuytxs.buyeron buy rows matches the participant (unchanged invariant — sourced fromTimeCurveBuy).cd indexer && cargo testgreen withYIELDOMEGA_PG_TEST_URLwhere you use Postgres integration.Leaving the issue open for your sign-off.
mentioned in commit
3d45e3b90dmentioned in issue #72
@PlasticDigits source + Postgres-roundtrip verification on
5eaf345.Source review
Decoder (src/decoder.rs):
Persist (src/persist.rs L125-133):
Reorg rollback (src/reorg.rs L119):
Config (src/config.rs L23-25):
API (src/api.rs):
Migration
Up SQL (migrations/20260426120000_timecurve_buy_router_kumbaya.up.sql):
Down SQL: clean DROP TABLE IF EXISTS
Applied to real yieldomega_indexer DB on yieldomega-pg, table structure inspected via psql \d:
Tests
cd indexer && cargo test:
Deferred until #72 lands (not closeable today)
Source layer is solid. Will close once #72 unblocks the deploy and I can ingest a real router event end-to-end.
Issue stays open.
mentioned in issue #75
@PlasticDigits per today's process update (file follow-ups, close originals): live ingestion items moved to #75 tracker. Source + real-Postgres roundtrip verification (see prior note on this issue) stands.
Closing #67. Live walkthrough proceeds via #75 once a buyViaKumbaya tx is captured (likely via #74 browser walkthrough).
mentioned in issue #83
mentioned in issue #84
mentioned in issue #156