marketdata

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InsertMarketData

func InsertMarketData(marketData MarketData) (int, error)

func InsertMarketDataList

func InsertMarketDataList(marketDataList []MarketData) error

func InsertMarketDataListManual

func InsertMarketDataListManual(marketDataList []MarketData) error

func InsertMarketDataQuote

func InsertMarketDataQuote(marketDataQuote MarketDataQuote) (int, error)

func InsertMarketDataQuoteList

func InsertMarketDataQuoteList(marketDataQuoteList []MarketDataQuote) error

func InsertMarketDataQuoteListManual

func InsertMarketDataQuoteListManual(marketDataQuoteList []MarketDataQuote) error

func RemoveMarketData

func RemoveMarketData(marketDataID int) error

func RemoveMarketDataFromBaseAssetBetweenDates

func RemoveMarketDataFromBaseAssetBetweenDates(assetID int, startDate, endDate time.Time) error

func RemoveMarketDataQuoteFromBaseAssetBetweenDates

func RemoveMarketDataQuoteFromBaseAssetBetweenDates(assetID int, startDate, endDate time.Time) error

func UpdateMarketData

func UpdateMarketData(marketData MarketData) error

Types

type MarketData

type MarketData struct {
	ID                *int      `json:"id"`
	UUID              string    `json:"uuid"`
	Name              string    `json:"name"`
	AlternateName     string    `json:"alternateName"`
	StartDate         time.Time `json:"startDate"`
	EndDate           time.Time `json:"endDate"`
	AssetID           *int      `json:"assetId"`
	OpenUSD           *float64  `json:"openUsd"`
	CloseUSD          *float64  `json:"closeUsd"`
	HighUSD           *float64  `json:"highUsd"`
	LowUSD            *float64  `json:"lowUsd"`
	PriceUSD          *float64  `json:"priceUsd"`
	VolumeUSD         *float64  `json:"volumeUsd"`
	MarketCapUSD      *float64  `json:"marketCapUsd"`
	Ticker            string    `json:"ticker"`
	Description       string    `json:"description"`
	IntervalID        *int      `json:"intervalId"`
	MarketDataTypeID  *int      `json:"marketDataTypeId"`
	SourceID          *int      `json:"sourceId"`
	TotalSupply       *float64  `json:"totalSupply"`
	MaxSupply         *float64  `json:"maxSupply"`
	CirculatingSupply *float64  `json:"circulatingSupply"`
	Sparkline7d       []float64 `json:"sparkline7d"`
	CreatedBy         string    `json:"createdBy"`
	CreatedAt         time.Time `json:"createdAt"`
	UpdatedBy         string    `json:"updatedBy"`
	UpdatedAt         time.Time `json:"updatedAt"`
}

MarketData

func GetMarketData

func GetMarketData(marketDataID int) (*MarketData, error)

func GetMarketDataList

func GetMarketDataList(ids []int) ([]MarketData, error)

func GetMarketDataListByUUIDs

func GetMarketDataListByUUIDs(UUIDList []string) ([]MarketData, error)

func GetStartAndEndDateDiffMarketDataList

func GetStartAndEndDateDiffMarketDataList(diffInDate int) ([]MarketData, error)

func GetTopTenMarketDatas

func GetTopTenMarketDatas() ([]MarketData, error)

type MarketDataQuote

type MarketDataQuote struct {
	MarketDataID         *int      `json:"marketDataId"`
	BaseAssetID          *int      `json:"baseAssetId"`
	QuoteAssetID         *int      `json:"quoteAssetId"`
	UUID                 string    `json:"uuid"`
	Name                 string    `json:"name"`
	AlternateName        string    `json:"alternateName"`
	Open                 *float64  `json:"open"`
	Close                *float64  `json:"close"`
	High24h              *float64  `json:"high24h"`
	Low24h               *float64  `json:"low24h"`
	Price                *float64  `json:"price"`
	Volume               *float64  `json:"volume"`
	MarketCap            *float64  `json:"marketCap"`
	Ticker               string    `json:"ticker"`
	Description          string    `json:"description"`
	SourceID             *int      `json:"sourceId"`
	FullyDilutedValution *float64  `json:"fullyDilutedValution"`
	Ath                  *float64  `json:"ath"`
	AthDate              time.Time `json:"athDate"`
	Atl                  *float64  `json:"atl"`
	AtlDate              time.Time `json:"atlDate"`
	PriceChange1h        *float64  `json:"priceChange1h"`
	PriceChange24h       *float64  `json:"priceChange24h"`
	PriceChange7d        *float64  `json:"priceChange7d"`
	PriceChange30d       *float64  `json:"priceChange30d"`
	PriceChange60d       *float64  `json:"priceChange60d"`
	PriceChange200d      *float64  `json:"priceChange200d"`
	PriceChange1y        *float64  `json:"priceChange1y"`
	CreatedBy            string    `json:"createdBy"`
	CreatedAt            time.Time `json:"createdAt"`
	UpdatedBy            string    `json:"updatedBy"`
	UpdatedAt            time.Time `json:"updatedAt"`
}

MarketData

type MarketDataQuoteResults

type MarketDataQuoteResults struct {
	MarketDataQuote
	StartDate        time.Time
	EndDate          time.Time
	BaseAssetName    string
	BaseAssetTicker  string
	QuoteAssetName   string
	QuoteAssetTicker string
}

func GetAllMarketDataFromStrategyID added in v1.0.9

func GetAllMarketDataFromStrategyID(strategyID *int) ([]MarketDataQuoteResults, error)

func GetLatestLiveMarketData

func GetLatestLiveMarketData() ([]MarketDataQuoteResults, error)

Jump to

Keyboard shortcuts

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