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) GetUsersBasedOnBlockNumberTrade(blockNumber int64, trader string) (User, error)
- func (m *Client) InBTCInverseContractWhiteList(perpID string) (bool, string)
- func (m *Client) InETHInverseContractWhiteList(perpID string) (bool, string)
- func (m *Client) InSATSInverseContractWhiteList(perpID string) (bool, string)
- type Errors
- type GraphInterface
- type MarginAccount
- type MarkPrice
- type MultiClient
- type MultiGraphInterface
- type User
- type Whitelist
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) GetUsersBasedOnBlockNumberTrade ¶ added in v0.0.82
func (*Client) InBTCInverseContractWhiteList ¶
func (*Client) InETHInverseContractWhiteList ¶
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, base) if this contract is inverse white list InBTCInverseContractWhiteList(perpID string) (bool, string) // InETHInverseContractWhiteList return (true, base) if this contract is inverse white list InETHInverseContractWhiteList(perpID string) (bool, string) // InSATSInverseContractWhiteList return (true, base) if this contract is inverse white list InSATSInverseContractWhiteList(perpID string) (bool, string) // GetPerpIDWithUSDBased get perpetual id depend on symbol. GetPerpIDWithUSDBased(symbol string) (string, error) }
type MarginAccount ¶
type MarginAccount struct { ID string `json:"id"` Position decimal.Decimal `json:"position"` TotalFee decimal.Decimal `json:"totalFee"` VaultFee decimal.Decimal `json:"vaultFee"` OperatorFee decimal.Decimal `json:"operatorFee"` TotalFeeFactor decimal.Decimal `json:"totalFeeFactor"` VaultFeeFactor decimal.Decimal `json:"vaultFeeFactor"` OperatorFeeFactor decimal.Decimal `json:"operatorFeeFactor"` }
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 ¶
type User ¶
type User struct { ID string `json:"id"` StakedMCB decimal.Decimal `json:"stakedMCB"` UnlockMCBTime int64 `json:"unlockMCBTime"` MarginAccounts []*MarginAccount }
type Whitelist ¶ added in v0.0.76
type Whitelist struct {
// contains filtered or unexported fields
}
func NewWhiteList ¶ added in v0.0.76
NewWhiteList makes sure order of contract address. index = 0 should be USD, index = 1 should be BTC, index = 2 should be ETH.
Click to show internal directories.
Click to hide internal directories.