diff --git a/ocp/rpc/currency/server.go b/ocp/rpc/currency/server.go index 9996106..67933f8 100644 --- a/ocp/rpc/currency/server.go +++ b/ocp/rpc/currency/server.go @@ -330,13 +330,25 @@ func (s *currencyServer) GetHistoricalMintData(ctx context.Context, req *currenc // Build historical data points with market cap var data []*currencypb.HistoricalMintData - // Add a 0 market cap value at time of currency creation if it falls within - // the start time if startTime.Before(metadataRecord.CreatedAt) { - data = append(data, ¤cypb.HistoricalMintData{ - Timestamp: timestamppb.New(metadataRecord.CreatedAt), - MarketCap: 0, - }) + if req.GetPredefinedRange() != currencypb.GetHistoricalMintDataRequest_ALL_TIME { + data = append( + data, + // 0 market cap value at the range start time + ¤cypb.HistoricalMintData{ + Timestamp: timestamppb.New(startTime), + MarketCap: 0, + }, + ) + } + data = append( + data, + // 0 market cap value at time of currency creation + ¤cypb.HistoricalMintData{ + Timestamp: timestamppb.New(metadataRecord.CreatedAt), + MarketCap: 0, + }, + ) } for _, reserve := range reserveHistory {