Contracts: DOUB prize split (70%) + AdminSellVault (30%) #249

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

Context

Per-buy DOUB prize routing and admin sell vault. Parent epic: #238.

Relevant files

  • New: contracts/src/PodiumVaults.sol or modules in TimeArena
  • New: contracts/src/AdminSellVault.sol
  • docs/integrations/kumbaya.md

Acceptance criteria

  • On each buy: 10% DOUB → each of 4 podium active pools; 7.5% → each of 4 seed pools; 30% → AdminSellVault
  • Integer math: remainder to admin vault or largest pool (documented)
  • AdminSellVault.sellDoubToUsdm(minOut) — only admin; USDM to admin account
  • Events for indexer: PodiumFunded, SeedFunded, AdminVaultFunded

Verification checklist

  • Forge: 1000 DOUB buy → vault balances 100/75/100/75/... + 300 admin
  • Admin sell mocked with AnvilKumbayaFixture
## Context Per-buy DOUB prize routing and admin sell vault. Parent epic: #238. ## Relevant files - New: `contracts/src/PodiumVaults.sol` or modules in TimeArena - New: `contracts/src/AdminSellVault.sol` - `docs/integrations/kumbaya.md` ## Acceptance criteria - [ ] On each buy: **10%** DOUB → each of 4 podium active pools; **7.5%** → each of 4 seed pools; **30%** → `AdminSellVault` - [ ] Integer math: remainder to admin vault or largest pool (documented) - [ ] `AdminSellVault.sellDoubToUsdm(minOut)` — only admin; USDM to admin account - [ ] Events for indexer: `PodiumFunded`, `SeedFunded`, `AdminVaultFunded` ## Verification checklist - [ ] Forge: 1000 DOUB buy → vault balances 100/75/100/75/... + 300 admin - [ ] Admin sell mocked with `AnvilKumbayaFixture`
PlasticDigits commented 2026-05-27 07:07:22 +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-27 13:59:15 +00:00 (Migrated from gitlab.com)

mentioned in issue #261

mentioned in issue #261
PlasticDigits commented 2026-05-27 13:59:17 +00:00 (Migrated from gitlab.com)

marked as related to #261

marked as related to #261
PlasticDigits commented 2026-05-28 13:58:42 +00:00 (Migrated from gitlab.com)

Implementation summary

  • ArenaBuyRouting + vault funding; AdminSellVault.sellDoubToUsdm + swap config.

Acceptance criteria

  • 10%/7.5% pools + 30% admin per buy
  • Vault events via PodiumVaults/AdminSellVault
  • Admin sell entrypoint

Verification checklist

  • ArenaPrizeRouting.t.sol, test_buy_routes_doub_split
## Implementation summary - `ArenaBuyRouting` + vault funding; `AdminSellVault.sellDoubToUsdm` + swap config. ## Acceptance criteria - [x] 10%/7.5% pools + 30% admin per buy - [x] Vault events via PodiumVaults/AdminSellVault - [x] Admin sell entrypoint ## Verification checklist - [x] `ArenaPrizeRouting.t.sol`, `test_buy_routes_doub_split`
PlasticDigits commented 2026-05-30 14:05:12 +00:00 (Migrated from gitlab.com)

mentioned in commit ee13b7371a

mentioned in commit ee13b7371a16018aa50481a5650011e5c44ebf7e
PlasticDigits commented 2026-05-30 14:05:12 +00:00 (Migrated from gitlab.com)

mentioned in commit 3f51eb08a5

mentioned in commit 3f51eb08a5a8d7c99bbbcdccce1cab89d695e46d
PlasticDigits commented 2026-05-30 14:05:27 +00:00 (Migrated from gitlab.com)

Verification complete (agent, worktree issue/249-doub-prize-split)

Verified GitLab #249 against main @ 3f51eb0. Infra was not restarted.

What was already implemented

  • ArenaBuyRouting.splitBuyAmount: 10% × 4 active + 7.5% × 4 seed + admin = amount - allocated (remainder → AdminSellVault).
  • TimeArena._routeDoubPrizeSplit: transfers + PodiumFunded / SeedFunded / AdminVaultFunded.
  • AdminSellVault.sellDoubToUsdm(minOut): onlyOwner, Kumbaya-style exactInputSingle, USDM to adminAccount.

