Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/onchain/TestAMMContract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -523,4 +523,24 @@ contract Test_AMMContract is Ownable {
function getAllPools() external view returns (PoolData[] memory) {
return pools;
}

/**
* @notice Retrieves current token reserves for a specified pool
* @dev Returns the current reserve amounts for both tokens in the pool
*
* @param marketId Unique identifier for the prediction market
*
* @return reserve0 Current reserve amount of tokenA in the pool
* @return reserve1 Current reserve amount of tokenB in the pool
*
* Requirements:
* - Pool must exist (will return 0,0 for non-existent pools)
*
* @custom:reserves These represent actual token balances held by this contract for the pool
* @custom:analytics Useful for calculating current pool ratios and available liquidity
*/
function getPoolReserves(bytes32 marketId) external view returns (uint256 reserve0, uint256 reserve1) {
PoolData memory pool = marketIdToPool[marketId];
return (pool.reserveA, pool.reserveB);
}
}
Loading