HodlingIndexPool

class HodlingIndexPool[source]

Bases: IndexMarketCapPool

Market-cap index pool that HODLs reserves between weight updates.

Unlike the base IndexMarketCapPool, which allows continuous arbitrage-driven rebalancing at every timestep, this variant only permits trades during a weight_interpolation_period window at the start of each chunk_period. Outside that window the pool’s reserves are frozen (HODLed), so the portfolio drifts with market prices rather than being continuously rebalanced.

Reserve calculations use the on-chain QuantAMM arbitrage mechanics (optimal-trade sifter with swap fees), matching what would happen on an actual G3M AMM deployment. The do_trades mask passed to the reserve calculator encodes which timesteps fall inside the active rebalancing window.

Inherits weight calculation logic (market-cap weighting) from IndexMarketCapPool and overrides calculate_reserves_with_fees and calculate_reserves_zero_fees to implement the HODLing behaviour.

See also

IndexMarketCapPool

Continuously-rebalanced base class.

TradHodlingIndexPool

Off-chain (CEX) variant with realistic trading costs instead of on-chain AMM mechanics.

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