@typus/typus-perp-sdk 1.1.45 → 1.1.46
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.d.ts +11 -1
- package/dist/src/api/sentio.js +17 -6
- package/package.json +1 -1
package/dist/src/api/sentio.d.ts
CHANGED
|
@@ -41,5 +41,15 @@ interface tlpComparison {
|
|
|
41
41
|
tlp_price: number;
|
|
42
42
|
}
|
|
43
43
|
export declare function getUserPnlFromSentio(startTimestamp: number, endTimestamp: number, userAddress?: string): Promise<any[]>;
|
|
44
|
-
export declare
|
|
44
|
+
export declare enum LeaderboardType {
|
|
45
|
+
RWA = "rwa",
|
|
46
|
+
CRYPTO = "crypto"
|
|
47
|
+
}
|
|
48
|
+
export type LeaderboardData = {
|
|
49
|
+
Address: string;
|
|
50
|
+
Trading_Vol: number;
|
|
51
|
+
Volume_Share_Top10: number;
|
|
52
|
+
PrizePool_Share: number;
|
|
53
|
+
};
|
|
54
|
+
export declare function getLeaderboardFromSentio(startTs: number, endTs: number, type?: LeaderboardType): Promise<LeaderboardData[]>;
|
|
45
55
|
export {};
|
package/dist/src/api/sentio.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LeaderboardType = void 0;
|
|
3
4
|
exports.getFromSentio = getFromSentio;
|
|
4
5
|
exports.getRecentTradesFromSentio = getRecentTradesFromSentio;
|
|
5
6
|
exports.getTradingVolumeFromSentio = getTradingVolumeFromSentio;
|
|
@@ -674,7 +675,12 @@ async function getUserPnlFromSentio(startTimestamp, endTimestamp, userAddress) {
|
|
|
674
675
|
return [];
|
|
675
676
|
}
|
|
676
677
|
}
|
|
677
|
-
|
|
678
|
+
var LeaderboardType;
|
|
679
|
+
(function (LeaderboardType) {
|
|
680
|
+
LeaderboardType["RWA"] = "rwa";
|
|
681
|
+
LeaderboardType["CRYPTO"] = "crypto";
|
|
682
|
+
})(LeaderboardType || (exports.LeaderboardType = LeaderboardType = {}));
|
|
683
|
+
async function getLeaderboardFromSentio(startTs, endTs, type = LeaderboardType.CRYPTO) {
|
|
678
684
|
let apiUrl = "https://app.sentio.xyz/api/v1/analytics/typus/typus_perp/sql/execute";
|
|
679
685
|
let size = 10;
|
|
680
686
|
let requestData = {
|
|
@@ -683,10 +689,15 @@ async function getLeaderboardFromSentio(startTs, endTs, checkRwaOnly = false) {
|
|
|
683
689
|
WITH
|
|
684
690
|
event AS (
|
|
685
691
|
SELECT
|
|
686
|
-
score/power(10, 9) AS volume,
|
|
687
|
-
distinct_id
|
|
688
|
-
FROM Score
|
|
689
|
-
|
|
692
|
+
s.score / power(10, 9) AS volume,
|
|
693
|
+
s.distinct_id
|
|
694
|
+
FROM Score s
|
|
695
|
+
LEFT JOIN OrderFilled o ON s.transaction_hash = o.transaction_hash
|
|
696
|
+
WHERE o.base_token NOT IN (
|
|
697
|
+
'XAU', 'XAG', 'USOIL', 'JPY', 'SPYX', 'QQQX',
|
|
698
|
+
'TSLAX', 'NVDAX', 'AAPLX', 'GOOGLX', 'METAX'
|
|
699
|
+
)
|
|
700
|
+
AND s.timestamp >= ${startTs} AND s.timestamp < ${endTs}
|
|
690
701
|
),
|
|
691
702
|
sum_vol AS (
|
|
692
703
|
SELECT
|
|
@@ -724,7 +735,7 @@ async function getLeaderboardFromSentio(startTs, endTs, checkRwaOnly = false) {
|
|
|
724
735
|
size,
|
|
725
736
|
},
|
|
726
737
|
};
|
|
727
|
-
if (
|
|
738
|
+
if (type === LeaderboardType.RWA) {
|
|
728
739
|
requestData = {
|
|
729
740
|
sqlQuery: {
|
|
730
741
|
sql: `
|