PartyInfo.working(); DeployMock/Sep LP token amount fix
This commit is contained in:
@@ -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).
|
||||
|
||||
@@ -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
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user