exponents: Exponent for the trend following portion
h: Inverse scaling within the channel
S: Pre-exp scaling for trend component
The strategy aims to:
Mean-revert within the channel (channel component, for small changes in g)
Follow trends (nonlinearly, if exponents are not 1) outside the channel (trend component, for large changes in g)
Smoothly transition between the two regimes (via the envelope function)
Parameters
Name
Type
Description
_prevWeights
int256[]
the previous weights retrieved from the vault
_data
int256[]
the latest data, usually price
_parameters
int256[][]
the parameters of the rule that are not lambda. Parameters [0] through [5] are arrays/vectors, [6] is a scalar. [0]=kappa [1]=width [2]=amplitude [3]=exponents [4]=inverseScaling [5]=preExpScaling [6]=useRawPrice
_poolParameters
QuantAMMPoolParameters
_requiresPrevMovingAverage
Check if the rule requires the previous moving average
Returns
Name
Type
Description
<none>
uint16
0 if it does not require the previous moving average, 1 if it does
_setInitialIntermediateValues
Set the initial intermediate values for the pool, in this case the gradient
Parameters
Name
Type
Description
_poolAddress
address
the target pool address
_initialValues
int256[]
the initial values of the pool
_numberOfAssets
uint256
the number of assets in the pool
validParameters
Structs
ChannelFollowingLocals
Struct to store local variables for the channel following calculation
struct to avoid stack too deep issues
Properties
Name
Type
Description
kappa
int256[]
array of kappa value parameters
width
int256[]
array of width value parameters
amplitude
int256[]
array of amplitude value parameters
exponents
int256[]
array of exponent value parameters
inverseScaling
int256[]
array of inverse scaling value parameters
preExpScaling
int256[]
array of pre-exp scaling value parameters
newWeights
int256[]
array of new weights
signal
int256[]
array of signal values
normalizationFactor
int256
normalization factor for the weights
prevWeightLength
uint256
length of the previous weights
useRawPrice
bool
boolean to determine if raw price should be used or average