PartyInfo.working(); DeployMock/Sep LP token amount fix

This commit is contained in:
tim
2025-11-10 16:31:43 -04:00
parent a08a928f7f
commit 89f4307ca0
4 changed files with 19 additions and 3 deletions

View File

@@ -4,6 +4,10 @@ pragma solidity ^0.8.30;
import {IPartyPool} from "./IPartyPool.sol";
interface IPartyInfo {
/// @notice returns true iff the pool is not killed and has been initialized with liquidity.
function working(IPartyPool pool) external view returns (bool);
/// @notice Marginal price of `base` denominated in `quote` as Q64.64.
/// @dev Returns the LMSR marginal price p_quote / p_base in ABDK 64.64 fixed-point format.
/// Useful for off-chain quoting; raw 64.64 value is returned (no scaling to token units).

View File

@@ -22,6 +22,16 @@ contract PartyInfo is PartyPoolHelpers, IPartyInfo {
MINT_IMPL = mintImpl;
}
function working(IPartyPool pool) external view returns (bool) {
if (pool.killed())
return false;
LMSRStabilized.State memory s = pool.LMSR();
uint256 sum = 0;
for( uint i=0; i<s.qInternal.length; i++ )
sum += s.qInternal[i];
return sum > 0;
}
//
// Current marginal prices
//