@sonarwatch/portfolio-plugins 0.12.129 → 0.12.131
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +2241 -2233
- package/README.md +3 -3
- package/package.json +1 -1
- package/src/index.js +5 -0
- package/src/index.js.map +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/debridge/airdropFetcher.d.ts +2 -0
- package/src/plugins/debridge/airdropFetcher.js +57 -0
- package/src/plugins/debridge/airdropFetcher.js.map +1 -0
- package/src/plugins/debridge/constants.d.ts +8 -0
- package/src/plugins/debridge/constants.js +25 -0
- package/src/plugins/debridge/constants.js.map +1 -0
- package/src/plugins/debridge/index.d.ts +8 -0
- package/src/plugins/debridge/index.js +10 -0
- package/src/plugins/debridge/index.js.map +1 -0
- package/src/plugins/debridge/types.d.ts +23 -0
- package/src/plugins/debridge/types.js +3 -0
- package/src/plugins/debridge/types.js.map +1 -0
- package/src/plugins/deepbook/constants.js +1 -2
- package/src/plugins/deepbook/constants.js.map +1 -1
- package/src/plugins/quarry/calculatePositions.d.ts +2 -2
- package/src/plugins/quarry/calculatePositions.js +35 -9
- package/src/plugins/quarry/calculatePositions.js.map +1 -1
- package/src/plugins/quarry/getClaimableRewards.d.ts +3 -0
- package/src/plugins/quarry/getClaimableRewards.js +18 -0
- package/src/plugins/quarry/getClaimableRewards.js.map +1 -0
- package/src/plugins/quarry/payroll.d.ts +29 -0
- package/src/plugins/quarry/payroll.js +54 -0
- package/src/plugins/quarry/payroll.js.map +1 -0
- package/src/plugins/quarry/positionsFetcher.js +27 -10
- package/src/plugins/quarry/positionsFetcher.js.map +1 -1
- package/src/plugins/quarry/types.d.ts +16 -2
- package/src/plugins/suins/constants.js +0 -1
- package/src/plugins/suins/constants.js.map +1 -1
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/utils/sei/constants.js +8 -8
- package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
package/README.md
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
# @sonarwatch/portfolio-plugins
|
2
|
-
|
3
|
-
This library is @sonarwatch/portfolio-plugins
|
1
|
+
# @sonarwatch/portfolio-plugins
|
2
|
+
|
3
|
+
This library is @sonarwatch/portfolio-plugins
|
package/package.json
CHANGED
package/src/index.js
CHANGED
@@ -134,6 +134,7 @@ const quarry_1 = require("./plugins/quarry");
|
|
134
134
|
const thevault_1 = require("./plugins/thevault");
|
135
135
|
const deepbook_1 = require("./plugins/deepbook");
|
136
136
|
const suins_1 = require("./plugins/suins");
|
137
|
+
const debridge_1 = require("./plugins/debridge");
|
137
138
|
var constants_1 = require("./plugins/tokens/constants");
|
138
139
|
Object.defineProperty(exports, "walletTokensPlatform", { enumerable: true, get: function () { return constants_1.walletTokensPlatform; } });
|
139
140
|
Object.defineProperty(exports, "walletNftsPlatform", { enumerable: true, get: function () { return constants_1.walletNftsPlatform; } });
|
@@ -261,6 +262,7 @@ exports.platforms = [
|
|
261
262
|
...thevault_1.platforms,
|
262
263
|
...deepbook_1.platforms,
|
263
264
|
...suins_1.platforms,
|
265
|
+
...debridge_1.platforms,
|
264
266
|
];
|
265
267
|
// JOBS //
|
266
268
|
exports.jobs = [
|
@@ -371,6 +373,7 @@ exports.jobs = [
|
|
371
373
|
...thevault_1.jobs,
|
372
374
|
...deepbook_1.jobs,
|
373
375
|
...suins_1.jobs,
|
376
|
+
...debridge_1.jobs,
|
374
377
|
];
|
375
378
|
// FETCHERS //
|
376
379
|
exports.fetchers = [
|
@@ -483,6 +486,7 @@ exports.fetchers = [
|
|
483
486
|
...thevault_1.fetchers,
|
484
487
|
...deepbook_1.fetchers,
|
485
488
|
...suins_1.fetchers,
|
489
|
+
...debridge_1.fetchers,
|
486
490
|
];
|
487
491
|
exports.fetchersByAddressSystem = (0, getFetchersByAddressSystem_1.getFetchersByAddressSystem)(exports.fetchers);
|
488
492
|
exports.airdropFetchers = [
|
@@ -493,6 +497,7 @@ exports.airdropFetchers = [
|
|
493
497
|
parcl_1.airdropFetcher,
|
494
498
|
deepbook_1.airdropFetcher,
|
495
499
|
suins_1.airdropFetcher,
|
500
|
+
debridge_1.airdropFetcher,
|
496
501
|
];
|
497
502
|
exports.airdropFetchersByAddressSystem = (0, getFetchersByAddressSystem_1.getFetchersByAddressSystem)(exports.airdropFetchers);
|
498
503
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/plugins/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAIA,wFAAqF;AACrF,sEAA8C;AAC9C,6CAI0B;AAC1B,yDAIgC;AAChC,uDAAgE;AAChE,iDAG4B;AAC5B,iDAI4B;AAC5B,2CAGyB;AACzB,yCAIwB;AACxB,+CAI2B;AAC3B,yCAIwB;AACxB,+CAI2B;AAC3B,2CAIyB;AACzB,6CAI0B;AAC1B,2CAIyB;AACzB,6CAG0B;AAC1B,6CAI0B;AAC1B,yCAIwB;AACxB,2DAGiC;AACjC,6CAI0B;AAC1B,2CAKyB;AACzB,2CAIyB;AACzB,qDAA6D;AAC7D,qEAIsC;AACtC,uDAI+B;AAC/B,mDAI6B;AAC7B,qDAG8B;AAC9B,uDAG+B;AAC/B,2CAIyB;AACzB,6CAK0B;AAC1B,6CAG0B;AAC1B,yCAIwB;AACxB,+CAI2B;AAC3B,uDAG+B;AAC/B,yCAGwB;AACxB,2CAIyB;AACzB,iDAI4B;AAC5B,iDAI4B;AAC5B,6CAI0B;AAC1B,+CAI2B;AAC3B,qDAG8B;AAC9B,iDAI4B;AAC5B,iDAI4B;AAC5B,mDAG6B;AAC7B,yCAIwB;AACxB,2CAIyB;AACzB,iDAI4B;AAC5B,iDAI4B;AAC5B,+CAK2B;AAC3B,yCAIwB;AACxB,2CAIyB;AACzB,mDAI6B;AAC7B,2CAIyB;AACzB,2CAIyB;AACzB,sCAIsB;AACtB,+CAI2B;AAC3B,yCAIwB;AACxB,iDA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B,GAAG,eAAY;IACf,GAAG,cAAW;IACd,GAAG,kBAAe;IAClB,GAAG,mBAAgB;IACnB,GAAG,oBAAiB;IACpB,GAAG,gBAAa;IAChB,GAAG,kBAAe;IAClB,GAAG,cAAW;IACd,GAAG,mBAAgB;IACnB,GAAG,eAAY;IACf,GAAG,iBAAc;IACjB,GAAG,eAAY;IACf,GAAG,oBAAiB;IACpB,GAAG,gBAAa;IAChB,GAAG,oBAAiB;IACpB,GAAG,gBAAa;IAChB,GAAG,iBAAc;IACjB,GAAG,gBAAa;IAChB,GAAG,gBAAa;IAChB,GAAG,eAAY;IACf,GAAG,kBAAe;IAClB,GAAG,kBAAe;IAClB,GAAG,mBAAgB;IACnB,GAAG,uBAAoB;IACvB,GAAG,mBAAgB;IACnB,GAAG,iBAAc;IACjB,GAAG,mBAAgB;IACnB,GAAG,kBAAe;IAClB,GAAG,iBAAc;IACjB,GAAG,iBAAc;IACjB,GAAG,kBAAe;IAClB,GAAG,oBAAiB;IACpB,GAAG,8BAA2B;IAC9B,GAAG,oBAAiB;IACpB,GAAG,kBAAe;IAClB,GAAG,kBAAe;IAClB,GAAG,kBAAe;IAClB,GAAG,iBAAc;IACjB,GAAG,mBAAgB;IACnB,GAAG,mBAAgB;IACnB,GAAG,gBAAa;IAChB,GAAG,mBAAgB;CACpB,CAAC;AACW,QAAA,uBAAuB,GAAG,IAAA,uDAA0B,EAAC,gBAAQ,CAAC,CAAC;AAE/D,QAAA,eAAe,GAAqB;IAC/C,GAAG,yBAAsB;IACzB,GAAG,wBAAqB;IACxB,GAAG,yBAAsB;IACzB,sBAAmB;IACnB,sBAAmB;IACnB,yBAAsB;IACtB,sBAAmB;IACnB,yBAAsB;CACvB,CAAC;AACW,QAAA,8BAA8B,GACzC,IAAA,uDAA0B,EAAC,uBAAe,CAAC,CAAC"}
|
@@ -36,27 +36,27 @@ exports.getBalancerPoolsV2 = void 0;
|
|
36
36
|
const graphql_request_1 = __importStar(require("graphql-request"));
|
37
37
|
function getBalancerPoolsV2(url) {
|
38
38
|
return __awaiter(this, void 0, void 0, function* () {
|
39
|
-
const query = (0, graphql_request_1.gql) `
|
40
|
-
query pools {
|
41
|
-
pools(
|
42
|
-
first: 1000
|
43
|
-
orderBy: totalLiquidity
|
44
|
-
orderDirection: desc
|
45
|
-
where: { totalLiquidity_gt: "500" }
|
46
|
-
) {
|
47
|
-
id
|
48
|
-
address
|
49
|
-
symbol
|
50
|
-
totalLiquidity
|
51
|
-
totalShares
|
52
|
-
tokens {
|
53
|
-
balance
|
54
|
-
decimals
|
55
|
-
symbol
|
56
|
-
address
|
57
|
-
}
|
58
|
-
}
|
59
|
-
}
|
39
|
+
const query = (0, graphql_request_1.gql) `
|
40
|
+
query pools {
|
41
|
+
pools(
|
42
|
+
first: 1000
|
43
|
+
orderBy: totalLiquidity
|
44
|
+
orderDirection: desc
|
45
|
+
where: { totalLiquidity_gt: "500" }
|
46
|
+
) {
|
47
|
+
id
|
48
|
+
address
|
49
|
+
symbol
|
50
|
+
totalLiquidity
|
51
|
+
totalShares
|
52
|
+
tokens {
|
53
|
+
balance
|
54
|
+
decimals
|
55
|
+
symbol
|
56
|
+
address
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}
|
60
60
|
`;
|
61
61
|
const res = yield (0, graphql_request_1.default)(url, query);
|
62
62
|
const pools = res.pools;
|
@@ -0,0 +1,57 @@
|
|
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.airdropFetcher = void 0;
|
16
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
17
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
18
|
+
const axios_1 = __importDefault(require("axios"));
|
19
|
+
const AirdropFetcher_1 = require("../../AirdropFetcher");
|
20
|
+
const constants_1 = require("./constants");
|
21
|
+
const dbrFactor = new bignumber_js_1.default(Math.pow(10, constants_1.dbrDecimals));
|
22
|
+
const executor = (owner) => __awaiter(void 0, void 0, void 0, function* () {
|
23
|
+
const apiRes = yield axios_1.default.get(constants_1.apiUrl + owner, {
|
24
|
+
timeout: 1000,
|
25
|
+
});
|
26
|
+
let amount = 0;
|
27
|
+
if (apiRes.data.distributions) {
|
28
|
+
const tokens = apiRes.data.distributions.map((dis) => new bignumber_js_1.default(dis.tokens).div(dbrFactor));
|
29
|
+
amount += tokens
|
30
|
+
.reduce((prev, curr) => prev.plus(curr), new bignumber_js_1.default(0))
|
31
|
+
.toNumber();
|
32
|
+
}
|
33
|
+
return (0, AirdropFetcher_1.getAirdropRaw)({
|
34
|
+
statics: constants_1.airdropStatics,
|
35
|
+
items: [
|
36
|
+
{
|
37
|
+
amount,
|
38
|
+
isClaimed: false,
|
39
|
+
label: 'DBR',
|
40
|
+
address: constants_1.dbrMint,
|
41
|
+
imageUri: constants_1.dbrMint ? undefined : constants_1.platform.image,
|
42
|
+
},
|
43
|
+
],
|
44
|
+
});
|
45
|
+
});
|
46
|
+
exports.airdropFetcher = {
|
47
|
+
id: constants_1.airdropStatics.id,
|
48
|
+
networkId: portfolio_core_1.NetworkId.ethereum,
|
49
|
+
executor,
|
50
|
+
};
|
51
|
+
// export const fetcher = airdropFetcherToFetcher(
|
52
|
+
// airdropFetcher,
|
53
|
+
// platform.id,
|
54
|
+
// 'deepbook-airdrop',
|
55
|
+
// airdropStatics.claimEnd
|
56
|
+
// );
|
57
|
+
//# sourceMappingURL=airdropFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"airdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/debridge/airdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,gEAAqC;AACrC,kDAA6C;AAC7C,yDAI8B;AAC9B,2CAMqB;AAGrB,MAAM,SAAS,GAAG,IAAI,sBAAS,CAAC,SAAA,EAAE,EAAI,uBAAW,CAAA,CAAC,CAAC;AAEnD,MAAM,QAAQ,GAA2B,CAAO,KAAa,EAAE,EAAE;IAC/D,MAAM,MAAM,GAA+B,MAAM,eAAK,CAAC,GAAG,CAAC,kBAAM,GAAG,KAAK,EAAE;QACzE,OAAO,EAAE,IAAI;KACd,CAAC,CAAC;IAEH,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CACnD,IAAI,sBAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CACzC,CAAC;QACF,MAAM,IAAI,MAAM;aACb,MAAM,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,sBAAS,CAAC,CAAC,CAAC,CAAC;aACzD,QAAQ,EAAE,CAAC;IAChB,CAAC;IAED,OAAO,IAAA,8BAAa,EAAC;QACnB,OAAO,EAAE,0BAAc;QACvB,KAAK,EAAE;YACL;gBACE,MAAM;gBACN,SAAS,EAAE,KAAK;gBAChB,KAAK,EAAE,KAAK;gBACZ,OAAO,EAAE,mBAAO;gBAChB,QAAQ,EAAE,mBAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,oBAAW,CAAC,KAAK;aAClD;SACF;KACF,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEW,QAAA,cAAc,GAAmB;IAC5C,EAAE,EAAE,0BAAc,CAAC,EAAE;IACrB,SAAS,EAAE,0BAAS,CAAC,QAAQ;IAC7B,QAAQ;CACT,CAAC;AACF,kDAAkD;AAClD,oBAAoB;AACpB,iBAAiB;AACjB,wBAAwB;AACxB,4BAA4B;AAC5B,KAAK"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { Platform } from '@sonarwatch/portfolio-core';
|
2
|
+
import { AirdropStatics } from '../../AirdropFetcher';
|
3
|
+
export declare const platformId = "debridge";
|
4
|
+
export declare const platform: Platform;
|
5
|
+
export declare const airdropStatics: AirdropStatics;
|
6
|
+
export declare const dbrMint: undefined;
|
7
|
+
export declare const dbrDecimals = 6;
|
8
|
+
export declare const apiUrl = "https://points-api.debridge.foundation/api/TokenDistribution/";
|
@@ -0,0 +1,25 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.apiUrl = exports.dbrDecimals = exports.dbrMint = exports.airdropStatics = exports.platform = exports.platformId = void 0;
|
4
|
+
exports.platformId = 'debridge';
|
5
|
+
exports.platform = {
|
6
|
+
id: exports.platformId,
|
7
|
+
name: 'deBridge',
|
8
|
+
image: 'https://sonar.watch/img/platforms/debridge.webp',
|
9
|
+
website: 'https://debridge.finance/',
|
10
|
+
twitter: 'https://x.com/deBridgeFinance',
|
11
|
+
defiLlamaId: 'debridge', // from https://defillama.com/docs/api
|
12
|
+
};
|
13
|
+
exports.airdropStatics = {
|
14
|
+
claimLink: 'https://debridge.foundation/',
|
15
|
+
emitterLink: 'https://debridge.finance/',
|
16
|
+
emitterName: 'deBridge',
|
17
|
+
id: `${exports.platformId}-token-launch`,
|
18
|
+
image: 'https://sonar.watch/img/platforms/debridge.webp',
|
19
|
+
claimEnd: undefined,
|
20
|
+
claimStart: undefined,
|
21
|
+
};
|
22
|
+
exports.dbrMint = undefined;
|
23
|
+
exports.dbrDecimals = 6;
|
24
|
+
exports.apiUrl = 'https://points-api.debridge.foundation/api/TokenDistribution/';
|
25
|
+
//# sourceMappingURL=constants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/debridge/constants.ts"],"names":[],"mappings":";;;AAGa,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,+BAA+B;IACxC,WAAW,EAAE,UAAU,EAAE,sCAAsC;CAChE,CAAC;AACW,QAAA,cAAc,GAAmB;IAC5C,SAAS,EAAE,8BAA8B;IACzC,WAAW,EAAE,2BAA2B;IACxC,WAAW,EAAE,UAAU;IACvB,EAAE,EAAE,GAAG,kBAAU,eAAe;IAChC,KAAK,EAAE,iDAAiD;IACxD,QAAQ,EAAE,SAAS;IACnB,UAAU,EAAE,SAAS;CACtB,CAAC;AAEW,QAAA,OAAO,GAAG,SAAS,CAAC;AACpB,QAAA,WAAW,GAAG,CAAC,CAAC;AAChB,QAAA,MAAM,GACjB,+DAA+D,CAAC"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { Platform } from '@sonarwatch/portfolio-core';
|
2
|
+
import { Fetcher } from '../../Fetcher';
|
3
|
+
import { Job } from '../../Job';
|
4
|
+
import { airdropFetcher } from './airdropFetcher';
|
5
|
+
export declare const platforms: Platform[];
|
6
|
+
export declare const jobs: Job[];
|
7
|
+
export declare const fetchers: Fetcher[];
|
8
|
+
export { airdropFetcher };
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.airdropFetcher = exports.fetchers = exports.jobs = exports.platforms = void 0;
|
4
|
+
const constants_1 = require("./constants");
|
5
|
+
const airdropFetcher_1 = require("./airdropFetcher");
|
6
|
+
Object.defineProperty(exports, "airdropFetcher", { enumerable: true, get: function () { return airdropFetcher_1.airdropFetcher; } });
|
7
|
+
exports.platforms = [constants_1.platform];
|
8
|
+
exports.jobs = [];
|
9
|
+
exports.fetchers = [];
|
10
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/debridge/index.ts"],"names":[],"mappings":";;;AAGA,2CAAuC;AACvC,qDAAkD;AAKzC,+FALA,+BAAc,OAKA;AAHV,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,EAAE,CAAC;AACjB,QAAA,QAAQ,GAAc,EAAE,CAAC"}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
export type ApiResponse = {
|
2
|
+
distributions: Distribution[];
|
3
|
+
notifications: Notification[];
|
4
|
+
};
|
5
|
+
export type Distribution = {
|
6
|
+
id: number;
|
7
|
+
title: string;
|
8
|
+
subtitle: string;
|
9
|
+
allocationTimestamp: number;
|
10
|
+
availableForSigningDate: number;
|
11
|
+
distributionStartTimestamp: number;
|
12
|
+
distributionEndTimestamp: number;
|
13
|
+
points: number;
|
14
|
+
tokens: string;
|
15
|
+
merkleTreeRoute: null;
|
16
|
+
};
|
17
|
+
export type Notification = {
|
18
|
+
id: string;
|
19
|
+
message: string;
|
20
|
+
timestamp: number;
|
21
|
+
type: string;
|
22
|
+
distributionId: number;
|
23
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/debridge/types.ts"],"names":[],"mappings":""}
|
@@ -11,8 +11,7 @@ exports.platform = {
|
|
11
11
|
defiLlamaId: 'deepbook', // from https://defillama.com/docs/api
|
12
12
|
};
|
13
13
|
exports.airdropStatics = {
|
14
|
-
|
15
|
-
emitterLink: 'https://deepbook.tech/#airdrop',
|
14
|
+
emitterLink: 'https://deepbook.tech',
|
16
15
|
emitterName: 'DeepBook',
|
17
16
|
id: `${exports.platformId}-token-launch`,
|
18
17
|
image: 'https://sonar.watch/img/platforms/deepbook.webp',
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/deepbook/constants.ts"],"names":[],"mappings":";;;AAGa,QAAA,UAAU,GAAG,UAAU,CAAC;AACxB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,iDAAiD;IACxD,OAAO,EAAE,uBAAuB;IAChC,OAAO,EAAE,6BAA6B;IACtC,WAAW,EAAE,UAAU,EAAE,sCAAsC;CAChE,CAAC;AACW,QAAA,cAAc,GAAmB;IAC5C,
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/deepbook/constants.ts"],"names":[],"mappings":";;;AAGa,QAAA,UAAU,GAAG,UAAU,CAAC;AACxB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,iDAAiD;IACxD,OAAO,EAAE,uBAAuB;IAChC,OAAO,EAAE,6BAA6B;IACtC,WAAW,EAAE,UAAU,EAAE,sCAAsC;CAChE,CAAC;AACW,QAAA,cAAc,GAAmB;IAC5C,WAAW,EAAE,uBAAuB;IACpC,WAAW,EAAE,UAAU;IACvB,EAAE,EAAE,GAAG,kBAAU,eAAe;IAChC,KAAK,EAAE,iDAAiD;IACxD,QAAQ,EAAE,SAAS;IACnB,UAAU,EAAE,SAAS;CACtB,CAAC;AAEW,QAAA,QAAQ,GACnB,gFAAgF,CAAC;AACtE,QAAA,YAAY,GAAG,CAAC,CAAC"}
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import { MergeMiner, Miner, Position, Rewarder } from './types';
|
1
|
+
import { MergeMiner, Miner, Position, QuarryData, Rewarder } from './types';
|
2
2
|
import { ParsedAccount } from '../../utils/solana';
|
3
|
-
export declare const calculatePositions: (mergeMinerAccounts: ParsedAccount<MergeMiner>[], minerAccounts: ParsedAccount<Miner>[], replicaMinerAccounts: ParsedAccount<Miner>[][], allRewarders: Rewarder[], owner: string) => Position[];
|
3
|
+
export declare const calculatePositions: (mergeMinerAccounts: ParsedAccount<MergeMiner>[], minerAccounts: ParsedAccount<Miner>[], replicaMinerAccounts: ParsedAccount<Miner>[][], allRewarders: Rewarder[], quarryAccounts: ParsedAccount<QuarryData>[], owner: string) => Position[];
|
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.calculatePositions = void 0;
|
4
4
|
const web3_js_1 = require("@solana/web3.js");
|
5
5
|
const helpers_1 = require("./helpers");
|
6
|
-
const
|
6
|
+
const getClaimableRewards_1 = require("./getClaimableRewards");
|
7
|
+
const calculatePositions = (mergeMinerAccounts, minerAccounts, replicaMinerAccounts, allRewarders, quarryAccounts, owner) => {
|
7
8
|
const positions = [];
|
8
9
|
const quarryPDAS = (0, helpers_1.getQuarryPDAs)(allRewarders, new web3_js_1.PublicKey(owner));
|
9
10
|
[...mergeMinerAccounts, ...minerAccounts].forEach((account, i) => {
|
@@ -21,13 +22,38 @@ const calculatePositions = (mergeMinerAccounts, minerAccounts, replicaMinerAccou
|
|
21
22
|
const primaryQuarry = primaryRewarder.quarries.find((q) => quarryPDA.primaryQuarry.toString() === q.quarry);
|
22
23
|
if (!primaryQuarry)
|
23
24
|
return;
|
24
|
-
const
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
25
|
+
const rewardsBalance = [];
|
26
|
+
const rewardsTokenInfo = [];
|
27
|
+
const primaryQuarryAccount = quarryAccounts.find((q) => q.pubkey.toString() === primaryQuarry.quarry.toString());
|
28
|
+
if (!primaryQuarryAccount)
|
29
|
+
return;
|
30
|
+
if ((0, helpers_1.isMinerAccount)(account)) {
|
31
|
+
rewardsTokenInfo.push(primaryRewarder.rewardsTokenInfo);
|
32
|
+
rewardsBalance.push((0, getClaimableRewards_1.getClaimableRewards)(primaryQuarryAccount, account));
|
33
|
+
}
|
34
|
+
else {
|
35
|
+
const minerAccount = replicaMinerAccounts[i].find((a) => a.quarry === primaryQuarryAccount.pubkey.toString());
|
36
|
+
if (!minerAccount)
|
37
|
+
return;
|
38
|
+
rewardsTokenInfo.push(primaryRewarder.rewardsTokenInfo);
|
39
|
+
rewardsBalance.push((0, getClaimableRewards_1.getClaimableRewards)(primaryQuarryAccount, minerAccount));
|
40
|
+
primaryQuarry.replicaQuarries.forEach((r) => {
|
41
|
+
const quarryAccount = quarryAccounts.find((q) => q.pubkey.toString() === r.quarry);
|
42
|
+
if (!quarryAccount)
|
43
|
+
return;
|
44
|
+
const replicaMinerAccount = replicaMinerAccounts[i].find((a) => a.quarry === quarryAccount.pubkey.toString());
|
45
|
+
if (!replicaMinerAccount)
|
46
|
+
return;
|
47
|
+
const replicaQuarryPDA = quarryPDA.replicas.find((rq) => rq.replicaQuarry.toString() === r.quarry);
|
48
|
+
if (!replicaQuarryPDA)
|
49
|
+
return;
|
50
|
+
const replicaRewarder = allRewarders.find((rew) => rew.rewarder === replicaQuarryPDA.rewarder.toString());
|
51
|
+
if (!replicaRewarder)
|
52
|
+
return;
|
53
|
+
rewardsTokenInfo.push(replicaRewarder.rewardsTokenInfo);
|
54
|
+
rewardsBalance.push((0, getClaimableRewards_1.getClaimableRewards)(quarryAccount, replicaMinerAccount));
|
55
|
+
});
|
56
|
+
}
|
31
57
|
positions.push({
|
32
58
|
primaryRewarder: {
|
33
59
|
slug: primaryRewarder.slug,
|
@@ -37,7 +63,7 @@ const calculatePositions = (mergeMinerAccounts, minerAccounts, replicaMinerAccou
|
|
37
63
|
? account.balance
|
38
64
|
: account.primaryBalance,
|
39
65
|
stakedTokenInfo: primaryQuarry.primaryTokenInfo,
|
40
|
-
|
66
|
+
rewardsTokenInfo,
|
41
67
|
rewardsBalance,
|
42
68
|
});
|
43
69
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"calculatePositions.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/quarry/calculatePositions.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;
|
1
|
+
{"version":3,"file":"calculatePositions.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/quarry/calculatePositions.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAW5C,uCAA0D;AAC1D,+DAA4D;AAErD,MAAM,kBAAkB,GAAG,CAChC,kBAA+C,EAC/C,aAAqC,EACrC,oBAA8C,EAC9C,YAAwB,EACxB,cAA2C,EAC3C,KAAa,EACb,EAAE;IACF,MAAM,SAAS,GAAe,EAAE,CAAC;IAEjC,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,YAAY,EAAE,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IAErE,CAAC,GAAG,kBAAkB,EAAE,GAAG,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE;;QAC/D,IAAI,CAAC,OAAO;YAAE,OAAO;QAErB,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CACtC,IAAA,wBAAc,EAAC,OAAO,CAAC;YACrB,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE;YACvD,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,CAClD,CAAC;QACF,IAAI,CAAC,SAAS;YAAE,OAAO;QAEvB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e,CAAC,IAAI,0CAAE,IAAI;aACjC;YACD,aAAa,EAAE,IAAA,wBAAc,EAAC,OAAO,CAAC;gBACpC,CAAC,CAAC,OAAO,CAAC,OAAO;gBACjB,CAAC,CAAC,OAAO,CAAC,cAAc;YAC1B,eAAe,EAAE,aAAa,CAAC,gBAAgB;YAC/C,gBAAgB;YAChB,cAAc;SACf,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AA7FW,QAAA,kBAAkB,sBA6F7B"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.getClaimableRewards = void 0;
|
7
|
+
const bn_js_1 = __importDefault(require("bn.js"));
|
8
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
9
|
+
const payroll_1 = require("./payroll");
|
10
|
+
const getClaimableRewards = (quarryAccount, minerAccount) => {
|
11
|
+
const timeInSec = new bn_js_1.default(Math.floor(Date.now() / 1000));
|
12
|
+
const payroll = new payroll_1.Payroll(new bn_js_1.default(quarryAccount.famineTs), new bn_js_1.default(quarryAccount.lastUpdateTs), new bn_js_1.default(quarryAccount.annualRewardsRate), new bn_js_1.default(quarryAccount.rewardsPerTokenStored), new bn_js_1.default(quarryAccount.totalTokensDeposited));
|
13
|
+
return new bignumber_js_1.default(payroll
|
14
|
+
.calculateRewardsEarned(timeInSec, new bn_js_1.default(minerAccount.balance), new bn_js_1.default(minerAccount.rewardsPerTokenPaid), new bn_js_1.default(minerAccount.rewardsEarned))
|
15
|
+
.toString());
|
16
|
+
};
|
17
|
+
exports.getClaimableRewards = getClaimableRewards;
|
18
|
+
//# sourceMappingURL=getClaimableRewards.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getClaimableRewards.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/quarry/getClaimableRewards.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAuB;AACvB,gEAAqC;AAErC,uCAAoC;AAE7B,MAAM,mBAAmB,GAAG,CACjC,aAAyB,EACzB,YAAmB,EACnB,EAAE;IACF,MAAM,SAAS,GAAG,IAAI,eAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;IAExD,MAAM,OAAO,GAAG,IAAI,iBAAO,CACzB,IAAI,eAAE,CAAC,aAAa,CAAC,QAAQ,CAAC,EAC9B,IAAI,eAAE,CAAC,aAAa,CAAC,YAAY,CAAC,EAClC,IAAI,eAAE,CAAC,aAAa,CAAC,iBAAiB,CAAC,EACvC,IAAI,eAAE,CAAC,aAAa,CAAC,qBAAqB,CAAC,EAC3C,IAAI,eAAE,CAAC,aAAa,CAAC,oBAAoB,CAAC,CAC3C,CAAC;IAEF,OAAO,IAAI,sBAAS,CAClB,OAAO;SACJ,sBAAsB,CACrB,SAAS,EACT,IAAI,eAAE,CAAC,YAAY,CAAC,OAAO,CAAC,EAC5B,IAAI,eAAE,CAAC,YAAY,CAAC,mBAAmB,CAAC,EACxC,IAAI,eAAE,CAAC,YAAY,CAAC,aAAa,CAAC,CACnC;SACA,QAAQ,EAAE,CACd,CAAC;AACJ,CAAC,CAAC;AAxBW,QAAA,mBAAmB,uBAwB9B"}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import BN from 'bn.js';
|
2
|
+
export declare const MAX_U64 = "18446744073709551616";
|
3
|
+
export declare const ZERO: BN;
|
4
|
+
export declare const BASE_TEN: BN;
|
5
|
+
export declare const MAX_U64_BN: BN;
|
6
|
+
export declare const SECONDS_PER_YEAR: BN;
|
7
|
+
export declare class Payroll {
|
8
|
+
readonly famineTs: BN;
|
9
|
+
readonly lastCheckpointTs: BN;
|
10
|
+
readonly annualRewardsRate: BN;
|
11
|
+
readonly rewardsPerTokenStored: BN;
|
12
|
+
readonly totalTokensDeposited: BN;
|
13
|
+
constructor(famineTs: BN, lastCheckpointTs: BN, annualRewardsRate: BN, rewardsPerTokenStored: BN, totalTokensDeposited: BN);
|
14
|
+
/**
|
15
|
+
* Calculates the amount of tokens that this user can receive.
|
16
|
+
* @param currentTs
|
17
|
+
* @returns
|
18
|
+
*/
|
19
|
+
calculateRewardPerToken(currentTs: BN): BN;
|
20
|
+
/**
|
21
|
+
* Calculates the amount of tokens that this user can claim.
|
22
|
+
* @param currentTs
|
23
|
+
* @param tokensDeposited
|
24
|
+
* @param rewardsPerTokenPaid
|
25
|
+
* @param rewardsEarned
|
26
|
+
* @returns
|
27
|
+
*/
|
28
|
+
calculateRewardsEarned(currentTs: BN, tokensDeposited: BN, rewardsPerTokenPaid: BN, rewardsEarned: BN): BN;
|
29
|
+
}
|
@@ -0,0 +1,54 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.Payroll = exports.SECONDS_PER_YEAR = exports.MAX_U64_BN = exports.BASE_TEN = exports.ZERO = exports.MAX_U64 = void 0;
|
7
|
+
const bn_js_1 = __importDefault(require("bn.js"));
|
8
|
+
exports.MAX_U64 = '18446744073709551616';
|
9
|
+
exports.ZERO = new bn_js_1.default(0);
|
10
|
+
exports.BASE_TEN = new bn_js_1.default(10);
|
11
|
+
exports.MAX_U64_BN = new bn_js_1.default(exports.MAX_U64);
|
12
|
+
exports.SECONDS_PER_YEAR = new bn_js_1.default(365 * 86400);
|
13
|
+
class Payroll {
|
14
|
+
constructor(famineTs, lastCheckpointTs, annualRewardsRate, rewardsPerTokenStored, totalTokensDeposited) {
|
15
|
+
this.famineTs = famineTs;
|
16
|
+
this.lastCheckpointTs = lastCheckpointTs;
|
17
|
+
this.annualRewardsRate = annualRewardsRate;
|
18
|
+
this.rewardsPerTokenStored = rewardsPerTokenStored;
|
19
|
+
this.totalTokensDeposited = totalTokensDeposited;
|
20
|
+
}
|
21
|
+
/**
|
22
|
+
* Calculates the amount of tokens that this user can receive.
|
23
|
+
* @param currentTs
|
24
|
+
* @returns
|
25
|
+
*/
|
26
|
+
calculateRewardPerToken(currentTs) {
|
27
|
+
if (this.totalTokensDeposited.isZero()) {
|
28
|
+
return this.rewardsPerTokenStored;
|
29
|
+
}
|
30
|
+
const lastTimeRewardsApplicable = bn_js_1.default.min(currentTs, this.famineTs);
|
31
|
+
const timeWorked = bn_js_1.default.max(exports.ZERO, lastTimeRewardsApplicable.sub(this.lastCheckpointTs));
|
32
|
+
const reward = timeWorked
|
33
|
+
.mul(exports.MAX_U64_BN)
|
34
|
+
.mul(this.annualRewardsRate)
|
35
|
+
.div(exports.SECONDS_PER_YEAR)
|
36
|
+
.div(this.totalTokensDeposited);
|
37
|
+
return this.rewardsPerTokenStored.add(reward);
|
38
|
+
}
|
39
|
+
/**
|
40
|
+
* Calculates the amount of tokens that this user can claim.
|
41
|
+
* @param currentTs
|
42
|
+
* @param tokensDeposited
|
43
|
+
* @param rewardsPerTokenPaid
|
44
|
+
* @param rewardsEarned
|
45
|
+
* @returns
|
46
|
+
*/
|
47
|
+
calculateRewardsEarned(currentTs, tokensDeposited, rewardsPerTokenPaid, rewardsEarned) {
|
48
|
+
const netNewRewards = this.calculateRewardPerToken(currentTs).sub(rewardsPerTokenPaid);
|
49
|
+
const earnedRewards = tokensDeposited.mul(netNewRewards).div(exports.MAX_U64_BN);
|
50
|
+
return earnedRewards.add(rewardsEarned);
|
51
|
+
}
|
52
|
+
}
|
53
|
+
exports.Payroll = Payroll;
|
54
|
+
//# sourceMappingURL=payroll.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"payroll.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/quarry/payroll.ts"],"names":[],"mappings":";;;;;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AC;IAED;;;;;;;OAOG;IACH,sBAAsB,CACpB,SAAa,EACb,eAAmB,EACnB,mBAAuB,EACvB,aAAiB;QAEjB,MAAM,aAAa,GACjB,IAAI,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;QACnE,MAAM,aAAa,GAAG,eAAe,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,kBAAU,CAAC,CAAC;QACzE,OAAO,aAAa,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC1C,CAAC;CACF;AAnDD,0BAmDC"}
|
@@ -14,6 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
15
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
16
16
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
17
|
+
const web3_js_1 = require("@solana/web3.js");
|
17
18
|
const constants_1 = require("./constants");
|
18
19
|
const constants_2 = require("../thevault/constants");
|
19
20
|
const constants_3 = require("../saber/constants");
|
@@ -36,24 +37,23 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
36
37
|
]);
|
37
38
|
if (mergeMinerAccounts.length === 0 && minerAccounts.length === 0)
|
38
39
|
return [];
|
39
|
-
const replicaMinerAccounts = yield Promise.all(mergeMinerAccounts.map((mmAcount) =>
|
40
|
-
|
41
|
-
}));
|
40
|
+
const replicaMinerAccounts = yield Promise.all(mergeMinerAccounts.map((mmAcount) => (0, solana_1.getAutoParsedProgramAccounts)(connection, constants_1.mineIdlItem, (0, filters_1.minerFilters)(mmAcount.pubkey.toString()))));
|
41
|
+
const quarryAccounts = yield (0, solana_1.getAutoParsedMultipleAccountsInfo)(connection, constants_1.mineIdlItem, [...minerAccounts, ...[...replicaMinerAccounts.values()].flat()].map((m) => new web3_js_1.PublicKey(m.quarry))).then((accs) => accs.filter((acc) => acc !== null));
|
42
42
|
const allRewarders = yield rewardersMemo.getItem(cache);
|
43
43
|
if (!allRewarders)
|
44
44
|
return [];
|
45
|
-
const positions = (0, calculatePositions_1.calculatePositions)(mergeMinerAccounts, minerAccounts, replicaMinerAccounts, allRewarders, owner);
|
45
|
+
const positions = (0, calculatePositions_1.calculatePositions)(mergeMinerAccounts, minerAccounts, replicaMinerAccounts, allRewarders, quarryAccounts, owner);
|
46
46
|
if (positions.length === 0)
|
47
47
|
return [];
|
48
48
|
const mints = new Set();
|
49
49
|
positions.forEach((position) => {
|
50
50
|
mints.add(position.stakedTokenInfo.address);
|
51
|
-
position.
|
51
|
+
position.rewardsTokenInfo.forEach((rewardTokenInfo) => mints.add(rewardTokenInfo.address.toString()));
|
52
52
|
});
|
53
53
|
const tokenPrices = yield cache.getTokenPricesAsMap([...mints], portfolio_core_1.NetworkId.solana);
|
54
54
|
const elements = [];
|
55
55
|
positions.forEach((position) => {
|
56
|
-
const {
|
56
|
+
const { rewardsTokenInfo, rewardsBalance, primaryRewarder, stakedBalance, stakedTokenInfo, } = position;
|
57
57
|
const assets = [];
|
58
58
|
const rewardAssets = [];
|
59
59
|
const stakedTokenPrice = tokenPrices.get(stakedTokenInfo.address);
|
@@ -78,19 +78,36 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
78
78
|
imageUri: stakedTokenInfo.logoURI,
|
79
79
|
});
|
80
80
|
}
|
81
|
-
|
81
|
+
rewardsTokenInfo.forEach((rewardTokenInfo, i) => {
|
82
82
|
var _a;
|
83
|
-
if (rewardsBalance[i]
|
83
|
+
if (rewardsBalance[i].isZero())
|
84
84
|
return;
|
85
|
-
const rewardTokenPrice = tokenPrices.get(
|
85
|
+
const rewardTokenPrice = tokenPrices.get(rewardTokenInfo.address);
|
86
86
|
if (rewardTokenPrice) {
|
87
87
|
rewardAssets.push((0, tokenPriceToAssetToken_1.default)(rewardTokenPrice.elementName === constants_1.IOUTokensElementName &&
|
88
88
|
((_a = rewardTokenPrice.underlyings) === null || _a === void 0 ? void 0 : _a.length) === 1
|
89
89
|
? rewardTokenPrice.underlyings[0].address
|
90
|
-
: rewardTokenPrice.address,
|
90
|
+
: rewardTokenPrice.address, rewardsBalance[i]
|
91
91
|
.dividedBy(Math.pow(10, rewardTokenPrice.decimals))
|
92
92
|
.toNumber(), portfolio_core_1.NetworkId.solana, rewardTokenPrice));
|
93
93
|
}
|
94
|
+
else {
|
95
|
+
rewardAssets.push({
|
96
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
97
|
+
type: 'token',
|
98
|
+
value: null,
|
99
|
+
attributes: {},
|
100
|
+
name: rewardTokenInfo.symbol,
|
101
|
+
data: {
|
102
|
+
amount: new bignumber_js_1.default(rewardsBalance[i])
|
103
|
+
.dividedBy(Math.pow(10, rewardTokenInfo.decimals))
|
104
|
+
.toNumber(),
|
105
|
+
address: rewardTokenInfo.address,
|
106
|
+
price: null,
|
107
|
+
},
|
108
|
+
imageUri: rewardTokenInfo.logoURI,
|
109
|
+
});
|
110
|
+
}
|
94
111
|
});
|
95
112
|
const assetsValue = (0, portfolio_core_1.getUsdValueSum)(assets.map((a) => a.value));
|
96
113
|
const rewardAssetsValue = (0, portfolio_core_1.getUsdValueSum)(rewardAssets.map((a) => a.value));
|