tables

package
v0.0.0-...-c8ab65e Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggEvent

type AggEvent struct {
	ID            string  `json:"id" db:"id"`
	EventIndex    int     `json:"eventIndex" db:"eventIndex"`
	Network       string  `json:"network" db:"network"`
	TX            string  `json:"tx" db:"tx"`
	Base          string  `json:"base" db:"base"`
	Quote         string  `json:"quote" db:"quote"`
	PoolIdx       int     `json:"poolIdx" db:"poolIdx"`
	PoolHash      string  `json:"poolHash" db:"poolHash"`
	User          string  `json:"user" db:"user"`
	Block         int     `json:"block" db:"block"`
	Time          int     `json:"time" db:"time"`
	BidTick       int     `json:"bidTick" db:"bidTick"`
	AskTick       int     `json:"askTick" db:"askTick"`
	SwapPrice     string  `json:"swapPrice"`
	IsFeeChange   bool    `json:"isFeeChange" db:"isFeeChange"`
	IsSwap        bool    `json:"isSwap" db:"isSwap"`
	IsLiq         bool    `json:"isLiq" db:"isLiq"`
	IsTickSkewed  bool    `json:"isTickSkewed" db:"isTickSkewed"`
	FlowsAtMarket bool    `json:"flowsAtMarket" db:"flowsAtMarket"`
	InBaseQty     bool    `json:"inBaseQty" db:"inBaseQty"`
	BaseFlow      float64 `json:"baseFlow" db:"baseFlow"`
	QuoteFlow     float64 `json:"quoteFlow" db:"quoteFlow"`
	FeeRate       int     `json:"feeRate" db:"feeRate"`
	Source        string  `json:"source" db:"source"`
}

type AggEventSubGraph

type AggEventSubGraph struct {
	ID              string `json:"id"`
	TransactionHash string `json:"transactionHash"`
	EventIndex      int    `json:"eventIndex"`
	Pool            struct {
		ID      string `json:"id"`
		Base    string `json:"base"`
		Quote   string `json:"quote"`
		PoolIdx string `json:"poolIdx"`
	} `json:"pool"`
	Block         string `json:"block"`
	Time          string `json:"time"`
	BidTick       int    `json:"bidTick"`
	AskTick       int    `json:"askTick"`
	SwapPrice     string `json:"swapPrice"`
	InBaseQty     bool   `json:"inBaseQty"`
	IsSwap        bool   `json:"isSwap"`
	IsLiq         bool   `json:"isLiq"`
	IsFeeChange   bool   `json:"isFeeChange"`
	IsTickSkewed  bool   `json:"isTickSkewed"`
	FlowsAtMarket bool   `json:"flowsAtMarket"`
	BaseFlow      string `json:"baseFlow"`
	QuoteFlow     string `json:"quoteFlow"`
	FeeRate       int    `json:"feeRate"`
}

type AggEventSubGraphData

type AggEventSubGraphData struct {
	AggEvents []AggEventSubGraph `json:"aggEvents"`
}

type AggEventSubGraphResp

type AggEventSubGraphResp struct {
	Data AggEventSubGraphData `json:"data"`
}

type AggEventsTable

type AggEventsTable struct{}

func (AggEventsTable) ConvertSubGraphRow

func (tbl AggEventsTable) ConvertSubGraphRow(r AggEventSubGraph, network string) AggEvent

func (AggEventsTable) GetID

func (tbl AggEventsTable) GetID(r AggEvent) string

func (AggEventsTable) GetTime

func (tbl AggEventsTable) GetTime(r AggEvent) int

func (AggEventsTable) ParseSubGraphResp

func (tbl AggEventsTable) ParseSubGraphResp(body []byte) ([]AggEventSubGraph, error)

func (AggEventsTable) SqlTableName

func (tbl AggEventsTable) SqlTableName() string

type Balance

type Balance struct {
	ID      string `db:"id"`
	Network string `db:"network"`
	Tx      string `db:"tx"`
	Block   int    `db:"block"`
	Time    int    `db:"time"`
	User    string `db:"user"`
	Token   string `db:"token"`
}

type BalanceSubGrapData

type BalanceSubGrapData struct {
	UserBalances []BalanceSubGraph `json:"userBalances"`
}

type BalanceSubGraph

type BalanceSubGraph struct {
	ID              string `json:"id"`
	TransactionHash string `json:"transactionHash"`
	Block           string `json:"block"`
	Time            string `json:"time"`
	User            string `json:"user"`
	Token           string `json:"token"`
}

