liquidityscrapers

package
v1.4.560 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: GPL-2.0 Imports: 67 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Blockchain = "Bifrost"
)
View Source
const (
	GLOBAL_NATIVE_LIQUIDITY_THRESHOLD = 0.5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AyinLiquidityScraper added in v1.4.504

type AyinLiquidityScraper struct {
	// contains filtered or unexported fields
}

func NewAyinLiquidityScraper added in v1.4.504

func NewAyinLiquidityScraper(exchange dia.Exchange, relDB *models.RelDB, datastore *models.DB) *AyinLiquidityScraper

NewAyinLiquidityScraper returns a new AyinLiquidityScraper initialized with default values. The instance is asynchronously scraping as soon as it is created. ENV values:

 	AYIN_SLEEP_TIMEOUT - (optional,millisecond), make timeout between API calls, default "alephiumhelper.DefaultSleepBetweenContractCalls" value
	AYIN_TARGET_SWAP_CONTRACT - (optional, string), useful for debug, default = ""
	AYIN_DEBUG - (optional, bool), make stdout output with alephium client http call, default = false

func (*AyinLiquidityScraper) Done added in v1.4.504

func (s *AyinLiquidityScraper) Done() chan bool

func (*AyinLiquidityScraper) Pool added in v1.4.504

func (s *AyinLiquidityScraper) Pool() chan dia.Pool

type BalancerV2Scraper

type BalancerV2Scraper struct {
	RestClient *ethclient.Client
	// contains filtered or unexported fields
}

func NewBalancerV2Scraper

func NewBalancerV2Scraper(exchange dia.Exchange, relDB *models.RelDB, datastore *models.DB) *BalancerV2Scraper

NewBalancerV2Scraper returns a Balancer V2 scraper

func (*BalancerV2Scraper) Done

func (scraper *BalancerV2Scraper) Done() chan bool

func (*BalancerV2Scraper) Pool

func (scraper *BalancerV2Scraper) Pool() chan dia.Pool

type BancorPool

type BancorPool struct {
	Reserves []struct {
		DltID   string `json:"dlt_id"`
		Symbol  string `json:"symbol"`
		Name    string `json:"name"`
		Balance struct {
			Usd string `json:"usd"`
		} `json:"balance"`
		Weight int `json:"weight"`
		Price  struct {
			Usd string `json:"usd"`
		} `json:"price"`
		Price24HAgo struct {
			Usd string `json:"usd"`
		} `json:"price_24h_ago"`
		Volume24H struct {
			Usd  string `json:"usd"`
			Base string `json:"base"`
		} `json:"volume_24h"`
	} `json:"reserves"`
	DltType        string `json:"dlt_type"`
	DltID          string `json:"dlt_id"`
	Type           int    `json:"type"`
	Version        int    `json:"version"`
	Symbol         string `json:"symbol"`
	Name           string `json:"name"`
	Supply         string `json:"supply"`
	ConverterDltID string `json:"converter_dlt_id"`
	ConversionFee  string `json:"conversion_fee"`
	Liquidity      struct {
		Usd string `json:"usd"`
	} `json:"liquidity"`
	Volume24H struct {
		Usd string `json:"usd"`
	} `json:"volume_24h"`
	Fees24H struct {
		Usd string `json:"usd"`
	} `json:"fees_24h"`
}

type BancorPoolScraper

type BancorPoolScraper struct {
	RestClient *ethclient.Client
	// contains filtered or unexported fields
}

func NewBancorPoolScraper

func NewBancorPoolScraper(exchange dia.Exchange, datastore *models.DB) *BancorPoolScraper

func (*BancorPoolScraper) ConverterTypeFour

func (scraper *BancorPoolScraper) ConverterTypeFour(address common.Address) (tokenAddress []common.Address, poolBalances []*big.Int, err error)

func (*BancorPoolScraper) ConverterTypeOne

func (scraper *BancorPoolScraper) ConverterTypeOne(address common.Address) (tokenAddress []common.Address, poolBalances []*big.Int, err error)

func (*BancorPoolScraper) ConverterTypeThree

func (scraper *BancorPoolScraper) ConverterTypeThree(address common.Address) (tokenAddress []common.Address, poolBalances []*big.Int, err error)

func (*BancorPoolScraper) ConverterTypeZero

func (scraper *BancorPoolScraper) ConverterTypeZero(address common.Address) (tokenAddress []common.Address, poolBalances []*big.Int, err error)

func (*BancorPoolScraper) Done

func (scraper *BancorPoolScraper) Done() chan bool

func (*BancorPoolScraper) Pool

func (scraper *BancorPoolScraper) Pool() chan dia.Pool

type BancorPools

type BancorPools struct {
	Data      []BancorPool `json:"data"`
	Timestamp struct {
		Ethereum struct {
			Block     int   `json:"block"`
			Timestamp int64 `json:"timestamp"`
		} `json:"ethereum"`
	} `json:"timestamp"`
}

type BifrostLiquidityScraper added in v1.4.550

type BifrostLiquidityScraper struct {
	// contains filtered or unexported fields
}

func NewBifrostLiquidityScraper added in v1.4.550

func NewBifrostLiquidityScraper(exchange dia.Exchange, relDB *models.RelDB, datastore *models.DB) *BifrostLiquidityScraper

NewBifrostLiquidityScraper returns a new BifrostLiquidityScraper initialized with default values. The instance is asynchronously scraping as soon as it is created. ENV values:

 	BIFROST_SLEEP_TIMEOUT - (optional,millisecond), make timeout between API calls, default "bifrosthelper.DefaultSleepBetweenContractCalls" value
	BIFROST_TARGET_SWAP_CONTRACT - (optional, string), useful for debug, default = ""
	BIFROST_DEBUG - (optional, bool), make stdout output with bifrost client http call, default = false

func (*BifrostLiquidityScraper) Done added in v1.4.550

func (s *BifrostLiquidityScraper) Done() chan bool

func (*BifrostLiquidityScraper) Pool added in v1.4.550

func (s *BifrostLiquidityScraper) Pool() chan dia.Pool

type BitflowLiquidityScraper added in v1.4.543

type BitflowLiquidityScraper struct {
	// contains filtered or unexported fields
}

func NewBitflowLiquidityScraper added in v1.4.543

func NewBitflowLiquidityScraper(exchange dia.Exchange, relDB *models.RelDB, datastore *models.DB) *BitflowLiquidityScraper

NewBitflowLiquidityScraper returns a new BitflowLiquidityScraper initialized with default values. The instance is asynchronously scraping as soon as it is created. ENV values:

 	BITFLOW_SLEEP_TIMEOUT - (optional, millisecond), make timeout between API calls, default "stackshelper.DefaultSleepBetweenCalls" value
	BITFLOW_TARGET_SWAP_CONTRACT - (optional, string), useful for debug, default = ""
	BITFLOW_HIRO_API_KEY - (optional, string), Hiro Stacks API key, improves scraping performance, default = ""
	BITFLOW_DEBUG - (optional, bool), make stdout output with bitflow client http call, default = false

func (*BitflowLiquidityScraper) Done added in v1.4.543

func (s *BitflowLiquidityScraper) Done() chan bool

func (*BitflowLiquidityScraper) Pool added in v1.4.543

func (s *BitflowLiquidityScraper) Pool() chan dia.Pool

type CamelotV3Scraper added in v1.4.401

type CamelotV3Scraper struct {
	RestClient *ethclient.Client
	WsClient   *ethclient.Client
	// contains filtered or unexported fields
}

func NewCamelotV3Scraper added in v1.4.401

func NewCamelotV3Scraper(exchange dia.Exchange, relDB *models.RelDB, datastore *models.DB) *CamelotV3Scraper

NewCamelotV3Scraper returns a new CamelotV3Scraper.

func (*CamelotV3Scraper) Done added in v1.4.401

func (cls *CamelotV3Scraper) Done() chan bool

func (*CamelotV3Scraper) Pool added in v1.4.401

func (cls *CamelotV3Scraper) Pool() chan dia.Pool

type CurveCoin added in v1.4.213

type CurveCoin struct {
	Symbol   string
	Decimals uint8
	Address  string
	Name     string
}

type CurveFIScraper

type CurveFIScraper struct {
	RestClient *ethclient.Client
	// contains filtered or unexported fields
}

func NewCurveFIScraper

func NewCurveFIScraper(exchange dia.Exchange, relDB *models.RelDB, datastore *models.DB) *CurveFIScraper

func (*CurveFIScraper) Done

func (scraper *CurveFIScraper) Done() chan bool

func (*CurveFIScraper) Pool

func (scraper *CurveFIScraper) Pool() chan dia.Pool

type GRPCClient added in v1.4.257

type GRPCClient struct {
	// contains filtered or unexported fields
}

func NewGRPCClient added in v1.4.257

func NewGRPCClient(conf *scrapers.OsmosisConfig) (*GRPCClient, error)

type HydrationLiquidityScraper added in v1.4.556

type HydrationLiquidityScraper struct {
	// contains filtered or unexported fields
}

func NewHydrationLiquidityScraper added in v1.4.556

func NewHydrationLiquidityScraper(exchange dia.Exchange, relDB *models.RelDB, datastore *models.DB) *HydrationLiquidityScraper

NewHydrationLiquidityScraper returns a new HydrationLiquidityScraper initialized with default values. The instance is asynchronously scraping as soon as it is created. ENV values:

 	BIFROST_SLEEP_TIMEOUT - (optional,millisecond), make timeout between API calls, default "Hydrationhelper.DefaultSleepBetweenContractCalls" value
	BIFROST_TARGET_SWAP_CONTRACT - (optional, string), useful for debug, default = ""
	BIFROST_DEBUG - (optional, bool), make stdout output with Hydration client http call, default = false

func (*HydrationLiquidityScraper) Done added in v1.4.556

func (s *HydrationLiquidityScraper) Done() chan bool

func (*HydrationLiquidityScraper) Pool added in v1.4.556

func (s *HydrationLiquidityScraper) Pool() chan dia.Pool

type LiquidityScraper

type LiquidityScraper interface {
	Pool() chan dia.Pool
	Done() chan bool
}

func NewLiquidityScraper

func NewLiquidityScraper(source string, relDB *models.RelDB, datastore *models.DB) LiquidityScraper

NewLiquidityScraper returns a liquidity scraper for @source.

type MaverickPool added in v1.4.329

type MaverickPool struct {
	Token0      dia.Asset
	Token1      dia.Asset
	ForeignName string
	Address     common.Address
}

type MaverickScraper added in v1.4.329

type MaverickScraper struct {
	RestClient *ethclient.Client
	// contains filtered or unexported fields
}

func NewMaverickScraper added in v1.4.329

func NewMaverickScraper(exchange dia.Exchange, relDB *models.RelDB, datastore *models.DB) (s *MaverickScraper)

func (*MaverickScraper) Done added in v1.4.329

func (s *MaverickScraper) Done() chan bool

func (*MaverickScraper) Pool added in v1.4.329

func (s *MaverickScraper) Pool() chan dia.Pool

type OrcaScraper added in v1.4.88

type OrcaScraper struct {
	RestClient *rpc.Client
	// contains filtered or unexported fields
}

func NewOrcaScraper added in v1.4.88

func NewOrcaScraper(exchange dia.Exchange, datastore *models.DB) *OrcaScraper

func (*OrcaScraper) Done added in v1.4.88

func (scraper *OrcaScraper) Done() chan bool

func (*OrcaScraper) Pool added in v1.4.88

func (scraper *OrcaScraper) Pool() chan dia.Pool

type OsmosisScraper added in v1.4.257

type OsmosisScraper struct {
	// contains filtered or unexported fields
}

func NewOsmosisScraper added in v1.4.257

func NewOsmosisScraper(exchange dia.Exchange, relDb *models.RelDB, datastore *models.DB) *OsmosisScraper

func (*OsmosisScraper) Done added in v1.4.257

func (scraper *OsmosisScraper) Done() chan bool

func (*OsmosisScraper) GetAssetMetadata added in v1.4.257

func (s *OsmosisScraper) GetAssetMetadata(asset gammtypes.PoolAsset) (dia.Asset, error)

func (*OsmosisScraper) HandlePool added in v1.4.257

func (s *OsmosisScraper) HandlePool(pool *gammtypes.Pool)

func (*OsmosisScraper) Pool added in v1.4.257

func (scraper *OsmosisScraper) Pool() chan dia.Pool

type PlatypusCoin

type PlatypusCoin struct {
	Symbol   string
	Decimals uint8
	Address  string
	Name     string
}

type PlatypusScraper

type PlatypusScraper struct {
	RestClient *ethclient.Client
	// contains filtered or unexported fields
}

The scraper object for Platypus Finance

func NewPlatypusScraper

func NewPlatypusScraper(exchange dia.Exchange, datastore *models.DB) *PlatypusScraper

Returns a new exchange scraper

func (*PlatypusScraper) Done

func (scraper *PlatypusScraper) Done() chan bool

func (*PlatypusScraper) Pool

func (scraper *PlatypusScraper) Pool() chan dia.Pool

type TraderJoeLiquidityScraper added in v1.4.353

type TraderJoeLiquidityScraper struct {
	RestClient *ethclient.Client
	WsClient   *ethclient.Client
	// contains filtered or unexported fields
}

TraderJoeLiquidityScraper manages the scraping of liquidity data for the Trader Joe exchange.

func NewTraderJoeLiquidityScraper added in v1.4.353

func NewTraderJoeLiquidityScraper(exchange dia.Exchange, relDB *models.RelDB, datastore *models.DB) *TraderJoeLiquidityScraper

NewTraderJoeLiquidityScraper initializes a Trader Joe liquidity scraper, creating an instance of the TraderJoeLiquidityScraper struct. It configures necessary parameters, initiates pool fetching, and returns the initialized scraper.

func (*TraderJoeLiquidityScraper) Done added in v1.4.353

func (tjls *TraderJoeLiquidityScraper) Done() chan bool

Done returns a channel for signaling the completion of Trader Joe liquidity scraping.

func (*TraderJoeLiquidityScraper) Pool added in v1.4.353

func (tjls *TraderJoeLiquidityScraper) Pool() chan dia.Pool

Pool returns a channel for receiving dia.Pool instances scraped by the Trader Joe liquidity scraper.

type UniswapPair

type UniswapPair struct {
	Token0      dia.Asset
	Token1      dia.Asset
	ForeignName string
	Address     common.Address
}

type UniswapScraper

type UniswapScraper struct {
	RestClient *ethclient.Client
	// contains filtered or unexported fields
}

func NewUniswapScraper

func NewUniswapScraper(exchange dia.Exchange, relDB *models.RelDB, datastore *models.DB) (us *UniswapScraper)

func (*UniswapScraper) Done

func (us *UniswapScraper) Done() chan bool

func (*UniswapScraper) GetDecimals

func (us *UniswapScraper) GetDecimals(tokenAddress common.Address) (decimals uint8, err error)

GetDecimals returns the decimals of the token with address @tokenAddress

func (*UniswapScraper) GetName

func (us *UniswapScraper) GetName(tokenAddress common.Address) (name string, err error)

func (*UniswapScraper) GetPoolByAddress

func (us *UniswapScraper) GetPoolByAddress(pairAddress common.Address) (pool dia.Pool, err error)

Get a pool by its LP token address.

func (*UniswapScraper) GetPoolByID

func (us *UniswapScraper) GetPoolByID(num int64) (dia.Pool, error)

GetPoolByID returns the Uniswap Pool with the integer id @num.

func (*UniswapScraper) Pool

func (us *UniswapScraper) Pool() chan dia.Pool

type UniswapV3Scraper

type UniswapV3Scraper struct {
	RestClient *ethclient.Client
	WsClient   *ethclient.Client
	// contains filtered or unexported fields
}

func NewUniswapV3Scraper

func NewUniswapV3Scraper(exchange dia.Exchange, relDB *models.RelDB, datastore *models.DB) *UniswapV3Scraper

NewUniswapV3Scraper returns a new UniswapV3Scraper.

func (*UniswapV3Scraper) Done

func (uas *UniswapV3Scraper) Done() chan bool

func (*UniswapV3Scraper) Pool

func (uas *UniswapV3Scraper) Pool() chan dia.Pool

type VelarLiquidityScraper added in v1.4.544

type VelarLiquidityScraper struct {
	// contains filtered or unexported fields
}

func NewVelarLiquidityScraper added in v1.4.544

func NewVelarLiquidityScraper(exchange dia.Exchange, relDB *models.RelDB, datastore *models.DB) *VelarLiquidityScraper

NewVelarLiquidityScraper returns a new VelarLiquidityScraper initialized with default values. The instance is asynchronously scraping as soon as it is created. ENV values:

 	VELAR_SLEEP_TIMEOUT - (optional, millisecond), make timeout between API calls, default "stackshelper.DefaultSleepBetweenCalls" value
	VELAR_HIRO_API_KEY - (optional, string), Hiro Stacks API key, improves scraping performance, default = ""
	VELAR_DEBUG - (optional, bool), make stdout output with velar client http call, default = false

func (*VelarLiquidityScraper) Done added in v1.4.544

func (s *VelarLiquidityScraper) Done() chan bool

func (*VelarLiquidityScraper) Pool added in v1.4.544

func (s *VelarLiquidityScraper) Pool() chan dia.Pool

type VelodromePoolScraper added in v1.4.325

type VelodromePoolScraper struct {
	RestClient *ethclient.Client
	// contains filtered or unexported fields
}

func NewVelodromePoolScraper added in v1.4.325

func NewVelodromePoolScraper(exchange dia.Exchange, relDB *models.RelDB, datastore *models.DB) (us *VelodromePoolScraper)

func (*VelodromePoolScraper) Done added in v1.4.325

func (us *VelodromePoolScraper) Done() chan bool

func (*VelodromePoolScraper) GetDecimals added in v1.4.325

func (us *VelodromePoolScraper) GetDecimals(tokenAddress common.Address) (decimals uint8, err error)

GetDecimals returns the decimals of the token with address @tokenAddress

func (*VelodromePoolScraper) GetLiquidityUniV2Type added in v1.4.540

func (us *VelodromePoolScraper) GetLiquidityUniV2Type(token0 dia.Asset, token1 dia.Asset, pairContract *velodrome.IPoolCaller, pool *dia.Pool)

func (*VelodromePoolScraper) GetLiquidityUniV3Type added in v1.4.540

func (us *VelodromePoolScraper) GetLiquidityUniV3Type(token0 dia.Asset, token1 dia.Asset, pairAddress common.Address, pool *dia.Pool)

func (*VelodromePoolScraper) GetName added in v1.4.325

func (us *VelodromePoolScraper) GetName(tokenAddress common.Address) (name string, err error)

func (*VelodromePoolScraper) GetPoolByAddress added in v1.4.325

func (us *VelodromePoolScraper) GetPoolByAddress(pairAddress common.Address) (pool dia.Pool, err error)

Get a pool by its LP token address.

func (*VelodromePoolScraper) GetPoolByID added in v1.4.325

func (us *VelodromePoolScraper) GetPoolByID(num int64) (dia.Pool, error)

GetPoolByID returns the Velodrome Pool with the integer id @num.

func (*VelodromePoolScraper) Pool added in v1.4.325

func (us *VelodromePoolScraper) Pool() chan dia.Pool

Jump to

Keyboard shortcuts

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