Skip to main content

Class: GeneralKandelDistributionHelper

Title

Helper for handling general Kandel offer distributions.

Constructors​

constructor​

β€’ new GeneralKandelDistributionHelper(helper): GeneralKandelDistributionHelper

Parameters​

NameType
helperKandelDistributionHelper

Returns​

GeneralKandelDistributionHelper

Defined in​

@mangrovedao/mangrove.js/src/kandel/generalKandelDistributionHelper.ts:12

Properties​

helper​

β€’ helper: KandelDistributionHelper

Defined in​

@mangrovedao/mangrove.js/src/kandel/generalKandelDistributionHelper.ts:10

Methods​

createDistributionWithOffers​

β–Έ createDistributionWithOffers(explicitOffers, distribution): GeneralKandelDistribution

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

Parameters​

NameTypeDescription
explicitOffersObjectThe explicit offers to use.
explicitOffers.bidsOffersWithGivesThe explicit bids to use.
explicitOffers.asksOffersWithGivesThe explicit asks to use.
distributionKandelDistribution | { pricePoints: number ; stepSize: number }The original distribution. If pricePoints is not provided, then the number of offers is used.

Returns​

GeneralKandelDistribution

The new distribution.

Defined in​

@mangrovedao/mangrove.js/src/kandel/generalKandelDistributionHelper.ts:23


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?BigThe change in base volume.
params.quoteDelta?BigThe change in quote volume.
params.minimumBasePerOfferBigThe minimum base per offer. Only applies for decrease in base volume.
params.minimumQuotePerOfferBigThe minimum quote per offer. Only applies for decrease in quote volume.

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/generalKandelDistributionHelper.ts:59