Documentation ¶
Index ¶
- Constants
- func PositionTypeForLiq(loc LiquidityLocation) string
- type BookLocation
- type ChainId
- type EthAddress
- type EthStorageHash
- type EthTxHash
- type EthTxHeader
- type KOClaimLocation
- type LiquidityLocation
- type NetworkName
- type PoolEventDescriptor
- type PoolEventFlow
- type PoolLocation
- type PoolPriceLiq
- type PoolRangeFields
- type PoolTxEvent
- type PositionLocation
- type TokenMetadata
- type TokenPairMetadata
- type UserBalance
Constants ¶
View Source
const MAX_CHAIN_LENGTH = 12
Arbitrary, but a chain ID hex address should never be more than 8 digits (plus leading 0x).
Variables ¶
This section is empty.
Functions ¶
func PositionTypeForLiq ¶
func PositionTypeForLiq(loc LiquidityLocation) string
Types ¶
type BookLocation ¶
type BookLocation struct { PoolLocation LiquidityLocation }
func (BookLocation) ToClaimLoc ¶
func (l BookLocation) ToClaimLoc(user EthAddress, pivotTime int) KOClaimLocation
func (BookLocation) ToPositionLocation ¶
func (l BookLocation) ToPositionLocation(user EthAddress) PositionLocation
type EthAddress ¶
type EthAddress string
func RequireEthAddr ¶
func RequireEthAddr(arg string) EthAddress
func ValidateEthAddr ¶
func ValidateEthAddr(arg string) EthAddress
type EthStorageHash ¶
type EthStorageHash string
type EthTxHeader ¶
type EthTxHeader struct { BlockNum int `json:"blockNum"` TxHash EthTxHash `json:"txHash"` TxTime int `json:"txTime"` User EthAddress `json:"user"` }
type KOClaimLocation ¶
type KOClaimLocation struct { PositionLocation PivotTime int `json:"pivotTime"` }
type LiquidityLocation ¶
type LiquidityLocation struct { BidTick int `json:"bidTick"` AskTick int `json:"askTick"` IsBid bool `json:"isBid"` // Defaults to false if not valid }
func AmbientLiquidityLocation ¶
func AmbientLiquidityLocation() LiquidityLocation
func KnockoutRangeLocation ¶
func KnockoutRangeLocation(bidTick int, askTick int, isBid bool) LiquidityLocation
func KnockoutTickLocation ¶
func KnockoutTickLocation(tick int, isBid bool, tickWidth int) LiquidityLocation
func RangeLiquidityLocation ¶
func RangeLiquidityLocation(bidTick int, askTick int) LiquidityLocation
func (LiquidityLocation) PivotTick ¶
func (l LiquidityLocation) PivotTick() int
type NetworkName ¶
type NetworkName string
type PoolEventDescriptor ¶
type PoolEventFlow ¶
type PoolLocation ¶
type PoolLocation struct { ChainId ChainId `json:"chainId"` Base EthAddress `json:"base"` Quote EthAddress `json:"quote"` PoolIdx int `json:"poolIdx"` }
type PoolPriceLiq ¶
type PoolRangeFields ¶
type PoolTxEvent ¶
type PoolTxEvent struct { EthTxHeader PoolLocation PoolEventFlow PoolEventDescriptor PoolRangeFields }
type PositionLocation ¶
type PositionLocation struct { PoolLocation LiquidityLocation User EthAddress `json:"user"` }
func (PositionLocation) ToBookLoc ¶
func (l PositionLocation) ToBookLoc() BookLocation
func (PositionLocation) ToClaimLoc ¶
func (l PositionLocation) ToClaimLoc(pivot int) KOClaimLocation
type TokenMetadata ¶
type TokenPairMetadata ¶
type TokenPairMetadata struct { BaseDecimals int `json:"baseDecimals"` BaseSymbol string `json:"baseSymbol"` QuoteDecimals int `json:"quoteDecimals"` QuoteSymbol string `json:"quoteSymbol"` }
func PairTokenMetadata ¶
func PairTokenMetadata(base TokenMetadata, quote TokenMetadata) TokenPairMetadata
type UserBalance ¶
type UserBalance struct { Token EthAddress `json:"token"` Balance big.Int `json:"balance"` }
Click to show internal directories.
Click to hide internal directories.