Documentation ¶
Index ¶
- Variables
- type Client
- func (m *Client) GetMarkPriceWithBlockNumberAddrIndex(blockNumber int64, poolAddr string, perpIndex int) (decimal.Decimal, error)
- func (m *Client) GetMarkPrices(blockNumber int64) (map[string]decimal.Decimal, error)
- func (m *Client) GetPerpIDWithUSDBased(symbol string) (string, error)
- func (m *Client) GetUsersBasedOnBlockNumber(blockNumber int64) ([]User, error)
- func (m *Client) InBTCInverseContractWhiteList(perpID string) (bool, string)
- func (m *Client) InETHInverseContractWhiteList(perpID string) (bool, string)
- type GraphInterface
- type MarginAccount
- type MarkPrice
- type MultiClient
- type MultiGraphInterface
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrBlockLengthNotEqualMAI3 = errors.New("length of block graph not equal to mai3 graph")
)
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetMarkPriceWithBlockNumberAddrIndex ¶
func (m *Client) GetMarkPriceWithBlockNumberAddrIndex( blockNumber int64, poolAddr string, perpIndex int) (decimal.Decimal, error)
GetMarkPriceWithBlockNumberAddrIndex get mark price based on block number, pool address, perpetual index.
func (*Client) GetMarkPrices ¶
GetMarkPrices get mark prices with block number. return map[markPriceID]price
func (*Client) GetPerpIDWithUSDBased ¶
func (*Client) GetUsersBasedOnBlockNumber ¶
GetUsersBasedOnBlockNumber get users based on blockNumber.
func (*Client) InBTCInverseContractWhiteList ¶
type GraphInterface ¶
type GraphInterface interface { GetUsersBasedOnBlockNumber(blockNumber int64) ([]User, error) GetMarkPrices(blockNumber int64) (map[string]decimal.Decimal, error) GetMarkPriceWithBlockNumberAddrIndex( blockNumber int64, poolAddr string, perpIndex int) (decimal.Decimal, error) // InBTCInverseContractWhiteList return (true, quote) if this contract is inverse white list InBTCInverseContractWhiteList(perpID string) (bool, string) // InETHInverseContractWhiteList return (true, quote) if this contract is inverse white list InETHInverseContractWhiteList(perpID string) (bool, string) // GetPerpIDWithUSDBased get perpetual id depend on symbol. GetPerpIDWithUSDBased(symbol string) (string, error) }
type MarginAccount ¶
type MultiClient ¶
type MultiClient struct {
// contains filtered or unexported fields
}
func NewMultiClient ¶
func NewMultiClient(logger logging.Logger, clients []GraphInterface) *MultiClient
func (*MultiClient) GetMai3GraphInterface ¶
func (c *MultiClient) GetMai3GraphInterface(index int) (GraphInterface, error)
func (*MultiClient) GetMultiMarkPrices ¶
GetMultiMarkPrices the order of clients need to match blockNumbers
func (*MultiClient) GetMultiUsersBasedOnMultiBlockNumbers ¶
func (c *MultiClient) GetMultiUsersBasedOnMultiBlockNumbers(blockNumbers []int64) ([][]User, error)
GetMultiUsersBasedOnMultiBlockNumbers the order of clients need to match blockNumbers, return 2-D users
type MultiGraphInterface ¶
Click to show internal directories.
Click to hide internal directories.