Skip to content

Commit

Permalink
add priceVolume helper InQuote
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Mar 18, 2024
1 parent 97c48e5 commit cbf957c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/types/price_volume_slice.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ type PriceVolume struct {
Price, Volume fixedpoint.Value
}

func (p PriceVolume) InQuote() fixedpoint.Value {
return p.Price.Mul(p.Volume)
}

func (p PriceVolume) Equals(b PriceVolume) bool {
return p.Price.Eq(b.Price) && p.Volume.Eq(b.Volume)
}
Expand Down

0 comments on commit cbf957c

Please sign in to comment.