use fixed interval to leverage caching on backend

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
This commit is contained in:
microwavedcola1 2021-12-26 11:43:29 +01:00
parent 42aeace9b7
commit 5c67a33cd0
1 changed files with 4 additions and 1 deletions

View File

@ -445,9 +445,12 @@ async function getOhlcv(
fromS: number,
toS: number
) {
const fromSFixed = fromS.toFixed();
const toSFixed = toS.toFixed();
const historyResponse = await fetch(
`https://serum-history.herokuapp.com/tv/history` +
`?symbol=${market}&resolution=${resolution}&from=${fromS}&to=${toS}`
`?symbol=${market}&resolution=${resolution}&from=${fromSFixed}&to=${toSFixed}`
);
return historyResponse.json();
}