Update TwoCrypto implementations (donations / yb) in the Factory

Summary:

Update donation‑enabled Twocrypto implementations on the existing Factory so new FX and yield‑basis pools can refill the pool’s re‑centering budget via add_liquidity(donation=True). Since the last post, we ran broader back‑tests and found a way to materially improve re‑centering efficiency while preserving safety: we smartly adjust the donation vesting timeline when shares are burned during a price tweak (instead of implicitly resetting it). No DAO spend and no fee‑split change.

Abstract:

Register two implementations in the Factory that support donations counted as fees to LPs and available to fund small, controlled price‑scale tweaks towards the on‑chain EMA oracle. For yb pairs, the DAO benefits indirectly (per the yb discussion); for FX/regular pairs, the standard 50% admin share remains.

(Background: the donation mechanism, protection window, and burn‑on‑tweak flow have been under continuous audit; resolved items include direct absorption and delayed unlock behavior, and the change here further refines the same area.)

Why an updated vote is needed (since the previous thread)

In extended back‑tests (historical order‑flow replays + two independent simulators), we observed that after a partial donation burn, the remaining donation “drip” could be effectively slowed if the vesting clock was treated as fresh. We now re‑anchor the vesting timestamp so the amount already unlocked by time remains unlocked after the burn; only the total donation pool shrinks. This preserves the intended unlock schedule and makes re‑centering available exactly when it should be, which improved simulated tracking and stability. This change is local to donation accounting; interfaces and fee‑splits are unchanged.

Additional minor improvements since the prior post

  • Event polish.

  • Small code‑size / readability tweaks (no functional change).

Motivation:

When fees are thin, twocrypto pools can drift from the oracle; donations provide a transparent budget for recentring. Ensuring the donation schedule is preserved across burns increases the odds a tweak can execute as soon as it is economically justified, improving depth and UX for FX/yb markets without relying on wash activity.

Specification:

Factory: 0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F

  • TwoCrypto (0% DAO fee) — for yb pools
    Implementation: 0xD15fdA1b43a5a30BE1DF0e39954874F567725a39
    id: keccak256("yb")

  • TwoCrypto (25% DAO fee) — for FX where asset issuer will be main source of LP and donations
    Implementation: 0x11e9078d9f73609688FC055ABf4ef7470D886Ca7
    id: keccak256("fx25")

  • TwoCrypto (50% DAO fee) — for FX / regular pairs (where donations may stream from within Curve protocol)
    Implementation: 0x898b779e912a980dffcc6e6E02E37C81c677079b
    id: keccak256("fx50")

These replace the contracts referenced in the prior thread; parameter surfaces and interfaces are unchanged.

Security:

All new changes to the code underwent investigation ad discussion with a security provider that previously reviewed the twocrypto code. Multiple suggested tweaks (i.e. single tweak_price per block) were implemented following their recommendations. No new issues were found.

Actions (for the DAO multisig)

set_pool0_impl  = (Factory, "set_pool_implementation", 0xD15fdA1b43a5a30BE1DF0e39954874F567725a39, int(keccak(text="yb").hex(), 16))
set_pool25_impl = (Factory, "set_pool_implementation", 0x11e9078d9f73609688FC055ABf4ef7470D886Ca7, int(keccak(text="fx25").hex(), 16))
set_pool50_impl = (Factory, "set_pool_implementation", 0x898b779e912a980dffcc6e6E02E37C81c677079b, int(keccak(text="fx50").hex(), 16))
cleanup_donations_impl = (Factory, "set_pool_implementation", 0x0000000000000000000000000000000000000000, int(keccak(text="donations").hex(), 16))

Poll

If passed, the Factory will serve the updated implementations for new pools under the IDs (“yb”, “fx25”, “fx50”). Existing pools are unaffected.

2 Likes

We are running a follow-up vote to register updated implementations. During yieldbasis pool bootstrap, we observed that donation sandwich&grief protection could act as an unintended “ape tax,” penalizing sequential large LP additions with up to the pool’s mid_fee. Parameters were tuned for yb, and this is not a large issue for pools with significant TVL, but to avoid this issue for new FX-like pools we now scale the protection fee strictly with the pool’s donations. Thus, newly created pools that don’t yet have any donations will not be subject to this fee.

New implementations:

  • yb (0% DAO fee): 0x82c251317ede0514302EEE1aD48f838a7A6EcE2F

  • fx25 (25% DAO fee): 0x3B0df55A2c64Ac7A3ada784eEA0898F0FD3cF17e

  • fx50 (50% DAO fee): 0xD1FAeCA80d6FDd1DF4CBcCe4b2551b6Ee63Ae3D6

Vote link: Curve.finance

If approved, the Factory will serve these new implementations for future pools; existing deployments remain unchanged.