AntiMomentumPool
- class AntiMomentumPool[source]
Bases:
MomentumPoolA class for anti-momentum strategies run as TFMM liquidity pools.
This class implements a mean-reversion-based strategy for asset allocation within a TFMM framework. It uses price data to generate mean-reversion signals, which are then translated into weight adjustments.
- Parameters:
None
- calculate_rule_outputs(params, run_fingerprint, prices, additional_oracle_input)[source]
Calculate the raw weight outputs based on mean-reversion signals.
Notes
The class implements a mean-reversion-based strategy for asset allocation within a TFMM framework. It uses price data to generate mean-reversion signals, which are then translated into weight adjustments. The class provides methods to calculate raw weight outputs based on these signals and refine them into final asset weights, taking into account various parameters and constraints defined in the pool setup.
- calculate_rule_outputs(params, run_fingerprint, prices, additional_oracle_input=None)[source]
Calculate the raw weight outputs based on antimomentum signals. This method computes the raw weight adjustments for the antimomentum strategy. It processes the input prices to calculate gradients, which are then used to determine weight updates.
- Parameters:
- Returns:
Raw weight outputs representing the suggested weight adjustments.
- Return type:
jnp.ndarray
Notes
The method performs the following steps: 1. Calculates the memory days based on the lambda parameter. 2. Computes the ‘k’ factor which scales the weight updates. 3. Extracts chunkwise price values from the input prices. 4. Calculates price gradients using the calc_gradients function. 5. Applies the antimomentum weight update (momentum with negative k) formula to get raw weight outputs.
The raw weight outputs are not the final weights, but rather the changes to be applied to the previous weights. These will be refined in subsequent steps.