Documentation ¶
Overview ¶
Package quoter submits quotes to the RFQ API for which assets the relayer is willing to relay.
Index ¶
- type Manager
- func (m *Manager) GetPrice(parentCtx context.Context, tokenName string) (_ float64, err error)
- func (m *Manager) IsProfitable(parentCtx context.Context, quote reldb.QuoteRequest) (isProfitable bool, err error)
- func (m *Manager) ShouldProcess(parentCtx context.Context, quote reldb.QuoteRequest) (res bool, err error)
- func (m *Manager) SubmitAllQuotes(ctx context.Context) (err error)
- func (m *Manager) SubscribeActiveRFQ(ctx context.Context) (err error)
- type QuoteInput
- type Quoter
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) IsProfitable ¶ added in v0.0.44
func (m *Manager) IsProfitable(parentCtx context.Context, quote reldb.QuoteRequest) (isProfitable bool, err error)
IsProfitable determines if a quote is profitable, i.e. we will not lose money on it, net of fees.
func (*Manager) ShouldProcess ¶
func (m *Manager) ShouldProcess(parentCtx context.Context, quote reldb.QuoteRequest) (res bool, err error)
ShouldProcess determines if a quote should be processed.
func (*Manager) SubmitAllQuotes ¶
SubmitAllQuotes submits all quotes to the RFQ API.
type QuoteInput ¶ added in v1.4.0
type QuoteInput struct { OriginChainID int DestChainID int OriginTokenAddr common.Address DestTokenAddr common.Address OriginBalance *big.Int DestBalance *big.Int DestRFQAddr string }
QuoteInput is a wrapper struct for input arguments to generateQuote.
type Quoter ¶
type Quoter interface { // SubmitAllQuotes submits all quotes to the RFQ API. SubmitAllQuotes(ctx context.Context) (err error) // SubscribeActiveRFQ subscribes to the RFQ websocket API. SubscribeActiveRFQ(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, error) // IsProfitable determines if a quote is profitable, i.e. we will not lose money on it, net of fees. IsProfitable(ctx context.Context, quote reldb.QuoteRequest) (bool, error) // GetPrice gets the price of a token. GetPrice(ctx context.Context, tokenName string) (float64, error) }
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, apiClient rfqAPIClient.AuthenticatedClient) (Quoter, error)
NewQuoterManager creates a new QuoterManager.
Click to show internal directories.
Click to hide internal directories.