Skip to main content

Class: GeometricKandelStatus

Title

Helper for getting status about a geometric Kandel instance.

Constructors​

constructor​

β€’ new GeometricKandelStatus(geometricDistributionHelper): GeometricKandelStatus

Constructor

Parameters​

NameTypeDescription
geometricDistributionHelperGeometricKandelDistributionHelperThe GeometricKandelDistributionHelper instance.

Returns​

GeometricKandelStatus

Defined in​

@mangrovedao/mangrove.js/src/kandel/geometricKandel/geometricKandelStatus.ts:91

Properties​

geometricDistributionHelper​

β€’ geometricDistributionHelper: GeometricKandelDistributionHelper

Defined in​

@mangrovedao/mangrove.js/src/kandel/geometricKandel/geometricKandelStatus.ts:86

Methods​

getIndexOfPriceClosestToMid​

β–Έ getIndexOfPriceClosestToMid(midBaseQuoteTick, baseQuoteTicks): number

Gets the index of the offer with a price closest to the mid price (since precision matters most there since it is used to distinguish expected dead from live.)

Parameters​

NameTypeDescription
midBaseQuoteTicknumberThe mid tick.
baseQuoteTicksnumber[]The ticks of the offers.

Returns​

number

The index of the offer with a price closest to the mid price.

Defined in​

@mangrovedao/mangrove.js/src/kandel/geometricKandel/geometricKandelStatus.ts:102


getOfferStatuses​

β–Έ getOfferStatuses(midPrice, baseQuoteTickOffset, pricePoints, stepSize, offers): Statuses

Determines the status of the Kandel instance based on the passed in offers.

Parameters​

NameTypeDescription
midPriceBigThe current mid price of the market used to discern expected bids from asks.
baseQuoteTickOffsetnumberThe offset in ticks between two price points of the geometric distribution.
pricePointsnumberThe number of price points in the Kandel instance.
stepSizenumberThe step size used when transporting funds from an offer to its dual.
offersObjectThe offers to determine the status of.
offers.bidsOffersWithLiveness-
offers.asksOffersWithLiveness-

Returns​

Statuses

The status of the Kandel instance.

Remarks

The expected prices are determined by extrapolating from an offer closest to the mid price. Offers are expected to be live bids below the mid price and asks above. Offers are expected to be dead near the mid price due to the step size between the live bid and ask.

Defined in​

@mangrovedao/mangrove.js/src/kandel/geometricKandel/geometricKandelStatus.ts:127