What this verification pass added

  • contracts/test/AdminSellVault.t.sol: mock exactInputSingle + AnvilMockUSDM (from AnvilKumbayaFixture) — closes the missing “admin sell mocked” checklist item.
  • TimeArena.t.sol::test_buy_routes_doub_split: asserts funding events (4×100, 4×75, 300 admin) on a 1000 DOUB buy.
  • ArenaPrizeRouting.t.sol::testFuzz_splitBuy_no_dust: fuzz conservation.
  • Docs/invariants: INV-ADMIN-SELL-VAULT-249, crosslinks in fee-routing, kumbaya §249, play-time-arena-doub, guardrails §6.

Forge

cd contracts && forge test --match-contract "AdminSellVault|ArenaPrizeRouting|TimeArenaTest" \
  --match-test "test_buy_routes_doub_split|test_split|test_sellDoub|testFuzz_splitBuy"

All matched tests passed.

Anvil smoke (read-only)

Registry AdminSellVault wired to TimeArena on http://127.0.0.1:8545.


Manual re-check checklist

  • forge test --match-contract AdminSellVault
  • forge test --match-test test_buy_routes_doub_split
  • forge test --match-contract ArenaPrizeRouting
  • One live DOUB buy → logs show 4× PodiumFunded, 4× SeedFunded, 1× AdminVaultFunded
  • After buys, AdminSellVault DOUB ≈ 30% of cumulative gross; PodiumVaults ≈ 70%
  • (Optional) sellDoubToUsdm on testnet/mainnet with real Kumbaya router

All #249 acceptance criteria satisfied in code + Forge; closing.

## Verification complete (agent, worktree `issue/249-doub-prize-split`) Verified GitLab **#249** against `main` @ `3f51eb0`. Infra was **not** restarted. ### What was already implemented - **`ArenaBuyRouting.splitBuyAmount`**: 10% × 4 active + 7.5% × 4 seed + admin = `amount - allocated` (remainder → **`AdminSellVault`**). - **`TimeArena._routeDoubPrizeSplit`**: transfers + **`PodiumFunded` / `SeedFunded` / `AdminVaultFunded`**. - **`AdminSellVault.sellDoubToUsdm(minOut)`**: `onlyOwner`, Kumbaya-style **`exactInputSingle`**, USDM to **`adminAccount`**. ### What this verification pass added - **`contracts/test/AdminSellVault.t.sol`**: mock **`exactInputSingle`** + **`AnvilMockUSDM`** (from **`AnvilKumbayaFixture`**) — closes the missing “admin sell mocked” checklist item. - **`TimeArena.t.sol::test_buy_routes_doub_split`**: asserts funding events (4×100, 4×75, 300 admin) on a 1000 DOUB buy. - **`ArenaPrizeRouting.t.sol::testFuzz_splitBuy_no_dust`**: fuzz conservation. - Docs/invariants: **`INV-ADMIN-SELL-VAULT-249`**, crosslinks in fee-routing, kumbaya §249, play-time-arena-doub, guardrails §6. ### Forge ```bash cd contracts && forge test --match-contract "AdminSellVault|ArenaPrizeRouting|TimeArenaTest" \ --match-test "test_buy_routes_doub_split|test_split|test_sellDoub|testFuzz_splitBuy" ``` All matched tests **passed**. ### Anvil smoke (read-only) Registry **`AdminSellVault`** wired to **`TimeArena`** on `http://127.0.0.1:8545`. --- ## Manual re-check checklist - [ ] `forge test --match-contract AdminSellVault` - [ ] `forge test --match-test test_buy_routes_doub_split` - [ ] `forge test --match-contract ArenaPrizeRouting` - [ ] One live DOUB `buy` → logs show 4× `PodiumFunded`, 4× `SeedFunded`, 1× `AdminVaultFunded` - [ ] After buys, `AdminSellVault` DOUB ≈ 30% of cumulative gross; `PodiumVaults` ≈ 70% - [ ] (Optional) `sellDoubToUsdm` on testnet/mainnet with real Kumbaya router All **#249** acceptance criteria satisfied in code + Forge; closing.
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-05-30 14:05:28 +00:00
PlasticDigits commented 2026-06-07 07:50:09 +00:00 (Migrated from gitlab.com)

mentioned in issue #300

mentioned in issue #300
PlasticDigits commented 2026-06-07 09:56:02 +00:00 (Migrated from gitlab.com)

mentioned in merge request !440

mentioned in merge request !440
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#249
No description provided.