From cbf957c7ce3f675b777800a7e4667916c28119b4 Mon Sep 17 00:00:00 2001 From: c9s Date: Mon, 18 Mar 2024 17:50:39 +0800 Subject: [PATCH] add priceVolume helper InQuote --- pkg/types/price_volume_slice.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/types/price_volume_slice.go b/pkg/types/price_volume_slice.go index 03a6c8b00..6a30b0c98 100644 --- a/pkg/types/price_volume_slice.go +++ b/pkg/types/price_volume_slice.go @@ -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) }