type BalanceSubGraphResp

type BalanceSubGraphResp struct {
	Data BalanceSubGrapData `json:"data"`
}

type BalanceTable

type BalanceTable struct{}

func (BalanceTable) ConvertSubGraphRow

func (tbl BalanceTable) ConvertSubGraphRow(r BalanceSubGraph, network string) Balance

func (BalanceTable) GetID

func (tbl BalanceTable) GetID(r Balance) string

func (BalanceTable) GetTime

func (tbl BalanceTable) GetTime(r Balance) int

func (BalanceTable) ParseSubGraphResp

func (tbl BalanceTable) ParseSubGraphResp(body []byte) ([]BalanceSubGraph, error)

func (BalanceTable) ReadSqlRow

func (tbl BalanceTable) ReadSqlRow(rows *sql.Rows) Balance

func (BalanceTable) SqlTableName

func (tbl BalanceTable) SqlTableName() string

type FeeChange

type FeeChange struct {
	ID        string `json:"id" db:"id"`
	CallIndex int    `json:"callIndex" db:"callIndex"`
	Network   string `json:"network" db:"network"`
	Tx        string `json:"tx" db:"tx"`
	Block     int    `json:"block" db:"block"`
	Time      int    `json:"time" db:"time"`
	Base      string `json:"base" db:"base"`
	Quote     string `json:"quote" db:"quote"`
	PoolIdx   int    `json:"poolIdx" db:"poolIdx"`
	PoolHash  string `json:"poolHash" db:"poolHash"`
	FeeRate   int    `json:"feeRate" db:"feeRate"`
}

type FeeChangeSubGraph

type FeeChangeSubGraph struct {
	ID              string `json:"id"`
	TransactionHash string `json:"transactionHash"`
	CallIndex       int    `json:"callIndex"`
	Block           string `json:"block"`
	Time            string `json:"time"`
	Pool            struct {
		ID      string `json:"id"`
		Base    string `json:"base"`
		Quote   string `json:"quote"`
		PoolIdx string `json:"poolIdx"`
	} `json:"pool"`
	FeeRate int `json:"feeRate"`
}

type FeeChangeSubGraphData

type FeeChangeSubGraphData struct {
	FeeChanges []FeeChangeSubGraph `json:"feeChanges"`
}

type FeeChangeSubGraphResp

type FeeChangeSubGraphResp struct {
	Data FeeChangeSubGraphData `json:"data"`
}

type FeeTable

type FeeTable struct{}

func (FeeTable) ConvertSubGraphRow

func (tbl FeeTable) ConvertSubGraphRow(r FeeChangeSubGraph, network string) FeeChange

func (FeeTable) GetID

func (tbl FeeTable) GetID(r FeeChange) string

func (FeeTable) GetTime

func (tbl FeeTable) GetTime(r FeeChange) int

func (FeeTable) ParseSubGraphResp

func (tbl FeeTable) ParseSubGraphResp(body []byte) ([]FeeChangeSubGraph, error)

func (FeeTable) ReadSqlRow

func (tbl FeeTable) ReadSqlRow(rows *sql.Rows) FeeChange

func (FeeTable) SqlTableName

func (tbl FeeTable) SqlTableName() string

type ITable

type ITable[Row any, SubGraphRow any] interface {
	GetID(r Row) string
	GetTime(r Row) int
	ConvertSubGraphRow(SubGraphRow, string) Row
	SqlTableName() string
	ParseSubGraphResp(body []byte) ([]SubGraphRow, error)
}

type KnockoutCross

type KnockoutCross struct {
	ID         string  `json:"id" db:"id"`
	Network    string  `json:"network" db:"network"`
	Tx         string  `json:"tx" db:"tx"`
	Block      int     `json:"block" db:"block"`
	Time       int     `json:"time" db:"time"`
	Base       string  `json:"base" db:"base"`
	Quote      string  `json:"quote" db:"quote"`
	PoolIdx    int     `json:"poolIdx" db:"poolIdx"`
	PoolHash   string  `json:"poolHash" db:"poolHash"`
	Tick       int     `json:"tick" db:"tick"`
	IsBid      int     `json:"isBid" db:"isBid"`
	PivotTime  int     `json:"pivotTime" db:"pivotTime"`
	FeeMileage float64 `json:"feeMileage" db:"feeMileage"`
}

type KnockoutCrossSubGraph

