types

package
v0.0.0-...-baf6593 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DaemonLiquidationInfo

type DaemonLiquidationInfo struct {
	sync.Mutex // lock
	// contains filtered or unexported fields
}

DaemonLiquidationInfo maintains the list of subaccount ids to be liquidated in the next block. Methods are goroutine safe.

func NewDaemonLiquidationInfo

func NewDaemonLiquidationInfo() *DaemonLiquidationInfo

NewDaemonLiquidationInfo creates a new `NewDaemonLiquidationInfo` struct.

func (*DaemonLiquidationInfo) GetBlockHeight

func (ls *DaemonLiquidationInfo) GetBlockHeight() uint32

GetBlockHeight returns the block height of the last update.

func (*DaemonLiquidationInfo) GetLiquidatableSubaccountIds

func (ls *DaemonLiquidationInfo) GetLiquidatableSubaccountIds() []satypes.SubaccountId

GetLiquidatableSubaccountIds returns the list of potentially liquidatable subaccount ids reported by the liquidation daemon.

func (*DaemonLiquidationInfo) GetNegativeTncSubaccountIds

func (ls *DaemonLiquidationInfo) GetNegativeTncSubaccountIds() []satypes.SubaccountId

GetNegativeTncSubaccountIds returns the list of subaccount ids with negative total net collateral reported by the liquidation daemon.

func (*DaemonLiquidationInfo) GetSubaccountsWithPositions

func (ls *DaemonLiquidationInfo) GetSubaccountsWithPositions() map[uint32]*clobtypes.SubaccountOpenPositionInfo

GetSubaccountsWithPositions returns the list of subaccount ids with open positions.

func (*DaemonLiquidationInfo) UpdateBlockHeight

func (ls *DaemonLiquidationInfo) UpdateBlockHeight(blockHeight uint32)

UpdateBlockHeight updates the struct with the given block height.

func (*DaemonLiquidationInfo) UpdateLiquidatableSubaccountIds

func (ls *DaemonLiquidationInfo) UpdateLiquidatableSubaccountIds(updates []satypes.SubaccountId)

UpdateLiquidatableSubaccountIds updates the struct with the given a list of potentially liquidatable subaccount ids.

func (*DaemonLiquidationInfo) UpdateNegativeTncSubaccountIds

func (ls *DaemonLiquidationInfo) UpdateNegativeTncSubaccountIds(updates []satypes.SubaccountId)

UpdateNegativeTncSubaccountIds updates the struct with the given a list of subaccount ids with negative total net collateral.

func (*DaemonLiquidationInfo) UpdateSubaccountsWithPositions

func (ls *DaemonLiquidationInfo) UpdateSubaccountsWithPositions(
	subaccountsWithPositions []clobtypes.SubaccountOpenPositionInfo,
)

UpdateSubaccountsWithPositions updates the struct with the given a list of subaccount ids with open positions.

Jump to

Keyboard shortcuts

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