subgraph

package
v0.0.0-...-2a4f382 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bundle

type Bundle struct {
	ID          string `json:"id"`
	EthPriceUSD string `json:"ethPriceUSD,omitempty"`
}

type Bundles

type Bundles struct {
	Bundles []Bundle `json:"bundles"`
}

type Client

type Client struct {
	GraphqlClient *graphql.Client
}

func NewSubgraphClient

func NewSubgraphClient(url string) (*Client, error)

func (*Client) GetBundles

func (s *Client) GetBundles(ctx context.Context, vars map[string]interface{}) (*Bundles, error)

func (*Client) GetCustom

func (s *Client) GetCustom(ctx context.Context, query string) (any, error)

func (*Client) GetDailyTotals

func (s *Client) GetDailyTotals(ctx context.Context, vars map[string]interface{}) (*DailyTotals, error)

func (*Client) GetHourlyTotals

func (s *Client) GetHourlyTotals(ctx context.Context, vars map[string]interface{}) (*HourlyTotals, error)

func (*Client) GetOrders

func (s *Client) GetOrders(ctx context.Context, vars map[string]interface{}) (*Orders, error)

func (*Client) GetPairDailies

func (s *Client) GetPairDailies(ctx context.Context, vars map[string]interface{}) (*PairDailies, error)

func (*Client) GetPairHourlies

func (s *Client) GetPairHourlies(ctx context.Context, vars map[string]interface{}) (*PairHourlies, error)

func (*Client) GetPairs

func (s *Client) GetPairs(ctx context.Context, vars map[string]interface{}) (*Pairs, error)

func (*Client) GetSettlements

func (s *Client) GetSettlements(ctx context.Context, vars map[string]interface{}) (*Settlements, error)

func (*Client) GetTokenDailyTotals

func (s *Client) GetTokenDailyTotals(ctx context.Context, vars map[string]interface{}) (*TokenDailyTotals, error)

func (*Client) GetTokenHourlyTotals

func (s *Client) GetTokenHourlyTotals(ctx context.Context, vars map[string]interface{}) (*TokenHourlyTotals, error)

func (*Client) GetTokenTradingEvents

func (s *Client) GetTokenTradingEvents(ctx context.Context, vars map[string]interface{}) (*TokenTradingEvents, error)

func (*Client) GetTokens

func (s *Client) GetTokens(ctx context.Context, vars map[string]interface{}) (*Tokens, error)

func (*Client) GetTotals

func (s *Client) GetTotals(ctx context.Context, vars map[string]interface{}) (*Totals, error)

func (*Client) GetTrades

func (s *Client) GetTrades(ctx context.Context, vars map[string]interface{}) (*Trades, error)

func (*Client) GetUniswapPools

func (s *Client) GetUniswapPools(ctx context.Context, vars map[string]interface{}) (*UniswapPools, error)

func (*Client) GetUniswapTokens

func (s *Client) GetUniswapTokens(ctx context.Context, vars map[string]interface{}) (*UniswapTokens, error)

func (*Client) GetUser

func (s *Client) GetUser(ctx context.Context, id string) (any, error)

query filter: block, id, subgraph err

func (*Client) GetUsers

func (s *Client) GetUsers(ctx context.Context, vars map[string]interface{}) (*Users, error)

type DailyTotal

type DailyTotal struct {
	ID             string  `json:"id"`
	Timestamp      int     `json:"timestamp"`
	TotalTokens    string  `json:"totalTokens"`
	NumberOfTrades string  `json:"numberOfTrades"`
	Orders         string  `json:"orders"`
	Settlements    string  `json:"settlements"`
	VolumeUsd      string  `json:"volumeUsd"`
	VolumeEth      string  `json:"volumeEth"`
	FeesUsd        string  `json:"feesUsd"`
	FeesEth        string  `json:"feesEth"`
	Tokens         []Token `json:"tokens"`
}

type DailyTotals

type DailyTotals struct {
	DailyTotals []DailyTotal `json:"dailyTotals"`
}

type HourlyTotal

type HourlyTotal struct {
	Timestamp      int     `json:"timestamp"`
	TotalTokens    string  `json:"totalTokens"`
	NumberOfTrades string  `json:"numberOfTrades"`
	Orders         string  `json:"orders"`
	Settlements    string  `json:"settlements"`
	VolumeUsd      string  `json:"volumeUsd"`
	VolumeEth      string  `json:"volumeEth"`
	FeesUsd        string  `json:"feesUsd"`
	FeesEth        string  `json:"feesEth"`
	Tokens         []Token `json:"tokens"`
}

type HourlyTotals

type HourlyTotals struct {
	HourlyTotals []HourlyTotal `json:"hourlyTotals"`
}

type Order

type Order struct {
	ID                  string  `json:"id"`
	TradesTimestamp     int     `json:"tradesTimestamp,omitempty"`
	InvalidateTimestamp int     `json:"invalidateTimestamp,omitempty"`
	PresignTimestamp    int     `json:"presignTimestamp,omitempty"`
	IsSigned            bool    `json:"isSigned,omitempty"`
	IsValid             bool    `json:"isValid,omitempty"`
	Owner               User    `json:"owner,omitempty"`
	Trades              []Trade `json:"trades,omitempty"`
}

