test_fixed_price_exchange

package
v0.0.0-...-23a414b Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: AGPL-3.0, AGPL-3.0-or-later Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BTC_USD_PRICE = 50000
	ETH_USD_PRICE = 4000
	SOL_USD_PRICE = 100
)

Fixed prices for BTC-USD, ETH-USD, SOL-USD

Variables

View Source
var (
	TestFixedPriceExchangeParams = FixedPriceExchangeParams{
		BTCUSDPrice: BTC_USD_PRICE,
		ETHUSDPrice: ETH_USD_PRICE,
		SOLUSDPrice: SOL_USD_PRICE,
	}
	TestFixedPriceExchangeDetails = types.ExchangeQueryDetails{
		Exchange:      exchange_common.EXCHANGE_ID_TEST_FIXED_PRICE_EXCHANGE,
		Url:           "https://jsonplaceholder.typicode.com/users",
		PriceFunction: FixedExchangePriceFunction,
		IsMultiMarket: false,
	}
)

Functions

func FixedExchangePriceFunction

func FixedExchangePriceFunction(
	response *http.Response,
	tickerToExponent map[string]int32,
	resolver types.Resolver,
) (tickerToPrice map[string]uint64, unavailableTickers map[string]error, err error)

Types

type FixedPriceExchangeParams

type FixedPriceExchangeParams struct {
	BTCUSDPrice float64
	ETHUSDPrice float64
	SOLUSDPrice float64
}

type FixedPriceTicker

type FixedPriceTicker struct {
	Pair  string
	Price string
}

func (FixedPriceTicker) GetAskPrice

func (t FixedPriceTicker) GetAskPrice() string

func (FixedPriceTicker) GetBidPrice

func (t FixedPriceTicker) GetBidPrice() string

func (FixedPriceTicker) GetLastPrice

func (t FixedPriceTicker) GetLastPrice() string

func (FixedPriceTicker) GetPair

func (t FixedPriceTicker) GetPair() string

Jump to

Keyboard shortcuts

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