Class: GeometricKandelStatus
Title
Helper for getting status about a geometric Kandel instance.
Constructorsβ
constructorβ
β’ new GeometricKandelStatus(geometricDistributionHelper
): GeometricKandelStatus
Constructor
Parametersβ
Name | Type | Description |
---|---|---|
geometricDistributionHelper | GeometricKandelDistributionHelper | The GeometricKandelDistributionHelper instance. |
Returnsβ
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β
Name | Type | Description |
---|---|---|
midBaseQuoteTick | number | The mid tick. |
baseQuoteTicks | number [] | 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β
Name | Type | Description |
---|---|---|
midPrice | Big | The current mid price of the market used to discern expected bids from asks. |
baseQuoteTickOffset | number | The offset in ticks between two price points of the geometric distribution. |
pricePoints | number | The number of price points in the Kandel instance. |
stepSize | number | The step size used when transporting funds from an offer to its dual. |
offers | Object | The offers to determine the status of. |
offers.bids | OffersWithLiveness | - |
offers.asks | OffersWithLiveness | - |
Returnsβ
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