Skip to main content

Preset

Implements​

  • Serializable

Table of contents​

Constructors​

Properties​

Methods​

Constructors​

constructor​

• new Preset(binStep?, baseFactor?, filterPeriod?, decayPeriod?, reductionFactor?, variableFeeControl?, protocolShare?, maxVolatilityAccumulated?, sampleLifetime?): Preset

Parameters​

NameTypeDefault valueDescription
binStepu320The bin step
baseFactoru320The base factor
filterPeriodu320The filter period, where the fees stays constant
decayPeriodu320The decay period, where the fees are halved
reductionFactoru320The reduction factor, used to calculate the reduction of the accumulator
variableFeeControlu320The variable fee control, used to control the variable fee, can be 0 to disable them
protocolShareu320The share of fees sent to protocol
maxVolatilityAccumulatedu320The max value of volatility accumulated
sampleLifetimeu320The value of volatility accumulated

Returns​

Preset

Defined in​

assembly/structs/Preset.ts:16

Properties​

baseFactor​

• baseFactor: u32 = 0

The base factor

Defined in​

assembly/structs/Preset.ts:18


binStep​

• binStep: u32 = 0

The bin step

Defined in​

assembly/structs/Preset.ts:17


decayPeriod​

• decayPeriod: u32 = 0

The decay period, where the fees are halved

Defined in​

assembly/structs/Preset.ts:20


filterPeriod​

• filterPeriod: u32 = 0

The filter period, where the fees stays constant

Defined in​

assembly/structs/Preset.ts:19


maxVolatilityAccumulated​

• maxVolatilityAccumulated: u32 = 0

The max value of volatility accumulated

Defined in​

assembly/structs/Preset.ts:24


protocolShare​

• protocolShare: u32 = 0

The share of fees sent to protocol

Defined in​

assembly/structs/Preset.ts:23


reductionFactor​

• reductionFactor: u32 = 0

The reduction factor, used to calculate the reduction of the accumulator

Defined in​

assembly/structs/Preset.ts:21


sampleLifetime​

• sampleLifetime: u32 = 0

The value of volatility accumulated

Defined in​

assembly/structs/Preset.ts:25


variableFeeControl​

• variableFeeControl: u32 = 0

The variable fee control, used to control the variable fee, can be 0 to disable them

Defined in​

assembly/structs/Preset.ts:22

Methods​

deserialize​

▸ deserialize(data, offset): Result<i32>

Parameters​

NameType
dataStaticArray<u8>
offseti32

Returns​

Result<i32>

Implementation of​

Serializable.deserialize

Defined in​

assembly/structs/Preset.ts:46


serialize​

▸ serialize(): StaticArray<u8>

Returns​

StaticArray<u8>

Implementation of​

Serializable.serialize

Defined in​

assembly/structs/Preset.ts:32