Glossary
Key terms and concepts used throughout the quantammsim documentation. Terms are cross-referenced where relevant; click any :term: link to jump to its definition.
- AMM (Automated Market Maker)
A smart-contract protocol that holds reserves of two or more tokens and algorithmically prices trades via a trading function, removing the need for a traditional order book. See also CFMM (Constant Function Market Maker).
- Amplitude
A log-space scaling factor applied to strategy signals before they are converted to weights. Provides an additional degree of freedom for controlling the magnitude of weight deviations from the base allocation.
- Arb Frequency
How often (in minutes) the simulator checks for and executes arbitrage opportunities. Finer arb frequency produces more realistic simulations but increases computation. Typically set to match the data resolution (e.g. 1 for minute-level data).
- Arbitrage
- Arb
The process by which an external agent exploits price discrepancies between the pool’s implied price and the external market price. In quantammsim the arbitrageur is modelled as an optimal rational actor who trades to align pool prices with the external oracle, subject to gas costs and fees.
- Batch Size
The number of randomly-sampled time windows evaluated per gradient computation. Each window in the batch uses an independent bout offset. Larger batches reduce gradient variance at the cost of memory and compute.
- Bout Offset
A random offset (in minutes) applied to shorten the start of each training window within a batch. Provides data diversity during SGD by ensuring that different gradient steps see slightly different sub-windows of the training period.
- Burn-in
The initial period of memory length (up to
max_memory_days) before the training window during which EWMA estimators accumulate history but no gradients are computed and no performance metrics are recorded. Ensures that estimator state is warm before evaluation begins.- CFMM (Constant Function Market Maker)
An AMM defined by a trading invariant \(f(R_1, \ldots, R_n) = k\) that is conserved across all trades. G3M pools are a special case.
- Channel Width
The width parameter for mean reversion channel strategies. Defines the threshold between the mean-reverting regime (small price moves) and the trend-following regime (large price moves).
- Chunk Period
The time interval (in minutes) between consecutive coarse weight updates. The default of 1440 corresponds to daily updates. Shorter chunk periods allow faster strategy response but increase turnover and computational cost.
- Coarse Weights
The target portfolio weights computed by the update rule at each chunk period boundary. These are the direct output of the strategy before any interpolation to finer time resolution.
- CoW AMM (Coincidence of Wants AMM)
A pool design in which post-trade quoted prices must match the trade execution price, preventing sandwich attacks by construction. Implemented in the CowAMM DeFi protocol.
- daily_log_sharpe
The default training objective: the Sharpe ratio computed on daily log-returns of pool value. Preferred over raw Sharpe because log-returns are additive, better-behaved under differentiation, and less susceptible to outlier-driven gradients.
- Early Stopping
Terminating training when a monitored validation metric (typically out-of-sample performance or a moving average of the training loss) stops improving. Prevents the optimiser from continuing into the overfitting regime.
- ECLP (Elliptic Concentrated Liquidity Pool)
A pool type (as used by Gyroscope) whose trading function is an elliptic curve, providing concentrated liquidity within user-specified price bounds while retaining a smooth, differentiable trading function and fungible LP positions.
- Ensemble Training
Training multiple parameter sets simultaneously and averaging their weight outputs at inference time. Provides implicit regularisation by reducing variance across the ensemble, analogous to bagging. Initialisation strategies (LHS, Sobol, grid) control the diversity of the initial parameter sets.
- EWMA (Exponentially Weighted Moving Average)
The core estimator underlying most update rules. Computes a recursive moving average of price data with exponential decay controlled by lambda. Implemented as a JAX scan for the CPU path and as a causal convolution for the GPU path.
- Fine Weights
Weights interpolated from coarse weights to minute-level resolution. The interpolation method (linear or optimal) determines how the pool transitions between coarse weight updates. See Weight Interpolation.
- Forward Pass
A single end-to-end evaluation of the simulation pipeline: price data is fed through EWMA estimators, the update rule produces coarse weights, these are interpolated to fine weights, arbitrage is simulated, and financial metrics are computed. In training, the return metric from the forward pass is differentiated to update strategy parameters.
- G3M (Generalised Mean Market Maker)
A family of AMMs whose trading function is defined by a weighted power mean of token reserves. Balancer-style pools are the canonical example. Token weights control the pool’s price exposure to each asset.
- Hook
A mixin class that modifies pool behaviour by composing with the base pool via Python’s MRO. Hooks are specified using double-underscore syntax in the run fingerprint (e.g.
bounded_weight__momentum) and can implement custom fee logic, weight bounds, ensemble averaging, or performance tracking. Multiple hooks compose left-to-right.- In-Sample (IS)
The training period within a single walk-forward cycle, on which strategy parameters are optimised.
- IS-OOS Gap
The difference between in-sample and out-of-sample performance. A large gap is the primary diagnostic for overfitting. Robustness features such as ensemble training, price noise, and early stopping all aim to reduce this gap.
- k (k_per_day)
Strategy aggressiveness parameter controlling how strongly the pool reacts to signals from the update rule. Larger values produce more concentrated weight tilts and higher turnover.
- Lambda
The decay parameter of the EWMA estimator. Defined as
lambda = sigmoid(logit_lambda)so that optimisation operates in unconstrained logit space. Higher values produce longer effective memory.- LP (Liquidity Provider)
An agent who deposits tokens into a pool in exchange for a proportional claim on the pool’s reserves. LP returns are the core performance metric that training seeks to maximise.
- Maximum Change
The maximum permitted weight change per update rule step. Prevents extreme rebalancing that could be exploited on-chain or indicate numerical instability. Enforced via clipping with STE (Straight-Through Estimator) to preserve gradient flow.
- Memory Length
The effective lookback period (in days) of an EWMA estimator, determined by lambda. The conversion is handled by
memory_days_to_logit_lamb()and its inverse. Capped atmax_memory_days(default 365) in the run fingerprint.- Out-of-Sample (OOS)
The held-out test period immediately following the in-sample window in a walk-forward cycle. Performance on this period is never used for parameter updates.
- Parameter Set
One complete set of strategy parameters (e.g. lambda, k, amplitude). Multiple parameter sets are trained in parallel via
n_parameter_setsfor ensemble training.- Pool Value
The total value of the pool’s reserves, denominated in a chosen numeraire (typically the last token). This is the primary quantity tracked for financial performance.
- Price Noise
Multiplicative log-normal noise applied to training prices as a data augmentation strategy. Forces the strategy to be robust to small price perturbations, acting as a regulariser that discourages reliance on exact historical price paths.
- Rademacher Complexity
An empirical measure of the effective complexity of the strategy search space. Estimated by evaluating the best training objective achievable on data with randomly flipped return signs; a high value indicates the search can fit noise, signalling overfitting risk from the optimisation process itself (Paleologo, 2024).
- Reserves
The quantities of each token held by the pool. Reserves change when trades (including arbitrage) occur and determine the pool’s implied marginal price.
- Return Metric
- return_val
The scalar objective function that training maximises (or whose negation is minimised). Common choices include daily_log_sharpe,
sharpe,calmar, andreturns_over_hodl. Specified in the run fingerprint via thereturn_valkey.- Run Fingerprint
The master configuration dictionary specifying all settings for a simulation or training run: tokens, update rule, date range, chunk period, fees, gas costs, return metric, and all robustness settings. Serialisable to JSON for reproducibility.
- STE (Straight-Through Estimator)
A gradient estimation technique that passes gradients through non-differentiable clipping operations unchanged. Used in quantammsim to allow backpropagation through maximum change enforcement and min/max weight bound clipping, which would otherwise have zero gradients almost everywhere.
- SWA (Stochastic Weight Averaging)
A technique that averages parameter snapshots from later training epochs, producing a solution that lies in a flatter region of the loss landscape. Flat minima tend to generalise better, reducing the IS-OOS gap.
- Turnover Penalty
A regularisation term added to the training objective that penalises excessive weight changes between consecutive coarse weight updates. Encourages smoother strategies that are cheaper to execute on-chain and less prone to overfitting via high-frequency signal chasing.
- Update Rule
The parameterised function that maps price data (via EWMA estimators and other features) to target portfolio weights. Examples include momentum, anti-momentum, mean reversion channel, and power channel rules. Each rule exposes a set of learnable parameters (e.g. lambda, k, amplitude).
- Walk-Forward Analysis (WFA)
An out-of-sample validation methodology in which the historical data is divided into sequential in-sample training windows and subsequent out-of-sample test windows. The strategy is retrained on each IS window and evaluated on the corresponding OOS window. Provides a realistic estimate of live performance (Pardo, 2008).
- Walk-Forward Efficiency (WFE)
The ratio of out-of-sample to in-sample performance across walk-forward folds. WFE > 0.5 is generally taken as evidence that the strategy captures genuine structure rather than overfitting to the training period.
- Weight Interpolation
The process of smoothly transitioning between consecutive coarse weight updates to produce fine weights. Linear interpolation spreads the change uniformly; optimal interpolation minimises tracking error. The interpolation granularity is controlled by Weight Interpolation Period.
- Weight Interpolation Period
The time interval (in minutes) between fine weight evaluations. Usually set equal to chunk period but can be made finer for higher-resolution interpolation.