Class: GeometricKandelDistributionHelper
Title
Helper for handling geometric Kandel offer distributions.
Constructorsβ
constructorβ
β’ new GeometricKandelDistributionHelper(market
): GeometricKandelDistributionHelper
Constructor
Parametersβ
Name | Type | Description |
---|---|---|
market | KeyResolvedForCalculation | The 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β
Name | Type | Description |
---|---|---|
offerType | BA | The offer type. |
index | number | The index of the known price. |
tickAtIndex | number | The known tick (the tick price of base per quote for bids and quote per base for asks). |
baseQuoteTickOffset | number | The offset in ticks between two price points of the geometric distribution. |
pricePoints | number | The 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β
Name | Type | Description |
---|---|---|
priceRatio | Big | the 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β
Name | Type | Description |
---|---|---|
baseQuoteTickOffset | number | The 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β
Name | Type | Description |
---|---|---|
params | Omit <DistributionParams , "generateFromMid" > | The distribution parameters, see DistributionParams |
Returnsβ
Object
The tick based parameters, see TickDistributionParams
Name | Type |
---|---|
minBaseQuoteTick | number |
baseQuoteTickOffset | number |
midBaseQuoteTick | number |
pricePoints | number |
Defined inβ
@mangrovedao/mangrove.js/src/kandel/geometricKandel/geometricKandelDistributionHelper.ts:129