type KnockoutCrossSubGraph struct {
	ID              string `json:"id"`
	TransactionHash string `json:"transactionHash"`
	Pool            struct {
		ID      string `json:"id"`
		Base    string `json:"base"`
		Quote   string `json:"quote"`
		PoolIdx string `json:"poolIdx"`
	} `json:"pool"`
	Block      string `json:"block"`
	Time       string `json:"time"`
	Tick       int    `json:"tick"`
	IsBid      bool   `json:"isBid"`
	PivotTime  string `json:"pivotTime"`
	FeeMileage string `json:"feeMileage"`
}

type KnockoutCrossSubGraphData

type KnockoutCrossSubGraphData struct {
	KnockoutCrosses []KnockoutCrossSubGraph `json:"knockoutCrosses"`
}

type KnockoutCrossSubGraphResp

type KnockoutCrossSubGraphResp struct {
	Data KnockoutCrossSubGraphData `json:"data"`
}

type KnockoutTable

type KnockoutTable struct{}

func (KnockoutTable) ConvertSubGraphRow

func (tbl KnockoutTable) ConvertSubGraphRow(r KnockoutCrossSubGraph, network string) KnockoutCross

func (KnockoutTable) GetID

func (tbl KnockoutTable) GetID(r KnockoutCross) string

func (KnockoutTable) GetTime

func (tbl KnockoutTable) GetTime(r KnockoutCross) int

func (KnockoutTable) ParseSubGraphResp

func (tbl KnockoutTable) ParseSubGraphResp(body []byte) ([]KnockoutCrossSubGraph, error)

func (KnockoutTable) ReadSqlRow

func (tbl KnockoutTable) ReadSqlRow(rows *sql.Rows) KnockoutCross

func (KnockoutTable) SqlTableName

func (tbl KnockoutTable) SqlTableName() string

type LiqChange

type LiqChange struct {
	ID           string   `json:"id" db:"id"`
	CallIndex    int      `json:"callIndex" db:"callIndex"`
	Network      string   `json:"network" db:"network"`
	TX           string   `json:"tx" db:"tx"`
	Base         string   `json:"base" db:"base"`
	Quote        string   `json:"quote" db:"quote"`
	PoolIdx      int      `json:"poolIdx" db:"poolIdx"`
	PoolHash     string   `json:"poolHash" db:"poolHash"`
	User         string   `json:"user" db:"user"`
	Block        int      `json:"block" db:"block"`
	Time         int      `json:"time" db:"time"`
	PositionType string   `json:"positionType" db:"positionType"`
	ChangeType   string   `json:"changeType" db:"changeType"`
	BidTick      int      `json:"bidTick" db:"bidTick"`
	AskTick      int      `json:"askTick" db:"askTick"`
	IsBid        int      `json:"isBid" db:"isBid"`
	Liq          *float64 `json:"liq" db:"liq"`
	BaseFlow     *float64 `json:"baseFlow" db:"baseFlow"`
	QuoteFlow    *float64 `json:"quoteFlow" db:"quoteFlow"`
	CallSource   string   `json:"callSource" db:"callSource"`
	Source       string   `json:"source" db:"source"`
	PivotTime    *int     `json:"pivotTime" db:"pivotTime"`
}

type LiqChangeSubGraph

type LiqChangeSubGraph struct {
	ID              string `json:"id"`
	TransactionHash string `json:"transactionHash"`
	CallIndex       int    `json:"callIndex"`
	User            string `json:"user"`
	Pool            struct {
		ID      string `json:"id"`
		Base    string `json:"base"`
		Quote   string `json:"quote"`
		PoolIdx string `json:"poolIdx"`
	} `json:"pool"`
	Block        string `json:"block"`
	Time         string `json:"time"`
	PositionType string `json:"positionType"`
	ChangeType   string `json:"changeType"`
	BidTick      int    `json:"bidTick"`
	AskTick      int    `json:"askTick"`
	IsBid        bool   `json:"isBid"`
	Liq          string `json:"liq"`
	BaseFlow     string `json:"baseFlow"`
	QuoteFlow    string `json:"quoteFlow"`
	CallSource   string `json:"callSource"`
	PivotTime    string `json:"pivotTime"`
}

type LiqChangeSubGraphData

type LiqChangeSubGraphData struct {
	LiqChanges []LiqChangeSubGraph `json:"liquidityChanges"`
}

type LiqChangeSubGraphResp

