Skip to main content

Class: GeneralKandelDistributionGenerator

Title

Helper for generating general Kandel distributions with fully specified bids and asks with tick and volumes.

Constructors​

constructor​

β€’ new GeneralKandelDistributionGenerator(generalDistributionHelper): GeneralKandelDistributionGenerator

Parameters​

NameType
generalDistributionHelperGeneralKandelDistributionHelper

Returns​

GeneralKandelDistributionGenerator

Defined in​

@mangrovedao/mangrove.js/src/kandel/generalKandelDistributionGenerator.ts:11

Properties​

generalDistributionHelper​

β€’ generalDistributionHelper: GeneralKandelDistributionHelper

Defined in​

@mangrovedao/mangrove.js/src/kandel/generalKandelDistributionGenerator.ts:9

Methods​

uniformlyChangeVolume​

β–Έ uniformlyChangeVolume(params): Object

Creates a new distribution with uniformly changed volume.

Parameters​

NameTypeDescription
paramsObjectThe parameters for the change.
params.distributionKandelDistributionThe distribution to change.
params.baseDelta?BigSourceThe change in base volume.
params.quoteDelta?BigSourceThe change in quote volume.
params.minimumBasePerOfferBigSourceThe minimum amount of base to give for each offer. Should be at least minimumBasePerOfferFactor from KandelConfiguration multiplied with the minimum volume for the market.
params.minimumQuotePerOfferBigSourceThe minimum amount of quote to give for each offer. Should be at least minimumQuotePerOfferFactor from KandelConfiguration multiplied with the minimum volume for the market.

Returns​

Object

The new distribution.

NameType
distributionGeneralKandelDistribution
totalBaseChangeBig
totalQuoteChangeBig

Remarks

The decrease has to respect minimums, and thus may decrease some offers more than others.

Defined in​

@mangrovedao/mangrove.js/src/kandel/generalKandelDistributionGenerator.ts:27


createDistributionWithOffers​

β–Έ createDistributionWithOffers(params): GeneralKandelDistribution

Creates a distribution based on an explicit set of offers. Either based on an original distribution or parameters for one.

Parameters​

NameTypeDescription
paramsObjectThe parameters for the distribution.
params.explicitOffersObjectThe explicit offers to use.
params.explicitOffers.bidsOffersWithGives-
params.explicitOffers.asksOffersWithGives-
params.distributionKandelDistribution | { pricePoints: number ; stepSize: number }The original distribution or parameters for one. If pricePoints is not provided, then the number of offers is used.

Returns​

GeneralKandelDistribution

The new distribution.

Defined in​

@mangrovedao/mangrove.js/src/kandel/generalKandelDistributionGenerator.ts:56