Pricing Modules
Last updated
Last updated
Pricing Modules are utility contracts that implement the IPricingModule interface and are used by the BiPoolManager during swaps to price the swaps. A pricing module has to implement two functions:
ConstantSumPricingModule is an IPricingModule that implements a constant-sum pricing formula for a two-asset pool.
ConstantProductPricingModule is an IPricingModule that implements a constant-product pricing formula for a two-asset pool.
Where is the bucket size of TokenIn, is the bucket size of TokenOut, is the amountIn, is the amountOut, is a constant, and is the value of tokenIn quoted in tokenOut.
Where is the bucket size of TokenIn, is the bucket size of TokenOut, is the amountIn, is the amountOut, is a constant, and is the value of tokenIn quoted in tokenOut.