quoter

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package quoter submits quotes to the RFQ API for which assets the relayer is willing to relay.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager submits quotes to the RFQ API. TODO: should be unexported.

func (*Manager) ShouldProcess

func (m *Manager) ShouldProcess(parentCtx context.Context, quote reldb.QuoteRequest) (res bool)

ShouldProcess determines if a quote should be processed.

func (*Manager) SubmitAllQuotes

func (m *Manager) SubmitAllQuotes(ctx context.Context) (err error)

SubmitAllQuotes submits all quotes to the RFQ API.

type Quoter

type Quoter interface {
	// SubmitAllQuotes submits all quotes to the RFQ API.
	SubmitAllQuotes(ctx context.Context) (err error)
	// ShouldProcess determines if a quote should be processed.
	// We do this by either saving all quotes in-memory, and refreshing via GetSelfQuotes() through the API
	// The first comparison is does bridge transaction OriginChainID+TokenAddr match with a quote + DestChainID+DestTokenAddr, then we look to see if we have enough amount to relay it + if the price fits our bounds (based on that the Relayer is relaying the destination token for the origin)
	// validateQuote(BridgeEvent)
	ShouldProcess(ctx context.Context, quote reldb.QuoteRequest) bool
}

Quoter submits quotes to the RFQ API.

func NewQuoterManager

func NewQuoterManager(config relconfig.Config, metricsHandler metrics.Handler, inventoryManager inventory.Manager, relayerSigner signer.Signer, feePricer pricer.FeePricer) (Quoter, error)

NewQuoterManager creates a new QuoterManager.

Jump to

Keyboard shortcuts

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