@typus/typus-perp-sdk 1.1.17 → 1.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37,6 +37,8 @@ interface tlpComparison {
37
37
  portfolio_60sui_40usdc: number;
38
38
  sui_value: number;
39
39
  tlp_value: number;
40
+ sui_price: number;
41
+ tlp_price: number;
40
42
  }
41
43
  export declare function getUserPnlFromSentio(startTimestamp: number, endTimestamp: number, userAddress?: string): Promise<any[]>;
42
44
  export declare function getLeaderboardFromSentio(startTs: number, endTs: number): Promise<any[]>;
@@ -496,8 +496,8 @@ function getTlpComparisonFromSentio(startTimestamp, endTimestamp) {
496
496
  apiUrl = "https://app.sentio.xyz/api/v1/analytics/typus/typus_perp_mainnet/sql/execute";
497
497
  requestData = {
498
498
  sqlQuery: {
499
- sql: "\n with\n tlp_hourly as (\n select\n toStartOfHour(timestamp + interval 30 minute) as hour,\n argMin(value, abs(toUnixTimestamp(timestamp) - toUnixTimestamp(toStartOfHour(timestamp + interval 30 minute)))) as tlp_price\n from tlp_price\n WHERE timestamp >= ".concat(startTimestamp, " and timestamp < ").concat(endTimestamp, "\n group by hour\n ),\n\n sui_hourly as (\n select\n toStartOfHour(time + interval 30 minute) as hour,\n argMin(price, abs(toUnixTimestamp(time) - toUnixTimestamp(toStartOfHour(time + interval 30 minute)))) as sui_price\n from 'token.prices'\n where symbol = 'sui'\n and time >= ").concat(startTimestamp, " and time < ").concat(endTimestamp, "\n group by hour\n ),\n\n merged as (\n select\n t.hour,\n t.tlp_price,\n s.sui_price\n from tlp_hourly t\n join sui_hourly s\n on t.hour = s.hour\n ),\n\n base as (\n select min(hour) as base_hour\n from merged\n ),\n base_prices as (\n select\n anyIf(m.tlp_price, m.hour = b.base_hour) as base_tlp,\n anyIf(m.sui_price, m.hour = b.base_hour) as base_sui\n from merged m\n cross join base b\n )\n\n select\n m.hour,\n 100 * m.tlp_price / bp.base_tlp as tlp_value,\n 100 * m.sui_price / bp.base_sui as sui_value,\n 0.6 * (100 * m.sui_price / bp.base_sui) + 0.4 * 100 as portfolio_60sui_40usdc\n from merged m\n cross join base_prices bp\n order by m.hour;\n "),
500
- size: 1000,
499
+ sql: "\n with\n tlp_hourly as (\n select\n toStartOfHour(timestamp + interval 30 minute) as hour,\n argMin(value, abs(toUnixTimestamp(timestamp) - toUnixTimestamp(toStartOfHour(timestamp + interval 30 minute)))) as tlp_price\n from tlp_price\n WHERE timestamp >= ".concat(startTimestamp, " and timestamp < ").concat(endTimestamp, "\n group by hour\n ),\n\n sui_hourly as (\n select\n toStartOfHour(time + interval 30 minute) as hour,\n argMin(price, abs(toUnixTimestamp(time) - toUnixTimestamp(toStartOfHour(time + interval 30 minute)))) as sui_price\n from 'token.prices'\n where symbol = 'sui'\n and time >= ").concat(startTimestamp, " and time < ").concat(endTimestamp, "\n group by hour\n ),\n\n merged as (\n select\n t.hour,\n t.tlp_price,\n s.sui_price\n from tlp_hourly t\n join sui_hourly s\n on t.hour = s.hour\n ),\n\n base as (\n select min(hour) as base_hour\n from merged\n ),\n base_prices as (\n select\n anyIf(m.tlp_price, m.hour = b.base_hour) as base_tlp,\n anyIf(m.sui_price, m.hour = b.base_hour) as base_sui\n from merged m\n cross join base b\n )\n\n select\n m.hour,\n m.tlp_price,\n m.sui_price,\n 100 * m.tlp_price / bp.base_tlp as tlp_value,\n 100 * m.sui_price / bp.base_sui as sui_value,\n 0.6 * (100 * m.sui_price / bp.base_sui) + 0.4 * 100 as portfolio_60sui_40usdc\n from merged m\n cross join base_prices bp\n order by m.hour;\n "),
500
+ size: 10000,
501
501
  },
502
502
  };
503
503
  jsonData = JSON.stringify(requestData);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typus/typus-perp-sdk",
3
- "version": "1.1.17",
3
+ "version": "1.1.19",
4
4
  "repository": "https://github.com/Typus-Lab/typus-perp-sdk.git",
5
5
  "author": "Typus",
6
6
  "description": "typus perp sdk",