@sonarwatch/portfolio-plugins 0.8.25 → 0.8.27
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 +8 -0
- package/package.json +2 -2
- package/src/plugins/curve/abis.d.ts +13 -0
- package/src/plugins/curve/abis.js +23 -0
- package/src/plugins/curve/abis.js.map +1 -0
- package/src/plugins/curve/constants.d.ts +3 -1
- package/src/plugins/curve/constants.js +4 -2
- package/src/plugins/curve/constants.js.map +1 -1
- package/src/plugins/curve/gaugesJob.d.ts +3 -0
- package/src/plugins/curve/gaugesJob.js +36 -0
- package/src/plugins/curve/gaugesJob.js.map +1 -0
- package/src/plugins/curve/getAllGaugesTypes.d.ts +50 -0
- package/src/plugins/curve/getAllGaugesTypes.js +9 -0
- package/src/plugins/curve/getAllGaugesTypes.js.map +1 -0
- package/src/plugins/curve/getPositionsFetcher.d.ts +3 -0
- package/src/plugins/curve/{getPoolsPositionFetcher.js → getPositionsFetcher.js} +72 -34
- package/src/plugins/curve/getPositionsFetcher.js.map +1 -0
- package/src/plugins/curve/helpers.d.ts +3 -0
- package/src/plugins/curve/helpers.js +34 -1
- package/src/plugins/curve/helpers.js.map +1 -1
- package/src/plugins/curve/index.js +6 -5
- package/src/plugins/curve/index.js.map +1 -1
- package/src/plugins/curve/poolsJob.js +9 -4
- package/src/plugins/curve/poolsJob.js.map +1 -1
- package/src/plugins/curve/getPoolsPositionFetcher.d.ts +0 -3
- package/src/plugins/curve/getPoolsPositionFetcher.js.map +0 -1
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
4
4
|
|
5
|
+
## [0.8.27](https://github.com/sonarwatch/portfolio/compare/plugins-0.8.26...plugins-0.8.27) (2023-10-16)
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
## [0.8.26](https://github.com/sonarwatch/portfolio/compare/plugins-0.8.25...plugins-0.8.26) (2023-10-16)
|
10
|
+
|
11
|
+
|
12
|
+
|
5
13
|
## [0.8.25](https://github.com/sonarwatch/portfolio/compare/plugins-0.8.24...plugins-0.8.25) (2023-10-16)
|
6
14
|
|
7
15
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sonarwatch/portfolio-plugins",
|
3
|
-
"version": "0.8.
|
3
|
+
"version": "0.8.27",
|
4
4
|
"type": "commonjs",
|
5
5
|
"generators": "./generators.json",
|
6
6
|
"dependencies": {
|
@@ -37,7 +37,7 @@
|
|
37
37
|
"web3-v1": "npm:web3@^1.5.0"
|
38
38
|
},
|
39
39
|
"peerDependencies": {
|
40
|
-
"@sonarwatch/portfolio-core": "0.8.
|
40
|
+
"@sonarwatch/portfolio-core": "0.8.27"
|
41
41
|
},
|
42
42
|
"main": "./src/index.js",
|
43
43
|
"types": "./src/index.d.ts"
|
@@ -0,0 +1,13 @@
|
|
1
|
+
export declare const balanceOfAbI: readonly [{
|
2
|
+
readonly type: "function";
|
3
|
+
readonly name: "balanceOf";
|
4
|
+
readonly stateMutability: "view";
|
5
|
+
readonly inputs: readonly [{
|
6
|
+
readonly name: "account";
|
7
|
+
readonly type: "address";
|
8
|
+
}];
|
9
|
+
readonly outputs: readonly [{
|
10
|
+
readonly name: "";
|
11
|
+
readonly type: "uint256";
|
12
|
+
}];
|
13
|
+
}];
|
@@ -0,0 +1,23 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.balanceOfAbI = void 0;
|
4
|
+
exports.balanceOfAbI = [
|
5
|
+
{
|
6
|
+
type: 'function',
|
7
|
+
name: 'balanceOf',
|
8
|
+
stateMutability: 'view',
|
9
|
+
inputs: [
|
10
|
+
{
|
11
|
+
name: 'account',
|
12
|
+
type: 'address',
|
13
|
+
},
|
14
|
+
],
|
15
|
+
outputs: [
|
16
|
+
{
|
17
|
+
name: '',
|
18
|
+
type: 'uint256',
|
19
|
+
},
|
20
|
+
],
|
21
|
+
},
|
22
|
+
];
|
23
|
+
//# sourceMappingURL=abis.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"abis.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/curve/abis.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG;IAC1B;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,WAAW;QACjB,eAAe,EAAE,MAAM;QACvB,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,SAAS;aAChB;SACF;QACD,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,EAAE;gBACR,IAAI,EAAE,SAAS;aAChB;SACF;KACF;CACO,CAAC"}
|
@@ -2,7 +2,9 @@ import { EvmNetworkIdType, Platform } from '@sonarwatch/portfolio-core';
|
|
2
2
|
export declare const platformId = "curve";
|
3
3
|
export declare const fooPlatform: Platform;
|
4
4
|
export declare const poolsCachePrefix: string;
|
5
|
-
export declare const
|
5
|
+
export declare const gaugesCachePrefix: string;
|
6
|
+
export declare const poolsByAddressPrefix: string;
|
7
|
+
export declare const gaugesAddresesCachePrefix: string;
|
6
8
|
export declare const apiBaseUrl = "https://api.curve.fi/api";
|
7
9
|
export declare enum CrvNetworkId {
|
8
10
|
ethereum = "ethereum",
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.crvNetworkIdBySwNetworkId = exports.crvNetworkIds = exports.CrvNetworkId = exports.apiBaseUrl = exports.
|
3
|
+
exports.crvNetworkIdBySwNetworkId = exports.crvNetworkIds = exports.CrvNetworkId = exports.apiBaseUrl = exports.gaugesAddresesCachePrefix = exports.poolsByAddressPrefix = exports.gaugesCachePrefix = exports.poolsCachePrefix = exports.fooPlatform = exports.platformId = void 0;
|
4
4
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
5
5
|
exports.platformId = 'curve';
|
6
6
|
exports.fooPlatform = {
|
@@ -10,7 +10,9 @@ exports.fooPlatform = {
|
|
10
10
|
defiLlamaId: 'parent#curve-finance',
|
11
11
|
};
|
12
12
|
exports.poolsCachePrefix = `${exports.platformId}-pools`;
|
13
|
-
exports.
|
13
|
+
exports.gaugesCachePrefix = `${exports.platformId}-gauges`;
|
14
|
+
exports.poolsByAddressPrefix = `${exports.platformId}-pools-by-address`;
|
15
|
+
exports.gaugesAddresesCachePrefix = `${exports.platformId}-gauges-addresses`;
|
14
16
|
exports.apiBaseUrl = 'https://api.curve.fi/api';
|
15
17
|
var CrvNetworkId;
|
16
18
|
(function (CrvNetworkId) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/curve/constants.ts"],"names":[],"mappings":";;;AAAA,+DAIoC;AAEvB,QAAA,UAAU,GAAG,OAAO,CAAC;AACrB,QAAA,WAAW,GAAa;IACnC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,6CAA6C;IACpD,WAAW,EAAE,sBAAsB;CACpC,CAAC;AACW,QAAA,gBAAgB,GAAG,GAAG,kBAAU,QAAQ,CAAC;AACzC,QAAA,
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/curve/constants.ts"],"names":[],"mappings":";;;AAAA,+DAIoC;AAEvB,QAAA,UAAU,GAAG,OAAO,CAAC;AACrB,QAAA,WAAW,GAAa;IACnC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,6CAA6C;IACpD,WAAW,EAAE,sBAAsB;CACpC,CAAC;AACW,QAAA,gBAAgB,GAAG,GAAG,kBAAU,QAAQ,CAAC;AACzC,QAAA,iBAAiB,GAAG,GAAG,kBAAU,SAAS,CAAC;AAC3C,QAAA,oBAAoB,GAAG,GAAG,kBAAU,mBAAmB,CAAC;AACxD,QAAA,yBAAyB,GAAG,GAAG,kBAAU,mBAAmB,CAAC;AAE7D,QAAA,UAAU,GAAG,0BAA0B,CAAC;AAErD,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,qCAAqB,CAAA;IACrB,mCAAmB,CAAA;IACnB,uCAAuB,CAAA;AACzB,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB;AAEY,QAAA,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AAE5C,QAAA,yBAAyB,GACpC;IACE,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,0BAAS,CAAC,QAAQ;IAC3C,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,0BAAS,CAAC,OAAO;IACzC,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,0BAAS,CAAC,SAAS;CAC9C,CAAC"}
|
@@ -0,0 +1,36 @@
|
|
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 constants_1 = require("./constants");
|
13
|
+
const helpers_1 = require("./helpers");
|
14
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
15
|
+
const allGauges = yield (0, helpers_1.getAllGaugesData)();
|
16
|
+
for (const [networkId, gauges] of Object.entries(allGauges)) {
|
17
|
+
for (let i = 0; i < gauges.length; i++) {
|
18
|
+
const gauge = gauges[i];
|
19
|
+
yield cache.setItem(gauge.gauge, gauge, {
|
20
|
+
networkId: networkId,
|
21
|
+
prefix: constants_1.gaugesCachePrefix,
|
22
|
+
});
|
23
|
+
}
|
24
|
+
const gaugeAddresses = gauges.map((g) => g.gauge);
|
25
|
+
yield cache.setItem(constants_1.gaugesAddresesCachePrefix, gaugeAddresses, {
|
26
|
+
prefix: constants_1.gaugesAddresesCachePrefix,
|
27
|
+
networkId: networkId,
|
28
|
+
});
|
29
|
+
}
|
30
|
+
});
|
31
|
+
const job = {
|
32
|
+
id: `${constants_1.platformId}-gauges`,
|
33
|
+
executor,
|
34
|
+
};
|
35
|
+
exports.default = job;
|
36
|
+
//# sourceMappingURL=gaugesJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"gaugesJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/curve/gaugesJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAGA,2CAIqB;AACrB,uCAA6C;AAE7C,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,SAAS,GAAG,MAAM,IAAA,0BAAgB,GAAE,CAAC;IAE3C,KAAK,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;QAC3D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACtC,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YACxB,MAAM,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE;gBACtC,SAAS,EAAE,SAA0B;gBACrC,MAAM,EAAE,6BAAiB;aAC1B,CAAC,CAAC;SACJ;QACD,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QAClD,MAAM,KAAK,CAAC,OAAO,CAAC,qCAAyB,EAAE,cAAc,EAAE;YAC7D,MAAM,EAAE,qCAAyB;YACjC,SAAS,EAAE,SAA0B;SACtC,CAAC,CAAC;KACJ;AACH,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,SAAS;IAC1B,QAAQ;CACT,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
export type GetAllGaugesResponse = {
|
2
|
+
success: boolean;
|
3
|
+
data: {
|
4
|
+
[key: string]: GaugeDatum;
|
5
|
+
};
|
6
|
+
generatedTimeMs: number;
|
7
|
+
};
|
8
|
+
export type GaugeDatum = {
|
9
|
+
poolUrls: PoolUrls;
|
10
|
+
swap: string;
|
11
|
+
swap_token: string;
|
12
|
+
name: string;
|
13
|
+
shortName: string;
|
14
|
+
gauge: string;
|
15
|
+
gauge_data: GaugeData;
|
16
|
+
gauge_controller: GaugeController;
|
17
|
+
factory: boolean;
|
18
|
+
side_chain: boolean;
|
19
|
+
is_killed: boolean;
|
20
|
+
hasNoCrv: boolean;
|
21
|
+
type: Type;
|
22
|
+
lpTokenPrice: number | null;
|
23
|
+
swap_data?: SwapData;
|
24
|
+
gaugeStatus?: GaugeStatus;
|
25
|
+
};
|
26
|
+
export type GaugeStatus = {
|
27
|
+
areCrvRewardsStuckInBridge: boolean;
|
28
|
+
rewardsNeedNudging: boolean;
|
29
|
+
};
|
30
|
+
export type GaugeController = {
|
31
|
+
gauge_relative_weight: string;
|
32
|
+
get_gauge_weight: string;
|
33
|
+
inflation_rate: number | string;
|
34
|
+
};
|
35
|
+
export type GaugeData = {
|
36
|
+
inflation_rate: number | string;
|
37
|
+
working_supply: string;
|
38
|
+
};
|
39
|
+
export type PoolUrls = {
|
40
|
+
swap: string[];
|
41
|
+
deposit: string[];
|
42
|
+
withdraw: string[];
|
43
|
+
};
|
44
|
+
export type SwapData = {
|
45
|
+
virtual_price: number | string;
|
46
|
+
};
|
47
|
+
export declare enum Type {
|
48
|
+
Crypto = "crypto",
|
49
|
+
Stable = "stable"
|
50
|
+
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Type = void 0;
|
4
|
+
var Type;
|
5
|
+
(function (Type) {
|
6
|
+
Type["Crypto"] = "crypto";
|
7
|
+
Type["Stable"] = "stable";
|
8
|
+
})(Type || (exports.Type = Type = {}));
|
9
|
+
//# sourceMappingURL=getAllGaugesTypes.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getAllGaugesTypes.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/curve/getAllGaugesTypes.ts"],"names":[],"mappings":";;;AAmDA,IAAY,IAGX;AAHD,WAAY,IAAI;IACd,yBAAiB,CAAA;IACjB,yBAAiB,CAAA;AACnB,CAAC,EAHW,IAAI,oBAAJ,IAAI,QAGf"}
|
@@ -12,54 +12,71 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
13
|
};
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
-
exports.
|
15
|
+
exports.getPositionsFetcher = void 0;
|
16
16
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
17
17
|
const viem_1 = require("viem");
|
18
18
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
19
19
|
const constants_1 = require("./constants");
|
20
|
-
const erc20Abi_1 = require("../../utils/evm/erc20Abi");
|
21
20
|
const clients_1 = require("../../utils/clients");
|
21
|
+
const abis_1 = require("./abis");
|
22
22
|
const zero = BigInt(0);
|
23
|
-
function
|
23
|
+
function getPositionsFetcher(crvNetworkId) {
|
24
24
|
const networkId = constants_1.crvNetworkIdBySwNetworkId[crvNetworkId];
|
25
25
|
const executor = (owner, cache) => __awaiter(this, void 0, void 0, function* () {
|
26
|
-
const
|
26
|
+
const poolsByAddress = yield cache.getItem(constants_1.poolsByAddressPrefix, {
|
27
27
|
networkId,
|
28
|
-
prefix: constants_1.
|
28
|
+
prefix: constants_1.poolsByAddressPrefix,
|
29
29
|
});
|
30
|
-
if (!
|
30
|
+
if (!poolsByAddress)
|
31
31
|
return [];
|
32
|
-
const
|
32
|
+
const addresses = Object.keys(poolsByAddress);
|
33
|
+
const contracts = addresses.map((address) => ({
|
33
34
|
address: (0, viem_1.getAddress)(address),
|
34
|
-
abi:
|
35
|
+
abi: abis_1.balanceOfAbI,
|
35
36
|
functionName: 'balanceOf',
|
36
37
|
args: [owner],
|
37
38
|
}));
|
38
39
|
const client = (0, clients_1.getEvmClient)(networkId);
|
39
40
|
const balanceOfResults = yield client.multicall({ contracts });
|
40
|
-
const
|
41
|
-
const
|
41
|
+
const poolAddresses = new Set();
|
42
|
+
const balanceOfByAddress = new Map();
|
42
43
|
balanceOfResults.forEach((r, i) => {
|
43
44
|
if (r.status === 'failure')
|
44
45
|
return;
|
45
46
|
if (r.result === zero)
|
46
47
|
return;
|
47
|
-
|
48
|
-
|
48
|
+
const address = addresses[i];
|
49
|
+
const poolAddress = poolsByAddress[address];
|
50
|
+
if (!poolAddress)
|
51
|
+
return;
|
52
|
+
balanceOfByAddress.set(address, new bignumber_js_1.default(r.result.toString()));
|
53
|
+
poolAddresses.add(poolAddress);
|
49
54
|
});
|
50
|
-
|
55
|
+
if (balanceOfByAddress.size === 0)
|
56
|
+
return [];
|
57
|
+
const poolAddressesArray = Array.from(poolAddresses);
|
58
|
+
const pools = yield cache.getItems(poolAddressesArray, {
|
51
59
|
prefix: constants_1.poolsCachePrefix,
|
52
60
|
networkId,
|
53
61
|
});
|
54
|
-
const
|
55
|
-
|
56
|
-
|
57
|
-
|
62
|
+
const poolDatumByAddress = new Map();
|
63
|
+
pools.forEach((pool, i) => {
|
64
|
+
if (!pool)
|
65
|
+
return;
|
66
|
+
poolDatumByAddress.set(poolAddressesArray[i], pool);
|
67
|
+
});
|
68
|
+
const poolLiquidities = [];
|
69
|
+
const gaugeLiquidities = [];
|
70
|
+
for (const [address, balance] of balanceOfByAddress) {
|
71
|
+
const poolAddress = poolsByAddress[address];
|
72
|
+
if (!poolAddress)
|
73
|
+
continue;
|
74
|
+
const pool = poolDatumByAddress.get(poolAddress);
|
58
75
|
if (!pool)
|
59
76
|
continue;
|
60
77
|
const coins = pool.underlyingCoins || pool.coins;
|
61
78
|
const supply = new bignumber_js_1.default(pool.totalSupply);
|
62
|
-
const shares =
|
79
|
+
const shares = balance.div(supply);
|
63
80
|
const assets = coins.map((coin) => {
|
64
81
|
const amount = new bignumber_js_1.default(coin.poolBalance)
|
65
82
|
.times(shares)
|
@@ -69,7 +86,7 @@ function getPoolsPositionFetcher(crvNetworkId) {
|
|
69
86
|
networkId,
|
70
87
|
type: portfolio_core_1.PortfolioAssetType.token,
|
71
88
|
data: {
|
72
|
-
address: coin.address,
|
89
|
+
address: (0, portfolio_core_1.formatTokenAddress)(coin.address, networkId),
|
73
90
|
amount,
|
74
91
|
price: coin.usdPrice || null,
|
75
92
|
},
|
@@ -85,25 +102,46 @@ function getPoolsPositionFetcher(crvNetworkId) {
|
|
85
102
|
rewardAssets: [],
|
86
103
|
rewardAssetsValue: null,
|
87
104
|
};
|
88
|
-
|
105
|
+
const isGauge = pool.gaugeAddress === address;
|
106
|
+
if (isGauge)
|
107
|
+
gaugeLiquidities.push(liquidity);
|
108
|
+
else
|
109
|
+
poolLiquidities.push(liquidity);
|
89
110
|
}
|
90
|
-
const
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
111
|
+
const elements = [];
|
112
|
+
if (poolLiquidities.length !== 0) {
|
113
|
+
const element = {
|
114
|
+
networkId,
|
115
|
+
platformId: constants_1.platformId,
|
116
|
+
label: 'LiquidityPool',
|
117
|
+
type: portfolio_core_1.PortfolioElementType.liquidity,
|
118
|
+
data: {
|
119
|
+
liquidities: poolLiquidities,
|
120
|
+
},
|
121
|
+
value: (0, portfolio_core_1.getUsdValueSum)(poolLiquidities.map((a) => a.value)),
|
122
|
+
};
|
123
|
+
elements.push(element);
|
124
|
+
}
|
125
|
+
if (gaugeLiquidities.length !== 0) {
|
126
|
+
const element = {
|
127
|
+
networkId,
|
128
|
+
platformId: constants_1.platformId,
|
129
|
+
label: 'Farming',
|
130
|
+
type: portfolio_core_1.PortfolioElementType.liquidity,
|
131
|
+
data: {
|
132
|
+
liquidities: gaugeLiquidities,
|
133
|
+
},
|
134
|
+
value: (0, portfolio_core_1.getUsdValueSum)(gaugeLiquidities.map((a) => a.value)),
|
135
|
+
};
|
136
|
+
elements.push(element);
|
137
|
+
}
|
138
|
+
return elements;
|
101
139
|
});
|
102
140
|
return {
|
103
141
|
executor,
|
104
142
|
networkId,
|
105
|
-
id: `${constants_1.platformId}-${networkId}-
|
143
|
+
id: `${constants_1.platformId}-${networkId}-positions`,
|
106
144
|
};
|
107
145
|
}
|
108
|
-
exports.
|
109
|
-
//# sourceMappingURL=
|
146
|
+
exports.getPositionsFetcher = getPositionsFetcher;
|
147
|
+
//# sourceMappingURL=getPositionsFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getPositionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/curve/getPositionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAQoC;AACpC,+BAAkC;AAClC,gEAAqC;AAErC,2CAMqB;AAErB,iDAAmD;AAEnD,iCAAsC;AAEtC,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAEvB,SAAgB,mBAAmB,CAAC,YAA0B;IAC5D,MAAM,SAAS,GAAG,qCAAyB,CAAC,YAAY,CAAC,CAAC;IAC1D,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;QACtE,MAA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pC,IAAI,EAAE;oBACJ,WAAW,EAAE,eAAe;iBAC7B;gBACD,KAAK,EAAE,IAAA,+BAAc,EAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;aAC3D,CAAC;YACF,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SACxB;QACD,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC,EAAE;YACjC,MAAM,OAAO,GAA8B;gBACzC,SAAS;gBACT,UAAU,EAAV,sBAAU;gBACV,KAAK,EAAE,SAAS;gBAChB,IAAI,EAAE,qCAAoB,CAAC,SAAS;gBACpC,IAAI,EAAE;oBACJ,WAAW,EAAE,gBAAgB;iBAC9B;gBACD,KAAK,EAAE,IAAA,+BAAc,EAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;aAC5D,CAAC;YACF,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SACxB;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAA,CAAC;IACF,OAAO;QACL,QAAQ;QACR,SAAS;QACT,EAAE,EAAE,GAAG,sBAAU,IAAI,SAAS,YAAY;KAC3C,CAAC;AACJ,CAAC;AAhID,kDAgIC"}
|
@@ -1,3 +1,6 @@
|
|
1
|
+
import { NetworkIdType } from '@sonarwatch/portfolio-core';
|
1
2
|
import { CrvNetworkId } from './constants';
|
2
3
|
import { PoolDatum } from './getPoolsTypes';
|
4
|
+
import { GaugeDatum } from './getAllGaugesTypes';
|
3
5
|
export declare function getPoolsData(crvNetworkId: CrvNetworkId): Promise<PoolDatum[]>;
|
6
|
+
export declare function getAllGaugesData(): Promise<Partial<Record<NetworkIdType, GaugeDatum[]>>>;
|
@@ -12,8 +12,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
13
|
};
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
-
exports.getPoolsData = void 0;
|
15
|
+
exports.getAllGaugesData = exports.getPoolsData = void 0;
|
16
16
|
const axios_1 = __importDefault(require("axios"));
|
17
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
17
18
|
const types_1 = require("./types");
|
18
19
|
const constants_1 = require("./constants");
|
19
20
|
function getPoolsEndpoints(crvNetworkId) {
|
@@ -46,4 +47,36 @@ function getPoolsData(crvNetworkId) {
|
|
46
47
|
});
|
47
48
|
}
|
48
49
|
exports.getPoolsData = getPoolsData;
|
50
|
+
function getGaugeNetworkId(gauge) {
|
51
|
+
if (gauge.side_chain === false)
|
52
|
+
return portfolio_core_1.NetworkId.ethereum;
|
53
|
+
const nameFirstPart = gauge.name.split('-').at(0);
|
54
|
+
if (!nameFirstPart)
|
55
|
+
return null;
|
56
|
+
const crvNetworkId = constants_1.CrvNetworkId[nameFirstPart];
|
57
|
+
if (!crvNetworkId)
|
58
|
+
return null;
|
59
|
+
return constants_1.crvNetworkIdBySwNetworkId[crvNetworkId];
|
60
|
+
}
|
61
|
+
function getAllGaugesData() {
|
62
|
+
return __awaiter(this, void 0, void 0, function* () {
|
63
|
+
const getAllGaugesRes = yield axios_1.default.get(`${constants_1.apiBaseUrl}/getAllGauges`).catch(() => null);
|
64
|
+
const allGaugesData = getAllGaugesRes === null || getAllGaugesRes === void 0 ? void 0 : getAllGaugesRes.data.data;
|
65
|
+
if (!allGaugesData)
|
66
|
+
return {};
|
67
|
+
const gauges = {};
|
68
|
+
const allGauges = Object.values(allGaugesData);
|
69
|
+
allGauges.forEach((gauge) => {
|
70
|
+
var _a;
|
71
|
+
const networkId = getGaugeNetworkId(gauge);
|
72
|
+
if (!networkId)
|
73
|
+
return;
|
74
|
+
if (!gauges[networkId])
|
75
|
+
gauges[networkId] = [];
|
76
|
+
(_a = gauges[networkId]) === null || _a === void 0 ? void 0 : _a.push(gauge);
|
77
|
+
});
|
78
|
+
return gauges;
|
79
|
+
});
|
80
|
+
}
|
81
|
+
exports.getAllGaugesData = getAllGaugesData;
|
49
82
|
//# sourceMappingURL=helpers.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/curve/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAA6C;AAC7C,mCAAqC;AACrC,
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/curve/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAA6C;AAC7C,+DAAsE;AACtE,mCAAqC;AACrC,2CAIqB;AAIrB,SAAS,iBAAiB,CAAC,YAA0B;IACnD,OAAO,MAAM,CAAC,MAAM,CAAC,kBAAU,CAAC,CAAC,GAAG,CAClC,CAAC,UAAU,EAAE,EAAE,CAAC,GAAG,sBAAU,aAAa,YAAY,IAAI,UAAU,EAAE,CACvE,CAAC;AACJ,CAAC;AAED,SAAsB,YAAY,CAChC,YAA0B;;QAE1B,MAAM,SAAS,GAAgB,EAAE,CAAC;QAClC,MAAM,SAAS,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC;QAClD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACzC,MAAM,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;YAC9B,MAAM,WAAW,GAA2C,MAAM,eAAK;iBACpE,GAAG,CAAC,QAAQ,CAAC;iBACb,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;YACrB,IAAI,CAAC,WAAW,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO;gBAAE,SAAS;YACxD,MAAM,EAAE,QAAQ,EAAE,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;YAC3C,MAAM,SAAS,GAAG,QAA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CAAC;QAC/C,SAAS,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;;YAC1B,MAAM,SAAS,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAC3C,IAAI,CAAC,SAAS;gBAAE,OAAO;YACvB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;gBAAE,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC;YAC/C,MAAA,MAAM,CAAC,SAAS,CAAC,0CAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;CAAA;AAjBD,4CAiBC"}
|
@@ -6,12 +6,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.fetchers = exports.jobs = exports.platforms = void 0;
|
7
7
|
const constants_1 = require("./constants");
|
8
8
|
const poolsJob_1 = __importDefault(require("./poolsJob"));
|
9
|
-
const
|
9
|
+
const gaugesJob_1 = __importDefault(require("./gaugesJob"));
|
10
|
+
const getPositionsFetcher_1 = require("./getPositionsFetcher");
|
10
11
|
exports.platforms = [constants_1.fooPlatform];
|
11
|
-
exports.jobs = [poolsJob_1.default];
|
12
|
+
exports.jobs = [poolsJob_1.default, gaugesJob_1.default];
|
12
13
|
exports.fetchers = [
|
13
|
-
(0,
|
14
|
-
(0,
|
15
|
-
(0,
|
14
|
+
(0, getPositionsFetcher_1.getPositionsFetcher)(constants_1.CrvNetworkId.ethereum),
|
15
|
+
(0, getPositionsFetcher_1.getPositionsFetcher)(constants_1.CrvNetworkId.polygon),
|
16
|
+
(0, getPositionsFetcher_1.getPositionsFetcher)(constants_1.CrvNetworkId.avalanche),
|
16
17
|
];
|
17
18
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/curve/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAwD;AACxD,0DAAkC;AAClC,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/curve/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAwD;AACxD,0DAAkC;AAClC,4DAAoC;AACpC,+DAA4D;AAE/C,QAAA,SAAS,GAAe,CAAC,uBAAW,CAAC,CAAC;AACtC,QAAA,IAAI,GAAU,CAAC,kBAAQ,EAAE,mBAAS,CAAC,CAAC;AACpC,QAAA,QAAQ,GAAc;IACjC,IAAA,yCAAmB,EAAC,wBAAY,CAAC,QAAQ,CAAC;IAC1C,IAAA,yCAAmB,EAAC,wBAAY,CAAC,OAAO,CAAC;IACzC,IAAA,yCAAmB,EAAC,wBAAY,CAAC,SAAS,CAAC;CAC5C,CAAC"}
|
@@ -18,14 +18,19 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
18
|
const pools = yield (0, helpers_1.getPoolsData)(crvNetworkId);
|
19
19
|
for (let j = 0; j < pools.length; j++) {
|
20
20
|
const pool = pools[j];
|
21
|
-
yield cache.setItem(pool.
|
21
|
+
yield cache.setItem(pool.address, pool, {
|
22
22
|
prefix: constants_1.poolsCachePrefix,
|
23
23
|
networkId,
|
24
24
|
});
|
25
25
|
}
|
26
|
-
const
|
27
|
-
|
28
|
-
|
26
|
+
const poolsByAddresses = new Map();
|
27
|
+
pools.forEach((p) => {
|
28
|
+
poolsByAddresses.set(p.lpTokenAddress, p.address);
|
29
|
+
if (p.gaugeAddress)
|
30
|
+
poolsByAddresses.set(p.gaugeAddress, p.address);
|
31
|
+
});
|
32
|
+
yield cache.setItem(constants_1.poolsByAddressPrefix, Object.fromEntries(poolsByAddresses), {
|
33
|
+
prefix: constants_1.poolsByAddressPrefix,
|
29
34
|
networkId,
|
30
35
|
});
|
31
36
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/curve/poolsJob.ts"],"names":[],"mappings":";;;;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,CAAC,OAAO,EAAE,IAAI,EAAE;gBACtC,MAAM,EAAE,4BAAgB;gBACxB,SAAS;aACV,CAAC,CAAC;SACJ;QAED,MAAM,gBAAgB,GAAwB,IAAI,GAAG,EAAE,CAAC;QACxD,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YAClB,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;YAClD,IAAI,CAAC,CAAC,YAAY;gBAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;QACtE,CAAC,CAAC,CAAC;QACH,MAAM,KAAK,CAAC,OAAO,CACjB,gCAAoB,EACpB,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC,EACpC;YACE,MAAM,EAAE,gCAAoB;YAC5B,SAAS;SACV,CACF,CAAC;KACH;AACH,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,QAAQ;CACT,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getPoolsPositionFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/curve/getPoolsPositionFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAOoC;AACpC,+BAAkC;AAClC,gEAAqC;AAErC,2CAMqB;AAErB,uDAAoD;AACpD,iDAAmD;AAGnD,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAEvB,SAAgB,uBAAuB,CAAC,YAA0B;IAChE,MAAM,SAAS,GAAG,qCAAyB,CAAC,YAAY,CAAC,CAAC;IAC1D,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;QACtE,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,OAAO,CAAW,iCAAqB,E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