Skip to content

Commit

Permalink
tri: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Jan 29, 2024
1 parent b898068 commit bfbf415
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/strategy/tri/strategy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ func loadMarket(symbol string) types.Market {
}

func newArbMarket(symbol, base, quote string, askPrice, askVolume, bidPrice, bidVolume float64) *ArbMarket {
market := loadMarket(symbol)
return &ArbMarket{
Symbol: symbol,
BaseCurrency: base,
QuoteCurrency: quote,
market: loadMarket(symbol),
market: market,
book: nil,
bestBid: types.PriceVolume{
Price: fixedpoint.NewFromFloat(bidPrice),
Expand All @@ -44,9 +45,12 @@ func newArbMarket(symbol, base, quote string, askPrice, askVolume, bidPrice, bid
Price: fixedpoint.NewFromFloat(askPrice),
Volume: fixedpoint.NewFromFloat(askVolume),
},
buyRate: 1.0 / askPrice,
sellRate: bidPrice,
buyRate: 1.0 / askPrice,
sellRate: bidPrice,
truncateBaseQuantity: createBaseQuantityTruncator(market),
truncateQuoteQuantity: createPricePrecisionBasedQuoteQuantityTruncator(market),
}

}

func TestPath_calculateBackwardRatio(t *testing.T) {
Expand Down

0 comments on commit bfbf415

Please sign in to comment.