Skip to content

Commit

Permalink
Merge pull request #740 from WayneAl/master
Browse files Browse the repository at this point in the history
Update typus finance adapter
  • Loading branch information
dtmkeng authored Aug 14, 2023
2 parents 581121d + df96b0e commit d225ff2
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 @@ -9,50 +9,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 @@ -98,7 +78,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 d225ff2

Please sign in to comment.