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β
| Name | Type | 
|---|---|
| generalDistributionHelper | GeneralKandelDistributionHelper | 
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β
| Name | Type | Description | 
|---|---|---|
| params | Object | The parameters for the change. | 
| params.distribution | KandelDistribution | The distribution to change. | 
| params.baseDelta? | BigSource | The change in base volume. | 
| params.quoteDelta? | BigSource | The change in quote volume. | 
| params.minimumBasePerOffer | BigSource | The 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.minimumQuotePerOffer | BigSource | The 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.
| 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/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β
| Name | Type | Description | 
|---|---|---|
| params | Object | The parameters for the distribution. | 
| params.explicitOffers | Object | The explicit offers to use. | 
| params.explicitOffers.bids | OffersWithGives | - | 
| params.explicitOffers.asks | OffersWithGives | - | 
| params.distribution | KandelDistribution| {pricePoints:number;stepSize:number} | The original distribution or parameters for one. If pricePoints is not provided, then the number of offers is used. | 
Returnsβ
The new distribution.
Defined inβ
@mangrovedao/mangrove.js/src/kandel/generalKandelDistributionGenerator.ts:56