oi5m = {
const data = []
let startTime = new Date("2022-12-01").getTime()
while (true) {
const response = await fetch(
'https://fapi.binance.com/futures/data/openInterestHist?symbol=BTCUSDT&period=5m&limit=500&startTime=' + startTime
).then((res) => res.json())
data.push(...response);
if (response.length < 500) break;
startTime = response.at(-1).timestamp
}
return data.map((v) => ({
startTime: new Date(v.timestamp),
openInterest: Number(v.sumOpenInterest)
}))
}