type LiqChangeSubGraphResp struct {
	Data LiqChangeSubGraphData `json:"data"`
}

type LiqChangeTable

type LiqChangeTable struct{}

func (LiqChangeTable) ConvertSubGraphRow

func (tbl LiqChangeTable) ConvertSubGraphRow(r LiqChangeSubGraph, network string) LiqChange

func (LiqChangeTable) GetID

func (tbl LiqChangeTable) GetID(r LiqChange) string

func (LiqChangeTable) GetTime

func (tbl LiqChangeTable) GetTime(r LiqChange) int

func (LiqChangeTable) ParseSubGraphResp

func (tbl LiqChangeTable) ParseSubGraphResp(body []byte) ([]LiqChangeSubGraph, error)

func (LiqChangeTable) ReadSqlRow

func (tbl LiqChangeTable) ReadSqlRow(rows *sql.Rows) LiqChange

func (LiqChangeTable) SqlTableName

func (tbl LiqChangeTable) SqlTableName() string

type Swap

type Swap struct {
	ID               string   `json:"id" db:"id"`
	CallIndex        int      `json:"callIndex" db:"callIndex"`
	Network          string   `json:"network" db:"network"`
	TX               string   `json:"tx" db:"tx"`
	User             string   `json:"user" db:"user"`
	Block            int      `json:"block" db:"block"`
	TransactionIndex int      `json:"transactionIndex" db:"transactionIndex"`
	Time             int      `json:"time" db:"time"`
	Base             string   `json:"base" db:"base"`
	Quote            string   `json:"quote" db:"quote"`
	PoolIdx          int      `json:"poolIdx" db:"poolIdx"`
	PoolHash         string   `json:"poolHash" db:"poolHash"`
	IsBuy            int      `json:"isBuy" db:"isBuy"`
	InBaseQty        int      `json:"inBaseQty" db:"inBaseQty"`
	Qty              float64  `json:"qty" db:"qty"`
	LimitPrice       *float64 `json:"limitPrice" db:"limitPrice"`
	MinOut           *float64 `json:"minOut" db:"minOut"`
	BaseFlow         float64  `json:"baseFlow" db:"baseFlow"`
	QuoteFlow        float64  `json:"quoteFlow" db:"quoteFlow"`
	CallSource       string   `json:"callSource" db:"callSource"`
	Source           string   `json:"source" db:"source"`
	Dex              string   `json:"dex" db:"dex"`
}

type SwapSubGraph

type SwapSubGraph struct {
	ID               string `json:"id"`
	TransactionHash  string `json:"transactionHash"`
	CallIndex        int    `json:"callIndex"`
	TransactionIndex string `json:"transactionIndex"`
	User             string `json:"user"`
	Pool             struct {
		ID      string `json:"id"`
		Base    string `json:"base"`
		Quote   string `json:"quote"`
		PoolIdx string `json:"poolIdx"`
	} `json:"pool"`
	Block      string `json:"block"`
	Time       string `json:"time"`
	IsBuy      bool   `json:"isBuy"`
	InBaseQty  bool   `json:"inBaseQty"`
	Qty        string `json:"qty"`
	LimitPrice string `json:"limitPrice"`
	MinOut     string `json:"minOut"`
	BaseFlow   string `json:"baseFlow"`
	QuoteFlow  string `json:"quoteFlow"`
	CallSource string `json:"callSource"`
	Dex        string `json:"dex"`
}

type SwapSubGraphData

type SwapSubGraphData struct {
	Swaps []SwapSubGraph `json:"swaps"`
}

type SwapSubGraphResp

type SwapSubGraphResp struct {
	Data SwapSubGraphData `json:"data"`
}

type SwapsTable

type SwapsTable struct{}

func (SwapsTable) ConvertSubGraphRow

func (tbl SwapsTable) ConvertSubGraphRow(r SwapSubGraph, network string) Swap

func (SwapsTable) GetID

func (tbl SwapsTable) GetID(r Swap) string

func (SwapsTable) GetTime

func (tbl SwapsTable) GetTime(r Swap) int

func (SwapsTable) ParseSubGraphResp

func (tbl SwapsTable) ParseSubGraphResp(body []byte) ([]SwapSubGraph, error)

func (SwapsTable) ReadSqlRow

func (tbl SwapsTable) ReadSqlRow(rows *sql.Rows) Swap

func (SwapsTable) SqlTableName

func (tbl SwapsTable) SqlTableName() string

Jump to

Keyboard shortcuts

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