Skip to content

Commit

Permalink
consolidate quote posting [goreleaser]
Browse files Browse the repository at this point in the history
  • Loading branch information
trajan0x committed Dec 30, 2023
1 parent b1d87e2 commit a20bd48
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion services/rfq/relayer/quoter/quoter.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ type Manager struct {
quotableTokens map[string][]string
// feePricer is used to price fees.
feePricer pricer.FeePricer
// metricsHandler handles traces, etc
metricsHandler metrics.Handler
}

// NewQuoterManager creates a new QuoterManager.
Expand All @@ -64,6 +66,7 @@ func NewQuoterManager(metricsHandler metrics.Handler, quotableTokens map[string]
inventoryManager: inventoryManager,
rfqClient: apiClient,
relayerSigner: relayerSigner,
metricsHandler: metricsHandler,
feePricer: feePricer,
}, nil
}
Expand Down Expand Up @@ -113,7 +116,12 @@ func (m *Manager) isProfitableQuote(ctx context.Context, quote reldb.QuoteReques
}

// SubmitAllQuotes submits all quotes to the RFQ API.
func (m *Manager) SubmitAllQuotes(ctx context.Context) error {
func (m *Manager) SubmitAllQuotes(ctx context.Context) (err error) {
ctx, span := m.metricsHandler.Tracer().Start(ctx, "submitQuotes")
defer func() {
metrics.EndSpanWithErr(span, err)
}()

inv, err := m.inventoryManager.GetCommitableBalances(ctx)
if err != nil {
return fmt.Errorf("error getting commitable balances: %w", err)
Expand Down

0 comments on commit a20bd48

Please sign in to comment.