type Orders

type Orders struct {
	Orders []Order `json:"orders"`
}

type OrdersPlaced

type OrdersPlaced struct {
	ID       *string `json:"id"`
	IsSigned *bool   `json:"isSigned,omitempty"`
}

type Pair

type Pair struct {
	ID                  string `json:"id"`
	Token0              Token  `json:"token0"`
	Token1              Token  `json:"token1"`
	Token0Price         string `json:"token0Price"`
	Token1Price         string `json:"token1Price"`
	Token0RelativePrice string `json:"token0relativePrice"`
	Token1RelativePrice string `json:"token1relativePrice"`
	VolumeToken0        string `json:"volumeToken0"`
	VolumeToken1        string `json:"volumeToken1"`
	VolumeTradedEth     string `json:"volumeTradedEth"`
	VolumeTradedUsd     string `json:"volumeTradedUsd"`
}

type PairDailies

type PairDailies struct {
	PairDailies []PairDaily `json:"pairDailies"`
}

type PairDaily

type PairDaily struct {
	ID                  string `json:"id"`
	Token0              Token  `json:"token0"`
	Token1              Token  `json:"token1"`
	Token0Price         string `json:"token0Price"`
	Token1Price         string `json:"token1Price"`
	Token0RelativePrice string `json:"token0relativePrice"`
	Token1RelativePrice string `json:"token1relativePrice"`
	VolumeToken0        string `json:"volumeToken0"`
	VolumeToken1        string `json:"volumeToken1"`
	VolumeTradedEth     string `json:"volumeTradedEth"`
	VolumeTradedUsd     string `json:"volumeTradedUsd"`
}

type PairHourlies

type PairHourlies struct {
	PairHourlies []PairHourly `json:"pairHourlies"`
}

type PairHourly

type PairHourly struct {
	ID                  string `json:"id"`
	Token0              Token  `json:"token0"`
	Token1              Token  `json:"token1"`
	Token0Price         string `json:"token0Price"`
	Token1Price         string `json:"token1Price"`
	Token0RelativePrice string `json:"token0relativePrice"`
	Token1RelativePrice string `json:"token1relativePrice"`
	VolumeToken0        string `json:"volumeToken0"`
	VolumeToken1        string `json:"volumeToken1"`
	VolumeTradedEth     string `json:"volumeTradedEth"`
	VolumeTradedUsd     string `json:"volumeTradedUsd"`
}

type Pairs

type Pairs struct {
	Pairs []Pair `json:"pairs"`
}

type Settlement

type Settlement struct {
	ID                  string  `json:"id"`
	TxHash              string  `json:"txHash,omitempty"`
	FirstTradeTimestamp int     `json:"firstTradeTimestamp,omitempty"`
	Trades              []Trade `json:"trades,omitempty"`
	Solver              User    `json:"solver,omitempty"`
}

type Settlements

type Settlements struct {
	Settlements []Settlement `json:"settlements"`
}

type Token

type Token struct {
	ID                  string `json:"id"`
	Address             string `json:"address,omitempty"`
	FirstTradeTimestamp int    `json:"firstTradeTimestamp,omitempty"`
	Name                string `json:"name,omitempty"`
	Symbol              string `json:"symbol,omitempty"`
	Decimals            int    `json:"decimals,omitempty"`
	TotalVolume         string `json:"totalVolume,omitempty"`
	PriceEth            string `json:"priceEth,omitempty"`
	PriceUsd            string `json:"priceUsd,omitempty"`
	NumberOfTrades      int    `json:"numberOfTrades,omitempty"`
	TotalVolumeUsd      string `json:"totalVolumeUsd,omitempty"`
	TotalVolumeEth      string `json:"totalVolumeEth,omitempty"`
}

type TokenDailyTotal

type TokenDailyTotal struct {
	ID             string `json:"id"`
	Token          Token  `json:"token"`
	Timestamp      int    `json:"timestamp"`
	TotalVolume    string `json:"totalVolume"`
	TotalVolumeUsd string `json:"totalVolumeUsd"`
	TotalVolumeEth string `json:"totalVolumeEth"`
	TotalTrades    string `json:"totalTrades"`
	OpenPrice      string `json:"openPrice"`
	ClosePrice     string `json:"closePrice"`
	HigherPrice    string `json:"higherPrice"`
	LowerPrice     string `json:"lowerPrice"`
	AveragePrice   string `json:"averagePrice"`
}

type TokenDailyTotals

type TokenDailyTotals struct {
	TokenDailyTotals []TokenDailyTotal `json:"tokenDailyTotals"`
}

type TokenHourlyTotal

type TokenHourlyTotal struct {
	ID             string `json:"id"`
	Token          Token  `json:"token"`
	Timestamp      int    `json:"timestamp"`
	TotalVolume    string `json:"totalVolume"`
	TotalVolumeUsd string `json:"totalVolumeUsd"`
	TotalVolumeEth string `json:"totalVolumeEth"`
	TotalTrades    string `json:"totalTrades"`
	OpenPrice      string `json:"openPrice"`
	ClosePrice     string `json:"closePrice"`
	HigherPrice    string `json:"higherPrice"`
	LowerPrice     string `json:"lowerPrice"`
	AveragePrice   string `json:"averagePrice"`
}

