diff --git a/doc/whitepaper.md b/doc/whitepaper.md index 7eba220..998dcb9 100644 --- a/doc/whitepaper.md +++ b/doc/whitepaper.md @@ -249,3 +249,5 @@ By coupling LMSR with the proportional parameterization $b(\mathbf{q})=\kappa S( ## References Hanson, R. (2002) [_Logarithmic Market Scoring Rules for Modular Combinatorial Information Aggregation_](https://mason.gmu.edu/~rhanson/mktscore.pdf) +Othman, Pennock, Reeves, Sandholm (2013) [_A Practical Liquidity-Sensitive Automated Market Maker_](https://www.cs.cmu.edu/~sandholm/liquidity-sensitive%20automated%20market%20maker.teac.pdf) +Xu, Paruch, Cousaert, Feng (2023) [SoK: Decentralized Exchanges (DEX) with Automated Market Maker (AMM) Protocols](https://arxiv.org/pdf/2103.12732) diff --git a/script/DeployMock.sol b/script/DeployMock.sol index 8b81389..6dd369d 100644 --- a/script/DeployMock.sol +++ b/script/DeployMock.sol @@ -75,7 +75,7 @@ contract DeployMock is Script { msg.sender, // payer: this script DEV_ACCOUNT_7, // receiver of initial LP initialDeposits, - 10000, + 10_000 * 10*18, 0 ); @@ -119,7 +119,7 @@ contract DeployMock is Script { msg.sender, // payer: this script DEV_ACCOUNT_7, // receiver of initial LP initialDeposits, - 10000, + 10_000 * 10*18, 0 ); @@ -159,7 +159,7 @@ contract DeployMock is Script { msg.sender, // payer: this script DEV_ACCOUNT_7, // receiver of initial LP initialDeposits, - 10000, + 10_000 * 10*18, 0 ); diff --git a/src/IPartyInfo.sol b/src/IPartyInfo.sol index d7cb26c..98fca7f 100644 --- a/src/IPartyInfo.sol +++ b/src/IPartyInfo.sol @@ -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). diff --git a/src/PartyInfo.sol b/src/PartyInfo.sol index 392181b..c99a68e 100644 --- a/src/PartyInfo.sol +++ b/src/PartyInfo.sol @@ -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 0; + } + // // Current marginal prices //