Skip to content

Commit

Permalink
Ignore Invalid symbol error
Browse files Browse the repository at this point in the history
  • Loading branch information
Haiss2 committed Jul 12, 2024
1 parent b6d29d7 commit fc1cadc
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pkg/pricefiller/price_fillter.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const (
backfillTradeLogsLimit = 60
addressETH = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
coinUSDT = "USDT"
invalidSymbolErrString = "<APIError> code=-1121, msg=Invalid symbol."
)

var (
Expand Down Expand Up @@ -158,8 +159,10 @@ func (p *PriceFiller) fullFillTradeLog(tradeLog storage.TradeLog) (storage.Trade
makerPrice, makerUsdAmount, err := p.getPriceAndAmountUsd(strings.ToLower(tradeLog.MakerToken),
tradeLog.MakerTokenAmount, int64(tradeLog.Timestamp))
if err != nil {
p.l.Errorw("Failed to getPriceAndAmountUsd for maker", "err", err)
return tradeLog, err
if err.Error() != invalidSymbolErrString {
p.l.Errorw("Failed to getPriceAndAmountUsd for maker", "err", err)
return tradeLog, err
}
}

tradeLog.MakerTokenPrice = makerPrice
Expand All @@ -168,8 +171,10 @@ func (p *PriceFiller) fullFillTradeLog(tradeLog storage.TradeLog) (storage.Trade
takerPrice, takerUsdAmount, err := p.getPriceAndAmountUsd(strings.ToLower(tradeLog.TakerToken),
tradeLog.TakerTokenAmount, int64(tradeLog.Timestamp))
if err != nil {
p.l.Errorw("Failed to getPriceAndAmountUsd for taker", "err", err)
return tradeLog, err
if err.Error() != invalidSymbolErrString {
p.l.Errorw("Failed to getPriceAndAmountUsd for taker", "err", err)
return tradeLog, err
}
}

tradeLog.TakerTokenPrice = takerPrice
Expand Down

0 comments on commit fc1cadc

Please sign in to comment.