CowPool

class CowPool[source]

Bases: AbstractPool

A class representing a CowPool, which is a type of automated market maker (AMM) pool

with specific characteristics.

__init__():

Initializes the CowPool instance.

calculate_reserves_with_fees(params, run_fingerprint, prices,
start_index, additional_oracle_input=None) -> jnp.ndarray:

Calculates the reserves of the pool considering fees.

calculate_reserves_zero_fees(params, run_fingerprint, prices,
start_index, additional_oracle_input=None) -> jnp.ndarray:

Calculates the reserves of the pool without considering fees.

calculate_reserves_with_dynamic_inputs(params, run_fingerprint, prices,
start_index, fees_array, arb_thresh_array, arb_fees_array, trade_array,
additional_oracle_input=None) -> jnp.ndarray:

Calculates the reserves of the pool with dynamic inputs for fees, arbitrage thresholds, arbitrage fees, and trades.

init_base_parameters(initial_values_dict, run_fingerprint, n_assets,
n_parameter_sets=1, noise="gaussian") -> Dict[str, Any]:

Initializes the base parameters for the pool. Cow pools have no parameters.

calculate_initial_weights(params, \*args, \*\*kwargs) jnp.ndarray:

Calculates the weights for the assets in the pool. For CowPool, the weights are always [0.5, 0.5].

make_vmap_in_axes(params, n_repeats_of_recurred=0):

Creates the vmap in_axes for the parameters.

is_trainable() bool:[source]

Indicates whether the pool is trainable. For CowPool, this is always False.

__init__()[source]
calculate_reserves_with_fees(params, run_fingerprint, prices, start_index, additional_oracle_input=None)[source]
Parameters:
Return type:

Array

calculate_reserves_zero_fees(params, run_fingerprint, prices, start_index, additional_oracle_input=None)[source]
Parameters:
Return type:

Array

calculate_reserves_with_dynamic_inputs(params, run_fingerprint, prices, start_index, fees_array, arb_thresh_array, arb_fees_array, trade_array, lp_supply_array=None, additional_oracle_input=None)[source]
Parameters:
Return type:

Array

init_base_parameters(initial_values_dict, run_fingerprint, n_assets, n_parameter_sets=1, noise='gaussian')[source]
Parameters:
Return type:

Dict[str, Any]

is_trainable()[source]