constant_product_calculator

class pactsdk.constant_product_calculator.ConstantProductParams(fee_bps, pact_fee_bps)

Bases: object

fee_bps: int
pact_fee_bps: int
pactsdk.constant_product_calculator.get_swap_gross_amount_received(liq_a, liq_b, amount_deposited)
Return type

int

pactsdk.constant_product_calculator.get_swap_amount_deposited(liq_a, liq_b, gross_amount_received)
Return type

int

pactsdk.constant_product_calculator.get_constant_product_minted_liquidity_tokens(added_primary, added_secondary, total_primary, total_secondary, total_liquidity)
Return type

int

class pactsdk.constant_product_calculator.ConstantProductCalculator(pool)

Bases: object

An implementation of a math behind constant product pools.

get_price(liq_a, liq_b)
Return type

float

get_swap_gross_amount_received(liq_a, liq_b, amount_deposited)
Return type

int

get_swap_amount_deposited(liq_a, liq_b, gross_amount_received)
Return type

int

get_minted_liquidity_tokens(added_liq_a, added_liq_b)
Return type

int