Class: KandelSeeder
Seeder for creating Kandel instances on-chain.
Constructorsβ
constructorβ
β’ new KandelSeeder(mgv
): KandelSeeder
Constructor
Parametersβ
Name | Type | Description |
---|---|---|
mgv | Mangrove | The Mangrove to deploy to. |
Returnsβ
Defined inβ
@mangrovedao/mangrove.js/src/kandel/kandelSeeder.ts:37
Propertiesβ
mgvβ
β’ mgv: Mangrove
Defined inβ
@mangrovedao/mangrove.js/src/kandel/kandelSeeder.ts:27
configurationβ
β’ configuration: KandelConfiguration
Defined inβ
@mangrovedao/mangrove.js/src/kandel/kandelSeeder.ts:28
tradeEventManagementβ
β’ tradeEventManagement: TradeEventManagement
Defined inβ
@mangrovedao/mangrove.js/src/kandel/kandelSeeder.ts:29
aaveKandelSeederβ
β’ aaveKandelSeeder: AaveKandelSeeder
Defined inβ
@mangrovedao/mangrove.js/src/kandel/kandelSeeder.ts:31
kandelSeederβ
β’ kandelSeeder: KandelSeeder
Defined inβ
@mangrovedao/mangrove.js/src/kandel/kandelSeeder.ts:32
Methodsβ
sowβ
βΈ sow(seed
, overrides?
): Promise
<Transaction
<GeometricKandelInstance
>>
Create a new Kandel instance.
Parametersβ
Name | Type | Description |
---|---|---|
seed | KandelSeed | The parameters for sowing the Kandel instance. |
overrides | Overrides | - |
Returnsβ
Promise
<Transaction
<GeometricKandelInstance
>>
Defined inβ
@mangrovedao/mangrove.js/src/kandel/kandelSeeder.ts:62
getKandelFromReceiptβ
βΈ getKandelFromReceipt(params
): Promise
<GeometricKandelInstance
>
Gets the Kandel instance created in a transaction via sow.
Parametersβ
Name | Type | Description |
---|---|---|
params | Object | The parameters. |
params.receipt | ContractReceipt | The receipt of the transaction. |
params.onAave | boolean | Whether the Kandel is an AaveKandel. |
params.market | Market | The market the Kandel is for. |
Returnsβ
Promise
<GeometricKandelInstance
>
The Kandel instance created in the transaction.
Defined inβ
@mangrovedao/mangrove.js/src/kandel/kandelSeeder.ts:105
getDefaultGasreqβ
βΈ getDefaultGasreq(onAave
): Promise
<number
>
Retrieves the default gasreq for the Kandel type.
Parametersβ
Name | Type | Description |
---|---|---|
onAave | boolean | Whether to get the gasreq for an AaveKandel or a standard Kandel. |
Returnsβ
Promise
<number
>
The gasreq for the Kandel type.
Defined inβ
@mangrovedao/mangrove.js/src/kandel/kandelSeeder.ts:145
getBufferedGaspriceβ
βΈ getBufferedGasprice(gaspriceFactor
, gasprice?
): Promise
<number
>
Retrieves the gasprice for the Kandel type multiplied by the buffer factor.
Parametersβ
Name | Type | Description |
---|---|---|
gaspriceFactor | number | The factor to multiply the gasprice by. This is used to ensure that the Kandel offers do not fail to be reposted even if Mangrove's gasprice increases up to this. |
gasprice? | number | The gasprice (in Mwei) to use for the Kandel (before multiplying with the factor). If null, then Mangrove's global gasprice will be used. |
Returnsβ
Promise
<number
>
The gasprice for the Kandel type multiplied by the buffer factor.
Defined inβ
@mangrovedao/mangrove.js/src/kandel/kandelSeeder.ts:158
getRequiredProvisionβ
βΈ getRequiredProvision(seed
, distribution
, gaspriceFactor?
, gasprice?
, gasreq?
): Promise
<Big
>
Determines the required provision for the distribution prior to sowing based on the number of price points.
Parametersβ
Name | Type | Description |
---|---|---|
seed | KandelSeed | The parameters for sowing the Kandel instance. |
distribution | KandelDistribution | The distribution to determine the provision for. |
gaspriceFactor? | number | The factor to multiply the gasprice by. This is used to ensure that the Kandel offers do not fail to be reposted even if Mangrove's gasprice increases up to this. If null, then the default gaspriceFactor for the market will be used. |
gasprice? | number | The gasprice (in Mwei) to use for the Kandel (before multiplying with the factor). If null, then Mangrove's global gasprice will be used. |
gasreq? | number | The gasreq to use for the Kandel. If null, then the default gasreq for the Kandel type will be used. |
Returnsβ
Promise
<Big
>
The provision required for the distribution.
Remarks
This takes into account that each price point can become both an ask and a bid which both require provision.
Defined inβ
@mangrovedao/mangrove.js/src/kandel/kandelSeeder.ts:171
getMinimumVolumeβ
βΈ getMinimumVolume(params
): Promise
<Big
>
Determines the minimum recommended volume for an offer of the given type to avoid density issues.
Parametersβ
Name | Type | Description |
---|---|---|
params | Object | The parameters. |
params.market | Market | The market the Kandel is deployed to. |
params.offerType | BA | The type of offer. |
params.onAave | boolean | Whether the Kandel is an AaveKandel. |
params.factor? | number | The factor to multiply the minimum volume by. Defaults to minimumBasePerOfferFactory / minimumQuotePerOfferFactor from KandelConfiguration. |
Returnsβ
Promise
<Big
>
The minimum recommended volume.
Defined inβ
@mangrovedao/mangrove.js/src/kandel/kandelSeeder.ts:197
getMinimumVolumeForGasreqβ
βΈ getMinimumVolumeForGasreq(params
): Big
Determines the minimum recommended volume for an offer of the given type to avoid density issues.
Parametersβ
Name | Type | Description |
---|---|---|
params | Object | The parameters. |
params.market | Market | The market the Kandel is deployed to. |
params.offerType | BA | The type of offer. |
params.factor? | number | The factor to multiply the minimum volume by. Defaults to minimumBasePerOfferFactory / minimumQuotePerOfferFactor from KandelConfiguration. |
params.gasreq | number | The gasreq to use. |
Returnsβ
Big
The minimum recommended volume.
Defined inβ
@mangrovedao/mangrove.js/src/kandel/kandelSeeder.ts:215