Documentation ¶
Index ¶
- Constants
- Variables
- func GetExchangeType(exchange dia.Exchange) string
- func StraightRates(intRates []*InterestRate) map[time.Time]float64
- func WeightedRates(intRates []*InterestRate, dateInit, dateFinal time.Time, holidays []time.Time, ...) (map[time.Time]float64, int)
- type AssetQuotation
- type AssetQuotationFull
- type BenchmarkedIndex
- type BenchmarkedIndexValue
- type Change
- type CoinSymbolAndName
- type CurrencyChange
- type DB
- func (datastore *DB) AddAssetQuotationsToBatch(quotations []*AssetQuotation) error
- func (datastore *DB) CopyInfluxMeasurements(dbOrigin string, dbDestination string, tableOrigin string, ...) (numCopiedRows int64, err error)
- func (datastore *DB) ExecuteRedisPipe() (err error)
- func (datastore *DB) ExistInterestRate(symbol, date string) bool
- func (datastore *DB) Flush() error
- func (datastore *DB) FlushRedisPipe() error
- func (datastore *DB) Get24HoursAssetVolume(asset dia.Asset) (*float64, error)
- func (datastore *DB) Get24HoursExchangeVolume(exchange string) (*float64, error)
- func (datastore *DB) GetActiveExchangesAndPairs(address string, blockchain string, numTradesThreshold int64, ...) (map[string][]dia.Pair, map[string]int64, error)
- func (datastore *DB) GetAllTrades(t time.Time, maxTrades int) ([]dia.Trade, error)
- func (datastore *DB) GetAssetPriceUSD(asset dia.Asset, timestamp time.Time) (price float64, err error)
- func (datastore *DB) GetAssetPriceUSDCache(asset dia.Asset) (price float64, err error)
- func (datastore *DB) GetAssetPriceUSDLatest(asset dia.Asset) (price float64, err error)
- func (datastore *DB) GetAssetQuotation(asset dia.Asset, timestamp time.Time) (*AssetQuotation, error)
- func (datastore *DB) GetAssetQuotationCache(asset dia.Asset) (*AssetQuotation, error)
- func (datastore *DB) GetAssetQuotationLatest(asset dia.Asset) (*AssetQuotation, error)
- func (datastore *DB) GetAssetQuotations(asset dia.Asset, starttime time.Time, endtime time.Time) ([]AssetQuotation, error)
- func (datastore *DB) GetAssetsMarketCap(asset dia.Asset) (float64, error)
- func (datastore *DB) GetAssetsWithVOLInflux(timeInit time.Time) ([]dia.Asset, error)
- func (datastore *DB) GetAvailablePairs(exchange string) ([]dia.ExchangePair, error)
- func (datastore *DB) GetBenchmarkedIndexValuesInflux(symbol string, starttime time.Time, endtime time.Time) (BenchmarkedIndex, error)
- func (datastore *DB) GetCompoundedAvg(symbol string, date time.Time, calDays, daysPerYear int, rounding int) (*InterestRate, error)
- func (datastore *DB) GetCompoundedAvgDIARange(symbol string, dateInit, dateFinal time.Time, calDays, daysPerYear int, ...) (values []*InterestRate, err error)
- func (datastore *DB) GetCompoundedAvgRange(symbol string, dateInit, dateFinal time.Time, calDays, daysPerYear int, ...) (values []*InterestRate, err error)
- func (datastore *DB) GetCompoundedIndex(symbol string, date time.Time, daysPerYear int, rounding int) (*InterestRate, error)
- func (datastore *DB) GetCompoundedIndexRange(symbol string, dateInit, dateFinal time.Time, daysPerYear int, rounding int) (values []*InterestRate, err error)
- func (datastore *DB) GetCompoundedRate(symbol string, dateInit, date time.Time, daysPerYear int, rounding int) (*InterestRate, error)
- func (datastore *DB) GetCurrencyChange() (*Change, error)
- func (db *DB) GetDiaCirculatingSupply() (float64, error)
- func (db *DB) GetDiaTotalSupply() (float64, error)
- func (datastore *DB) GetExchangePairVolumes(asset dia.Asset, starttime time.Time, endtime time.Time, threshold float64) (map[string][]dia.PairVolume, error)
- func (datastore *DB) GetFilter(filter string, topAsset dia.Asset, scale string, starttime time.Time, ...) ([]dia.FilterPoint, error)
- func (datastore *DB) GetFilterAllExchanges(filter string, address string, blockchain string, starttime time.Time, ...) (assetQuotations []AssetQuotation, err error)
- func (datastore *DB) GetFilterPoints(filter string, exchange string, symbol string, scale string, ...) (*Points, error)
- func (datastore *DB) GetFilterPointsAsset(filter string, exchange string, address string, blockchain string, ...) (*Points, error)
- func (datastore *DB) GetFirstDate(symbol string) (time.Time, error)
- func (datastore *DB) GetFirstTradeDate(table string) (time.Time, error)
- func (datastore *DB) GetForeignPriceYesterday(symbol, source string) (float64, error)
- func (datastore *DB) GetForeignQuotationInflux(symbol, source string, timestamp time.Time) (ForeignQuotation, error)
- func (datastore *DB) GetForeignSymbolsInflux(source string) (symbols []string, err error)
- func (datastore *DB) GetInterestRate(symbol, date string) (*InterestRate, error)
- func (datastore *DB) GetInterestRateRange(symbol, dateInit, dateFinal string) ([]*InterestRate, error)
- func (datastore *DB) GetIssuer(symbol string) (string, error)
- func (datastore *DB) GetLastPriceBefore(asset dia.Asset, filter string, exchange string, timestamp time.Time) (Price, error)
- func (datastore *DB) GetLastTradeTimeForExchange(asset dia.Asset, exchange string) (*time.Time, error)
- func (datastore *DB) GetLastTrades(asset dia.Asset, exchange string, timestamp time.Time, maxTrades int, ...) ([]dia.Trade, error)
- func (datastore *DB) GetLatestSupply(symbol string, relDB *RelDB) (*dia.Supply, error)
- func (datastore *DB) GetNumTrades(exchange string, address string, blockchain string, starttime time.Time, ...) (numTrades int64, err error)
- func (datastore *DB) GetNumTradesExchange24H(exchange string) (numTrades int64, err error)
- func (datastore *DB) GetNumTradesSeries(asset dia.Asset, exchange string, starttime time.Time, endtime time.Time, ...) (numTrades []int64, err error)
- func (datastore *DB) GetOldTradesFromInflux(table string, exchange string, verified bool, timeInit, timeFinal time.Time) ([]dia.Trade, error)
- func (datastore *DB) GetOldestQuotation(asset dia.Asset) (quotation AssetQuotation, err error)
- func (datastore *DB) GetPoolInflux(poolAddress string, starttime time.Time, endtime time.Time) ([]dia.Pool, error)
- func (datastore *DB) GetPoolLiquiditiesUSD(p *dia.Pool, priceCache map[string]float64)
- func (datastore *DB) GetPrice(asset dia.Asset, exchange string) (float64, error)
- func (datastore *DB) GetPrice14d(asset dia.Asset, exchange string) (float64, error)
- func (datastore *DB) GetPrice1h(asset dia.Asset, exchange string) (float64, error)
- func (datastore *DB) GetPrice30d(asset dia.Asset, exchange string) (float64, error)
- func (datastore *DB) GetPrice7d(asset dia.Asset, exchange string) (float64, error)
- func (datastore *DB) GetPriceYesterday(asset dia.Asset, exchange string) (float64, error)
- func (datastore *DB) GetRates() []string
- func (datastore *DB) GetRatesMeta() (RatesMeta []InterestRateMeta, err error)
- func (datastore *DB) GetSortedAssetQuotations(assets []dia.Asset) ([]AssetQuotation, error)
- func (db *DB) GetStockQuotation(source string, symbol string, timeInit time.Time, timeFinal time.Time) ([]StockQuotation, error)
- func (db *DB) GetStockSymbols() (map[Stock]string, error)
- func (datastore *DB) GetSupply(symbol string, starttime, endtime time.Time, relDB *RelDB) ([]dia.Supply, error)
- func (datastore *DB) GetSupplyCache(asset dia.Asset) (supply dia.Supply, err error)
- func (datastore *DB) GetSupplyInflux(asset dia.Asset, starttime time.Time, endtime time.Time) ([]dia.Supply, error)
- func (datastore *DB) GetSymbols(exchange string) ([]string, error)
- func (datastore *DB) GetSynthAssets(blockchain, protocol string) (r []string, err error)
- func (datastore *DB) GetSynthLastSupplyInflux(blockchain, protocol, address string)
- func (datastore *DB) GetSynthSupplyInflux(blockchain, protocol, address string, limit int, starttime, endtime time.Time) ([]dia.SynthAssetSupply, error)
- func (datastore *DB) GetTopAssetByMcap(symbol string, relDB *RelDB) (topAsset dia.Asset, err error)
- func (datastore *DB) GetTopAssetByVolume(symbol string, relDB *RelDB) (topAsset dia.Asset, err error)
- func (datastore *DB) GetTradeInflux(asset dia.Asset, exchange string, endtime time.Time, window time.Duration) (*dia.Trade, error)
- func (datastore *DB) GetTradePrice14d(asset dia.Asset, exchange string) (*dia.Trade, error)
- func (datastore *DB) GetTradePrice1h(asset dia.Asset, exchange string) (*dia.Trade, error)
- func (datastore *DB) GetTradePrice24h(asset dia.Asset, exchange string) (*dia.Trade, error)
- func (datastore *DB) GetTradePrice30d(asset dia.Asset, exchange string) (*dia.Trade, error)
- func (datastore *DB) GetTradePrice7d(asset dia.Asset, exchange string) (*dia.Trade, error)
- func (datastore *DB) GetTradePriceBefore(asset dia.Asset, exchange string, timestamp time.Time, window time.Duration) (*dia.Trade, error)
- func (datastore *DB) GetTradesByExchangepairs(exchangepairMap map[string][]dia.Pair, exchangepoolMap map[string][]string, ...) ([]dia.Trade, error)
- func (datastore *DB) GetTradesByExchangesAndBaseAssets(asset dia.Asset, baseassets []dia.Asset, exchanges []string, ...) ([]dia.Trade, error)
- func (datastore *DB) GetTradesByExchangesBatched(quoteasset dia.Asset, baseassets []dia.Asset, exchanges []string, ...) ([]dia.Trade, error)
- func (datastore *DB) GetTradesByExchangesBatchedFull(quoteasset dia.Asset, baseassets []dia.Asset, exchanges []string, ...) ([]dia.Trade, error)
- func (datastore *DB) GetTradesByExchangesFull(asset dia.Asset, baseassets []dia.Asset, exchanges []string, ...) ([]dia.Trade, error)
- func (datastore *DB) GetTradesByFeedSelection(feedselection []dia.FeedSelection, starttimes []time.Time, ...) ([]dia.Trade, error)
- func (datastore *DB) GetVWAPFirefly(foreignName string, starttime time.Time, endtime time.Time) (values []float64, timestamps []time.Time, err error)
- func (datastore *DB) GetVolumeInflux(asset dia.Asset, exchange string, starttime time.Time, endtime time.Time) (*float64, error)
- func (datastore *DB) GetVolumesAllExchanges(asset dia.Asset, starttime time.Time, endtime time.Time) (exchVolumes dia.ExchangeVolumesList, err error)
- func (datastore *DB) GetxcTradesByExchangesBatched(quoteassets []dia.Asset, exchanges []string, startTimes []time.Time, ...) ([]dia.Trade, error)
- func (datastore *DB) SaveFilterInflux(filter string, asset dia.Asset, exchange string, value float64, t time.Time) error
- func (datastore *DB) SaveForeignQuotationInflux(fq ForeignQuotation) error
- func (datastore *DB) SaveIndexEngineTimeInflux(tags map[string]string, fields map[string]interface{}, timestamp time.Time) error
- func (datastore *DB) SavePoolInflux(p dia.Pool) error
- func (datastore *DB) SaveSupplyInflux(supply *dia.Supply) error
- func (datastore *DB) SaveSynthSupplyInflux(t *dia.SynthAssetSupply) error
- func (datastore *DB) SaveSynthSupplyInfluxToTable(t *dia.SynthAssetSupply, table string) error
- func (datastore *DB) SaveTradeInflux(t *dia.Trade) error
- func (datastore *DB) SaveTradeInfluxToTable(t *dia.Trade, table string) error
- func (datastore *DB) SetAssetPriceUSD(asset dia.Asset, price float64, timestamp time.Time) error
- func (datastore *DB) SetAssetQuotation(quotation *AssetQuotation) error
- func (datastore *DB) SetAssetQuotationCache(quotation *AssetQuotation, check bool) (bool, error)
- func (datastore *DB) SetAvailablePairs(exchange string, pairs []dia.ExchangePair) error
- func (datastore *DB) SetBatchFiatPriceInflux(fiatQuotations []*FiatQuotation) error
- func (datastore *DB) SetCurrencyChange(cc *Change) error
- func (db *DB) SetDiaCirculatingSupply(circulatingSupply float64) error
- func (db *DB) SetDiaTotalSupply(totalSupply float64) error
- func (datastore *DB) SetFilter(filter string, asset dia.Asset, exchange string, value float64, t time.Time) error
- func (datastore *DB) SetInfluxClient(url string)
- func (datastore *DB) SetInterestRate(ir *InterestRate) error
- func (datastore *DB) SetLastTradeTimeForExchange(asset dia.Asset, exchange string, t time.Time) error
- func (datastore *DB) SetSingleFiatPriceRedis(fiatQuotation *FiatQuotation) error
- func (datastore *DB) SetStockQuotation(sq StockQuotation) error
- func (datastore *DB) SetSupply(supply *dia.Supply) error
- func (datastore *DB) SetVWAPFirefly(foreignName string, value float64, timestamp time.Time) error
- func (datastore *DB) WriteBatchInflux() (err error)
- type Datastore
- type DefiScore
- type FiatQuotation
- type ForeignQuotation
- type HistoricalQuote
- type InterestRate
- type InterestRateMeta
- type Pairs
- type Points
- type Price
- type Quotation
- type RelDB
- func (rdb *RelDB) ChangeOracleState(feederID string, active bool) (err error)
- func (rdb *RelDB) Count() (count uint32, err error)
- func (rdb *RelDB) CountCache() (uint32, error)
- func (rdb *RelDB) DeleteOracle(feederID string) (err error)
- func (rdb *RelDB) ExpireOracle(feederID string) (err error)
- func (rdb *RelDB) Get24HoursNFTExchangeTrades(exchange dia.NFTExchange) (int64, error)
- func (rdb *RelDB) Get24HoursNFTExchangeVolume(exchange dia.NFTExchange) (float64, error)
- func (rdb *RelDB) GetAllAssets(blockchain string) (assets []dia.Asset, err error)
- func (rdb *RelDB) GetAllAssetsBlockchains() ([]string, error)
- func (rdb *RelDB) GetAllBlockchains(fullAsset bool) ([]dia.BlockChain, error)
- func (rdb *RelDB) GetAllChainConfig() (chainconfigs []dia.ChainConfig, err error)
- func (rdb *RelDB) GetAllDEXPoolsCount() (map[string]int, error)
- func (rdb *RelDB) GetAllExchangeAssets(verified bool) (assets []dia.Asset, err error)
- func (rdb *RelDB) GetAllExchanges() (exchanges []dia.Exchange, err error)
- func (rdb *RelDB) GetAllFeeders(isDeleted bool, isExpired bool) (oracleconfigs []dia.OracleConfig, err error)
- func (rdb *RelDB) GetAllLastTrades(nftclass dia.NFTClass) (trades []dia.NFTTrade, err error)
- func (rdb *RelDB) GetAllNFTClasses(blockchain string) (nftClasses []dia.NFTClass, err error)
- func (rdb *RelDB) GetAllNFTExchanges() (exchanges []dia.NFTExchange, err error)
- func (rdb *RelDB) GetAllPoolAddrsExchange(exchange string, liquiThreshold float64) (addresses []string, err error)
- func (rdb *RelDB) GetAllPoolsExchange(exchange string, liquiThreshold float64) (pools []dia.Pool, err error)
- func (rdb *RelDB) GetAsset(address, blockchain string) (asset dia.Asset, err error)
- func (rdb *RelDB) GetAssetByGroupID(group_id string) (assets []dia.Asset, err error)
- func (rdb *RelDB) GetAssetByID(assetID string) (asset dia.Asset, err error)
- func (rdb *RelDB) GetAssetCache(blockchain string, address string) (asset dia.Asset, err error)
- func (rdb *RelDB) GetAssetExchange(symbol string) (exchanges []string, err error)
- func (rdb *RelDB) GetAssetID(asset dia.Asset) (ID string, err error)
- func (rdb *RelDB) GetAssetMap(asset_id string) (ID string, err error)
- func (rdb *RelDB) GetAssetSource(asset dia.Asset, cex bool) (exchanges []string, err error)
- func (rdb *RelDB) GetAssets(symbol string) (assets []dia.Asset, err error)
- func (rdb *RelDB) GetAssetsByAddress(address string) (assets []dia.Asset, err error)
- func (rdb *RelDB) GetAssetsBySymbolName(symbol, name string) (assets []dia.Asset, err error)
- func (rdb *RelDB) GetAssetsWithVOL(starttime time.Time, numAssets int64, skip int64, onlycex bool, ...) (volumeSortedAssets []dia.AssetVolume, err error)
- func (rdb *RelDB) GetAssetsWithVolByBlockchain(starttime time.Time, endtime time.Time, blockchain string) (assets []dia.AssetVolume, err error)
- func (rdb *RelDB) GetBlockData(blockchain string, blocknumber int64) (dia.BlockData, error)
- func (rdb *RelDB) GetBlockchain(name string) (blockchain dia.BlockChain, err error)
- func (rdb *RelDB) GetByLimit(limit, skip uint32) (assets []dia.Asset, assetIds []string, err error)
- func (rdb *RelDB) GetCollectionCountByExchange(exchange string) (int64, error)
- func (rdb *RelDB) GetExchange(name string) (exchange dia.Exchange, err error)
- func (rdb *RelDB) GetExchangeNames() (allExchanges []string, err error)
- func (rdb *RelDB) GetExchangePair(exchange string, foreignname string, caseSensitive bool) (dia.ExchangePair, error)
- func (rdb *RelDB) GetExchangePairCache(exchange string, foreignName string) (dia.ExchangePair, error)
- func (rdb *RelDB) GetExchangePairSeparator(exchange string) (string, error)
- func (rdb *RelDB) GetExchangePairSymbols(exchange string) (pairs []dia.ExchangePair, err error)
- func (rdb *RelDB) GetExchangeSymbol(exchange string, symbol string) (asset dia.Asset, err error)
- func (rdb *RelDB) GetExchangeSymbolAssetID(exchange string, symbol string) (assetID string, verified bool, err error)
- func (rdb *RelDB) GetExchangeSymbols(exchange string, substring string) (symbols []string, err error)
- func (rdb *RelDB) GetExchangesForSymbol(symbol string) (exchanges []string, err error)
- func (rdb *RelDB) GetExpiredFeeders() (oracleconfigs []dia.OracleConfig, err error)
- func (rdb *RelDB) GetFeeder(feederID string) (oracleconfig dia.OracleConfig, err error)
- func (rdb *RelDB) GetFeederAccessByID(id string) (owner string)
- func (rdb *RelDB) GetFeederByID(id string) (owner string)
- func (rdb *RelDB) GetFeederID(address string) (feederId string)
- func (rdb *RelDB) GetFeederLimit(owner string) (limit int)
- func (rdb *RelDB) GetFeederResources() (addresses []string, err error)
- func (rdb *RelDB) GetFiatAssetBySymbol(symbol string) (asset dia.Asset, err error)
- func (rdb *RelDB) GetHistoricalQuotations(asset dia.Asset, starttime time.Time, endtime time.Time) (quotations []AssetQuotation, err error)
- func (rdb *RelDB) GetKeyAsset(asset dia.Asset) (string, error)
- func (rdb *RelDB) GetKeyPairID(publicKey string) string
- func (rdb *RelDB) GetKeys(table string) (keys []string, err error)
- func (rdb *RelDB) GetLastAssetVolume24H(asset dia.Asset) (volume float64, err error)
- func (rdb *RelDB) GetLastBlockBlockscraper(blockchain string) (blockNumber int64, err error)
- func (rdb *RelDB) GetLastBlockNFTBid(nftclass dia.NFTClass) (blocknumber uint64, err error)
- func (rdb *RelDB) GetLastBlockNFTOffer(nftclass dia.NFTClass) (blocknumber uint64, err error)
- func (rdb *RelDB) GetLastBlockNFTTrade(nftclass dia.NFTClass) (blocknumber uint64, err error)
- func (rdb *RelDB) GetLastBlockheightTopshot(upperBound time.Time) (uint64, error)
- func (rdb *RelDB) GetLastHistoricalQuotationTimestamp(asset dia.Asset) (timestamp time.Time, err error)
- func (rdb *RelDB) GetLastNFTBid(address string, blockchain string, tokenID string, blockNumber uint64, ...) (nftBid dia.NFTBid, err error)
- func (rdb *RelDB) GetLastNFTOffer(address string, blockchain string, tokenID string, blockNumber uint64, ...) (offer dia.NFTOffer, err error)
- func (rdb *RelDB) GetNFT(address string, blockchain string, tokenID string) (dia.NFT, error)
- func (rdb *RelDB) GetNFTBids(address string, blockchain string, tokenID string) (bids []dia.NFTBid, err error)
- func (rdb *RelDB) GetNFTCategories() (categories []string, err error)
- func (rdb *RelDB) GetNFTClass(address string, blockchain string) (nftclass dia.NFTClass, err error)
- func (rdb *RelDB) GetNFTClassByID(id string) (nftclass dia.NFTClass, err error)
- func (rdb *RelDB) GetNFTClassID(address string, blockchain string) (ID string, err error)
- func (rdb *RelDB) GetNFTClasses(limit, offset uint64) (nftClasses []dia.NFTClass, err error)
- func (rdb *RelDB) GetNFTClassesByNameSymbol(searchstring string) (collections []dia.NFTClass, err error)
- func (rdb *RelDB) GetNFTExchange(name string) (exchange dia.Exchange, err error)
- func (rdb *RelDB) GetNFTExchanges(address string, blockchain string) (exchanges []string, err error)
- func (rdb *RelDB) GetNFTFloor(nftclass dia.NFTClass, timestamp time.Time, floorWindowSeconds time.Duration, ...) (floor float64, err error)
- func (rdb *RelDB) GetNFTFloorLevel(nftclass dia.NFTClass, timestamp time.Time, floorWindowSeconds time.Duration, ...) (floor float64, err error)
- func (rdb *RelDB) GetNFTFloorRange(nftClass dia.NFTClass, starttime time.Time, endtime time.Time, ...) (floorPrices []float64, err error)
- func (rdb *RelDB) GetNFTFloorRecursive(nftClass dia.NFTClass, timestamp time.Time, floorWindowSeconds time.Duration, ...) (floor float64, err error)
- func (rdb *RelDB) GetNFTID(address string, blockchain string, tokenID string) (ID string, err error)
- func (rdb *RelDB) GetNFTOffers(address string, blockchain string, tokenID string) (offers []dia.NFTOffer, err error)
- func (rdb *RelDB) GetNFTTrades(address string, blockchain string, tokenID string, starttime time.Time, ...) (trades []dia.NFTTrade, err error)
- func (rdb *RelDB) GetNFTTradesCollection(address string, blockchain string, starttime time.Time, endtime time.Time) (trades []dia.NFTTrade, err error)
- func (rdb *RelDB) GetNFTVolume(address, blockchain, exchange string, starttime time.Time, endtime time.Time) (float64, error)
- func (rdb *RelDB) GetNumNFTTrades(address, blockchain, exchange string, starttime time.Time, endtime time.Time) (int, error)
- func (rdb *RelDB) GetNumPairs(exchange dia.Exchange) (numPairs int, err error)
- func (rdb *RelDB) GetOracleConfig(address, chainid string) (oracleconfig dia.OracleConfig, err error)
- func (rdb *RelDB) GetOracleUpdateCount(address string, chainid string) (int64, error)
- func (rdb *RelDB) GetOracleUpdates(address string, chainid string, offset int) ([]dia.OracleUpdate, error)
- func (rdb *RelDB) GetOraclesByOwner(owner string) (oracleconfigs []dia.OracleConfig, err error)
- func (rdb *RelDB) GetPage(pageNumber uint32) (assets []dia.Asset, hasNextPage bool, err error)
- func (rdb *RelDB) GetPairsForAsset(asset dia.Asset, filterVerified bool, verified bool) ([]dia.ExchangePair, error)
- func (rdb *RelDB) GetPairsForExchange(exchange dia.Exchange, filterVerified bool, verified bool) ([]dia.ExchangePair, error)
- func (rdb *RelDB) GetPoolByAddress(blockchain string, address string) (pool dia.Pool, err error)
- func (rdb *RelDB) GetPoolsByAsset(asset dia.Asset, liquidityThreshold float64, liquidityThresholdUSD float64) ([]dia.Pool, error)
- func (rdb *RelDB) GetScraperConfig(ctx context.Context, scraperName string, config ScraperConfig) error
- func (rdb *RelDB) GetScraperIndex(exchange string, scraperType string) (string, int64, error)
- func (rdb *RelDB) GetScraperState(ctx context.Context, scraperName string, state ScraperState) error
- func (rdb *RelDB) GetSortedAssetSymbols(numAssets int64, skip int64, search string) (volumeSortedAssets []dia.AssetVolume, err error)
- func (rdb *RelDB) GetTopAssetByVolume(symbol string) (assets []dia.Asset, err error)
- func (rdb *RelDB) GetTopNFTsEth(numCollections int, offset int64, exchanges []string, starttime time.Time, ...) (nftVolumes []struct{ ... }, err error)
- func (rdb *RelDB) GetTotalFeeder(owner string) (total int)
- func (rdb *RelDB) GetTradedNFTClasses(starttime time.Time) (nftClasses []dia.NFTClass, err error)
- func (rdb *RelDB) GetUnverifiedExchangeSymbols(exchange string) (symbols []string, err error)
- func (rdb *RelDB) InsertAssetMap(group_id string, asset_id string) error
- func (rdb *RelDB) InsertNewAssetMap(asset_id string) error
- func (rdb *RelDB) SetAsset(asset dia.Asset) error
- func (rdb *RelDB) SetAssetCache(asset dia.Asset) error
- func (rdb *RelDB) SetAssetVolume24H(asset dia.Asset, volume float64, timestamp time.Time) error
- func (rdb *RelDB) SetBlockData(blockdata dia.BlockData) error
- func (rdb *RelDB) SetBlockchain(blockchain dia.BlockChain) (err error)
- func (rdb *RelDB) SetChainConfig(chainconfig dia.ChainConfig) (err error)
- func (rdb *RelDB) SetExchange(exchange dia.Exchange) (err error)
- func (rdb *RelDB) SetExchangePair(exchange string, pair dia.ExchangePair, cache bool) error
- func (rdb *RelDB) SetExchangePairCache(exchange string, pair dia.ExchangePair) error
- func (rdb *RelDB) SetExchangeSymbol(exchange string, symbol string) error
- func (rdb *RelDB) SetFeederConfig(feederid, oracleconfigid string) error
- func (rdb *RelDB) SetHistoricalQuotation(quotation AssetQuotation) error
- func (rdb *RelDB) SetKeyPair(publickey string, privatekey string) error
- func (rdb *RelDB) SetNFT(nft dia.NFT) error
- func (rdb *RelDB) SetNFTBid(bid dia.NFTBid) error
- func (rdb *RelDB) SetNFTClass(nftClass dia.NFTClass) error
- func (rdb *RelDB) SetNFTExchange(exchange dia.NFTExchange) (err error)
- func (rdb *RelDB) SetNFTOffer(offer dia.NFTOffer) error
- func (rdb *RelDB) SetNFTTrade(trade dia.NFTTrade) error
- func (rdb *RelDB) SetNFTTradeToTable(trade dia.NFTTrade, table string) error
- func (rdb *RelDB) SetOracleConfig(...) error
- func (rdb *RelDB) SetPool(pool dia.Pool) error
- func (rdb *RelDB) SetScraperConfig(ctx context.Context, scraperName string, config ScraperConfig) error
- func (rdb *RelDB) SetScraperIndex(exchange string, scraperType string, indexType string, index int64) error
- func (rdb *RelDB) SetScraperState(ctx context.Context, scraperName string, state ScraperState) error
- func (rdb *RelDB) UpdateFeederAddressCheckSum(oracleaddress string) (err error)
- func (rdb *RelDB) UpdateNFTClassCategory(nftclassID string, category string) (bool, error)
- func (rdb *RelDB) VerifyExchangeSymbol(exchange string, symbol string, assetID string) (bool, error)
- type RelDatastore
- type ScraperConfig
- type ScraperState
- type Stock
- type StockQuotation
- type SymbolExchangeDetails
Constants ¶
const ( WindowYesterday = 24 * 60 * 60 Window1h = 60 * 60 Window7d = 7 * 24 * 60 * 60 Window14d = 7 * 24 * 60 * 60 Window30d = 30 * 24 * 60 * 60 Window2 = 24 * 60 * 60 * 8 BufferTTL = 60 * 60 BiggestWindow = Window2 TimeOutRedis = time.Duration(time.Second*BiggestWindow + time.Second*BufferTTL) TimeOutAssetQuotation = time.Duration(time.Second * WindowYesterday) )
const ( NfttradeCurrTable = "nfttradecurrent" NfttradeSumeriaTable = "nfttradesumeria" )
const (
WindowVolume = 60 * 60 * 24
)
Variables ¶
var EscapeReplacer = strings.NewReplacer("\n", `\n`)
Functions ¶
func GetExchangeType ¶ added in v1.4.2
func StraightRates ¶
func StraightRates(intRates []*InterestRate) map[time.Time]float64
StraightRates returns a map which maps a rate to each day in the time period. This includes (artificial) rate values for non-business days. intRates must be sorted by date in increasing order.
func WeightedRates ¶
func WeightedRates(intRates []*InterestRate, dateInit, dateFinal time.Time, holidays []time.Time, startIndex int) (map[time.Time]float64, int)
WeightedRates returns a map which maps a rate to each business day in the time period given by @dateInit and @dateFinal. Rates are weighted by the rate factor. intRates must be sorted by date in increasing order.
Types ¶
type AssetQuotation ¶ added in v1.2.0
type AssetQuotation struct { Asset dia.Asset `json:"Asset"` Price float64 `json:"Price"` Source string `json:"Source"` Time time.Time `json:"Time"` }
AssetQuotation is the most recent price point information on an asset.
func (*AssetQuotation) MarshalBinary ¶ added in v1.2.0
func (aq *AssetQuotation) MarshalBinary() ([]byte, error)
MarshalBinary for quotations
func (*AssetQuotation) UnmarshalBinary ¶ added in v1.2.0
func (aq *AssetQuotation) UnmarshalBinary(data []byte) error
UnmarshalBinary for quotations
type AssetQuotationFull ¶ added in v1.2.0
type AssetQuotationFull struct { Symbol string `json:"Symbol"` Name string `json:"Name"` Address string `json:"Address"` Blockchain string `json:"Blockchain"` Price float64 `json:"Price"` PriceYesterday float64 `json:"PriceYesterday"` VolumeYesterdayUSD float64 `json:"VolumeYesterdayUSD"` Time time.Time `json:"Time"` Source string `json:"Source"` Signature string `json:"Signature,omitempty"` }
func (*AssetQuotationFull) MarshalBinary ¶ added in v1.2.0
func (aq *AssetQuotationFull) MarshalBinary() ([]byte, error)
MarshalBinary for quotations
func (*AssetQuotationFull) UnmarshalBinary ¶ added in v1.2.0
func (aq *AssetQuotationFull) UnmarshalBinary(data []byte) error
UnmarshalBinary for quotations
type BenchmarkedIndex ¶ added in v1.2.0
type BenchmarkedIndex struct { Name string Values []BenchmarkedIndexValue }
type BenchmarkedIndexValue ¶ added in v1.2.0
type Change ¶
type Change struct {
USD []CurrencyChange `json:"USD"`
}
func (*Change) UnmarshalBinary ¶
UnmarshalBinary -
type CoinSymbolAndName ¶
type CurrencyChange ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func NewDataStore ¶
func NewDataStoreWithOptions ¶
func NewInfluxDataStore ¶
func NewRedisDataStore ¶
func (*DB) AddAssetQuotationsToBatch ¶ added in v1.2.0
func (datastore *DB) AddAssetQuotationsToBatch(quotations []*AssetQuotation) error
AddAssetQuotationsToBatch is a helper function that adds a slice of quotations to an influx batch.
func (*DB) CopyInfluxMeasurements ¶ added in v1.2.0
func (datastore *DB) CopyInfluxMeasurements(dbOrigin string, dbDestination string, tableOrigin string, tableDestination string, timeInit time.Time, timeFinal time.Time) (numCopiedRows int64, err error)
CopyInfluxMeasurements copies entries from measurement @tableOrigin in database @dbOrigin into @tableDestination in database @dbDestination. It takes into account all data ranging from @timeInit until @timeFinal.
func (*DB) ExecuteRedisPipe ¶ added in v1.3.0
func (*DB) ExistInterestRate ¶
ExistInterestRate returns true if a database entry with given date stamp exists, and false otherwise. @date should be a substring of a string formatted as "yyyy-mm-dd hh:mm:ss".
func (*DB) FlushRedisPipe ¶ added in v1.3.0
func (*DB) Get24HoursAssetVolume ¶ added in v1.4.2
Get24HoursAssetVolume returns the 24h trading volume of @asset across exchanges.
func (*DB) Get24HoursExchangeVolume ¶ added in v1.4.2
Get24HoursExchangeVolume returns 24h trade volume on @exchange using VOL120 filtered data from influx.
func (*DB) GetActiveExchangesAndPairs ¶ added in v1.4.2
func (datastore *DB) GetActiveExchangesAndPairs( address string, blockchain string, numTradesThreshold int64, starttime time.Time, endtime time.Time, ) (map[string][]dia.Pair, map[string]int64, error)
GetActiveExchangesAndPairs returns all exchanges the asset with @address and @blockchain was traded on in the given time-range as keys of a map. The map's values are the underlying pairs. Additionally, a map is returned where keys are exchange/pair identifier and values are the number of trades in the respective time-range. The pair has to have at least @numTrades trades in the given time-range in order to get returned.
func (*DB) GetAllTrades ¶
GetAllTrades returns at most @maxTrades trades from influx with timestamp > @t. Only used by replayInflux option.
func (*DB) GetAssetPriceUSD ¶ added in v1.2.0
func (datastore *DB) GetAssetPriceUSD(asset dia.Asset, timestamp time.Time) (price float64, err error)
GetAssetPriceUSD returns the latest USD price of @asset before @timestamp.
func (*DB) GetAssetPriceUSDCache ¶ added in v1.2.0
GetAssetPriceUSDCache returns the latest price of @asset from the cache.
func (*DB) GetAssetPriceUSDLatest ¶ added in v1.2.0
GetAssetPriceUSDLatest returns the latest price of @asset.
func (*DB) GetAssetQuotation ¶ added in v1.2.0
func (datastore *DB) GetAssetQuotation(asset dia.Asset, timestamp time.Time) (*AssetQuotation, error)
GetAssetQuotation returns the latest full quotation for @asset before @timestamp.
func (*DB) GetAssetQuotationCache ¶ added in v1.2.0
func (datastore *DB) GetAssetQuotationCache(asset dia.Asset) (*AssetQuotation, error)
GetAssetQuotationCache returns the latest quotation for @asset from the redis cache.
func (*DB) GetAssetQuotationLatest ¶ added in v1.2.0
func (datastore *DB) GetAssetQuotationLatest(asset dia.Asset) (*AssetQuotation, error)
GetAssetQuotation returns the latest full quotation for @asset.
func (*DB) GetAssetQuotations ¶ added in v1.4.2
func (datastore *DB) GetAssetQuotations(asset dia.Asset, starttime time.Time, endtime time.Time) ([]AssetQuotation, error)
GetAssetQuotations returns all assetQuotations for @asset in the given time-range.
func (*DB) GetAssetsMarketCap ¶ added in v1.2.0
GetAssetsMarketCap returns the actual market cap of @asset.
func (*DB) GetAssetsWithVOLInflux ¶ added in v1.2.0
GetAssetsWithVOLInflux returns all assets that have an entry in Influx's volumes table and hence have been traded since @timeInit.
func (*DB) GetAvailablePairs ¶ added in v1.2.0
func (datastore *DB) GetAvailablePairs(exchange string) ([]dia.ExchangePair, error)
GetAvailablePairs a slice of all pairs available in the exchange in the internal redis db
func (*DB) GetBenchmarkedIndexValuesInflux ¶ added in v1.2.0
func (*DB) GetCompoundedAvg ¶
func (datastore *DB) GetCompoundedAvg(symbol string, date time.Time, calDays, daysPerYear int, rounding int) (*InterestRate, error)
GetCompoundedAvg returns the compounded average of the index @symbol over rolling @calDays calendar days.
func (*DB) GetCompoundedAvgDIARange ¶
func (datastore *DB) GetCompoundedAvgDIARange(symbol string, dateInit, dateFinal time.Time, calDays, daysPerYear int, rounding int) (values []*InterestRate, err error)
GetCompoundedAvgDIARange returns the compounded average DIA index of @symbol over rolling @calDays calendar days.
func (*DB) GetCompoundedAvgRange ¶
func (datastore *DB) GetCompoundedAvgRange(symbol string, dateInit, dateFinal time.Time, calDays, daysPerYear int, rounding int) (values []*InterestRate, err error)
GetCompoundedAvgRange returns the compounded average of the index @symbol over rolling @calDays calendar days.
func (*DB) GetCompoundedIndex ¶
func (datastore *DB) GetCompoundedIndex(symbol string, date time.Time, daysPerYear int, rounding int) (*InterestRate, error)
GetCompoundedIndex returns the compounded index over the maximal period of existence of @symbol
func (*DB) GetCompoundedIndexRange ¶
func (datastore *DB) GetCompoundedIndexRange(symbol string, dateInit, dateFinal time.Time, daysPerYear int, rounding int) (values []*InterestRate, err error)
GetCompoundedIndexRange returns the compounded average of the index @symbol over rolling @calDays calendar days.
func (*DB) GetCompoundedRate ¶
func (datastore *DB) GetCompoundedRate(symbol string, dateInit, date time.Time, daysPerYear int, rounding int) (*InterestRate, error)
GetCompoundedRate returns the compounded rate for the period @dateInit to @date. It computes the rate for all days for which an entry is present in the database. All other days are assumed to be holidays (or weekends).
func (*DB) GetCurrencyChange ¶
func (*DB) GetDiaCirculatingSupply ¶ added in v1.4.2
func (*DB) GetDiaTotalSupply ¶ added in v1.4.2
func (*DB) GetExchangePairVolumes ¶ added in v1.4.138
func (*DB) GetFilterAllExchanges ¶ added in v1.4.131
func (datastore *DB) GetFilterAllExchanges( filter string, address string, blockchain string, starttime time.Time, endtime time.Time, ) (assetQuotations []AssetQuotation, err error)
GetFilterAllExchanges returns a slice of quotations for each exchange the asset given by @address and @blockchain has a filter value in the given time-range. It returns the most recent filter value in the given time-range for each exchange resp.
func (*DB) GetFilterPoints ¶
func (datastore *DB) GetFilterPoints(filter string, exchange string, symbol string, scale string, starttime time.Time, endtime time.Time) (*Points, error)
GetFilterPoints returns filter points from either a specific exchange or all exchanges. symbol is mapped to the underlying asset with biggest market cap.
func (*DB) GetFilterPointsAsset ¶ added in v1.4.2
func (*DB) GetFirstDate ¶
GetFirstDate returns the oldest date written in the database for the rate with symbol @symbol
func (*DB) GetFirstTradeDate ¶ added in v1.2.0
func (*DB) GetForeignPriceYesterday ¶
GetForeignPriceYesterday returns the average price of @symbol on @source from yesterday
func (*DB) GetForeignQuotationInflux ¶
func (datastore *DB) GetForeignQuotationInflux(symbol, source string, timestamp time.Time) (ForeignQuotation, error)
GetForeignQuotationInflux returns the last quotation of @symbol before @timestamp
func (*DB) GetForeignSymbolsInflux ¶
GetForeignSymbolsInflux returns a list with all symbols available for quotation from @source.
func (*DB) GetInterestRate ¶
func (datastore *DB) GetInterestRate(symbol, date string) (*InterestRate, error)
GetInterestRate returns the interest rate value for the last time stamp before @date. If @date is an empty string it returns the rate at the latest time stamp. @symbol is the shorthand symbol for the requested interest rate. @date is a string in the format yyyy-mm-dd.
func (*DB) GetInterestRateRange ¶
func (datastore *DB) GetInterestRateRange(symbol, dateInit, dateFinal string) ([]*InterestRate, error)
GetInterestRateRange returns the interest rate values for a range of timestamps. @symbol is the shorthand symbol for the requested interest rate. @dateInit and @dateFinal are strings in the format yyyy-mm-dd.
func (*DB) GetLastPriceBefore ¶
func (*DB) GetLastTradeTimeForExchange ¶
func (*DB) GetLastTrades ¶
func (datastore *DB) GetLastTrades(asset dia.Asset, exchange string, timestamp time.Time, maxTrades int, fullAsset bool) ([]dia.Trade, error)
GetLastTrades returns the last @maxTrades of @asset on @exchange before @timestamp. If exchange is empty string it returns trades from all exchanges. If fullAsset=true, blockchain and address of both involved assets is returned as well
func (*DB) GetLatestSupply ¶
func (*DB) GetNumTrades ¶ added in v1.4.2
func (datastore *DB) GetNumTrades(exchange string, address string, blockchain string, starttime time.Time, endtime time.Time) (numTrades int64, err error)
GetNumTrades returns the number of trades on @exchange for asset with @address and @blockchain in the given time-range. If @address and @blockchain are empty, it returns all trades on @exchange in the given-time range.
func (*DB) GetNumTradesExchange24H ¶ added in v1.4.2
GetNumTradesExchange24H returns the number of trades on @exchange in the last 24 hours.
func (*DB) GetNumTradesSeries ¶ added in v1.4.2
func (datastore *DB) GetNumTradesSeries( asset dia.Asset, exchange string, starttime time.Time, endtime time.Time, grouping string, ) (numTrades []int64, err error)
GetNumTradesSeries returns a time-series of number of trades in the respective time-ranges. If pair is the empty string, trades are identified by address/blockchain. @grouping defines the time-ranges in the notation of influx such as 30s, 40m, 2h,...
func (*DB) GetOldTradesFromInflux ¶ added in v1.2.0
func (datastore *DB) GetOldTradesFromInflux(table string, exchange string, verified bool, timeInit, timeFinal time.Time) ([]dia.Trade, error)
GetOldTradesFromInflux returns all recorded trades from @table done on @exchange between @timeInit and @timeFinal where the time interval is closed on the left and open on the right side. If @exchange is empty, trades across all exchanges are returned. If @verified is true, address and blockchain are also parsed for both assets.
func (*DB) GetOldestQuotation ¶ added in v1.4.207
func (datastore *DB) GetOldestQuotation(asset dia.Asset) (quotation AssetQuotation, err error)
func (*DB) GetPoolInflux ¶ added in v1.4.2
func (datastore *DB) GetPoolInflux(poolAddress string, starttime time.Time, endtime time.Time) ([]dia.Pool, error)
GetPoolInflux returns all info/liquidities of pool with @poolAddress in the time-range [starttime, endtime).
func (*DB) GetPoolLiquiditiesUSD ¶ added in v1.4.292
GetPoolLiquiditiesUSD attempts to fill the field @VolumeUSD by fetching the price of the corresponding asset. @priceCache acts as a poor man's cache for repeated requests.
func (*DB) GetPrice14d ¶
func (*DB) GetPrice1h ¶
func (*DB) GetPrice30d ¶
func (*DB) GetPrice7d ¶
func (*DB) GetPriceYesterday ¶
func (*DB) GetRates ¶
GetRates returns a (unique) slice of all rates that have been written into the database
func (*DB) GetRatesMeta ¶
func (datastore *DB) GetRatesMeta() (RatesMeta []InterestRateMeta, err error)
GetRatesMeta returns a list of all available rate symbols along with their first timestamp in the database.
func (*DB) GetSortedAssetQuotations ¶ added in v1.2.0
func (datastore *DB) GetSortedAssetQuotations(assets []dia.Asset) ([]AssetQuotation, error)
GetSortedQuotations returns quotations for all assets in @assets, sorted by 24h volume in descending order.
func (*DB) GetStockQuotation ¶ added in v1.2.0
func (db *DB) GetStockQuotation(source string, symbol string, timeInit time.Time, timeFinal time.Time) ([]StockQuotation, error)
GetStockQuotationInflux returns the last quotation of @symbol before @timestamp.
func (*DB) GetStockSymbols ¶ added in v1.4.0
GetStockSymbols returns all symbols available from @source.
func (*DB) GetSupplyCache ¶ added in v1.4.2
func (*DB) GetSupplyInflux ¶
func (datastore *DB) GetSupplyInflux(asset dia.Asset, starttime time.Time, endtime time.Time) ([]dia.Supply, error)
GetSupplyInflux returns supply and circulating supply of @asset. Needs asset.Address and asset.Blockchain. If no time range is given it returns the latest supply.
func (*DB) GetSynthAssets ¶ added in v1.4.2
GetSynthSupplyInflux Get distinct syntasset per protocol
func (*DB) GetSynthLastSupplyInflux ¶ added in v1.4.2
func (*DB) GetSynthSupplyInflux ¶ added in v1.4.2
func (datastore *DB) GetSynthSupplyInflux(blockchain, protocol, address string, limit int, starttime, endtime time.Time) ([]dia.SynthAssetSupply, error)
GetSynthSupplyInflux
func (*DB) GetTopAssetByMcap ¶ added in v1.2.0
GetTopAssetByMcap returns the asset with highest market cap among all assets with symbol @symbol.
func (*DB) GetTopAssetByVolume ¶ added in v1.2.0
func (datastore *DB) GetTopAssetByVolume(symbol string, relDB *RelDB) (topAsset dia.Asset, err error)
GetTopAssetByVolume returns the asset with highest volume among all assets with symbol @symbol. This method allows us to use all API endpoints called on a symbol.
func (*DB) GetTradeInflux ¶
func (datastore *DB) GetTradeInflux(asset dia.Asset, exchange string, endtime time.Time, window time.Duration) (*dia.Trade, error)
GetTradeInflux returns the latest trade of @asset on @exchange before @timestamp in the time-range [endtime-window, endtime].
func (*DB) GetTradePrice14d ¶
func (*DB) GetTradePrice1h ¶
func (*DB) GetTradePrice24h ¶
func (*DB) GetTradePrice30d ¶
func (*DB) GetTradePrice7d ¶
func (*DB) GetTradePriceBefore ¶
func (*DB) GetTradesByExchangepairs ¶ added in v1.4.305
func (datastore *DB) GetTradesByExchangepairs(exchangepairMap map[string][]dia.Pair, exchangepoolMap map[string][]string, starttime time.Time, endtime time.Time) ([]dia.Trade, error)
GetTradesByExchangepairs returns all trades where either of the following is fulfilled. 1. The exchange is a key of @exchangepairMap AND the pair is in the corresponding slice @[]dia.Pair. 2. The exchange is a key of @exchangepoolMap AND the pool is in the corresponding slice @[]string.
func (*DB) GetTradesByExchangesAndBaseAssets ¶ added in v1.4.2
func (*DB) GetTradesByExchangesBatched ¶ added in v1.3.5
func (datastore *DB) GetTradesByExchangesBatched( quoteasset dia.Asset, baseassets []dia.Asset, exchanges []string, startTimes []time.Time, endTimes []time.Time, maxTrades int, ) ([]dia.Trade, error)
GetTradesByExchangesBatched executes multiple select queries on the trades table in one batch. The time ranges of the queries are given by the intervals [startTimes[i], endTimes[i]].
func (*DB) GetTradesByExchangesBatchedFull ¶ added in v1.4.2
func (datastore *DB) GetTradesByExchangesBatchedFull( quoteasset dia.Asset, baseassets []dia.Asset, exchanges []string, returnBasetoken bool, startTimes []time.Time, endTimes []time.Time, maxTrades int, ) ([]dia.Trade, error)
GetTradesByExchangesBatchedFull executes multiple select queries on the trades table in one batch. The time ranges of the queries are given by the intervals [startTimes[i], endTimes[i]].
func (*DB) GetTradesByExchangesFull ¶ added in v1.4.2
func (*DB) GetTradesByFeedSelection ¶ added in v1.4.305
func (datastore *DB) GetTradesByFeedSelection( feedselection []dia.FeedSelection, starttimes []time.Time, endtimes []time.Time, limit int, ) ([]dia.Trade, error)
GetTradesByFeedSelection returns all trades with restrictions given by the struct @feedselection.
func (*DB) GetVWAPFirefly ¶ added in v1.4.2
func (*DB) GetVolumeInflux ¶
func (datastore *DB) GetVolumeInflux(asset dia.Asset, exchange string, starttime time.Time, endtime time.Time) (*float64, error)
GetVolumeInflux returns the volume of @asset on @exchange using the VOL120 filter in the given time-range. Both, @asset and @exchange may be empty. If @starttime,@endtime are empty, the last 24h are taken into account.
func (*DB) GetVolumesAllExchanges ¶ added in v1.4.50
func (datastore *DB) GetVolumesAllExchanges(asset dia.Asset, starttime time.Time, endtime time.Time) (exchVolumes dia.ExchangeVolumesList, err error)
Returns aggregated volumes from filters measurement on all exchanges.
func (*DB) GetxcTradesByExchangesBatched ¶ added in v1.4.258
func (datastore *DB) GetxcTradesByExchangesBatched( quoteassets []dia.Asset, exchanges []string, startTimes []time.Time, endTimes []time.Time, ) ([]dia.Trade, error)
GetxcTradesByExchangesBatched executes multiple select queries on the trades table in one batch. The time ranges of the queries are given by the intervals [startTimes[i], endTimes[i]].
func (*DB) SaveFilterInflux ¶
func (datastore *DB) SaveFilterInflux(filter string, asset dia.Asset, exchange string, value float64, t time.Time) error
SaveFilterInflux stores a filter point in influx.
func (*DB) SaveForeignQuotationInflux ¶
func (datastore *DB) SaveForeignQuotationInflux(fq ForeignQuotation) error
SaveForeignQuotationInflux stores a quotation which is not from DIA to an influx batch
func (*DB) SaveIndexEngineTimeInflux ¶ added in v1.2.0
func (*DB) SavePoolInflux ¶ added in v1.4.2
SavePoolInflux stores a DEX pool in influx.
func (*DB) SaveSynthSupplyInflux ¶ added in v1.4.2
func (datastore *DB) SaveSynthSupplyInflux(t *dia.SynthAssetSupply) error
SaveSynthSupplyInflux stores a synth supply in influx. Flushed when more than maxPoints in batch. Wrapper around SaveSynthSupplyInfluxToTable.
func (*DB) SaveSynthSupplyInfluxToTable ¶ added in v1.4.2
func (datastore *DB) SaveSynthSupplyInfluxToTable(t *dia.SynthAssetSupply, table string) error
SaveSynthSupplyInfluxToTable stores a synth supply in influx into @table. Flushed when more than maxPoints in batch.
func (*DB) SaveTradeInflux ¶
SaveTradeInflux stores a trade in influx. Flushed when more than maxPoints in batch. Wrapper around SaveTradeInfluxToTable.
func (*DB) SaveTradeInfluxToTable ¶ added in v1.2.0
SaveTradeInfluxToTable stores a trade in influx into @table. Flushed when more than maxPoints in batch.
func (*DB) SetAssetPriceUSD ¶ added in v1.2.0
SetAssetPriceUSD stores the price of @asset in influx and the caching layer. The latter only holds the most recent price point.
func (*DB) SetAssetQuotation ¶ added in v1.2.0
func (datastore *DB) SetAssetQuotation(quotation *AssetQuotation) error
SetAssetQuotation stores the full quotation of @asset into influx and cache.
func (*DB) SetAssetQuotationCache ¶ added in v1.2.0
func (datastore *DB) SetAssetQuotationCache(quotation *AssetQuotation, check bool) (bool, error)
SetAssetQuotationCache stores @quotation in redis cache. If @check is true, it checks for a more recent quotation first.
func (*DB) SetAvailablePairs ¶ added in v1.2.0
func (datastore *DB) SetAvailablePairs(exchange string, pairs []dia.ExchangePair) error
SetAvailablePairs stores @pairs in redis TO DO: Setter and getter should act on RelDB
func (*DB) SetBatchFiatPriceInflux ¶ added in v1.2.0
func (datastore *DB) SetBatchFiatPriceInflux(fiatQuotations []*FiatQuotation) error
func (*DB) SetCurrencyChange ¶
func (*DB) SetDiaCirculatingSupply ¶ added in v1.4.2
func (*DB) SetDiaTotalSupply ¶ added in v1.4.2
func (*DB) SetFilter ¶
func (datastore *DB) SetFilter(filter string, asset dia.Asset, exchange string, value float64, t time.Time) error
SetFilter stores a filter point
func (*DB) SetInfluxClient ¶ added in v1.2.0
SetInfluxClient resets influx's client url to @url.
func (*DB) SetInterestRate ¶
func (datastore *DB) SetInterestRate(ir *InterestRate) error
SetInterestRate writes the interest rate struct ir into the Redis database and writes rate type into a set of all available rates (if not done yet).
func (*DB) SetLastTradeTimeForExchange ¶
func (*DB) SetSingleFiatPriceRedis ¶ added in v1.2.0
func (datastore *DB) SetSingleFiatPriceRedis(fiatQuotation *FiatQuotation) error
func (*DB) SetStockQuotation ¶ added in v1.2.0
func (datastore *DB) SetStockQuotation(sq StockQuotation) error
SetStockQuotationInflux stores a stock quotation to an influx batch.
func (*DB) SetVWAPFirefly ¶ added in v1.4.2
func (*DB) WriteBatchInflux ¶
type Datastore ¶
type Datastore interface { SetInfluxClient(url string) SetBatchFiatPriceInflux(fqs []*FiatQuotation) error SetSingleFiatPriceRedis(fiatQuotation *FiatQuotation) error GetLatestSupply(string, *RelDB) (*dia.Supply, error) GetSupplyCache(asset dia.Asset) (dia.Supply, error) GetSupply(string, time.Time, time.Time, *RelDB) ([]dia.Supply, error) SetSupply(supply *dia.Supply) error GetSupplyInflux(dia.Asset, time.Time, time.Time) ([]dia.Supply, error) SaveSynthSupplyInfluxToTable(*dia.SynthAssetSupply, string) error SaveSynthSupplyInflux(*dia.SynthAssetSupply) error GetSynthSupplyInflux(string, string, string, int, time.Time, time.Time) ([]dia.SynthAssetSupply, error) GetSynthAssets(string, string) ([]string, error) SetDiaTotalSupply(totalSupply float64) error GetDiaTotalSupply() (float64, error) SetDiaCirculatingSupply(circulatingSupply float64) error GetDiaCirculatingSupply() (float64, error) GetSymbols(exchange string) ([]string, error) GetLastTradeTimeForExchange(asset dia.Asset, exchange string) (*time.Time, error) SetLastTradeTimeForExchange(asset dia.Asset, exchange string, t time.Time) error GetFirstTradeDate(table string) (time.Time, error) SaveTradeInflux(t *dia.Trade) error SaveTradeInfluxToTable(t *dia.Trade, table string) error GetTradeInflux(dia.Asset, string, time.Time, time.Duration) (*dia.Trade, error) SaveFilterInflux(filter string, asset dia.Asset, exchange string, value float64, t time.Time) error GetFilterAllExchanges(filter string, address string, blockchain string, starttime time.Time, endtime time.Time) ([]AssetQuotation, error) GetLastTrades(asset dia.Asset, exchange string, timestamp time.Time, maxTrades int, fullAsset bool) ([]dia.Trade, error) GetAllTrades(t time.Time, maxTrades int) ([]dia.Trade, error) GetTradesByExchangesFull(asset dia.Asset, baseAssets []dia.Asset, exchanges []string, returnBasetoken bool, startTime, endTime time.Time, maxTrades int) ([]dia.Trade, error) GetTradesByExchangesAndBaseAssets(asset dia.Asset, baseassets []dia.Asset, exchanges []string, startTime time.Time, endTime time.Time, maxTrades int) ([]dia.Trade, error) GetTradesByExchangesBatchedFull(asset dia.Asset, baseAssets []dia.Asset, exchanges []string, returnBasetoken bool, startTimes, endTimes []time.Time, maxTrades int) ([]dia.Trade, error) GetTradesByExchangesBatched(asset dia.Asset, baseAssets []dia.Asset, exchanges []string, startTimes, endTimes []time.Time, maxTrades int) ([]dia.Trade, error) GetxcTradesByExchangesBatched(quoteassets []dia.Asset, exchanges []string, startTimes []time.Time, endTimes []time.Time) ([]dia.Trade, error) GetTradesByExchangepairs(exchangepairMap map[string][]dia.Pair, exchangepoolMap map[string][]string, starttime time.Time, endtime time.Time) ([]dia.Trade, error) GetTradesByFeedSelection(feedselection []dia.FeedSelection, starttimes []time.Time, endtimes []time.Time, limit int) ([]dia.Trade, error) GetActiveExchangesAndPairs(address string, blockchain string, numTradesThreshold int64, starttime time.Time, endtime time.Time) (map[string][]dia.Pair, map[string]int64, error) GetOldTradesFromInflux(table string, exchange string, verified bool, timeInit, timeFinal time.Time) ([]dia.Trade, error) CopyInfluxMeasurements(dbOrigin string, dbDestination string, tableOrigin string, tableDestination string, timeInit time.Time, timeFinal time.Time) (int64, error) Flush() error ExecuteRedisPipe() error FlushRedisPipe() error GetFilterPoints(filter string, exchange string, symbol string, scale string, starttime time.Time, endtime time.Time) (*Points, error) GetFilterPointsAsset(filter string, exchange string, address string, blockchain string, starttime time.Time, endtime time.Time) (*Points, error) SetFilter(filterName string, asset dia.Asset, exchange string, value float64, t time.Time) error GetLastPriceBefore(asset dia.Asset, filter string, exchange string, timestamp time.Time) (Price, error) SetAvailablePairs(exchange string, pairs []dia.ExchangePair) error GetAvailablePairs(exchange string) ([]dia.ExchangePair, error) SetCurrencyChange(cc *Change) error GetCurrencyChange() (*Change, error) // Volume methods GetVolumeInflux(asset dia.Asset, exchange string, starttime time.Time, endtime time.Time) (*float64, error) Get24HoursAssetVolume(asset dia.Asset) (*float64, error) Get24HoursExchangeVolume(exchange string) (*float64, error) GetNumTradesExchange24H(exchange string) (int64, error) GetNumTrades(exchange string, address string, blockchain string, starttime time.Time, endtime time.Time) (int64, error) GetNumTradesSeries(asset dia.Asset, exchange string, starttime time.Time, endtime time.Time, grouping string) ([]int64, error) GetVolumesAllExchanges(asset dia.Asset, starttime time.Time, endtime time.Time) (exchVolumes dia.ExchangeVolumesList, err error) GetExchangePairVolumes(asset dia.Asset, starttime time.Time, endtime time.Time, threshold float64) (map[string][]dia.PairVolume, error) // New Asset pricing methods: 23/02/2021 SetAssetPriceUSD(asset dia.Asset, price float64, timestamp time.Time) error GetAssetPriceUSD(asset dia.Asset, timestamp time.Time) (float64, error) GetAssetPriceUSDLatest(asset dia.Asset) (price float64, err error) SetAssetQuotation(quotation *AssetQuotation) error GetAssetQuotation(asset dia.Asset, timestamp time.Time) (*AssetQuotation, error) GetAssetQuotations(asset dia.Asset, starttime time.Time, endtime time.Time) ([]AssetQuotation, error) GetAssetQuotationLatest(asset dia.Asset) (*AssetQuotation, error) GetSortedAssetQuotations(assets []dia.Asset) ([]AssetQuotation, error) AddAssetQuotationsToBatch(quotations []*AssetQuotation) error SetAssetQuotationCache(quotation *AssetQuotation, check bool) (bool, error) GetAssetQuotationCache(asset dia.Asset) (*AssetQuotation, error) GetAssetPriceUSDCache(asset dia.Asset) (price float64, err error) GetTopAssetByMcap(symbol string, relDB *RelDB) (dia.Asset, error) GetTopAssetByVolume(symbol string, relDB *RelDB) (topAsset dia.Asset, err error) GetAssetsWithVOLInflux(timeInit time.Time) ([]dia.Asset, error) GetOldestQuotation(asset dia.Asset) (AssetQuotation, error) // DEX Pool methods SavePoolInflux(p dia.Pool) error GetPoolInflux(poolAddress string, starttime time.Time, endtime time.Time) ([]dia.Pool, error) GetPoolLiquiditiesUSD(p *dia.Pool, priceCache map[string]float64) // Market Measures GetAssetsMarketCap(asset dia.Asset) (float64, error) // Interest rates' methods SetInterestRate(ir *InterestRate) error GetInterestRate(symbol, date string) (*InterestRate, error) GetInterestRateRange(symbol, dateInit, dateFinal string) ([]*InterestRate, error) GetRatesMeta() (RatesMeta []InterestRateMeta, err error) GetCompoundedIndex(symbol string, date time.Time, daysPerYear int, rounding int) (*InterestRate, error) GetCompoundedIndexRange(symbol string, dateInit, dateFinal time.Time, daysPerYear int, rounding int) ([]*InterestRate, error) GetCompoundedAvg(symbol string, date time.Time, calDays, daysPerYear int, rounding int) (*InterestRate, error) GetCompoundedAvgRange(symbol string, dateInit, dateFinal time.Time, calDays, daysPerYear int, rounding int) ([]*InterestRate, error) GetCompoundedAvgDIARange(symbol string, dateInit, dateFinal time.Time, calDays, daysPerYear int, rounding int) ([]*InterestRate, error) // Foreign quotation methods SaveForeignQuotationInflux(fq ForeignQuotation) error GetForeignQuotationInflux(symbol, source string, timestamp time.Time) (ForeignQuotation, error) GetForeignPriceYesterday(symbol, source string) (float64, error) GetForeignSymbolsInflux(source string) ([]string, error) SetVWAPFirefly(foreignName string, value float64, timestamp time.Time) error GetVWAPFirefly(foreignName string, starttime time.Time, endtime time.Time) ([]float64, []time.Time, error) SaveIndexEngineTimeInflux(map[string]string, map[string]interface{}, time.Time) error GetBenchmarkedIndexValuesInflux(string, time.Time, time.Time) (BenchmarkedIndex, error) // Stock methods SetStockQuotation(sq StockQuotation) error GetStockQuotation(source string, symbol string, timeInit time.Time, timeFinal time.Time) ([]StockQuotation, error) GetStockSymbols() (map[Stock]string, error) }
type FiatQuotation ¶ added in v1.2.0
type FiatQuotation struct { QuoteCurrency string `json:"QuoteCurrency"` BaseCurrency string `json:"BaseCurrency"` Price float64 `json:"Price"` Source string `json:"Source"` Time time.Time `json:"Time"` }
func (*FiatQuotation) MarshalBinary ¶ added in v1.2.0
func (fq *FiatQuotation) MarshalBinary() ([]byte, error)
MarshalBinary for fiat quotations
func (*FiatQuotation) UnmarshalBinary ¶ added in v1.2.0
func (fq *FiatQuotation) UnmarshalBinary(data []byte) error
UnmarshalBinary for fiat quotations
type ForeignQuotation ¶
type ForeignQuotation struct { Symbol string `json:"Symbol"` Name string `json:"Name"` Price float64 `json:"Price"` PriceYesterday float64 `json:"PriceYesterday"` VolumeYesterdayUSD float64 `json:"VolumeYesterdayUSD"` Source string `json:"Source"` Time time.Time `json:"Time"` }
func (*ForeignQuotation) MarshalBinary ¶
func (fq *ForeignQuotation) MarshalBinary() ([]byte, error)
MarshalBinary -
func (*ForeignQuotation) UnmarshalBinary ¶
func (fq *ForeignQuotation) UnmarshalBinary(data []byte) error
UnmarshalBinary -
type HistoricalQuote ¶ added in v1.4.207
type HistoricalQuote struct { Symbol string `db:"symbol"` Price float64 `db:"price"` QuoteTime time.Time `db:"quote_time"` Source string `db:"source"` }
HistoricalQuote is a historical price of an asset.
type InterestRate ¶
type InterestRate struct { Symbol string `json:"Symbol"` Value float64 `json:"Value"` PublicationTime time.Time `json:"PublicationTime"` EffectiveDate time.Time `json:"EffectiveDate"` Source string `json:"Source"` }
func (*InterestRate) MarshalBinary ¶
func (e *InterestRate) MarshalBinary() ([]byte, error)
MarshalBinary for interest rates
func (*InterestRate) UnmarshalBinary ¶
func (e *InterestRate) UnmarshalBinary(data []byte) error
UnmarshalBinary for interest rates
type InterestRateMeta ¶
type Pairs ¶
type Pairs struct {
Pairs []dia.ExchangePair
}
type Points ¶
type Points struct {
DataPoints []clientInfluxdb.Result `json:"DataPoints"`
}
func (*Points) UnmarshalBinary ¶
type Quotation ¶
type Quotation struct { Symbol string `json:"Symbol"` Name string `json:"Name"` Price float64 `json:"Price"` PriceYesterday *float64 `json:"PriceYesterday"` VolumeYesterdayUSD *float64 `json:"VolumeYesterdayUSD"` Source string `json:"Source"` Time time.Time `json:"Time"` }
Quotation is deprecating. Going to be substituted by AssetQuotation
func (*Quotation) MarshalBinary ¶
MarshalBinary for quotations
func (*Quotation) UnmarshalBinary ¶
UnmarshalBinary for quotations
type RelDB ¶
type RelDB struct { URI string // contains filtered or unexported fields }
RelDB is a relative database with redis caching layer.
func NewCachingLayer ¶
NewCachingLayer returns a datastore with redis caching layer and without postgres client.
func NewPostgresDataStore ¶
NewPostgresDataStore returns a datastore with postgres client and without redis caching layer.
func NewRelDataStore ¶
NewRelDataStore returns a datastore with postgres client and redis cache.
func NewRelDataStoreWithOptions ¶
NewRelDataStoreWithOptions returns a postgres datastore and/or redis caching layer.
func (*RelDB) ChangeOracleState ¶ added in v1.4.126
func (*RelDB) CountCache ¶ added in v1.2.0
CountCache returns the number of assets in the cache
func (*RelDB) DeleteOracle ¶ added in v1.4.188
func (*RelDB) ExpireOracle ¶ added in v1.4.384
func (*RelDB) Get24HoursNFTExchangeTrades ¶ added in v1.4.10
func (rdb *RelDB) Get24HoursNFTExchangeTrades(exchange dia.NFTExchange) (int64, error)
Get24HoursNFTExchangeTrades returns the number of trades in last 24 hours
func (*RelDB) Get24HoursNFTExchangeVolume ¶ added in v1.4.10
func (rdb *RelDB) Get24HoursNFTExchangeVolume(exchange dia.NFTExchange) (float64, error)
Get24HoursNFTExchangeVolume returns the volume traded in last 24 hours
func (*RelDB) GetAllAssets ¶ added in v1.2.0
GetAllAssets returns all assets on @blockchain from asset table.
func (*RelDB) GetAllAssetsBlockchains ¶ added in v1.4.2
GetAllAssetsBlockchains returns all blockchain names existent in the asset table.
func (*RelDB) GetAllBlockchains ¶ added in v1.2.0
func (rdb *RelDB) GetAllBlockchains(fullAsset bool) ([]dia.BlockChain, error)
GetAllBlockchains returns all blockchains from the blockchain table. If fullAsset=true it returns the complete native token as asset, otherwise only its symbol string.
func (*RelDB) GetAllChainConfig ¶ added in v1.4.2
func (rdb *RelDB) GetAllChainConfig() (chainconfigs []dia.ChainConfig, err error)
func (*RelDB) GetAllDEXPoolsCount ¶ added in v1.4.402
GetAllDEXPoolsCount returns a map which maps a DEX onto the number of pools on the DEX.
func (*RelDB) GetAllExchangeAssets ¶ added in v1.4.255
GetAllExchangeAssets returns all assets traded as quotetoken on a CEX.
func (*RelDB) GetAllExchanges ¶ added in v1.4.2
GetAllExchanges returns all exchanges existent in the exchange table.
func (*RelDB) GetAllFeeders ¶ added in v1.4.161
func (*RelDB) GetAllLastTrades ¶ added in v1.4.211
GetAllLastTrades returns the last recorded trade for each NFT from the collection given by @nftclass. Caution: Currently, not all dia.NFTTrade variables are returned.
func (*RelDB) GetAllNFTClasses ¶
GetAllNFTClasses returns all NFT classes on @blockchain.
func (*RelDB) GetAllNFTExchanges ¶ added in v1.4.7
func (rdb *RelDB) GetAllNFTExchanges() (exchanges []dia.NFTExchange, err error)
GetAllNFTExchanges returns all nft exchanges existent in the nftexchange table.
func (*RelDB) GetAllPoolAddrsExchange ¶ added in v1.4.2
func (rdb *RelDB) GetAllPoolAddrsExchange(exchange string, liquiThreshold float64) (addresses []string, err error)
GetAllPoolAddrsExchange returns all pool addresses available for @exchange.
func (*RelDB) GetAllPoolsExchange ¶ added in v1.4.129
func (rdb *RelDB) GetAllPoolsExchange(exchange string, liquiThreshold float64) (pools []dia.Pool, err error)
GetAllPoolsExchange returns all pool addresses available for @exchange. Remark that it returns each pool n times where n is the number of assets in the pool.
func (*RelDB) GetAsset ¶ added in v1.2.0
GetAsset is the standard method in order to uniquely retrieve an asset from asset table.
func (*RelDB) GetAssetByGroupID ¶ added in v1.4.2
func (*RelDB) GetAssetByID ¶ added in v1.2.0
GetAssetByID returns an asset by its uuid
func (*RelDB) GetAssetCache ¶ added in v1.2.0
GetAssetCache returns an asset by its asset_id as defined in asset table in postgres
func (*RelDB) GetAssetExchange ¶ added in v1.2.0
GetAssetExchnage returns all assets which share the symbol ticker @symbol.
func (*RelDB) GetAssetID ¶ added in v1.2.0
GetAssetID returns the unique identifier of @asset in postgres table asset, if the entry exists.
func (*RelDB) GetAssetMap ¶ added in v1.4.2
func (*RelDB) GetAssetSource ¶ added in v1.4.2
GetAssetSource returns all exchanges @asset is traded on. For @cex true, only CEXes are returned. Otherwise only DEXes.
func (*RelDB) GetAssets ¶ added in v1.2.0
GetAssets returns all assets which share the symbol ticker @symbol.
func (*RelDB) GetAssetsByAddress ¶ added in v1.4.2
GetAssetsByAddress returns a (possibly multiple) dia.Asset by its address from postgres.
func (*RelDB) GetAssetsBySymbolName ¶ added in v1.2.0
GetAssetsBySymbolName returns a (possibly multiple) dia.Asset by its symbol and name from postgres. If @name is an empty string, it returns all assets with @symbol. If @symbol is an empty string, it returns all assets with @name.
func (*RelDB) GetAssetsWithVOL ¶ added in v1.2.0
func (rdb *RelDB) GetAssetsWithVOL(starttime time.Time, numAssets int64, skip int64, onlycex bool, blockchain string) (volumeSortedAssets []dia.AssetVolume, err error)
GetAssetsWithVOL returns the first @numAssets assets with entry in the assetvolume table, sorted by volume in descending order. If @numAssets==0, all assets are returned. If @substring is not the empty string, results are filtered by the first letters being @substring.
func (*RelDB) GetAssetsWithVolByBlockchain ¶ added in v1.4.26
func (rdb *RelDB) GetAssetsWithVolByBlockchain(starttime time.Time, endtime time.Time, blockchain string) (assets []dia.AssetVolume, err error)
GetAssetsWithVolByBlockchain returns all assets from assetvolume table that have a timestamp in the time-range (@starttime,@endtime]. If blockchain is a non-empty string it only returns assets from @blockchain.
func (*RelDB) GetBlockData ¶ added in v1.2.0
GetBlockData returns information on the block with @blocknumber on @blockchain.
func (*RelDB) GetBlockchain ¶ added in v1.2.0
func (rdb *RelDB) GetBlockchain(name string) (blockchain dia.BlockChain, err error)
func (*RelDB) GetByLimit ¶ added in v1.2.0
func (*RelDB) GetCollectionCountByExchange ¶ added in v1.4.10
GetCollectionCountByExchange returns the number of NFT collections traded on exchange
func (*RelDB) GetExchange ¶ added in v1.4.2
func (*RelDB) GetExchangeNames ¶ added in v1.4.2
GetExchangeNames returns the names of all available exchanges.
func (*RelDB) GetExchangePair ¶ added in v1.2.0
func (rdb *RelDB) GetExchangePair(exchange string, foreignname string, caseSensitive bool) (dia.ExchangePair, error)
GetExchangePair returns the unique exchange pair given by @exchange and @foreignname from postgres. It also returns the underlying pair if existent. If @caseSensitive is false case of @foreignname is ignored.
func (*RelDB) GetExchangePairCache ¶ added in v1.2.0
func (rdb *RelDB) GetExchangePairCache(exchange string, foreignName string) (dia.ExchangePair, error)
GetExchangePairCache returns an exchange pair by @exchange and @foreigName
func (*RelDB) GetExchangePairSeparator ¶ added in v1.4.305
GetExchangePairSeparator returns the separator that is used as notation for an exchange pair. Examples: BTC-USDT, BTCUSDT, BTC/USDT.
func (*RelDB) GetExchangePairSymbols ¶ added in v1.2.0
func (rdb *RelDB) GetExchangePairSymbols(exchange string) (pairs []dia.ExchangePair, err error)
GetExchangePairSymbols returns all foreign names on @exchange from exchangepair table.
func (*RelDB) GetExchangeSymbol ¶ added in v1.4.305
func (*RelDB) GetExchangeSymbolAssetID ¶ added in v1.2.0
func (rdb *RelDB) GetExchangeSymbolAssetID(exchange string, symbol string) (assetID string, verified bool, err error)
GetExchangeSymbolAssetID returns the ID of the unique asset associated to @symbol on @exchange in case the symbol is verified. An empty string if not.
func (*RelDB) GetExchangeSymbols ¶ added in v1.2.0
func (rdb *RelDB) GetExchangeSymbols(exchange string, substring string) (symbols []string, err error)
GetExchangeSymbols returns all symbols traded on @exchange. If @exchange is the empty string, all symbols are returned. If @substring is not the empty string, all symbols that begin with @substring (case insensitive) are returned.
func (*RelDB) GetExchangesForSymbol ¶ added in v1.2.0
func (*RelDB) GetExpiredFeeders ¶ added in v1.4.384
func (rdb *RelDB) GetExpiredFeeders() (oracleconfigs []dia.OracleConfig, err error)
func (*RelDB) GetFeeder ¶ added in v1.4.399
func (rdb *RelDB) GetFeeder(feederID string) (oracleconfig dia.OracleConfig, err error)
func (*RelDB) GetFeederAccessByID ¶ added in v1.4.46
func (*RelDB) GetFeederByID ¶ added in v1.4.147
func (*RelDB) GetFeederID ¶ added in v1.4.46
func (*RelDB) GetFeederLimit ¶ added in v1.4.94
func (*RelDB) GetFeederResources ¶ added in v1.4.202
func (*RelDB) GetFiatAssetBySymbol ¶ added in v1.2.0
GetFiatAssetBySymbol returns a fiat asset by its symbol. This is possible as fiat currencies are uniquely defined by their symbol.
func (*RelDB) GetHistoricalQuotations ¶ added in v1.4.211
func (rdb *RelDB) GetHistoricalQuotations(asset dia.Asset, starttime time.Time, endtime time.Time) (quotations []AssetQuotation, err error)
GetHistoricalQuotations returns all historical quotations of @asset in the given time range.
func (*RelDB) GetKeyAsset ¶ added in v1.2.0
GetKeyAsset returns an asset's key in the redis cache of the asset table. @assetID refers to the primary key asset_id in the asset table.
func (*RelDB) GetKeyPairID ¶ added in v1.4.43
func (*RelDB) GetKeys ¶
GetKeys returns a slice of strings holding the names of the keys of @table in postgres
func (*RelDB) GetLastAssetVolume24H ¶ added in v1.4.75
func (*RelDB) GetLastBlockBlockscraper ¶ added in v1.2.0
GetLastBlockBlockscraper returns the last scraped block on @blockchain for block data scrapers.
func (*RelDB) GetLastBlockNFTBid ¶ added in v1.2.0
GetLastBlockNFTBid returns the last blocknumber that was scraped for bids in @nftclass.
func (*RelDB) GetLastBlockNFTOffer ¶ added in v1.4.2
GetLastBlockNFTOffer returns the last blocknumber that was scraped for offers in @nftclass.
func (*RelDB) GetLastBlockNFTTrade ¶
GetLastBlockNFTTtrade returns the last blocknumber that was scraped for trades in @nftclass.
func (*RelDB) GetLastBlockheightTopshot ¶ added in v1.2.0
GetLastBlockheightTopshot returns the last block number before timestamp given by @upperBound.
func (*RelDB) GetLastHistoricalQuotationTimestamp ¶ added in v1.4.207
func (rdb *RelDB) GetLastHistoricalQuotationTimestamp(asset dia.Asset) (timestamp time.Time, err error)
GetLastHistoricalQuoteTimestamp returns the timestamp of the last historical quote for asset symbol.
func (*RelDB) GetLastNFTBid ¶ added in v1.2.0
func (rdb *RelDB) GetLastNFTBid(address string, blockchain string, tokenID string, blockNumber uint64, blockPosition uint) (nftBid dia.NFTBid, err error)
GetLastNFTBid returns the last bid on the nft with @address and @tokenID. Here, 'last' refers to block number and block position smaller or equal (in the case of block number) than @blockNumber and @blockPosition resp.
func (*RelDB) GetLastNFTOffer ¶ added in v1.2.0
func (rdb *RelDB) GetLastNFTOffer(address string, blockchain string, tokenID string, blockNumber uint64, blockPosition uint) (offer dia.NFTOffer, err error)
GetLastNFTOffer returns the last offer on the nft with @address and @tokenID. Here, 'last' refers to block number and block position smaller or equal (in the case of block number) than @blockNumber and @blockPosition resp.
func (*RelDB) GetNFTBids ¶ added in v1.4.2
func (rdb *RelDB) GetNFTBids(address string, blockchain string, tokenID string) (bids []dia.NFTBid, err error)
GetNFTBids returns all bids done on the nft given by @address, @blockchain and @tokenID.
func (*RelDB) GetNFTCategories ¶
GetNFTCategories returns all available NFT categories.
func (*RelDB) GetNFTClass ¶
func (*RelDB) GetNFTClassByID ¶
func (*RelDB) GetNFTClassID ¶
func (*RelDB) GetNFTClasses ¶
GetNFTClassPage returns @limit NFT classes with @offset.
func (*RelDB) GetNFTClassesByNameSymbol ¶ added in v1.4.2
func (rdb *RelDB) GetNFTClassesByNameSymbol(searchstring string) (collections []dia.NFTClass, err error)
GetNFTClassByNameSymbol returns all nft collections which have @searchstring in either its name or symbol. Search is case-insensitive.
func (*RelDB) GetNFTExchange ¶ added in v1.4.7
func (*RelDB) GetNFTExchanges ¶ added in v1.4.2
func (rdb *RelDB) GetNFTExchanges(address string, blockchain string) (exchanges []string, err error)
GetNFTExchanges returns the exchanges in which nft is traded
func (*RelDB) GetNFTFloor ¶ added in v1.4.2
func (rdb *RelDB) GetNFTFloor( nftclass dia.NFTClass, timestamp time.Time, floorWindowSeconds time.Duration, noBundles bool, exchange string, ) (floor float64, err error)
GetNFTFloor returns the floor price of @nftclass w.r.t. the last 24h.
func (*RelDB) GetNFTFloorLevel ¶ added in v1.4.2
func (rdb *RelDB) GetNFTFloorLevel( nftclass dia.NFTClass, timestamp time.Time, floorWindowSeconds time.Duration, currencies []dia.Asset, level float64, noBundles bool, exchange string, ) (floor float64, err error)
GetNFTFloorLevel returns the floor price of @nftclass w.r.t. the last 24h. Here, floor is w.r.t the lower bound @level. For Ethereum, only trades with @currencies are taken into account.
func (*RelDB) GetNFTFloorRange ¶ added in v1.4.2
func (rdb *RelDB) GetNFTFloorRange( nftClass dia.NFTClass, starttime time.Time, endtime time.Time, floorWindowSeconds time.Duration, stepBackLimit int, noBundles bool, exchange string, ) (floorPrices []float64, err error)
GetNFTFloorRange returns a slice of floor prices in the given time range @starttime -- @endtime.
func (*RelDB) GetNFTFloorRecursive ¶ added in v1.4.2
func (rdb *RelDB) GetNFTFloorRecursive( nftClass dia.NFTClass, timestamp time.Time, floorWindowSeconds time.Duration, stepBackLimit int, noBundles bool, exchange string, ) (floor float64, err error)
GetNFTFloorRecursive returns the floor price of @nftclass. If necessary, it iterates back in time until it finds a floor price.
func (*RelDB) GetNFTOffers ¶ added in v1.4.2
func (rdb *RelDB) GetNFTOffers(address string, blockchain string, tokenID string) (offers []dia.NFTOffer, err error)
GetNFTOffers returns all offers done on the nft given by @address, @blockchain and @tokenID.
func (*RelDB) GetNFTTrades ¶ added in v1.2.0
func (rdb *RelDB) GetNFTTrades(address string, blockchain string, tokenID string, starttime time.Time, endtime time.Time) (trades []dia.NFTTrade, err error)
GetNFTTrades returns all trades done on the nft given by @address, @blockchain and @tokenID.
func (*RelDB) GetNFTTradesCollection ¶ added in v1.4.2
func (rdb *RelDB) GetNFTTradesCollection(address string, blockchain string, starttime time.Time, endtime time.Time) (trades []dia.NFTTrade, err error)
GetNFTTradesCollection returns all trades done on the nft collection given by @address and @blockchain.
func (*RelDB) GetNFTVolume ¶ added in v1.4.2
func (rdb *RelDB) GetNFTVolume(address, blockchain, exchange string, starttime time.Time, endtime time.Time) (float64, error)
GetNFTVolume returns the trade volume of a collection in the time-range (@starttime, @endtime].
func (*RelDB) GetNumNFTTrades ¶ added in v1.4.2
func (rdb *RelDB) GetNumNFTTrades(address, blockchain, exchange string, starttime time.Time, endtime time.Time) (int, error)
GetNumNFTTrades returns the number of trades recorded in [@starttime,@endtime] on the collection on @blockchain with @address.
func (*RelDB) GetNumPairs ¶ added in v1.4.2
GetNumPairs returns the number of exchangepairs/pools on @exchange.
func (*RelDB) GetOracleConfig ¶ added in v1.4.46
func (rdb *RelDB) GetOracleConfig(address, chainid string) (oracleconfig dia.OracleConfig, err error)
func (*RelDB) GetOracleUpdateCount ¶ added in v1.4.283
func (*RelDB) GetOracleUpdates ¶ added in v1.4.272
func (*RelDB) GetOraclesByOwner ¶ added in v1.4.117
func (rdb *RelDB) GetOraclesByOwner(owner string) (oracleconfigs []dia.OracleConfig, err error)
func (*RelDB) GetPage ¶ added in v1.2.0
GetPage returns assets per page number. @hasNext is true iff there is a non-empty next page.
func (*RelDB) GetPairsForAsset ¶ added in v1.4.22
func (*RelDB) GetPairsForExchange ¶ added in v1.4.22
func (rdb *RelDB) GetPairsForExchange(exchange dia.Exchange, filterVerified bool, verified bool) ([]dia.ExchangePair, error)
GetExchangePairs returns all pairs on a (centralized) @exchange.
func (*RelDB) GetPoolByAddress ¶ added in v1.4.2
GetPoolByAddress returns the most recent pool data, i.e. liquidity.
func (*RelDB) GetPoolsByAsset ¶ added in v1.4.252
func (rdb *RelDB) GetPoolsByAsset(asset dia.Asset, liquidityThreshold float64, liquidityThresholdUSD float64) ([]dia.Pool, error)
GetPoolsByAsset returns all pools with @asset as a pool asset and both assets have liquidity above @liquiThreshold. If @liquidityThresholdUSD>0 AND @liquiThreshold=0, only pools where total liquidity is available AND above @liquidityThresholdUSD are returned.
func (*RelDB) GetScraperConfig ¶ added in v1.2.0
func (*RelDB) GetScraperIndex ¶ added in v1.4.424
func (*RelDB) GetScraperState ¶ added in v1.2.0
func (*RelDB) GetSortedAssetSymbols ¶ added in v1.4.29
func (rdb *RelDB) GetSortedAssetSymbols(numAssets int64, skip int64, search string) (volumeSortedAssets []dia.AssetVolume, err error)
GetSortedAssetSymbols search asstet by symbol
func (*RelDB) GetTopAssetByVolume ¶ added in v1.2.0
func (*RelDB) GetTopNFTsEth ¶ added in v1.4.2
func (rdb *RelDB) GetTopNFTsEth(numCollections int, offset int64, exchanges []string, starttime time.Time, endtime time.Time) (nftVolumes []struct { Name string Address string Blockchain string Volume float64 }, err error)
GetTopNFTsEth returns a list of @numCollections NFT collections sorted by trading volume in [@starttime, @endtime] in descending order. Only takes into account trades done with ETH.
func (*RelDB) GetTotalFeeder ¶ added in v1.4.94
func (*RelDB) GetTradedNFTClasses ¶ added in v1.4.255
func (*RelDB) GetUnverifiedExchangeSymbols ¶ added in v1.2.0
GetUnverifiedExchangeSymbols returns all symbols from @exchange which haven't been verified yet.
func (*RelDB) InsertAssetMap ¶ added in v1.4.2
SetAsset stores an asset into postgres.
func (*RelDB) InsertNewAssetMap ¶ added in v1.4.2
func (*RelDB) SetAssetCache ¶ added in v1.2.0
SetAssetCache stores @asset in redis, using its primary key in postgres as key. As a consequence, @asset is only cached iff it exists in postgres.
func (*RelDB) SetAssetVolume24H ¶ added in v1.2.0
func (*RelDB) SetBlockData ¶ added in v1.2.0
SetBlockData stores @blockdata in postgres.
func (*RelDB) SetBlockchain ¶ added in v1.4.0
func (rdb *RelDB) SetBlockchain(blockchain dia.BlockChain) (err error)
func (*RelDB) SetChainConfig ¶ added in v1.4.2
func (rdb *RelDB) SetChainConfig(chainconfig dia.ChainConfig) (err error)
func (*RelDB) SetExchange ¶ added in v1.4.2
func (*RelDB) SetExchangePair ¶ added in v1.2.0
SetExchangePair adds @pair to exchangepair table. If cache==true, it is also cached into redis
func (*RelDB) SetExchangePairCache ¶ added in v1.2.0
func (rdb *RelDB) SetExchangePairCache(exchange string, pair dia.ExchangePair) error
SetExchangePairCache stores @pairs in redis
func (*RelDB) SetExchangeSymbol ¶ added in v1.2.0
SetExchangeSymbol writes unique data into exchangesymbol table if not yet in there.
func (*RelDB) SetFeederConfig ¶ added in v1.4.46
func (*RelDB) SetHistoricalQuotation ¶ added in v1.4.207
func (rdb *RelDB) SetHistoricalQuotation(quotation AssetQuotation) error
SetHistoricalQuote stores a historical quote for an asset symbol at a specific time into postgres.
func (*RelDB) SetKeyPair ¶ added in v1.4.43
func (*RelDB) SetNFTClass ¶
SetNFTClass stores @nftClass in postgres.
func (*RelDB) SetNFTExchange ¶ added in v1.4.7
func (rdb *RelDB) SetNFTExchange(exchange dia.NFTExchange) (err error)
func (*RelDB) SetNFTOffer ¶ added in v1.2.0
SetNFTOffer stores @offer in postgres.
func (*RelDB) SetNFTTrade ¶
SetNFTTTrade is a wrapper for SetNFTTradeToTable that stores @trade into the main nfttrade table.
func (*RelDB) SetNFTTradeToTable ¶ added in v1.4.2
SetNFTTradeToTable stores into @table.
func (*RelDB) SetOracleConfig ¶ added in v1.4.46
func (*RelDB) SetPool ¶ added in v1.4.2
SetPool writes pool data into pool table and the underlying asset and liquidity data into the poolasset table.
func (*RelDB) SetScraperConfig ¶ added in v1.2.0
func (*RelDB) SetScraperIndex ¶ added in v1.4.424
func (*RelDB) SetScraperState ¶ added in v1.2.0
func (*RelDB) UpdateFeederAddressCheckSum ¶ added in v1.4.349
func (*RelDB) UpdateNFTClassCategory ¶
func (*RelDB) VerifyExchangeSymbol ¶ added in v1.2.0
func (rdb *RelDB) VerifyExchangeSymbol(exchange string, symbol string, assetID string) (bool, error)
VerifyExchangeSymbol verifies @symbol on @exchange and maps it uniquely to @assetID in asset table. It returns true if symbol,exchange is present and succesfully updated.
type RelDatastore ¶
type RelDatastore interface { // --- Assets methods --- // --------- Persistent --------- SetAsset(asset dia.Asset) error GetAsset(address, blockchain string) (dia.Asset, error) GetAssetByID(ID string) (dia.Asset, error) GetAssetsBySymbolName(symbol, name string) ([]dia.Asset, error) GetAllAssets(blockchain string) ([]dia.Asset, error) GetFiatAssetBySymbol(symbol string) (asset dia.Asset, err error) GetAssetID(asset dia.Asset) (string, error) GetPage(pageNumber uint32) ([]dia.Asset, bool, error) Count() (uint32, error) SetAssetVolume24H(asset dia.Asset, volume float64, timestamp time.Time) error GetLastAssetVolume24H(asset dia.Asset) (float64, error) GetAssetsWithVOL(starttime time.Time, numAssets int64, skip int64, onlycex bool, substring string) ([]dia.AssetVolume, error) GetAssetSource(asset dia.Asset, onlycex bool) ([]string, error) GetAssetsWithVolByBlockchain(starttime time.Time, endtime time.Time, blockchain string) ([]dia.AssetVolume, error) // --------------- asset methods for exchanges --------------- SetExchangePair(exchange string, pair dia.ExchangePair, cache bool) error GetExchangePair(exchange string, foreignname string, caseSensitive bool) (exchangepair dia.ExchangePair, err error) GetExchangePairSeparator(exchange string) (string, error) GetPairsForExchange(exchange dia.Exchange, filterVerified bool, verified bool) ([]dia.ExchangePair, error) GetPairsForAsset(asset dia.Asset, filterVerified bool, verified bool) ([]dia.ExchangePair, error) GetExchangePairSymbols(exchange string) ([]dia.ExchangePair, error) GetNumPairs(exchange dia.Exchange) (int, error) SetExchangeSymbol(exchange string, symbol string) error GetExchangeSymbol(exchange string, symbol string) (dia.Asset, error) GetExchangeSymbols(exchange string, substring string) ([]string, error) GetUnverifiedExchangeSymbols(exchange string) ([]string, error) VerifyExchangeSymbol(exchange string, symbol string, assetID string) (bool, error) GetExchangeSymbolAssetID(exchange string, symbol string) (string, bool, error) GetAllExchangeAssets(verified bool) ([]dia.Asset, error) // ----------------- Historical quotations methods ------------------- SetHistoricalQuotation(quotation AssetQuotation) error GetHistoricalQuotations(asset dia.Asset, starttime time.Time, endtime time.Time) ([]AssetQuotation, error) GetLastHistoricalQuotationTimestamp(asset dia.Asset) (time.Time, error) // ----------------- exchange methods ------------------- SetExchange(exchange dia.Exchange) error GetExchange(name string) (dia.Exchange, error) GetAllExchanges() ([]dia.Exchange, error) GetExchangeNames() ([]string, error) // ----------------- pool methods ------------------- SetPool(pool dia.Pool) error SetScraperIndex(exchange string, scraperType string, indexType string, index int64) error GetScraperIndex(exchange string, scraperType string) (string, int64, error) GetAllDEXPoolsCount() (map[string]int, error) GetPoolByAddress(blockchain string, address string) (pool dia.Pool, err error) GetAllPoolAddrsExchange(exchange string, liquiThreshold float64) ([]string, error) GetAllPoolsExchange(exchange string, liquiThreshold float64) ([]dia.Pool, error) GetPoolsByAsset(asset dia.Asset, liquidityThreshold float64, liquidityThresholdUSD float64) ([]dia.Pool, error) // ----------------- blockchain methods ------------------- SetBlockchain(blockchain dia.BlockChain) error GetBlockchain(name string) (dia.BlockChain, error) GetAllAssetsBlockchains() ([]string, error) GetAllBlockchains(fullAsset bool) ([]dia.BlockChain, error) // ------ Caching ------ SetAssetCache(asset dia.Asset) error GetAssetCache(blockchain string, address string) (dia.Asset, error) SetExchangePairCache(exchange string, pair dia.ExchangePair) error GetExchangePairCache(exchange string, foreignName string) (dia.ExchangePair, error) CountCache() (uint32, error) // ---------------- NFT methods ------------------- // NFT class methods SetNFTClass(nftClass dia.NFTClass) error GetAllNFTClasses(blockchain string) ([]dia.NFTClass, error) GetTradedNFTClasses(starttime time.Time) ([]dia.NFTClass, error) GetNFTClasses(limit, offset uint64) ([]dia.NFTClass, error) GetNFTClass(address string, blockchain string) (dia.NFTClass, error) GetNFTClassID(address string, blockchain string) (string, error) GetNFTClassByID(id string) (dia.NFTClass, error) GetNFTClassesByNameSymbol(searchstring string) ([]dia.NFTClass, error) UpdateNFTClassCategory(nftclassID string, category string) (bool, error) GetNFTCategories() ([]string, error) // NFT methods SetNFT(nft dia.NFT) error GetNFT(address string, blockchain string, tokenID string) (dia.NFT, error) GetNFTID(address string, blockchain string, tokenID string) (string, error) // NFT trading and bidding methods SetNFTTrade(trade dia.NFTTrade) error SetNFTTradeToTable(trade dia.NFTTrade, table string) error GetNFTTrades(address string, blockchain string, tokenID string, starttime time.Time, endtime time.Time) ([]dia.NFTTrade, error) GetNFTTradesCollection(address string, blockchain string, starttime time.Time, endtime time.Time) ([]dia.NFTTrade, error) GetAllLastTrades(nftclass dia.NFTClass) ([]dia.NFTTrade, error) GetNFTOffers(address string, blockchain string, tokenID string) ([]dia.NFTOffer, error) GetNFTBids(address string, blockchain string, tokenID string) ([]dia.NFTBid, error) GetNFTFloor(nftclass dia.NFTClass, timestamp time.Time, floorWindowSeconds time.Duration, noBundles bool, exchange string) (float64, error) GetNFTFloorLevel(nftclass dia.NFTClass, timestamp time.Time, floorWindowSeconds time.Duration, currencies []dia.Asset, level float64, noBundles bool, exchange string) (float64, error) GetNFTFloorRecursive(nftClass dia.NFTClass, timestamp time.Time, floorWindowSeconds time.Duration, stepBackLimit int, noBundles bool, exchange string) (float64, error) GetNFTFloorRange(nftClass dia.NFTClass, starttime time.Time, endtime time.Time, floorWindowSeconds time.Duration, stepBackLimit int, noBundles bool, exchange string) ([]float64, error) GetLastBlockheightTopshot(upperBound time.Time) (uint64, error) SetNFTBid(bid dia.NFTBid) error GetLastNFTBid(address string, blockchain string, tokenID string, blockNumber uint64, blockPosition uint) (dia.NFTBid, error) GetLastBlockNFTBid(nftclass dia.NFTClass) (uint64, error) GetLastBlockNFTOffer(nftclass dia.NFTClass) (uint64, error) GetLastBlockNFTTrade(nftclass dia.NFTClass) (uint64, error) SetNFTOffer(offer dia.NFTOffer) error GetLastNFTOffer(address string, blockchain string, tokenID string, blockNumber uint64, blockPosition uint) (offer dia.NFTOffer, err error) // NFT stats GetTopNFTsEth(numCollections int, offset int64, exchanges []string, starttime time.Time, endtime time.Time) ([]struct { Name string Address string Blockchain string Volume float64 }, error) GetNumNFTTrades(address string, blockchain string, exchange string, starttime time.Time, endtime time.Time) (int, error) GetNFTVolume(address string, blockchain string, exchange string, starttime time.Time, endtime time.Time) (float64, error) // General methods GetKeys(table string) ([]string, error) // Scraper config and state GetScraperState(ctx context.Context, scraperName string, state ScraperState) error SetScraperState(ctx context.Context, scraperName string, state ScraperState) error GetScraperConfig(ctx context.Context, scraperName string, config ScraperConfig) error SetScraperConfig(ctx context.Context, scraperName string, config ScraperConfig) error // Blockchain data SetBlockData(dia.BlockData) error GetBlockData(blockchain string, blocknumber int64) (dia.BlockData, error) GetLastBlockBlockscraper(blockchain string) (int64, error) GetAllNFTExchanges() (exchanges []dia.NFTExchange, err error) GetNFTExchange(name string) (exchange dia.Exchange, err error) SetNFTExchange(exchange dia.NFTExchange) (err error) GetCollectionCountByExchange(exchange string) (int64, error) Get24HoursNFTExchangeVolume(exchange dia.NFTExchange) (float64, error) Get24HoursNFTExchangeTrades(exchange dia.NFTExchange) (int64, error) //Oracle builder SetKeyPair(publickey string, privatekey string) error GetKeyPairID(publickey string) string GetFeederAccessByID(id string) (owner string) GetFeederByID(id string) (owner string) SetOracleConfig(address, feederID, owner, feederAddress, symbols, feedSelection, chainID, frequency, sleepseconds, deviationpermille, blockchainnode, mandatoryFrequency string) error SetFeederConfig(feederid, oracleconfigid string) error GetFeederID(address string) (feederId string) GetFeederLimit(owner string) (limit int) GetTotalFeeder(owner string) (total int) GetOracleConfig(address, chainid string) (oracleconfig dia.OracleConfig, err error) ChangeOracleState(feederID string, active bool) (err error) DeleteOracle(feederID string) (err error) GetOraclesByOwner(owner string) (oracleconfigs []dia.OracleConfig, err error) GetAllFeeders(bool, bool) (oracleconfigs []dia.OracleConfig, err error) GetFeederResources() (addresses []string, err error) GetOracleUpdates(address string, chainid string, offset int) ([]dia.OracleUpdate, error) GetOracleUpdateCount(address string, chainid string) (int64, error) UpdateFeederAddressCheckSum(oracleaddress string) error GetExpiredFeeders() (oracleconfigs []dia.OracleConfig, err error) GetFeeder(feederID string) (oracleconfig dia.OracleConfig, err error) }
RelDatastore is a (persistent) relational database with an additional redis caching layer
type ScraperConfig ¶ added in v1.2.0
type ScraperConfig interface{}
ScraperConfig is a JSON compatible struct to keep the configuration of a scraper
type ScraperState ¶ added in v1.2.0
type ScraperState interface{}
ScraperState is a JSON compatible struct to keep the state of a scraper
type StockQuotation ¶ added in v1.2.0
Source Files ¶
- ForeignQuotation.go
- assets.go
- benchmarkedIndex.go
- blockscrapers.go
- chainconfig.go
- currencyChange.go
- db.go
- exchanges.go
- fiatQuotation.go
- filters.go
- foreignTypes.go
- init.go
- nftexchanges.go
- nfts.go
- oracle.go
- pairs.go
- pools.go
- prices.go
- quotation.go
- rates.go
- relDB.go
- scrapers.go
- stockQuotation.go
- supplies.go
- symbols.go
- synthAssets.go
- trades.go
- types.go
- volumes.go