Documentation ¶
Overview ¶
Package pricer contains pricing logic for RFQ relayer quotes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CoingeckoPriceFetcher ¶ added in v0.0.40
type CoingeckoPriceFetcher interface {
GetPrice(ctx context.Context, token string) (float64, error)
}
CoingeckoPriceFetcher is an interface for fetching prices from coingecko.
type CoingeckoPriceFetcherImpl ¶ added in v0.0.40
type CoingeckoPriceFetcherImpl struct {
// contains filtered or unexported fields
}
CoingeckoPriceFetcherImpl is an implementation of CoingeckoPriceFetcher.
func NewCoingeckoPriceFetcher ¶ added in v0.0.40
func NewCoingeckoPriceFetcher(timeout time.Duration) *CoingeckoPriceFetcherImpl
NewCoingeckoPriceFetcher creates a new instance of CoingeckoPriceFetcherImpl.
type FeePricer ¶
type FeePricer interface { // Start starts the fee pricer. Start(ctx context.Context) // GetOriginFee returns the total fee for a given chainID and gas limit, denominated in a given token. GetOriginFee(ctx context.Context, origin, destination uint32, denomToken string, isQuote bool) (*big.Int, error) // GetDestinationFee returns the total fee for a given chainID and gas limit, denominated in a given token. GetDestinationFee(ctx context.Context, origin, destination uint32, denomToken string, isQuote bool) (*big.Int, error) // GetTotalFee returns the total fee for a given origin and destination chainID, denominated in a given token. GetTotalFee(ctx context.Context, origin, destination uint32, denomToken string, isQuote bool) (*big.Int, error) // GetGasPrice returns the gas price for a given chainID in native units. GetGasPrice(ctx context.Context, chainID uint32) (*big.Int, error) // GetTokenPrice returns the price of a token in USD. GetTokenPrice(ctx context.Context, token string) (float64, error) }
FeePricer is the interface for the fee pricer.
func NewFeePricer ¶
func NewFeePricer(config relconfig.Config, clientFetcher submitter.ClientFetcher, priceFetcher CoingeckoPriceFetcher, handler metrics.Handler) FeePricer
NewFeePricer creates a new fee pricer.
Click to show internal directories.
Click to hide internal directories.