From 9cff9248b83001938db622c909d06b4de62b293c Mon Sep 17 00:00:00 2001 From: Ian Philips Date: Fri, 28 Feb 2025 13:22:02 -0800 Subject: [PATCH] Include last bet in points --- common/src/contract-params.ts | 2 +- web/components/charts/contract/zoom-utils.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/src/contract-params.ts b/common/src/contract-params.ts index 13d22f24fc..63860a37dd 100644 --- a/common/src/contract-params.ts +++ b/common/src/contract-params.ts @@ -76,7 +76,7 @@ export async function getContractParams( contractId: contract.id, filterRedemptions: !includeRedemptions, includeZeroShareRedemptions: includeRedemptions, - beforeTime: contract.lastBetTime ?? contract.createdTime, + beforeTime: (contract.lastBetTime ?? contract.createdTime) + 1, afterTime: contract.createdTime, }) : [], diff --git a/web/components/charts/contract/zoom-utils.ts b/web/components/charts/contract/zoom-utils.ts index a7645c82f3..4f4ba6f169 100644 --- a/web/components/charts/contract/zoom-utils.ts +++ b/web/components/charts/contract/zoom-utils.ts @@ -70,7 +70,7 @@ export const useDataZoomFetcher = (props: { const min = viewXScale.invert(minX - 20).valueOf() const max = viewXScale.invert(maxX + 20).valueOf() const fixedMin = Math.max(min, createdTime) - const fixedMax = Math.min(max, lastBetTime) + const fixedMax = Math.min(max, lastBetTime) + 1 onZoomData(fixedMin, fixedMax) } else { @@ -173,7 +173,7 @@ export const useMultiChoiceDataZoomFetcher = (props: { const min = viewXScale.invert(minX - 20).valueOf() const max = viewXScale.invert(maxX + 20).valueOf() const fixedMin = Math.max(min, createdTime) - const fixedMax = Math.min(max, lastBetTime) + const fixedMax = Math.min(max, lastBetTime) + 1 onZoomData(fixedMin, fixedMax) } else {