type TokenHourlyTotals

type TokenHourlyTotals struct {
	TokenHourlyTotals []TokenHourlyTotal `json:"tokenHourlyTotals"`
}

type TokenTradingEvent

type TokenTradingEvent struct {
	ID        string `json:"id"`
	Token     Token  `json:"token"`
	Trade     Trade  `json:"trade"`
	Timestamp int    `json:"timestamp"`
	AmountEth string `json:"amountEth"`
	AmountUsd string `json:"amountUsd"`
}

type TokenTradingEvents

type TokenTradingEvents struct {
	TokenTradingEvents []TokenTradingEvent `json:"tokenTradingEvents"`
}

type Tokens

type Tokens struct {
	Tokens []Token `json:"tokens"`
}

type Total

type Total struct {
	ID             string `json:"id"`
	Tokens         string `json:"tokens,omitempty"`
	Traders        string `json:"traders,omitempty"`
	NumberOfTrades string `json:"numberOfTrades,omitempty"`
	Settlements    string `json:"settlements,omitempty"`
	VolumeUsd      string `json:"volumeUsd,omitempty"`
	VolumeEth      string `json:"volumeEth,omitempty"`
	FeesUsd        string `json:"feesUsd,omitempty"`
	FeesEth        string `json:"feesEth,omitempty"`
}

type Totals

type Totals struct {
	Totals []Total `json:"totals"`
}

type Trade

type Trade struct {
	ID            string     `json:"id"`
	Timestamp     int        `json:"timestamp,omitempty"`
	GasPrice      string     `json:"gasPrice,omitempty"`
	FeeAmount     string     `json:"feeAmount,omitempty"`
	TxHash        string     `json:"txHash,omitempty"`
	Settlement    Settlement `json:"settlement,omitempty"`
	BuyAmount     string     `json:"buyAmount,omitempty"`
	SellAmount    string     `json:"sellAmount,omitempty"`
	BuyAmountUsd  string     `json:"buyAmountUsd,omitempty"`
	SellAmountUsd string     `json:"sellAmountUsd,omitempty"`
	BuyAmountEth  string     `json:"buyAmountEth,omitempty"`
	SellAmountEth string     `json:"sellAmountEth,omitempty"`
	SellToken     Token      `json:"sellToken,omitempty"`
	BuyToken      Token      `json:"buyToken,omitempty"`
	Order         Order      `json:"order,omitempty"`
}

type Trades

type Trades struct {
	Trades []Trade `json:"trades,omitempty"`
}

type UniswapPool

type UniswapPool struct {
	ID                     string       `json:"id"`
	Liquidity              string       `json:"liquidity,omitempty"`
	Token0Price            string       `json:"token0Price,omitempty"`
	Token1Price            string       `json:"token1Price,omitempty"`
	Tick                   string       `json:"tick,omitempty"`
	TotalValueLockedToken0 string       `json:"totalValueLockedToken0,omitempty"`
	TotalValueLockedToken1 string       `json:"totalValueLockedToken1,omitempty"`
	Token0                 UniswapToken `json:"token0,omitempty"`
	Token1                 UniswapToken `json:"token1,omitempty"`
}

type UniswapPools

type UniswapPools struct {
	UniswapPools []UniswapPool `json:"uniswapPools"`
}

type UniswapToken

type UniswapToken struct {
	ID       string `json:"id"`
	Address  string `json:"address,omitempty"`
	Name     string `json:"name,omitempty"`
	Symbol   string `json:"symbol,omitempty"`
	Decimals int    `json:"decimals,omitempty"`
	PriceEth string `json:"priceEth,omitempty"`
	PriceUsd string `json:"priceUsd,omitempty"`
}

type UniswapTokens

type UniswapTokens struct {
	UniswapTokens []UniswapToken `json:"uniswapTokens"`
}

type User

type User struct {
	ID                  string         `json:"id"`
	Address             string         `json:"address,omitempty"`
	FirstTradeTimestamp int64          `json:"firstTradeTimestamp,omitempty"`
	IsSolver            bool           `json:"isSolver,omitempty"`
	NumberOfTrades      int64          `json:"numberOfTrades,omitempty"`
	SolvedAmountEth     string         `json:"solvedAmountEth,omitempty"`
	SolvedAmountUsd     string         `json:"solvedAmountUsd,omitempty"`
	TradedAmountUsd     string         `json:"tradedAmountUsd,omitempty"`
	TradedAmountEth     string         `json:"tradedAmountEth,omitempty"`
	OrdersPlaced        []OrdersPlaced `json:"ordersPlaced,omitempty"`
}

type UserData

type UserData struct {
	Users User `json:"user,omitempty"`
}

type Users

type Users struct {
	Users []User `json:"users"`
}

Jump to

Keyboard shortcuts

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