Contracts: TimeArenaBuyRouter — DOUB, CL8Y, ETH, USDm entry paths #251

Closed
opened 2026-05-27 07:07:27 +00:00 by PlasticDigits · 12 comments
PlasticDigits commented 2026-05-27 07:07:27 +00:00 (Migrated from gitlab.com)

Context

DOUB-primary buy router with Kumbaya multi-asset entry. Parent epic: #238.

Relevant files

  • Refactor contracts/src/TimeCurveBuyRouter.sol → TimeArenaBuyRouter.sol
  • contracts/src/fixtures/AnvilKumbayaFixture.sol
  • docs/integrations/kumbaya.md
  • frontend/src/lib/timeCurveKumbayaSingleTx.ts

Acceptance criteria

  • DOUB direct: buy(charmWad) pulls DOUB
  • CL8Y: swap via CL8Y/DOUB Kumbaya pair → DOUB → buy
  • ETH / USDm: multi-hop to CL8Y → DOUB
  • Single-tx router: buyViaKumbaya targets DOUB output equal to gross DOUB need
  • Balance-delta ingress preserved (#123)
  • Chain-time swap deadlines (#83)

Verification checklist

  • Forge fork/local: each pay asset path
  • bash scripts/verify-timecurve-buy-router-anvil.sh replaced with arena equivalent
## Context DOUB-primary buy router with Kumbaya multi-asset entry. Parent epic: #238. ## Relevant files - Refactor `contracts/src/TimeCurveBuyRouter.sol` → `TimeArenaBuyRouter.sol` - `contracts/src/fixtures/AnvilKumbayaFixture.sol` - `docs/integrations/kumbaya.md` - `frontend/src/lib/timeCurveKumbayaSingleTx.ts` ## Acceptance criteria - [ ] **DOUB direct:** `buy(charmWad)` pulls DOUB - [ ] **CL8Y:** swap via CL8Y/DOUB Kumbaya pair → DOUB → buy - [ ] **ETH / USDm:** multi-hop to CL8Y → DOUB - [ ] Single-tx router: `buyViaKumbaya` targets DOUB output equal to gross DOUB need - [ ] Balance-delta ingress preserved (#123) - [ ] Chain-time swap deadlines (#83) ## Verification checklist - [ ] Forge fork/local: each pay asset path - [ ] `bash scripts/verify-timecurve-buy-router-anvil.sh` replaced with arena equivalent
PlasticDigits commented 2026-05-27 07:07:28 +00:00 (Migrated from gitlab.com)

marked as related to #238

marked as related to #238
PlasticDigits commented 2026-05-27 07:08:00 +00:00 (Migrated from gitlab.com)

mentioned in issue #238

mentioned in issue #238
PlasticDigits commented 2026-05-28 13:58:45 +00:00 (Migrated from gitlab.com)

Implementation summary

  • TimeArenaBuyRouter.sol (DOUB exactOutput + buyFor); stub scripts/verify-time-arena-buy-router-anvil.sh.

Acceptance criteria

  • Router contract for ETH/stable/CL8Y → DOUB
  • Full Anvil fork matrix (deploy script follow-up)

Verification checklist

  • Run verify script after Kumbaya fixture deploy
## Implementation summary - `TimeArenaBuyRouter.sol` (DOUB `exactOutput` + `buyFor`); stub `scripts/verify-time-arena-buy-router-anvil.sh`. ## Acceptance criteria - [x] Router contract for ETH/stable/CL8Y → DOUB - [ ] Full Anvil fork matrix (deploy script follow-up) ## Verification checklist - [ ] Run verify script after Kumbaya fixture deploy
PlasticDigits commented 2026-05-29 03:22:14 +00:00 (Migrated from gitlab.com)

mentioned in issue #260

mentioned in issue #260
PlasticDigits commented 2026-05-29 06:54:28 +00:00 (Migrated from gitlab.com)

mentioned in issue #263

mentioned in issue #263
PlasticDigits commented 2026-05-29 08:06:24 +00:00 (Migrated from gitlab.com)

marked as related to #264

marked as related to #264
PlasticDigits commented 2026-05-29 08:06:25 +00:00 (Migrated from gitlab.com)

mentioned in issue #264

mentioned in issue #264
PlasticDigits commented 2026-05-29 08:15:04 +00:00 (Migrated from gitlab.com)

mentioned in issue #269

mentioned in issue #269
PlasticDigits commented 2026-05-29 08:24:35 +00:00 (Migrated from gitlab.com)

mentioned in issue #270

mentioned in issue #270
PlasticDigits commented 2026-05-30 14:39:07 +00:00 (Migrated from gitlab.com)

mentioned in commit 16b3278007

mentioned in commit 16b327800772ae6821dfa0c7bc6251a478499fee
PlasticDigits commented 2026-05-30 14:39:11 +00:00 (Migrated from gitlab.com)

Verification complete (#251)

Verified TimeArenaBuyRouter on the live Anvil stack (no infra restart). Deployed Kumbaya fixtures on existing Anvil (DeployKumbayaAnvilFixtures), merged registry + ran full verify script. Pushed to main as 16b3278.

What changed

  • Forge: test_buyViaKumbaya_cl8y_creditsAlice, test_buy_doub_direct_pullsFromWallet, new VerifyTimeArenaBuyRouterAnvil.t.sol (fork ETH/USDM/CL8Y matrix on deployed Anvil)
  • Scripts: verify-time-arena-buy-router-anvil.sh — no longer kills running Anvil; fixed cast bool/arenaStart parsing; runs fork matrix; verify-timecurve-buy-router-anvil.sh → deprecated wrapper
  • Docs: docs/integrations/kumbaya.md Arena v2 section, INV-TIME-ARENA-BUY-ROUTER updated, skills/play-time-arena-doub/SKILL.md cross-link

Acceptance criteria

  • DOUB direct: TimeArena.buy(charmWad) pulls DOUB — TimeArenaBuyRouter.t.sol::test_buy_doub_direct_pullsFromWallet
  • CL8Y: CL8Y/DOUB single-hop → buyFor — unit + fork tests
  • ETH / USDm: multi-hop → DOUB — unit + fork tests
  • Single-tx buyViaKumbaya targets gross DOUB need
  • Balance-delta ingress (#123) — test_stableIngressParity_revertsOnFeeOnTransfer
  • Chain-time swap deadlines (#83) — test_buyViaKumbaya_revertsExpiredDeadline

Manual verification checklist

  • bash scripts/verify-time-arena-buy-router-anvil.sh on Anvil with YIELDOMEGA_DEPLOY_KUMBAYA=1 if router unset
  • cd contracts && forge test --match-contract TimeArenaBuyRouter -q
  • YIELDOMEGA_FORK_VERIFY=1 FORK_URL=http://127.0.0.1:8545 YIELDOMEGA_TIME_ARENA=<proxy> forge test --match-path test/VerifyTimeArenaBuyRouterAnvil.t.sol
  • /arena ETH/USDM pay when VITE_KUMBAYA_TIME_ARENA_BUY_ROUTER matches onchain router
  • Indexer ingests BuyViaKumbaya after registry lists TimeArenaBuyRouter

All automated criteria from the issue body and prior comment pass. Closing.

## Verification complete (#251) Verified **TimeArenaBuyRouter** on the live Anvil stack (no infra restart). Deployed Kumbaya fixtures on existing Anvil (`DeployKumbayaAnvilFixtures`), merged registry + ran full verify script. Pushed to `main` as `16b3278`. ### What changed - **Forge:** `test_buyViaKumbaya_cl8y_creditsAlice`, `test_buy_doub_direct_pullsFromWallet`, new `VerifyTimeArenaBuyRouterAnvil.t.sol` (fork ETH/USDM/CL8Y matrix on deployed Anvil) - **Scripts:** `verify-time-arena-buy-router-anvil.sh` — no longer kills running Anvil; fixed `cast` bool/`arenaStart` parsing; runs fork matrix; `verify-timecurve-buy-router-anvil.sh` → deprecated wrapper - **Docs:** `docs/integrations/kumbaya.md` Arena v2 section, `INV-TIME-ARENA-BUY-ROUTER` updated, `skills/play-time-arena-doub/SKILL.md` cross-link ### Acceptance criteria - [x] **DOUB direct:** `TimeArena.buy(charmWad)` pulls DOUB — `TimeArenaBuyRouter.t.sol::test_buy_doub_direct_pullsFromWallet` - [x] **CL8Y:** CL8Y/DOUB single-hop → `buyFor` — unit + fork tests - [x] **ETH / USDm:** multi-hop → DOUB — unit + fork tests - [x] **Single-tx `buyViaKumbaya`** targets gross DOUB need - [x] **Balance-delta ingress** (#123) — `test_stableIngressParity_revertsOnFeeOnTransfer` - [x] **Chain-time swap deadlines** (#83) — `test_buyViaKumbaya_revertsExpiredDeadline` ### Manual verification checklist - [ ] `bash scripts/verify-time-arena-buy-router-anvil.sh` on Anvil with `YIELDOMEGA_DEPLOY_KUMBAYA=1` if router unset - [ ] `cd contracts && forge test --match-contract TimeArenaBuyRouter -q` - [ ] `YIELDOMEGA_FORK_VERIFY=1 FORK_URL=http://127.0.0.1:8545 YIELDOMEGA_TIME_ARENA=<proxy> forge test --match-path test/VerifyTimeArenaBuyRouterAnvil.t.sol` - [ ] `/arena` ETH/USDM pay when `VITE_KUMBAYA_TIME_ARENA_BUY_ROUTER` matches onchain router - [ ] Indexer ingests `BuyViaKumbaya` after registry lists `TimeArenaBuyRouter` All automated criteria from the issue body and prior comment pass. Closing.
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-05-30 14:39:12 +00:00
PlasticDigits commented 2026-06-08 08:16:56 +00:00 (Migrated from gitlab.com)

mentioned in issue #303

mentioned in issue #303
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
code/yieldomega#251
No description provided.