Fetching Pair Price
If you want to run this example, be sure that you have followed the steps here to configure your Wallet Client.
AgoraStableSwapPair exposes two read functions for price discovery:
Pick the pair address
Helper function to read the price
Example use of the helper function (with a 5-minute deadline)
Returned Data
Token order in the pair
Deadline logic
For pairs where token1 is interest-bearing, passing a future timestamp guards against receiving fewer tokens than expected if block processing is delayed. For non-yield token pairs, deadline simply replays the current price.
Understanding Pricing
Since token0 and token1 might have different decimals, the pricing of the pair follows:

