liquidity

package
v0.61.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuctionState

type AuctionState interface {
	IsOpeningAuction() bool
	IsLiquidityAuction() bool
	IsLiquidityExtension() bool
	StartLiquidityAuction(t time.Time, d *types.AuctionDuration)
	SetReadyToLeave()
	InAuction() bool
	ExtendAuctionLiquidity(delta types.AuctionDuration)
	ExpiresAt() *time.Time
}

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

func (*Engine) CheckLiquidity

func (e *Engine) CheckLiquidity(as AuctionState, t time.Time, currentStake *num.Uint, trades []*types.Trade,
	rf types.RiskFactor, refPrice *num.Uint, bestStaticBidVolume, bestStaticAskVolume uint64, persistent bool,
) bool

CheckLiquidity Starts or Ends a Liquidity auction given the current and target stakes along with best static bid and ask volumes. The constant c1 represents the netparam `MarketLiquidityTargetStakeTriggeringRatio`, "true" gets returned if non-persistent order should be rejected.

func (*Engine) SetMinDuration

func (e *Engine) SetMinDuration(d time.Duration)

func (*Engine) UpdateParameters

func (e *Engine) UpdateParameters(params *types.LiquidityMonitoringParameters)

func (*Engine) UpdateTargetStakeTriggerRatio

func (e *Engine) UpdateTargetStakeTriggerRatio(ctx context.Context, ratio num.Decimal)

type TargetStakeCalculator

type TargetStakeCalculator interface {
	GetTheoreticalTargetStake(rf types.RiskFactor, now time.Time, markPrice *num.Uint, trades []*types.Trade) *num.Uint
}

TargetStakeCalculator interface

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL