Skip to content

Commit

Permalink
Update typus finance adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
WayneAl committed Aug 14, 2023
1 parent 3655327 commit df96b0e
Showing 1 changed file with 7 additions and 27 deletions.
34 changes: 7 additions & 27 deletions options/typus/getChainData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,50 +7,30 @@ const headers = {

const requestData = {
timeRange: {
start: "1677918120",
start: "-1M",
end: "now",
step: 86400,
timezone: "UTC",
timezone: "Asia/Taipei",
},
limit: 20,
queries: [
{
metricsQuery: {
query: "deliverySizeUSD",
alias: "SUM",
id: "a",
labelSelector: {},
aggregate: {
op: "SUM",
grouping: ["coin_symbol"],
grouping: [],
},
functions: [
{
name: "sum_over_time",
arguments: [
{
durationValue: {
value: 1,
unit: "d",
},
},
],
},
],
disabled: true,
functions: [],
disabled: false,
},
dataSource: "METRICS",
sourceName: "",
},
],
formulas: [
{
expression: "sum(a)",
alias: "Total",
id: "A",
disabled: false,
functions: [],
},
],
};

export async function getDataFromSentio(
Expand Down Expand Up @@ -101,7 +81,7 @@ interface ChainData {

async function getChainData(timestamp: string): Promise<ChainData> {
let ts = Number(timestamp);
ts = ts - (ts % (24 * 60 * 60));
ts = ts - (ts % (24 * 60 * 60)) + 16 * 60 * 60;
timestamp = ts.toString();

let deliverySizeUSDs = await getDataFromSentio(
Expand Down

0 comments on commit df96b0e

Please sign in to comment.