Skip to main content

Class: KandelSeeder

Seeder for creating Kandel instances on-chain.

Constructors​

constructor​

β€’ new KandelSeeder(mgv): KandelSeeder

Constructor

Parameters​

NameTypeDescription
mgvMangroveThe Mangrove to deploy to.

Returns​

KandelSeeder

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​

NameTypeDescription
seedKandelSeedThe parameters for sowing the Kandel instance.
overridesOverrides-

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​

NameTypeDescription
paramsObjectThe parameters.
params.receiptContractReceiptThe receipt of the transaction.
params.onAavebooleanWhether the Kandel is an AaveKandel.
params.marketMarketThe 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​

NameTypeDescription
onAavebooleanWhether 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​

NameTypeDescription
gaspriceFactornumberThe 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?numberThe 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​

NameTypeDescription
seedKandelSeedThe parameters for sowing the Kandel instance.
distributionKandelDistributionThe distribution to determine the provision for.
gaspriceFactor?numberThe 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?numberThe gasprice (in Mwei) to use for the Kandel (before multiplying with the factor). If null, then Mangrove's global gasprice will be used.
gasreq?numberThe 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​

NameTypeDescription
paramsObjectThe parameters.
params.marketMarketThe market the Kandel is deployed to.
params.offerTypeBAThe type of offer.
params.onAavebooleanWhether the Kandel is an AaveKandel.
params.factor?numberThe 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​

NameTypeDescription
paramsObjectThe parameters.
params.marketMarketThe market the Kandel is deployed to.
params.offerTypeBAThe type of offer.
params.factor?numberThe factor to multiply the minimum volume by. Defaults to minimumBasePerOfferFactory / minimumQuotePerOfferFactor from KandelConfiguration.
params.gasreqnumberThe gasreq to use.

Returns​

Big

The minimum recommended volume.

Defined in​

@mangrovedao/mangrove.js/src/kandel/kandelSeeder.ts:215

  • Constructors
    • constructor
  • Properties
    • mgv
    • configuration
    • tradeEventManagement
    • aaveKandelSeeder
    • kandelSeeder
  • Methods
    • sow
    • getKandelFromReceipt
    • getDefaultGasreq
    • getBufferedGasprice
    • getRequiredProvision
    • getMinimumVolume
    • getMinimumVolumeForGasreq