Skip to main content

Class: GeometricKandelDistributionHelper

Title

Helper for handling geometric Kandel offer distributions.

Constructors​

constructor​

β€’ new GeometricKandelDistributionHelper(market): GeometricKandelDistributionHelper

Constructor

Parameters​

NameTypeDescription
marketKeyResolvedForCalculationThe key data about the market.

Returns​

GeometricKandelDistributionHelper

Defined in​

@mangrovedao/mangrove.js/src/kandel/geometricKandel/geometricKandelDistributionHelper.ts:55

Properties​

helper​

β€’ helper: KandelDistributionHelper

Defined in​

@mangrovedao/mangrove.js/src/kandel/geometricKandel/geometricKandelDistributionHelper.ts:50

Methods​

getBaseQuoteTicksFromTick​

β–Έ getBaseQuoteTicksFromTick(offerType, index, tickAtIndex, baseQuoteTickOffset, pricePoints): number[]

Gets the ticks for the geometric distribution based on a single known tick at an index.

Parameters​

NameTypeDescription
offerTypeBAThe offer type.
indexnumberThe index of the known price.
tickAtIndexnumberThe known tick (the tick price of base per quote for bids and quote per base for asks).
baseQuoteTickOffsetnumberThe offset in ticks between two price points of the geometric distribution.
pricePointsnumberThe number of price points in the distribution.

Returns​

number[]

The quote per base ticks in the distribution.

Defined in​

@mangrovedao/mangrove.js/src/kandel/geometricKandel/geometricKandelDistributionHelper.ts:67


calculateBaseQuoteTickOffset​

β–Έ calculateBaseQuoteTickOffset(priceRatio): number

Calculates the base quote tick offset closely corresponding to the given ratio.

Parameters​

NameTypeDescription
priceRatioBigthe price ratio.

Returns​

number

The base quote tick offset.

Defined in​

@mangrovedao/mangrove.js/src/kandel/geometricKandel/geometricKandelDistributionHelper.ts:94


getPriceRatioFromBaseQuoteOffset​

β–Έ getPriceRatioFromBaseQuoteOffset(baseQuoteTickOffset): Big

Gets the price ratio given by the baseQuoteTickOffset.

Parameters​

NameTypeDescription
baseQuoteTickOffsetnumberThe base quote tick offset.

Returns​

Big

The price ratio.

Defined in​

@mangrovedao/mangrove.js/src/kandel/geometricKandel/geometricKandelDistributionHelper.ts:116


getTickDistributionParams​

β–Έ getTickDistributionParams(params): Object

Gets tick based parameters for a distribution based on tick or price params.

Parameters​

NameTypeDescription
paramsOmit<DistributionParams, "generateFromMid">The distribution parameters, see DistributionParams

Returns​

Object

The tick based parameters, see TickDistributionParams

NameType
minBaseQuoteTicknumber
baseQuoteTickOffsetnumber
midBaseQuoteTicknumber
pricePointsnumber

Defined in​

@mangrovedao/mangrove.js/src/kandel/geometricKandel/geometricKandelDistributionHelper.ts:129

  • Constructors
    • constructor
  • Properties
    • helper
  • Methods
    • getBaseQuoteTicksFromTick
    • calculateBaseQuoteTickOffset
    • getPriceRatioFromBaseQuoteOffset
    • getTickDistributionParams