Class: GeneralKandelDistributionHelper
Title
Helper for handling general Kandel offer distributions.
Constructorsβ
constructorβ
β’ new GeneralKandelDistributionHelper(helper
): GeneralKandelDistributionHelper
Parametersβ
Name | Type |
---|---|
helper | KandelDistributionHelper |
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β
Name | Type | Description |
---|---|---|
explicitOffers | Object | The explicit offers to use. |
explicitOffers.bids | OffersWithGives | The explicit bids to use. |
explicitOffers.asks | OffersWithGives | The explicit asks to use. |
distribution | KandelDistribution | { pricePoints : number ; stepSize : number } | The original distribution. If pricePoints is not provided, then the number of offers is used. |
Returnsβ
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β
Name | Type | Description |
---|---|---|
params | Object | The parameters for the change. |
params.distribution | KandelDistribution | The distribution to change. |
params.baseDelta? | Big | The change in base volume. |
params.quoteDelta? | Big | The change in quote volume. |
params.minimumBasePerOffer | Big | The minimum base per offer. Only applies for decrease in base volume. |
params.minimumQuotePerOffer | Big | The minimum quote per offer. Only applies for decrease in quote volume. |
Returnsβ
Object
The new distribution.
Name | Type |
---|---|
distribution | GeneralKandelDistribution |
totalBaseChange | Big |
totalQuoteChange | Big |
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