@sonarwatch/portfolio-plugins 0.14.49 → 0.14.51
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/CHANGELOG.md +1788 -1780
- package/README.md +3 -3
- package/package.json +1 -1
- package/src/index.js +6 -2
- package/src/index.js.map +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/bluemove/constants.d.ts +1 -2
- package/src/plugins/bluemove/constants.js +2 -3
- package/src/plugins/bluemove/constants.js.map +1 -1
- package/src/plugins/bluemove/index.js +4 -2
- package/src/plugins/bluemove/index.js.map +1 -1
- package/src/plugins/bluemove/lockLpFetcher.js +66 -0
- package/src/plugins/bluemove/lockLpFetcher.js.map +1 -0
- package/src/plugins/{deepbook/poolsJob.js → bluemove/lockLpJob.js} +12 -6
- package/src/plugins/bluemove/lockLpJob.js.map +1 -0
- package/src/plugins/bluemove/types.d.ts +24 -0
- package/src/plugins/deepbook/constants.d.ts +0 -3
- package/src/plugins/deepbook/constants.js +1 -4
- package/src/plugins/deepbook/constants.js.map +1 -1
- package/src/plugins/deepbook/helpers.d.ts +10 -4
- package/src/plugins/deepbook/helpers.js +4 -97
- package/src/plugins/deepbook/helpers.js.map +1 -1
- package/src/plugins/deepbook/index.js +6 -4
- package/src/plugins/deepbook/index.js.map +1 -1
- package/src/plugins/deepbook/types.d.ts +0 -7
- package/src/plugins/deepbook/v2/constants.d.ts +3 -0
- package/src/plugins/deepbook/v2/constants.js +7 -0
- package/src/plugins/deepbook/v2/constants.js.map +1 -0
- package/src/plugins/deepbook/v2/depositsFetcher.d.ts +3 -0
- package/src/plugins/deepbook/{ordersFetcher.js → v2/depositsFetcher.js} +9 -7
- package/src/plugins/deepbook/v2/depositsFetcher.js.map +1 -0
- package/src/plugins/deepbook/v2/helpers.d.ts +4 -0
- package/src/plugins/deepbook/v2/helpers.js +49 -0
- package/src/plugins/deepbook/v2/helpers.js.map +1 -0
- package/src/plugins/deepbook/v2/poolsJob.d.ts +3 -0
- package/src/plugins/deepbook/v2/poolsJob.js +41 -0
- package/src/plugins/deepbook/v2/poolsJob.js.map +1 -0
- package/src/plugins/deepbook/v2/types.d.ts +7 -0
- package/src/plugins/deepbook/v2/types.js +3 -0
- package/src/plugins/deepbook/v2/types.js.map +1 -0
- package/src/plugins/deepbook/v3/constants.d.ts +4 -0
- package/src/plugins/deepbook/v3/constants.js +8 -0
- package/src/plugins/deepbook/v3/constants.js.map +1 -0
- package/src/plugins/deepbook/v3/depositsFetcher.d.ts +3 -0
- package/src/plugins/deepbook/v3/depositsFetcher.js +83 -0
- package/src/plugins/deepbook/v3/depositsFetcher.js.map +1 -0
- package/src/plugins/deepbook/v3/helpers.d.ts +12 -0
- package/src/plugins/deepbook/v3/helpers.js +69 -0
- package/src/plugins/deepbook/v3/helpers.js.map +1 -0
- package/src/plugins/deepbook/v3/poolsJob.d.ts +3 -0
- package/src/plugins/deepbook/v3/poolsJob.js +48 -0
- package/src/plugins/deepbook/v3/poolsJob.js.map +1 -0
- package/src/plugins/doubleup/constants.d.ts +7 -0
- package/src/plugins/doubleup/constants.js +17 -0
- package/src/plugins/doubleup/constants.js.map +1 -0
- package/src/plugins/doubleup/housesAndRedeemJob.d.ts +3 -0
- package/src/plugins/doubleup/housesAndRedeemJob.js +127 -0
- package/src/plugins/doubleup/housesAndRedeemJob.js.map +1 -0
- package/src/plugins/doubleup/index.d.ts +6 -0
- package/src/plugins/doubleup/index.js +13 -0
- package/src/plugins/doubleup/index.js.map +1 -0
- package/src/plugins/doubleup/redeemTicketsFetcher.d.ts +3 -0
- package/src/plugins/doubleup/redeemTicketsFetcher.js +46 -0
- package/src/plugins/doubleup/redeemTicketsFetcher.js.map +1 -0
- package/src/plugins/doubleup/structs.d.ts +19 -0
- package/src/plugins/doubleup/structs.js +22 -0
- package/src/plugins/doubleup/structs.js.map +1 -0
- package/src/plugins/doubleup/types.d.ts +42 -0
- package/src/plugins/doubleup/types.js +3 -0
- package/src/plugins/doubleup/types.js.map +1 -0
- package/src/plugins/moonwalk/constants.d.ts +1 -1
- package/src/plugins/moonwalk/constants.js +2 -2
- package/src/plugins/moonwalk/constants.js.map +1 -1
- package/src/plugins/moonwalk/gamesFetcher.js +36 -13
- package/src/plugins/moonwalk/gamesFetcher.js.map +1 -1
- package/src/plugins/navi/constants.d.ts +0 -9
- package/src/plugins/navi/constants.js +1 -49
- package/src/plugins/navi/constants.js.map +1 -1
- package/src/plugins/suilend/airdropFetcher.js +2 -1
- package/src/plugins/suilend/airdropFetcher.js.map +1 -1
- package/src/plugins/suilend/earlyUsers.json +3 -2
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/plugins/zeta/airdropFetcher.js +14 -14
- package/src/utils/sei/constants.js +8 -8
- package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
- package/src/plugins/deepbook/ordersFetcher.js.map +0 -1
- package/src/plugins/deepbook/poolsJob.js.map +0 -1
- /package/src/plugins/{deepbook/ordersFetcher.d.ts → bluemove/lockLpFetcher.d.ts} +0 -0
- /package/src/plugins/{deepbook/poolsJob.d.ts → bluemove/lockLpJob.d.ts} +0 -0
@@ -11,10 +11,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
12
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
13
13
|
const constants_1 = require("./constants");
|
14
|
-
const clients_1 = require("
|
14
|
+
const clients_1 = require("../../../utils/clients");
|
15
15
|
const helpers_1 = require("./helpers");
|
16
|
-
const ElementRegistry_1 = require("
|
17
|
-
const getOwnedObjectsPreloaded_1 = require("
|
16
|
+
const ElementRegistry_1 = require("../../../utils/elementbuilder/ElementRegistry");
|
17
|
+
const getOwnedObjectsPreloaded_1 = require("../../../utils/sui/getOwnedObjectsPreloaded");
|
18
|
+
const constants_2 = require("../constants");
|
18
19
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
19
20
|
var _a;
|
20
21
|
const client = (0, clients_1.getClientSui)();
|
@@ -34,13 +35,13 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
34
35
|
return [];
|
35
36
|
const accountCapId = accountCaps[0].data.objectId;
|
36
37
|
const pools = yield cache.getItem(constants_1.poolsCacheKey, {
|
37
|
-
prefix:
|
38
|
+
prefix: constants_2.platformId,
|
38
39
|
networkId: portfolio_core_1.NetworkId.sui,
|
39
40
|
});
|
40
41
|
if (!pools)
|
41
42
|
return [];
|
42
43
|
const positions = yield Promise.all(pools.map((pool) => (0, helpers_1.getUserPosition)(pool, accountCapId, client)));
|
43
|
-
const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.sui,
|
44
|
+
const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.sui, constants_2.platformId);
|
44
45
|
pools.forEach((pool, i) => {
|
45
46
|
if (!positions[i])
|
46
47
|
return;
|
@@ -52,6 +53,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
52
53
|
return;
|
53
54
|
const element = elementRegistry.addElementMultiple({
|
54
55
|
label: 'Deposit',
|
56
|
+
name: 'V2',
|
55
57
|
});
|
56
58
|
element.addAsset({
|
57
59
|
address: pool.baseAsset,
|
@@ -65,9 +67,9 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
65
67
|
return elementRegistry.getElements(cache);
|
66
68
|
});
|
67
69
|
const fetcher = {
|
68
|
-
id: `${
|
70
|
+
id: `${constants_2.platformId}-v2-deposits`,
|
69
71
|
networkId: portfolio_core_1.NetworkId.sui,
|
70
72
|
executor,
|
71
73
|
};
|
72
74
|
exports.default = fetcher;
|
73
|
-
//# sourceMappingURL=
|
75
|
+
//# sourceMappingURL=depositsFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../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AI,EAAE,CAAC,EAAE,EAAE;QACxB,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;YAAE,OAAO;QAE1B,MAAM,YAAY,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;QAElC,IACE,YAAY,CAAC,mBAAmB,CAAC,MAAM,EAAE;YACzC,YAAY,CAAC,gBAAgB,CAAC,MAAM,EAAE;YACtC,YAAY,CAAC,oBAAoB,CAAC,MAAM,EAAE;YAC1C,YAAY,CAAC,iBAAiB,CAAC,MAAM,EAAE;YAEvC,OAAO;QAET,MAAM,OAAO,GAAG,eAAe,CAAC,kBAAkB,CAAC;YACjD,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;QAEH,OAAO,CAAC,QAAQ,CAAC;YACf,OAAO,EAAE,IAAI,CAAC,SAAS;YACvB,MAAM,EAAE,YAAY,CAAC,mBAAmB,CAAC,IAAI,CAC3C,YAAY,CAAC,gBAAgB,CAC9B;SACF,CAAC,CAAC;QAEH,OAAO,CAAC,QAAQ,CAAC;YACf,OAAO,EAAE,IAAI,CAAC,UAAU;YACxB,MAAM,EAAE,YAAY,CAAC,oBAAoB,CAAC,IAAI,CAC5C,YAAY,CAAC,gBAAgB,CAC9B;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
|
+
};
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
+
exports.getUserPosition = void 0;
|
16
|
+
const bcs_1 = require("@mysten/bcs");
|
17
|
+
const transactions_1 = require("@mysten/sui/transactions");
|
18
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
19
|
+
const constants_1 = require("./constants");
|
20
|
+
const helpers_1 = require("../helpers");
|
21
|
+
const DUMMY_ADDRESS = (0, helpers_1.normalizeSuiAddress)('0x0');
|
22
|
+
const checkAccountCap = (accountCap) => {
|
23
|
+
if (accountCap === undefined) {
|
24
|
+
throw new Error('accountCap is undefined, please call setAccountCap() first');
|
25
|
+
}
|
26
|
+
return (0, helpers_1.normalizeSuiObjectId)(accountCap);
|
27
|
+
};
|
28
|
+
const getUserPosition = (pool, accountCap, suiClient) => __awaiter(void 0, void 0, void 0, function* () {
|
29
|
+
var _a, _b;
|
30
|
+
const tx = new transactions_1.Transaction();
|
31
|
+
const cap = checkAccountCap(accountCap);
|
32
|
+
tx.moveCall({
|
33
|
+
typeArguments: [pool.baseAsset, pool.quoteAsset],
|
34
|
+
target: `${constants_1.PACKAGE_ID}::${constants_1.MODULE_CLOB}::account_balance`,
|
35
|
+
arguments: [tx.object((0, helpers_1.normalizeSuiObjectId)(pool.poolId)), tx.object(cap)],
|
36
|
+
});
|
37
|
+
const [availableBaseAmount, lockedBaseAmount, availableQuoteAmount, lockedQuoteAmount,] = (_b = (_a = (yield suiClient.devInspectTransactionBlock({
|
38
|
+
transactionBlock: tx,
|
39
|
+
sender: DUMMY_ADDRESS,
|
40
|
+
})).results) === null || _a === void 0 ? void 0 : _a[0].returnValues) === null || _b === void 0 ? void 0 : _b.map(([bytes]) => new bignumber_js_1.default(new bcs_1.BcsReader(Uint8Array.from(bytes)).read64()));
|
41
|
+
return {
|
42
|
+
availableBaseAmount,
|
43
|
+
lockedBaseAmount,
|
44
|
+
availableQuoteAmount,
|
45
|
+
lockedQuoteAmount,
|
46
|
+
};
|
47
|
+
});
|
48
|
+
exports.getUserPosition = getUserPosition;
|
49
|
+
//# sourceMappingURL=helpers.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/deepbook/v2/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,qCAAwC;AACxC,2DAAuD;AACvD,gEAAqC;AAErC,2CAAsD;AAEtD,wCAAuE;AAGvE,MAAM,aAAa,GAAG,IAAA,6BAAmB,EAAC,KAAK,CAAC,CAAC;AAEjD,MAAM,eAAe,GAAG,CAAC,UAAkB,EAAU,EAAE;IACrD,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CACb,4DAA4D,CAC7D,CAAC;IACJ,CAAC;IACD,OAAO,IAAA,8BAAoB,EAAC,UAAU,CAAC,CAAC;AAC1C,CAAC,CAAC;AAEK,MAAM,eAAe,GAAG,CAC7B,IAAiB,EACjB,UAAkB,EAClB,SAAoB,EACG,EAAE;;IACzB,MAAM,EAAE,GAAG,IAAI,0BAAW,EAAE,CAAC;IAC7B,MAAM,GAAG,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;IAExC,EAAE,CAAC,QAAQ,CAAC;QACV,aAAa,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC;QAChD,MAAM,EAAE,GAAG,sBAAU,KAAK,uBAAW,mBAAmB;QACxD,SAAS,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,IAAA,8BAAoB,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;KAC1E,CAAC,CAAC;IACH,MAAM,CACJ,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EAClB,GAAG,MAAA,MAAA,CACF,MAAM,SAAS,CAAC,0BAA0B,CAAC;QACzC,gBAAgB,EAAE,EAAE;QACpB,MAAM,EAAE,aAAa;KACtB,CAAC,CACH,CAAC,OAAO,0CAAG,CAAC,EAAE,YAAY,0CAAE,GAAG,CAC9B,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,IAAI,sBAAS,CAAC,IAAI,eAAS,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAC5D,CAAC;IAEjB,OAAO;QACL,mBAAmB;QACnB,gBAAgB;QAChB,oBAAoB;QACpB,iBAAiB;KAClB,CAAC;AACJ,CAAC,CAAA,CAAC;AAjCW,QAAA,eAAe,mBAiC1B"}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
13
|
+
const clients_1 = require("../../../utils/clients");
|
14
|
+
const constants_1 = require("./constants");
|
15
|
+
const helpers_1 = require("../helpers");
|
16
|
+
const queryEvents_1 = require("../../../utils/sui/queryEvents");
|
17
|
+
const constants_2 = require("../constants");
|
18
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
19
|
+
const client = (0, clients_1.getClientSui)();
|
20
|
+
const events = yield (0, queryEvents_1.queryEvents)(client, {
|
21
|
+
MoveEventType: `${constants_1.PACKAGE_ID}::${constants_1.MODULE_CLOB}::PoolCreated`,
|
22
|
+
});
|
23
|
+
const pools = events
|
24
|
+
.map((e) => e.parsedJson && {
|
25
|
+
poolId: e.parsedJson.pool_id,
|
26
|
+
baseAsset: (0, helpers_1.normalizeStructTag)(e.parsedJson.base_asset.name),
|
27
|
+
quoteAsset: (0, helpers_1.normalizeStructTag)(e.parsedJson.quote_asset.name),
|
28
|
+
})
|
29
|
+
.filter((p) => p !== null);
|
30
|
+
yield cache.setItem(constants_1.poolsCacheKey, pools, {
|
31
|
+
prefix: constants_2.platformId,
|
32
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
33
|
+
});
|
34
|
+
});
|
35
|
+
const job = {
|
36
|
+
id: `${constants_2.platformId}-v2-pools`,
|
37
|
+
executor,
|
38
|
+
label: 'normal',
|
39
|
+
};
|
40
|
+
exports.default = job;
|
41
|
+
//# sourceMappingURL=poolsJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/deepbook/v2/poolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,oDAAsD;AACtD,2CAAqE;AACrE,wCAAgD;AAChD,gEAA6D;AAE7D,4CAA0C;AAE1C,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,MAAM,GAAG,MAAM,IAAA,yBAAW,EAI7B,MAAM,EAAE;QACT,aAAa,EAAE,GAAG,sBAAU,KAAK,uBAAW,eAAe;KAC5D,CAAC,CAAC;IAEH,MAAM,KAAK,GAAG,MAAM;SACjB,GAAG,CACF,CAAC,CAAC,EAAE,EAAE,CACJ,CAAC,CAAC,UAAU,IAAI;QACd,MAAM,EAAE,CAAC,CAAC,UAAU,CAAC,OAAiB;QACtC,SAAS,EAAE,IAAA,4BAAkB,EAAC,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC;QAC3D,UAAU,EAAE,IAAA,4BAAkB,EAAC,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC;KAC9D,CACJ;SACA,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,CAAkB,CAAC;IAE9C,MAAM,KAAK,CAAC,OAAO,CAAC,yBAAa,EAAE,KAAK,EAAE;QACxC,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,GAAG;KACzB,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/deepbook/v2/types.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
export declare const PACKAGE_ID = "0x2c8d603bc51326b8c13cef9dd07031a408a48dddb541963357661df5d3204809";
|
2
|
+
export declare const MODULE_CLOB = "pool";
|
3
|
+
export declare const PoolCreatedEvent = "0x2c8d603bc51326b8c13cef9dd07031a408a48dddb541963357661df5d3204809::pool::PoolCreated";
|
4
|
+
export declare const poolsCacheKey = "pools-v3";
|
@@ -0,0 +1,8 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.poolsCacheKey = exports.PoolCreatedEvent = exports.MODULE_CLOB = exports.PACKAGE_ID = void 0;
|
4
|
+
exports.PACKAGE_ID = '0x2c8d603bc51326b8c13cef9dd07031a408a48dddb541963357661df5d3204809';
|
5
|
+
exports.MODULE_CLOB = 'pool';
|
6
|
+
exports.PoolCreatedEvent = `${exports.PACKAGE_ID}::${exports.MODULE_CLOB}::PoolCreated`;
|
7
|
+
exports.poolsCacheKey = 'pools-v3';
|
8
|
+
//# sourceMappingURL=constants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/deepbook/v3/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GACrB,oEAAoE,CAAC;AAE1D,QAAA,WAAW,GAAG,MAAM,CAAC;AACrB,QAAA,gBAAgB,GAAG,GAAG,kBAAU,KAAK,mBAAW,eAAe,CAAC;AAEhE,QAAA,aAAa,GAAG,UAAU,CAAC"}
|
@@ -0,0 +1,83 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
13
|
+
const constants_1 = require("../constants");
|
14
|
+
const ElementRegistry_1 = require("../../../utils/elementbuilder/ElementRegistry");
|
15
|
+
const helpers_1 = require("./helpers");
|
16
|
+
const clients_1 = require("../../../utils/clients");
|
17
|
+
const constants_2 = require("./constants");
|
18
|
+
const multiGetObjects_1 = require("../../../utils/sui/multiGetObjects");
|
19
|
+
const multipleGetDynamicFieldsObjectsSafe_1 = require("../../../utils/sui/multipleGetDynamicFieldsObjectsSafe");
|
20
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
21
|
+
const client = (0, clients_1.getClientSui)();
|
22
|
+
const deepbookBalanceManagerIds = yield (0, helpers_1.getDeepbookBalanceManagerIds)(client, owner);
|
23
|
+
if (!deepbookBalanceManagerIds.length)
|
24
|
+
return [];
|
25
|
+
const pools = yield cache.getItem(constants_2.poolsCacheKey, {
|
26
|
+
prefix: constants_1.platformId,
|
27
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
28
|
+
});
|
29
|
+
if (!pools)
|
30
|
+
return [];
|
31
|
+
const [unflattenedLockedBalances, deepbookBalanceManagers] = yield Promise.all([
|
32
|
+
Promise.all(deepbookBalanceManagerIds.map((deepbookBalanceManagerId) => (0, helpers_1.getLockedBalances)(pools, client, owner, deepbookBalanceManagerId))),
|
33
|
+
(0, multiGetObjects_1.multiGetObjects)(client, deepbookBalanceManagerIds),
|
34
|
+
]);
|
35
|
+
const lockedBalances = unflattenedLockedBalances.flat();
|
36
|
+
const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.sui, constants_1.platformId);
|
37
|
+
const element = elementRegistry.addElementMultiple({
|
38
|
+
label: 'Deposit',
|
39
|
+
name: 'V3',
|
40
|
+
});
|
41
|
+
// Locked
|
42
|
+
lockedBalances.forEach((balance) => {
|
43
|
+
element.addAsset({
|
44
|
+
address: balance.baseAsset,
|
45
|
+
amount: balance.base,
|
46
|
+
});
|
47
|
+
element.addAsset({
|
48
|
+
address: balance.quoteAsset,
|
49
|
+
amount: balance.quote,
|
50
|
+
});
|
51
|
+
});
|
52
|
+
// Free Balance
|
53
|
+
if (deepbookBalanceManagers.length) {
|
54
|
+
const balanceIds = deepbookBalanceManagers
|
55
|
+
.map((bm) => { var _a, _b; return (_b = (_a = bm.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields.balances.fields.id.id; })
|
56
|
+
.filter((b) => b !== null);
|
57
|
+
if (balanceIds.length) {
|
58
|
+
const balances = (yield (0, multipleGetDynamicFieldsObjectsSafe_1.multipleGetDynamicFieldsObjectsSafe)(client, balanceIds)).flat();
|
59
|
+
if (balances.length) {
|
60
|
+
balances.forEach((balance) => {
|
61
|
+
var _a;
|
62
|
+
if (!((_a = balance.data) === null || _a === void 0 ? void 0 : _a.content))
|
63
|
+
return;
|
64
|
+
const { keys } = (0, portfolio_core_1.parseTypeString)(balance.data.type);
|
65
|
+
if (!keys || !keys[0] || !keys[0].keys || !keys[0].keys[0])
|
66
|
+
return;
|
67
|
+
element.addAsset({
|
68
|
+
address: keys[0].keys[0].type,
|
69
|
+
amount: balance.data.content.fields.value,
|
70
|
+
});
|
71
|
+
});
|
72
|
+
}
|
73
|
+
}
|
74
|
+
}
|
75
|
+
return elementRegistry.getElements(cache);
|
76
|
+
});
|
77
|
+
const fetcher = {
|
78
|
+
id: `${constants_1.platformId}-v3-deposits`,
|
79
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
80
|
+
executor,
|
81
|
+
};
|
82
|
+
exports.default = fetcher;
|
83
|
+
//# sourceMappingURL=depositsFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/deepbook/v3/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAwE;AAExE,4CAA0C;AAE1C,mFAAgF;AAChF,uCAA4E;AAC5E,oDAAsD;AAEtD,2CAA4C;AAC5C,wEAAqE;AAErE,gHAA6G;AAE7G,MAAM,QAAQ,GAAoB,CAA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C,OAAO,CAAC,MAAM,CAAC,KAAK;qBAC1C,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
2
|
+
import { SuiClient } from '../../../utils/clients/types';
|
3
|
+
import { PoolSummary } from '../types';
|
4
|
+
export declare const getDeepbookBalanceManagerIds: (client: SuiClient, owner: string) => Promise<string[]>;
|
5
|
+
export declare const getLockedBalances: (pools: PoolSummary[], client: SuiClient, owner: string, managerKey: string) => Promise<{
|
6
|
+
base: BigNumber;
|
7
|
+
quote: BigNumber;
|
8
|
+
deep: BigNumber;
|
9
|
+
poolId: string;
|
10
|
+
baseAsset: string;
|
11
|
+
quoteAsset: string;
|
12
|
+
}[]>;
|
@@ -0,0 +1,69 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
|
+
};
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
+
exports.getLockedBalances = exports.getDeepbookBalanceManagerIds = void 0;
|
16
|
+
const transactions_1 = require("@mysten/sui/transactions");
|
17
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
18
|
+
const bcs_1 = require("@mysten/bcs");
|
19
|
+
const constants_1 = require("./constants");
|
20
|
+
const getDeepbookBalanceManagerIds = (client, owner) => __awaiter(void 0, void 0, void 0, function* () {
|
21
|
+
const tx = new transactions_1.Transaction();
|
22
|
+
tx.moveCall({
|
23
|
+
target: `0x624a80998bfca8118a794c71cccca771c351158eecd425661e07056f4ed94683::cetus_balance_manager::get_balance_managers_by_owner`,
|
24
|
+
arguments: [
|
25
|
+
tx.object('0x5c1a039f97ed1cbd84d54b5d633bdffd681086acc38961b1d366c4ecf680d150'),
|
26
|
+
tx.pure.address(owner),
|
27
|
+
],
|
28
|
+
typeArguments: [],
|
29
|
+
});
|
30
|
+
const simulateRes = yield client.devInspectTransactionBlock({
|
31
|
+
transactionBlock: tx,
|
32
|
+
sender: owner,
|
33
|
+
});
|
34
|
+
return simulateRes.events
|
35
|
+
.filter((e) => e.type ===
|
36
|
+
'0x624a80998bfca8118a794c71cccca771c351158eecd425661e07056f4ed94683::cetus_balance_manager::GetCetusBalanceManagerList')
|
37
|
+
.map((e) => e.parsedJson
|
38
|
+
.deepbook_balance_managers)
|
39
|
+
.flat();
|
40
|
+
});
|
41
|
+
exports.getDeepbookBalanceManagerIds = getDeepbookBalanceManagerIds;
|
42
|
+
const getLockedBalances = (pools, client, owner, managerKey) => __awaiter(void 0, void 0, void 0, function* () {
|
43
|
+
const simulateRess = yield Promise.all(pools.map((pool) => __awaiter(void 0, void 0, void 0, function* () {
|
44
|
+
// https://github.com/MystenLabs/sui/blob/5bc14df0074eb549ff9e431aee69fc6ffb2052fc/sdk/deepbook-v3/src/transactions/deepbook.ts#L676
|
45
|
+
const tx = new transactions_1.Transaction();
|
46
|
+
tx.moveCall({
|
47
|
+
target: `${constants_1.PACKAGE_ID}::pool::locked_balance`,
|
48
|
+
arguments: [tx.object(pool.poolId), tx.object(managerKey)],
|
49
|
+
typeArguments: [pool.baseAsset, pool.quoteAsset],
|
50
|
+
});
|
51
|
+
return client.devInspectTransactionBlock({
|
52
|
+
transactionBlock: tx,
|
53
|
+
sender: owner,
|
54
|
+
});
|
55
|
+
})));
|
56
|
+
const lockedBalances = [];
|
57
|
+
pools.forEach((pool, i) => {
|
58
|
+
const simulateRes = simulateRess[i];
|
59
|
+
if (!simulateRes || simulateRes.error || !simulateRes.results)
|
60
|
+
return;
|
61
|
+
const { returnValues } = simulateRes.results[0];
|
62
|
+
if (!returnValues)
|
63
|
+
return;
|
64
|
+
lockedBalances.push(Object.assign(Object.assign({}, pool), { base: new bignumber_js_1.default(new bcs_1.BcsReader(Uint8Array.from(returnValues[0][0])).read64()), quote: new bignumber_js_1.default(new bcs_1.BcsReader(Uint8Array.from(returnValues[1][0])).read64()), deep: new bignumber_js_1.default(new bcs_1.BcsReader(Uint8Array.from(returnValues[2][0])).read64()) }));
|
65
|
+
});
|
66
|
+
return lockedBalances;
|
67
|
+
});
|
68
|
+
exports.getLockedBalances = getLockedBalances;
|
69
|
+
//# sourceMappingURL=helpers.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/deepbook/v3/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2DAAuD;AACvD,gEAAqC;AACrC,qCAAwC;AAGxC,2CAAyC;AAElC,MAAM,4BAA4B,GAAG,CAC1C,MAAiB,EACjB,KAAa,EACb,EAAE;IACF,MAAM,EAAE,GAAG,IAAI,0BAAW,EAAE,CAAC;IAE7B,EAAE,CAAC,QAAQ,CAAC;QACV,MAAM,EAAE,0HAA0H;QAClI,SAAS,EAAE;YACT,EAAE,CAAC,MAAM,CACP,oEAAoE,CACrE;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,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;QACxB,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QACpC,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,KAAK,IAAI,CAAC,WAAW,CAAC,OAAO;YAAE,OAAO;QACtE,MAAM,EAAE,YAAY,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAChD,IAAI,CAAC,YAAY;YAAE,OAAO;QAC1B,cAAc,CAAC,IAAI,iCACd,IAAI,KACP,IAAI,EAAE,IAAI,sBAAS,CACjB,IAAI,eAAS,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAC5D,EACD,KAAK,EAAE,IAAI,sBAAS,CAClB,IAAI,eAAS,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAC5D,EACD,IAAI,EAAE,IAAI,sBAAS,CACjB,IAAI,eAAS,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAC5D,IACD,CAAC;IACL,CAAC,CAAC,CAAC;IACH,OAAO,cAAc,CAAC;AACxB,CAAC,CAAA,CAAC;AAhDW,QAAA,iBAAiB,qBAgD5B"}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
13
|
+
const clients_1 = require("../../../utils/clients");
|
14
|
+
const constants_1 = require("./constants");
|
15
|
+
const queryEvents_1 = require("../../../utils/sui/queryEvents");
|
16
|
+
const helpers_1 = require("../helpers");
|
17
|
+
const constants_2 = require("../constants");
|
18
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
19
|
+
const client = (0, clients_1.getClientSui)();
|
20
|
+
const pools = (yield (0, queryEvents_1.queryEvents)(client, {
|
21
|
+
MoveEventModule: {
|
22
|
+
module: constants_1.MODULE_CLOB,
|
23
|
+
package: constants_1.PACKAGE_ID,
|
24
|
+
},
|
25
|
+
}))
|
26
|
+
.filter((e) => e.type.startsWith(constants_1.PoolCreatedEvent))
|
27
|
+
.map((e) => {
|
28
|
+
var _a;
|
29
|
+
const { keys } = (0, portfolio_core_1.parseTypeString)(e.type);
|
30
|
+
return (e.parsedJson &&
|
31
|
+
keys && {
|
32
|
+
poolId: e.parsedJson.pool_id,
|
33
|
+
baseAsset: (0, helpers_1.normalizeStructTag)((_a = keys[0]) === null || _a === void 0 ? void 0 : _a.type),
|
34
|
+
quoteAsset: (0, helpers_1.normalizeStructTag)(keys[1].type),
|
35
|
+
});
|
36
|
+
});
|
37
|
+
yield cache.setItem(constants_1.poolsCacheKey, pools, {
|
38
|
+
prefix: constants_2.platformId,
|
39
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
40
|
+
});
|
41
|
+
});
|
42
|
+
const job = {
|
43
|
+
id: `${constants_2.platformId}-v3-pools`,
|
44
|
+
executor,
|
45
|
+
label: 'normal',
|
46
|
+
};
|
47
|
+
exports.default = job;
|
48
|
+
//# sourceMappingURL=poolsJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/deepbook/v3/poolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAwE;AAGxE,oDAAsD;AACtD,2CAKqB;AACrB,gEAA6D;AAC7D,wCAAgD;AAChD,4CAA0C;AAE1C,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,KAAK,GAAG,CACZ,MAAM,IAAA,yBAAW,EAAsB,MAAM,EAAE;QAC7C,eAAe,EAAE;YACf,MAAM,EAAE,uBAAW;YACnB,OAAO,EAAE,sBAAU;SACpB;KACF,CAAC,CACH;SACE,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,4BAAgB,CAAC,CAAC;SAClD,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;;QACT,MAAM,EAAE,IAAI,EAAE,GAAG,IAAA,gCAAe,EAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACzC,OAAO,CACL,CAAC,CAAC,UAAU;YACZ,IAAI,IAAI;YACN,MAAM,EAAE,CAAC,CAAC,UAAU,CAAC,OAAiB;YACtC,SAAS,EAAE,IAAA,4BAAkB,EAAC,MAAA,IAAI,CAAC,CAAC,CAAC,0CAAE,IAAI,CAAC;YAC5C,UAAU,EAAE,IAAA,4BAAkB,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;SAC7C,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;IAEL,MAAM,KAAK,CAAC,OAAO,CAAC,yBAAa,EAAE,KAAK,EAAE;QACxC,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,GAAG;KACzB,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { Platform } from '@sonarwatch/portfolio-core';
|
2
|
+
export declare const platformId = "doubleup";
|
3
|
+
export declare const platform: Platform;
|
4
|
+
export declare const houseType = "0x2f2226a22ebeb7a0e63ea39551829b238589d981d1c6dd454f01fcc513035593::house::House";
|
5
|
+
export declare const unihouse = "0x75c63644536b1a7155d20d62d9f88bf794dc847ea296288ddaf306aa320168ab";
|
6
|
+
export declare const redeemType = "0x2f2226a22ebeb7a0e63ea39551829b238589d981d1c6dd454f01fcc513035593::unihouse::RedeemRequest";
|
7
|
+
export declare const redeemTicketsKey = "redeemTickets";
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.redeemTicketsKey = exports.redeemType = exports.unihouse = exports.houseType = exports.platform = exports.platformId = void 0;
|
4
|
+
exports.platformId = 'doubleup';
|
5
|
+
exports.platform = {
|
6
|
+
id: exports.platformId,
|
7
|
+
name: 'DoubleUp',
|
8
|
+
image: 'https://sonar.watch/img/platforms/doubleup.webp',
|
9
|
+
website: 'https://www.doubleup.fun/',
|
10
|
+
twitter: 'https://x.com/doubleup_app',
|
11
|
+
defiLlamaId: 'doubleup', // from https://defillama.com/docs/api
|
12
|
+
};
|
13
|
+
exports.houseType = '0x2f2226a22ebeb7a0e63ea39551829b238589d981d1c6dd454f01fcc513035593::house::House';
|
14
|
+
exports.unihouse = '0x75c63644536b1a7155d20d62d9f88bf794dc847ea296288ddaf306aa320168ab';
|
15
|
+
exports.redeemType = '0x2f2226a22ebeb7a0e63ea39551829b238589d981d1c6dd454f01fcc513035593::unihouse::RedeemRequest';
|
16
|
+
exports.redeemTicketsKey = 'redeemTickets';
|
17
|
+
//# sourceMappingURL=constants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/doubleup/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,UAAU,CAAC;AACxB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,iDAAiD;IACxD,OAAO,EAAE,2BAA2B;IACpC,OAAO,EAAE,4BAA4B;IACrC,WAAW,EAAE,UAAU,EAAE,sCAAsC;CAChE,CAAC;AAEW,QAAA,SAAS,GACpB,kFAAkF,CAAC;AACxE,QAAA,QAAQ,GACnB,oEAAoE,CAAC;AAC1D,QAAA,UAAU,GACrB,6FAA6F,CAAC;AACnF,QAAA,gBAAgB,GAAG,eAAe,CAAC"}
|
@@ -0,0 +1,127 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
|
+
};
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
16
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
17
|
+
const constants_1 = require("./constants");
|
18
|
+
const clients_1 = require("../../utils/clients");
|
19
|
+
const getDecimals_1 = require("../../utils/sui/getDecimals");
|
20
|
+
const getDynamicFields_1 = require("../../utils/sui/getDynamicFields");
|
21
|
+
const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
|
22
|
+
const depositsFetcher_1 = require("../drift-market-maker-vault/depositsFetcher");
|
23
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
24
|
+
var _a, _b, _c, _d, _e;
|
25
|
+
const client = (0, clients_1.getClientSui)();
|
26
|
+
const objects = yield (0, getDynamicFields_1.getDynamicFields)(client, constants_1.unihouse);
|
27
|
+
// House to price the LP tokens (gTokens)
|
28
|
+
const housesDynFields = objects.filter((obj) => obj.objectType.includes(constants_1.houseType));
|
29
|
+
// RedeemRequest to show pending withdraw to users
|
30
|
+
const redeemDynFields = objects.filter((obj) => obj.objectType.includes(constants_1.redeemType));
|
31
|
+
const [housesObjects, redeemRequestsObjects] = yield Promise.all([
|
32
|
+
(0, multiGetObjects_1.multiGetObjects)(client, housesDynFields.map((obj) => obj.objectId)),
|
33
|
+
(0, multiGetObjects_1.multiGetObjects)(client, redeemDynFields.map((obj) => obj.objectId)),
|
34
|
+
]);
|
35
|
+
const mints = [];
|
36
|
+
housesObjects.forEach((house) => {
|
37
|
+
var _a;
|
38
|
+
if ((_a = house.data) === null || _a === void 0 ? void 0 : _a.type) {
|
39
|
+
const { keys } = (0, portfolio_core_1.parseTypeString)(house.data.type);
|
40
|
+
if (keys) {
|
41
|
+
const { type } = keys[0];
|
42
|
+
if (type)
|
43
|
+
mints.push(type);
|
44
|
+
}
|
45
|
+
}
|
46
|
+
});
|
47
|
+
const tokenPriceById = yield cache.getTokenPricesAsMap(mints, portfolio_core_1.NetworkId.sui);
|
48
|
+
const tokenPriceSources = [];
|
49
|
+
for (const houseObj of housesObjects) {
|
50
|
+
if (!houseObj.data || !((_a = houseObj.data.content) === null || _a === void 0 ? void 0 : _a.fields))
|
51
|
+
continue;
|
52
|
+
const houseFields = houseObj.data.content.fields;
|
53
|
+
let mint;
|
54
|
+
let tokenTicker;
|
55
|
+
const { keys } = (0, portfolio_core_1.parseTypeString)(houseObj.data.type);
|
56
|
+
if (keys) {
|
57
|
+
const { type, struct } = keys[0];
|
58
|
+
if (type)
|
59
|
+
mint = type;
|
60
|
+
tokenTicker = struct;
|
61
|
+
}
|
62
|
+
if (!mint)
|
63
|
+
continue;
|
64
|
+
const tokenPrice = tokenPriceById.get(mint);
|
65
|
+
if (!tokenPrice)
|
66
|
+
continue;
|
67
|
+
const decimals = yield (0, getDecimals_1.getDecimals)(client, mint);
|
68
|
+
if (decimals === null)
|
69
|
+
continue;
|
70
|
+
const ratio = (0, bignumber_js_1.default)(houseFields.pool)
|
71
|
+
.plus(houseFields.pipe_debt.fields.value)
|
72
|
+
.dividedBy(houseFields.supply.fields.value);
|
73
|
+
const lpMint = (_c = (_b = (0, portfolio_core_1.parseTypeString)(houseFields.supply.type).keys) === null || _b === void 0 ? void 0 : _b.at(0)) === null || _c === void 0 ? void 0 : _c.type;
|
74
|
+
if (!lpMint)
|
75
|
+
continue;
|
76
|
+
tokenPriceSources.push({
|
77
|
+
address: lpMint,
|
78
|
+
decimals,
|
79
|
+
id: houseObj.data.objectId,
|
80
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
81
|
+
platformId: constants_1.platformId,
|
82
|
+
price: ratio.times(tokenPrice.price).toNumber(),
|
83
|
+
underlyings: [
|
84
|
+
{
|
85
|
+
address: tokenPrice.address,
|
86
|
+
amountPerLp: ratio.toNumber(),
|
87
|
+
decimals: tokenPrice.decimals,
|
88
|
+
networkId: tokenPrice.networkId,
|
89
|
+
price: tokenPrice.price,
|
90
|
+
},
|
91
|
+
],
|
92
|
+
timestamp: Date.now(),
|
93
|
+
weight: 1,
|
94
|
+
liquidityName: tokenTicker ? `g${tokenTicker}` : undefined,
|
95
|
+
});
|
96
|
+
}
|
97
|
+
const redeemTickets = [];
|
98
|
+
for (const redeemReq of redeemRequestsObjects) {
|
99
|
+
if (!redeemReq.data || !redeemReq.data.content)
|
100
|
+
continue;
|
101
|
+
const lockUntil = (0, bignumber_js_1.default)(redeemReq.data.content.fields.created_at)
|
102
|
+
.plus(depositsFetcher_1.oneDay)
|
103
|
+
.toNumber();
|
104
|
+
const amount = redeemReq.data.content.fields.s_coin.fields.balance;
|
105
|
+
const mint = (_e = (_d = (0, portfolio_core_1.parseTypeString)(redeemReq.data.content.fields.s_coin.type).keys) === null || _d === void 0 ? void 0 : _d.at(0)) === null || _e === void 0 ? void 0 : _e.type;
|
106
|
+
if (!mint)
|
107
|
+
continue;
|
108
|
+
redeemTickets.push({
|
109
|
+
owner: redeemReq.data.content.fields.sender,
|
110
|
+
amount,
|
111
|
+
mint,
|
112
|
+
lockUntil,
|
113
|
+
});
|
114
|
+
}
|
115
|
+
yield cache.setItem(constants_1.redeemTicketsKey, redeemTickets, {
|
116
|
+
prefix: constants_1.platformId,
|
117
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
118
|
+
});
|
119
|
+
yield cache.setTokenPriceSources(tokenPriceSources);
|
120
|
+
});
|
121
|
+
const job = {
|
122
|
+
id: `${constants_1.platformId}-houses`,
|
123
|
+
executor,
|
124
|
+
label: 'normal',
|
125
|
+
};
|
126
|
+
exports.default = job;
|
127
|
+
//# sourceMappingURL=housesAndRedeemJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"housesAndRedeemJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/doubleup/housesAndRedeemJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AACpC,gEAAqC;AAGrC,2CAMqB;AACrB,iDAAmD;AAEnD,6DAA0D;AAC1D,uEAAoE;AACpE,qEAAkE;AAClE,iFAAqE;AAErE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;;IACnD,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,OAAO,GAAG,MAAM,IAAA,mCAAgB,EAAC,MAAM,EAAE,oBAAQ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