calculate_reserve_price_in_quote_token_decimal#

calculate_reserve_price_in_quote_token_decimal(reversed, reserve0, reserve1, amount0_in, amount1_in, amount0_out, amount1_out)[source]#

Calculate the market price based on Uniswap pool reserve0 an reserve1.

All inputs are converted from fixed point numbers to natural decimal point placed numbers.

Parameters:
  • reversed (bool) – Determine base, quote token order relative to token0, token1. If reversed, quote token is token0, else quote token is token0.

  • reserve0 (Decimal) –

  • reserve1 (Decimal) –

  • amount0_in (Decimal) –

  • amount1_in (Decimal) –

  • amount0_out (Decimal) –

  • amount1_out (Decimal) –

Returns:

Price in quote token, amount in quote token

Return type:

Tuple[SwapKind, Decimal, Decimal]