@typus/typus-perp-sdk 1.1.18 → 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.
- package/dist/src/api/sentio.js +1 -1
- package/package.json +1 -1
package/dist/src/api/sentio.js
CHANGED
|
@@ -497,7 +497,7 @@ function getTlpComparisonFromSentio(startTimestamp, endTimestamp) {
|
|
|
497
497
|
requestData = {
|
|
498
498
|
sqlQuery: {
|
|
499
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:
|
|
500
|
+
size: 10000,
|
|
501
501
|
},
|
|
502
502
|
};
|
|
503
503
|
jsonData = JSON.stringify(requestData);
|