PartyPoolBalancedPair as subclass

This commit is contained in:
tim
2025-10-06 16:09:34 -04:00
parent 0049d27c90
commit 63f6e66d08
4 changed files with 71 additions and 15 deletions

View File

@@ -8,6 +8,7 @@ import {LMSRStabilized} from "./LMSRStabilized.sol";
import {PartyPool} from "./PartyPool.sol";
import {PartyPoolMintImpl} from "./PartyPoolMintImpl.sol";
import {PartyPoolSwapImpl} from "./PartyPoolSwapImpl.sol";
import {PartyPoolBalancedPair} from "./PartyPoolBalancedPair.sol";
/// @title PartyPlanner
/// @notice Factory contract for creating and tracking PartyPool instances
@@ -86,7 +87,21 @@ contract PartyPlanner is IPartyPlanner {
require(_kappa > int128(0), "Planner: kappa must be > 0");
// Create a new PartyPool instance (kappa-based constructor)
pool = new PartyPool(
pool = _stable && _tokens.length == 2 ?
new PartyPoolBalancedPair(
name_,
symbol_,
_tokens,
_bases,
_kappa,
_swapFeePpm,
_flashFeePpm,
PROTOCOL_FEE_PPM,
PROTOCOL_FEE_ADDRESS,
PartyPoolSwapImpl(SWAP_MINT_IMPL),
MINT_IMPL
) :
new PartyPool(
name_,
symbol_,
_tokens,
@@ -96,7 +111,6 @@ contract PartyPlanner is IPartyPlanner {
_flashFeePpm,
PROTOCOL_FEE_PPM,
PROTOCOL_FEE_ADDRESS,
_stable,
PartyPoolSwapImpl(SWAP_MINT_IMPL),
MINT_IMPL
);