PartyInfo.working(); DeployMock/Sep LP token amount fix
This commit is contained in:
@@ -249,3 +249,5 @@ By coupling LMSR with the proportional parameterization $b(\mathbf{q})=\kappa S(
|
|||||||
|
|
||||||
## References
|
## References
|
||||||
Hanson, R. (2002) [_Logarithmic Market Scoring Rules for Modular Combinatorial Information Aggregation_](https://mason.gmu.edu/~rhanson/mktscore.pdf)
|
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)
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ contract DeployMock is Script {
|
|||||||
msg.sender, // payer: this script
|
msg.sender, // payer: this script
|
||||||
DEV_ACCOUNT_7, // receiver of initial LP
|
DEV_ACCOUNT_7, // receiver of initial LP
|
||||||
initialDeposits,
|
initialDeposits,
|
||||||
10000,
|
10_000 * 10*18,
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ contract DeployMock is Script {
|
|||||||
msg.sender, // payer: this script
|
msg.sender, // payer: this script
|
||||||
DEV_ACCOUNT_7, // receiver of initial LP
|
DEV_ACCOUNT_7, // receiver of initial LP
|
||||||
initialDeposits,
|
initialDeposits,
|
||||||
10000,
|
10_000 * 10*18,
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@ contract DeployMock is Script {
|
|||||||
msg.sender, // payer: this script
|
msg.sender, // payer: this script
|
||||||
DEV_ACCOUNT_7, // receiver of initial LP
|
DEV_ACCOUNT_7, // receiver of initial LP
|
||||||
initialDeposits,
|
initialDeposits,
|
||||||
10000,
|
10_000 * 10*18,
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ pragma solidity ^0.8.30;
|
|||||||
import {IPartyPool} from "./IPartyPool.sol";
|
import {IPartyPool} from "./IPartyPool.sol";
|
||||||
|
|
||||||
interface IPartyInfo {
|
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.
|
/// @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.
|
/// @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).
|
/// 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;
|
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
|
// Current marginal prices
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user