@typus/typus-perp-sdk 1.0.79 → 1.0.80
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 +2 -2
- package/package.json +1 -1
package/dist/src/api/sentio.js
CHANGED
|
@@ -458,7 +458,7 @@ function getUserPnlFromSentio(startTimestamp, endTimestamp, userAddress) {
|
|
|
458
458
|
requestData = {
|
|
459
459
|
version: 25,
|
|
460
460
|
sqlQuery: {
|
|
461
|
-
sql: "\n WITH\n Pnl_history as (\n
|
|
461
|
+
sql: "\n WITH\n Pnl_history as (\n SELECT\n timestamp as time,\n CAST( realized_pnl AS Float64 ) as Trader_PnlUSD,\n filled_size * filled_price as volumeUSD,\n distinct_id as address\n from OrderFilled\n WHERE timestamp >= ".concat(startTimestamp, " and timestamp < ").concat(endTimestamp, "\n UNION ALL\n SELECT\n timestamp as time,\n CAST(value_for_lp_pool_usd + liquidator_fee_usd AS Float64) * (-1) as Trader_PnlUSD,\n 0 as volumeUSD,\n distinct_id as address\n from Liquidate -- collateral liquidate, liquidate fee\u4E0D\u7B97\n WHERE timestamp >= ").concat(startTimestamp, " and timestamp < ").concat(endTimestamp, "\n UNION ALL\n SELECT\n timestamp as time,\n CAST(realized_funding_fee_usd AS Float64) * (-1) as Trader_PnlUSD,\n 0 as volumeUSD,\n distinct_id as address\n from 'RealizeFunding' -- funding fee \u6B63\u7684\u662F user paid to pool\n WHERE timestamp >= ").concat(startTimestamp, " and timestamp < ").concat(endTimestamp, "\n UNION ALL\n SELECT\n timestamp as time,\n CAST(\n user_remaining_in_usd + (realized_loss_value - exercise_balance_value) * (user_remaining_in_usd / user_remaining_value) AS Float64\n ) as Trader_PnlUSD,\n 0 as volumeUSD,\n distinct_id as address\n from 'RealizeOption'\n WHERE timestamp >= ").concat(startTimestamp, " and timestamp < ").concat(endTimestamp, "\n ),\n sum_Trader_PnlUSD as (\n SELECT\n sum(Trader_PnlUSD) as Trader_PnlUSD,\n sum(volumeUSD) as volumeUSD,\n address\n from Pnl_history\n GROUP BY address\n )\n SELECT\n *\n from sum_Trader_PnlUSD\n where address not in (\n '0xc9ea1b9c3542551189cf26a08f5ca5ed7964aef34c14d06c888d30c8d91867e4',\n '0x83d2cb640ee252bae6b01bd6104c4afc69071e67b688db85a029ce452c61f11c',\n '0x39770d149a9bc9d9639314fca2c380e9061c0d230737635762c5bcc61dee13d0',\n '0x834d17f7b2e167cae224325a17b49babffe168182c418caa0c63a92d6f70b83a',\n '0xd35ae21660aee607ee21e104d093d03643d36efbf79df669092c4411308ed2e2',\n '0xe6cbba68c446f52cf8211c12ae79179233c8f9cec5e0b5008418ec339ca72fea'\n )\n ").concat(userFilter, "\n order by Trader_PnlUSD desc\n "),
|
|
462
462
|
size: 100,
|
|
463
463
|
},
|
|
464
464
|
};
|
|
@@ -473,7 +473,7 @@ function getUserPnlFromSentio(startTimestamp, endTimestamp, userAddress) {
|
|
|
473
473
|
return [4 /*yield*/, response.json()];
|
|
474
474
|
case 2:
|
|
475
475
|
data = _a.sent();
|
|
476
|
-
console.log(data);
|
|
476
|
+
// console.log(data);
|
|
477
477
|
if (data.result) {
|
|
478
478
|
return [2 /*return*/, data.result.rows];
|
|
479
479
|
}
|