Documentation ¶
Index ¶
Constants ¶
const ( StatusOpen = int64(0) StatusFilled = int64(1) StatusUnfunded = int64(2) )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FillRecord ¶
type IndexConsumer ¶
type IndexConsumer struct {
// contains filtered or unexported fields
}
func NewIndexConsumer ¶
func NewIndexConsumer(db *gorm.DB, status int64, concurrency int) *IndexConsumer
func (*IndexConsumer) Consume ¶
func (consumer *IndexConsumer) Consume(msg channels.Delivery)
type Indexer ¶
type Indexer struct {
// contains filtered or unexported fields
}
func (*Indexer) RecordFill ¶
func (indexer *Indexer) RecordFill(fillRecord *FillRecord) error
RecordFill takes information about a filled order and updates the corresponding database record, if any exists.
type Order ¶
type Order struct { types.Order CreatedAt time.Time UpdatedAt time.Time OrderHash []byte `gorm:"primary_key"` Status int64 `gorm:"index"` Price float64 `gorm:"index:price"` FeeRate float64 `gorm:"index:price"` MakerTokenRemaining *types.Uint256 MakerFeeRemaining *types.Uint256 }
func (*Order) Save ¶
Save records the order in the database, defaulting to the specified status. Status should either be db.StatusOpen, or db.StatusUnfunded. If the order is filled based on order.TakerTokenAmountFilled + order.TakerTokenAmountCancelled the status will be recorded as db.StatusFilled regardless of the specified status.
type Pair ¶
Pair tracks pairs of tokens TokenA and TokenB
func GetAllTokenPairs ¶
GetAllTokenPairs returns an unfilitered list of Pairs based on the trading pairs currently present in the database, limited by a count and offset.
func GetTokenABPairs ¶
GetTokenABPairs returns a list of Pairs based on the trading pairs currrently present in the database, filtered to include only pairs that include both tokenA and tokenB. There should only be one distinct combination of both token pairs, so there is no offset or limit, but it still returns a list to provide the same return value as the other retrieval methods.
func GetTokenAPairs ¶
GetTokenAPairs returns a list of Pairs based on the trading pairs currrently present in the database, filtered to include only pairs that include tokenA and limited by a count and offset.
func (*Pair) MarshalJSON ¶
type RecordFillConsumer ¶
type RecordFillConsumer struct {
// contains filtered or unexported fields
}
func NewRecordFillConsumer ¶
func NewRecordFillConsumer(db *gorm.DB, concurrency int) *RecordFillConsumer
func (*RecordFillConsumer) Consume ¶
func (consumer *RecordFillConsumer) Consume(msg channels.Delivery)
type RecordSpendConsumer ¶
type RecordSpendConsumer struct {
// contains filtered or unexported fields
}
func NewRecordSpendConsumer ¶
func NewRecordSpendConsumer(db *gorm.DB, concurrency int) *RecordSpendConsumer
func (*RecordSpendConsumer) Consume ¶
func (consumer *RecordSpendConsumer) Consume(msg channels.Delivery)