Fetching Purchase Fees
If you want to run this example, be sure that you have followed the steps here to configure your Wallet Client.
The AgoraStableSwapPair contract stores the current purchase-fee rate :
token0PurchaseFee– fee charged when buying token0 (i.e., swapping into token0).token1PurchaseFee– fee charged when buying token1.
The returned rates are both using 18 decimal “fee precision” units.
Pick a pair address
Helper function to read the purchase fees
Example use of the helper function
Returned Data
This is the value stored by the contract. In order to convert these units to human readable values, we’ll need to divide the output by the ERC20 token decimals.

