@sonarwatch/portfolio-plugins 0.14.5 → 0.14.7
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1616 -1608
- package/README.md +3 -3
- package/package.json +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/debridge/dlmmVaultsFetcher.js.map +1 -1
- package/src/plugins/lulo/depositsFetcher.js +1 -17
- package/src/plugins/lulo/depositsFetcher.js.map +1 -1
- package/src/plugins/raydium/ammV2ApiJob.d.ts +3 -0
- package/src/plugins/raydium/ammV2ApiJob.js +122 -0
- package/src/plugins/raydium/ammV2ApiJob.js.map +1 -0
- package/src/plugins/raydium/constants.d.ts +1 -0
- package/src/plugins/raydium/constants.js +2 -1
- package/src/plugins/raydium/constants.js.map +1 -1
- package/src/plugins/raydium/index.js +2 -6
- package/src/plugins/raydium/index.js.map +1 -1
- package/src/plugins/raydium/lpTokensJob.js +35 -47
- package/src/plugins/raydium/lpTokensJob.js.map +1 -1
- package/src/plugins/raydium/types.d.ts +57 -0
- package/src/plugins/save/constants.d.ts +2 -0
- package/src/plugins/save/constants.js +9 -1
- package/src/plugins/save/constants.js.map +1 -1
- package/src/plugins/save/helpers.d.ts +3 -3
- package/src/plugins/save/helpers.js +122 -121
- package/src/plugins/save/helpers.js.map +1 -1
- package/src/plugins/save/index.js +1 -1
- package/src/plugins/save/index.js.map +1 -1
- package/src/plugins/save/obligationsFetcher.js +14 -34
- package/src/plugins/save/obligationsFetcher.js.map +1 -1
- 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/elementbuilder/ElementRegistry.js.map +1 -1
- 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
@@ -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;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"dlmmVaultsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/debridge/dlmmVaultsFetcher.ts"],"names":[],"mappings":";AAAA,2BAA2B;AAC3B,mBAAmB;;;;;;;;;;;;;;AAEnB,+DAKoC;
|
1
|
+
{"version":3,"file":"dlmmVaults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AAE,EACnC,0BAAS,CAAC,MAAM,EAChB,cAAc,EACd,SAAS,EACT,EAAE,WAAW,EAAE,aAAa,EAAE,CAC/B,CACF,CAAC;IACJ,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnC,OAAO;QACL;YACE,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,IAAI,EAAE,qCAAoB,CAAC,QAAQ;YACnC,KAAK,EAAE,SAAS;YAChB,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE;gBACJ,MAAM;aACP;YACD,KAAK,EAAE,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;SAClD;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -25,7 +25,6 @@ const clients_1 = require("../../utils/clients");
|
|
25
25
|
const struct_1 = require("./struct");
|
26
26
|
const structs_1 = require("../save/structs");
|
27
27
|
const constants_3 = require("../save/constants");
|
28
|
-
const getMultipleAccountsInfoSafe_1 = require("../../utils/solana/getMultipleAccountsInfoSafe");
|
29
28
|
const helpers_2 = require("../save/helpers");
|
30
29
|
const MarginfiAccount_1 = require("../marginfi/structs/MarginfiAccount");
|
31
30
|
const constants_4 = require("../marginfi/constants");
|
@@ -67,28 +66,13 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
67
66
|
networkId: portfolio_core_1.NetworkId.solana,
|
68
67
|
});
|
69
68
|
if (reservesInfos.length !== 0) {
|
70
|
-
const mints = [];
|
71
|
-
const pythAddresses = [];
|
72
69
|
const reserveByAddress = new Map();
|
73
70
|
reservesInfos.forEach((reserve) => {
|
74
71
|
if (!reserve)
|
75
72
|
return;
|
76
|
-
pythAddresses.push(new web3_js_1.PublicKey(reserve.reserve.liquidity.pythOracle));
|
77
|
-
mints.push(reserve.reserve.liquidity.mintPubkey);
|
78
73
|
reserveByAddress.set(reserve.pubkey, reserve);
|
79
74
|
});
|
80
|
-
const
|
81
|
-
(0, getMultipleAccountsInfoSafe_1.getMultipleAccountsInfoSafe)(client, pythAddresses),
|
82
|
-
cache.getTokenPricesAsMap(mints, portfolio_core_1.NetworkId.solana),
|
83
|
-
]);
|
84
|
-
const pythAccByAddress = new Map();
|
85
|
-
for (let i = 0; i < pythAddresses.length; i++) {
|
86
|
-
const account = pythAccounts[i];
|
87
|
-
if (account === null)
|
88
|
-
continue;
|
89
|
-
pythAccByAddress.set(pythAddresses[i].toString(), account);
|
90
|
-
}
|
91
|
-
const solendElements = (0, helpers_2.getElementsFromObligations)([saveObligation], reserveByAddress, new Map([[constants_3.mainMarket, mainMarketInfo]]), tokenPriceByAddress, pythAccByAddress);
|
75
|
+
const solendElements = yield (0, helpers_2.getElementsFromObligations)([saveObligation], reserveByAddress, new Map([[constants_3.mainMarket, mainMarketInfo]]), owner, cache);
|
92
76
|
portfolioElements.push(...solendElements);
|
93
77
|
}
|
94
78
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/lulo/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAyE;AACzE,
|
1
|
+
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/lulo/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAyE;AACzE,6CAA4C;AAG5C,2CAAyC;AACzC,uCAA8C;AAC9C,+EAA4D;AAC5D,0EAA8D;AAC9D,mFAA6D;AAC7D,mDAA2D;AAC3D,kFAA+E;AAC/E,iDAA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AK,gCAAoB,CAAC,EAAE;gBAC/C,CAAC,CAAC,gBAAgB;gBAClB,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE;oBAC/C,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACrC,UAAU,CAAC,UAAU,GAAG,sBAAU,CAAC;QACnC,QAAQ,CAAC,IAAI,mBACR,UAAU,EACb,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -0,0 +1,122 @@
|
|
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 axios_1 = __importDefault(require("axios"));
|
17
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
18
|
+
const constants_1 = require("./constants");
|
19
|
+
const getLpTokenSource_1 = require("../../utils/misc/getLpTokenSource");
|
20
|
+
const computeAndStoreLpPrice_1 = require("../../utils/misc/computeAndStoreLpPrice");
|
21
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
22
|
+
let apiRes;
|
23
|
+
let page = 1;
|
24
|
+
let subPools;
|
25
|
+
let tokenPriceById;
|
26
|
+
let lastLiquidity;
|
27
|
+
do {
|
28
|
+
apiRes = yield axios_1.default
|
29
|
+
.get(`${constants_1.apiV3}pools/info/list`, {
|
30
|
+
params: {
|
31
|
+
poolType: 'standard',
|
32
|
+
poolSortField: 'liquidity',
|
33
|
+
sortType: 'desc',
|
34
|
+
pageSize: 300,
|
35
|
+
page,
|
36
|
+
},
|
37
|
+
})
|
38
|
+
.catch((er) => {
|
39
|
+
throw new Error(`[Raydium AMM V2 Job] Unable to get pools info from APi. \n Error : ${er}`);
|
40
|
+
});
|
41
|
+
if (apiRes.data.data.count === 0)
|
42
|
+
return;
|
43
|
+
subPools = apiRes.data.data;
|
44
|
+
lastLiquidity = subPools.data[subPools.count - 1].tvl;
|
45
|
+
tokenPriceById = yield cache.getTokenPricesAsMap(subPools.data
|
46
|
+
.map((pool) => [pool.mintA.address, pool.mintB.address])
|
47
|
+
.flat(), portfolio_core_1.NetworkId.solana);
|
48
|
+
let poolInfo;
|
49
|
+
let lpSupply;
|
50
|
+
let mintA;
|
51
|
+
let mintB;
|
52
|
+
let lpMint;
|
53
|
+
let decimalsA;
|
54
|
+
let decimalsB;
|
55
|
+
let lpDecimals;
|
56
|
+
let tokenAmountA;
|
57
|
+
let tokenAmountB;
|
58
|
+
let tokenPriceA;
|
59
|
+
let tokenPriceB;
|
60
|
+
const tokenPriceSources = [];
|
61
|
+
for (let id = 0; id < subPools.data.length; id++) {
|
62
|
+
poolInfo = subPools.data[id];
|
63
|
+
lpSupply = new bignumber_js_1.default(poolInfo.lpAmount);
|
64
|
+
if (lpSupply.isZero())
|
65
|
+
continue;
|
66
|
+
if ((0, bignumber_js_1.default)(poolInfo.tvl).isLessThan(computeAndStoreLpPrice_1.minimumLiquidity))
|
67
|
+
continue;
|
68
|
+
mintA = poolInfo.mintA.address;
|
69
|
+
mintB = poolInfo.mintB.address;
|
70
|
+
lpMint = poolInfo.lpMint.address;
|
71
|
+
[decimalsA, decimalsB, lpDecimals] = [
|
72
|
+
poolInfo.mintA.decimals,
|
73
|
+
poolInfo.mintB.decimals,
|
74
|
+
poolInfo.lpMint.decimals,
|
75
|
+
];
|
76
|
+
if (!decimalsA || !decimalsB || !lpDecimals)
|
77
|
+
continue;
|
78
|
+
tokenAmountA = poolInfo.mintAmountA;
|
79
|
+
tokenAmountB = poolInfo.mintAmountB;
|
80
|
+
[tokenPriceA, tokenPriceB] = [
|
81
|
+
tokenPriceById.get(mintA),
|
82
|
+
tokenPriceById.get(mintB),
|
83
|
+
];
|
84
|
+
tokenPriceSources.push(...(0, getLpTokenSource_1.getLpTokenSource)({
|
85
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
86
|
+
sourceId: lpMint.toString(),
|
87
|
+
platformId: constants_1.platformId,
|
88
|
+
priceUnderlyings: true,
|
89
|
+
lpDetails: {
|
90
|
+
address: lpMint.toString(),
|
91
|
+
decimals: lpDecimals,
|
92
|
+
supply: lpSupply.toNumber(),
|
93
|
+
},
|
94
|
+
poolUnderlyings: [
|
95
|
+
{
|
96
|
+
address: mintA,
|
97
|
+
decimals: decimalsA,
|
98
|
+
reserveAmount: tokenAmountA,
|
99
|
+
tokenPrice: tokenPriceA,
|
100
|
+
weight: 0.5,
|
101
|
+
},
|
102
|
+
{
|
103
|
+
address: mintB,
|
104
|
+
decimals: decimalsB,
|
105
|
+
reserveAmount: tokenAmountB,
|
106
|
+
tokenPrice: tokenPriceB,
|
107
|
+
weight: 0.5,
|
108
|
+
},
|
109
|
+
],
|
110
|
+
}));
|
111
|
+
}
|
112
|
+
yield cache.setTokenPriceSources(tokenPriceSources);
|
113
|
+
page += 1;
|
114
|
+
} while (subPools.hasNextPage && computeAndStoreLpPrice_1.minimumLiquidity.isLessThan(lastLiquidity));
|
115
|
+
});
|
116
|
+
const job = {
|
117
|
+
id: `${constants_1.platformId}-lp-tokens-api`,
|
118
|
+
executor,
|
119
|
+
label: 'normal',
|
120
|
+
};
|
121
|
+
exports.default = job;
|
122
|
+
//# sourceMappingURL=ammV2ApiJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ammV2ApiJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/ammV2ApiJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,kDAA0B;AAC1B,gEAAqC;AAGrC,2CAAgD;AAEhD,wEAAqE;AACrE,oFAA2E;AAE3E,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,IAAI,MAAM,CAAC;IACX,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,IAAI,QAAQ,CAAC;IACb,IAAI,cAAc,CAAC;IACnB,IAAI,aAAa,CAAC;IAClB,GAAG,CAAC;QACF,MAAM,GAAG,MAAM,eAAK;aACjB,GAAG,CAAgB,GAAG,iBAAK,iBAAiB,EAAE;YAC7C,MAAM,EAAE;gBACN,QAAQ,EAAE,UAAU;gBACpB,aAAa,EAAE,WAAW;gBAC1B,QAAQ,EAAE,MAAM;gBAChB,QAAQ,EAAE,GAAG;gBACb,IAAI;aACL;SACF,CAAC;aACD,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE;YACZ,MAAM,IAAI,KAAK,CACb,sEAAsE,EAAE,EAAE,CAC3E,CAAC;QACJ,CAAC,CAAC,CAAC;QAEL,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC;YAAE,OAAO;QAEzC,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;QAC5B,aAAa,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC,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WAAW,IAAI,yCAAgB,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE;AAC/E,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,gBAAgB;IACjC,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -2,6 +2,7 @@ import { PublicKey } from '@solana/web3.js';
|
|
2
2
|
import { Platform } from '@sonarwatch/portfolio-core';
|
3
3
|
export declare const platformId = "raydium";
|
4
4
|
export declare const platform: Platform;
|
5
|
+
export declare const apiV3 = "https://api-v3.raydium.io/";
|
5
6
|
export declare const AMM_PROGRAM_ID_V3: PublicKey;
|
6
7
|
export declare const AMM_PROGRAM_ID_V4: PublicKey;
|
7
8
|
export declare const AMM_PROGRAM_ID_V5: PublicKey;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.rayDecimals = exports.rayMint = exports.positionsIdentifier = exports.cpmmProgramId = exports.raydiumProgram = exports.AMM_PROGRAM_ID_V5 = exports.AMM_PROGRAM_ID_V4 = exports.AMM_PROGRAM_ID_V3 = exports.platform = exports.platformId = void 0;
|
3
|
+
exports.rayDecimals = exports.rayMint = exports.positionsIdentifier = exports.cpmmProgramId = exports.raydiumProgram = exports.AMM_PROGRAM_ID_V5 = exports.AMM_PROGRAM_ID_V4 = exports.AMM_PROGRAM_ID_V3 = exports.apiV3 = exports.platform = exports.platformId = void 0;
|
4
4
|
const web3_js_1 = require("@solana/web3.js");
|
5
5
|
exports.platformId = 'raydium';
|
6
6
|
exports.platform = {
|
@@ -10,6 +10,7 @@ exports.platform = {
|
|
10
10
|
defiLlamaId: 'raydium',
|
11
11
|
website: 'https://raydium.io/',
|
12
12
|
};
|
13
|
+
exports.apiV3 = 'https://api-v3.raydium.io/';
|
13
14
|
exports.AMM_PROGRAM_ID_V3 = new web3_js_1.PublicKey('EhhTKczWMGQt46ynNeRX1WfeagwwJd7ufHvCDjRxjo5Q');
|
14
15
|
exports.AMM_PROGRAM_ID_V4 = new web3_js_1.PublicKey('675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8');
|
15
16
|
exports.AMM_PROGRAM_ID_V5 = new web3_js_1.PublicKey('5quBtoiQqxF9Jv6KYKctB59NT3gtJD2Y65kdnB1Uev3h');
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,gDAAgD;IACvD,WAAW,EAAE,SAAS;IACtB,OAAO,EAAE,qBAAqB;CAC/B,CAAC;AAEW,QAAA,iBAAiB,GAAG,IAAI,mBAAS,CAC5C,8CAA8C,CAC/C,CAAC;AAEW,QAAA,iBAAiB,GAAG,IAAI,mBAAS,CAC5C,8CAA8C,CAC/C,CAAC;
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,gDAAgD;IACvD,WAAW,EAAE,SAAS;IACtB,OAAO,EAAE,qBAAqB;CAC/B,CAAC;AAEW,QAAA,KAAK,GAAG,4BAA4B,CAAC;AAErC,QAAA,iBAAiB,GAAG,IAAI,mBAAS,CAC5C,8CAA8C,CAC/C,CAAC;AAEW,QAAA,iBAAiB,GAAG,IAAI,mBAAS,CAC5C,8CAA8C,CAC/C,CAAC;AACW,QAAA,iBAAiB,GAAG,IAAI,mBAAS,CAC5C,8CAA8C,CAC/C,CAAC;AAEW,QAAA,cAAc,GAAG,IAAI,mBAAS,CACzC,8CAA8C,CAC/C,CAAC;AAEW,QAAA,aAAa,GAAG,IAAI,mBAAS,CACxC,8CAA8C,CAC/C,CAAC;AAEW,QAAA,mBAAmB,GAAG,gCAAgC,CAAC;AAEvD,QAAA,OAAO,GAAG,8CAA8C,CAAC;AACzD,QAAA,WAAW,GAAG,CAAC,CAAC"}
|
@@ -5,17 +5,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
exports.fetchers = exports.jobs = exports.platforms = void 0;
|
7
7
|
// import lpTokensJob from './lpTokensJob';
|
8
|
+
const ammV2ApiJob_1 = __importDefault(require("./ammV2ApiJob"));
|
8
9
|
const clmmJob_1 = __importDefault(require("./clmmJob"));
|
9
10
|
const cpmmJob_1 = __importDefault(require("./cpmmJob"));
|
10
11
|
const farmsJob_1 = __importDefault(require("./farmsJob"));
|
11
12
|
const constants_1 = require("./constants");
|
12
13
|
const farmsFetcher_1 = __importDefault(require("./farmsFetcher"));
|
13
14
|
exports.platforms = [constants_1.platform];
|
14
|
-
exports.jobs = [
|
15
|
-
// lpTokensJob,
|
16
|
-
farmsJob_1.default,
|
17
|
-
clmmJob_1.default,
|
18
|
-
cpmmJob_1.default,
|
19
|
-
];
|
15
|
+
exports.jobs = [ammV2ApiJob_1.default, farmsJob_1.default, clmmJob_1.default, cpmmJob_1.default];
|
20
16
|
exports.fetchers = [farmsFetcher_1.default];
|
21
17
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAA2C;AAC3C,wDAAgC;AAChC,wDAAgC;AAChC,0DAAkC;AAClC,2CAAuC;AACvC,kEAA0C;AAE7B,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAA2C;AAC3C,gEAA2C;AAC3C,wDAAgC;AAChC,wDAAgC;AAChC,0DAAkC;AAClC,2CAAuC;AACvC,kEAA0C;AAE7B,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,qBAAc,EAAE,kBAAQ,EAAE,iBAAO,EAAE,iBAAO,CAAC,CAAC;AAC3D,QAAA,QAAQ,GAAc,CAAC,sBAAY,CAAC,CAAC"}
|
@@ -8,9 +8,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
9
|
});
|
10
10
|
};
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
|
-
};
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
12
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
16
13
|
const clients_1 = require("../../utils/clients");
|
@@ -20,9 +17,8 @@ const solana_1 = require("../../utils/solana");
|
|
20
17
|
const filters_1 = require("./filters");
|
21
18
|
const types_1 = require("./types");
|
22
19
|
const getMultipleAccountsInfoSafe_1 = require("../../utils/solana/getMultipleAccountsInfoSafe");
|
23
|
-
const getLpUnderlyingTokenSourceOld_1 = __importDefault(require("../../utils/misc/getLpUnderlyingTokenSourceOld"));
|
24
|
-
const getLpTokenSourceRawOld_1 = __importDefault(require("../../utils/misc/getLpTokenSourceRawOld"));
|
25
20
|
const constants_2 = require("../orders/clobs-solana/constants");
|
21
|
+
const getLpTokenSourceRaw_1 = require("../../utils/misc/getLpTokenSourceRaw");
|
26
22
|
const ammsDetails = [
|
27
23
|
{
|
28
24
|
versionId: 4,
|
@@ -31,13 +27,13 @@ const ammsDetails = [
|
|
31
27
|
filters: filters_1.ammV4Filter,
|
32
28
|
name: 'Pools V4',
|
33
29
|
},
|
34
|
-
{
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
},
|
30
|
+
// {
|
31
|
+
// versionId: 5,
|
32
|
+
// struct: ammInfoV5Struct,
|
33
|
+
// programId: AMM_PROGRAM_ID_V5,
|
34
|
+
// filters: ammV5Filter,
|
35
|
+
// name: 'Pools V5',
|
36
|
+
// },
|
41
37
|
];
|
42
38
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
43
39
|
const client = (0, clients_1.getClientSolana)();
|
@@ -133,24 +129,6 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
133
129
|
tokenPrices.get(mintB),
|
134
130
|
];
|
135
131
|
const lpMint = amm.lpMintAddress;
|
136
|
-
const underlyingSource = (0, getLpUnderlyingTokenSourceOld_1.default)(lpMint.toString(), portfolio_core_1.NetworkId.solana, {
|
137
|
-
address: mintA,
|
138
|
-
decimals: decimalsA,
|
139
|
-
reserveAmountRaw: tokenAmountA,
|
140
|
-
tokenPrice: tokenPriceA,
|
141
|
-
weight: 0.5,
|
142
|
-
}, {
|
143
|
-
address: mintB,
|
144
|
-
decimals: decimalsB,
|
145
|
-
reserveAmountRaw: tokenAmountB,
|
146
|
-
tokenPrice: tokenPriceB,
|
147
|
-
weight: 0.5,
|
148
|
-
});
|
149
|
-
if (underlyingSource) {
|
150
|
-
yield cache.setTokenPriceSource(underlyingSource);
|
151
|
-
}
|
152
|
-
if (!tokenPriceB || !tokenPriceA)
|
153
|
-
continue;
|
154
132
|
const lpMintAccount = mintAccountsMap.get(lpMint.toString());
|
155
133
|
if (!lpMintAccount)
|
156
134
|
continue;
|
@@ -158,24 +136,34 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
158
136
|
const lpSupply = amm.lpAmount;
|
159
137
|
if (lpSupply.isZero())
|
160
138
|
continue;
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
{
|
167
|
-
address:
|
168
|
-
decimals:
|
169
|
-
|
170
|
-
reserveAmountRaw: tokenAmountA,
|
171
|
-
},
|
172
|
-
{
|
173
|
-
address: tokenPriceB.address,
|
174
|
-
decimals: tokenPriceB.decimals,
|
175
|
-
price: tokenPriceB.price,
|
176
|
-
reserveAmountRaw: tokenAmountB,
|
139
|
+
const tokenSources = (0, getLpTokenSourceRaw_1.getLpTokenSourceRaw)({
|
140
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
141
|
+
sourceId: lpMint.toString(),
|
142
|
+
platformId: constants_1.platformId,
|
143
|
+
priceUnderlyings: true,
|
144
|
+
lpDetails: {
|
145
|
+
address: lpMint.toString(),
|
146
|
+
decimals: lpDecimals,
|
147
|
+
supplyRaw: lpSupply,
|
177
148
|
},
|
178
|
-
|
149
|
+
poolUnderlyingsRaw: [
|
150
|
+
{
|
151
|
+
address: mintA,
|
152
|
+
decimals: decimalsA,
|
153
|
+
reserveAmountRaw: tokenAmountA,
|
154
|
+
tokenPrice: tokenPriceA,
|
155
|
+
weight: 0.5,
|
156
|
+
},
|
157
|
+
{
|
158
|
+
address: mintB,
|
159
|
+
decimals: decimalsB,
|
160
|
+
reserveAmountRaw: tokenAmountB,
|
161
|
+
tokenPrice: tokenPriceB,
|
162
|
+
weight: 0.5,
|
163
|
+
},
|
164
|
+
],
|
165
|
+
});
|
166
|
+
tokenPriceSources.push(...tokenSources);
|
179
167
|
}
|
180
168
|
}
|
181
169
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"lpTokensJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/lpTokensJob.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"lpTokensJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/lp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utsideX64: BN[];
|
180
180
|
};
|
181
|
+
export type ApiV3Response = {
|
182
|
+
id: string;
|
183
|
+
success: boolean;
|
184
|
+
data: {
|
185
|
+
count: number;
|
186
|
+
data: PoolInfo[];
|
187
|
+
hasNextPage: boolean;
|
188
|
+
};
|
189
|
+
};
|
190
|
+
export type PoolInfo = {
|
191
|
+
type: string;
|
192
|
+
programId: string;
|
193
|
+
id: string;
|
194
|
+
mintA: LpMint;
|
195
|
+
mintB: LpMint;
|
196
|
+
price: number;
|
197
|
+
mintAmountA: number;
|
198
|
+
mintAmountB: number;
|
199
|
+
feeRate: number;
|
200
|
+
openTime: string;
|
201
|
+
tvl: number;
|
202
|
+
day: Day;
|
203
|
+
week: Day;
|
204
|
+
month: Day;
|
205
|
+
pooltype: string[];
|
206
|
+
rewardDefaultInfos: number[];
|
207
|
+
farmUpcomingCount: number;
|
208
|
+
farmOngoingCount: number;
|
209
|
+
farmFinishedCount: number;
|
210
|
+
marketId: string;
|
211
|
+
lpMint: LpMint;
|
212
|
+
lpPrice: number;
|
213
|
+
lpAmount: number;
|
214
|
+
burnPercent: number;
|
215
|
+
};
|
216
|
+
export type Day = {
|
217
|
+
volume: number;
|
218
|
+
volumeQuote: number;
|
219
|
+
volumeFee: number;
|
220
|
+
apr: number;
|
221
|
+
feeApr: number;
|
222
|
+
priceMin: number;
|
223
|
+
priceMax: number;
|
224
|
+
rewardApr: number[];
|
225
|
+
};
|
226
|
+
export type LpMint = {
|
227
|
+
chainId: number;
|
228
|
+
address: string;
|
229
|
+
programId: string;
|
230
|
+
logoURI: string;
|
231
|
+
symbol: string;
|
232
|
+
name: string;
|
233
|
+
decimals: number;
|
234
|
+
tags: string[];
|
235
|
+
extensions: Extensions;
|
236
|
+
};
|
237
|
+
export type Extensions = object;
|
@@ -1,7 +1,9 @@
|
|
1
1
|
import { PublicKey } from '@solana/web3.js';
|
2
2
|
import { Platform } from '@sonarwatch/portfolio-core';
|
3
3
|
export declare const platformId = "save";
|
4
|
+
export declare const platformDumpyId = "dumpy";
|
4
5
|
export declare const platform: Platform;
|
6
|
+
export declare const platformDumpy: Platform;
|
5
7
|
export declare const marketsPrefix = "save-markets";
|
6
8
|
export declare const marketsKey = "markets";
|
7
9
|
export declare const reservesPrefix = "save-reserves";
|
@@ -1,8 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.slndMint = exports.externalRewardStatsEndpoint = exports.rewardProofsEndpoint = exports.mainMarket = exports.wadsDecimal = exports.reserveEndpoint = exports.marketsEndpoint = exports.merkleProgramId = exports.pid = exports.rewardStatsKey = exports.rewardStatsPrefix = exports.reservesPrefix = exports.marketsKey = exports.marketsPrefix = exports.platform = exports.platformId = void 0;
|
3
|
+
exports.slndMint = exports.externalRewardStatsEndpoint = exports.rewardProofsEndpoint = exports.mainMarket = exports.wadsDecimal = exports.reserveEndpoint = exports.marketsEndpoint = exports.merkleProgramId = exports.pid = exports.rewardStatsKey = exports.rewardStatsPrefix = exports.reservesPrefix = exports.marketsKey = exports.marketsPrefix = exports.platformDumpy = exports.platform = exports.platformDumpyId = exports.platformId = void 0;
|
4
4
|
const web3_js_1 = require("@solana/web3.js");
|
5
5
|
exports.platformId = 'save';
|
6
|
+
exports.platformDumpyId = 'dumpy';
|
6
7
|
exports.platform = {
|
7
8
|
id: exports.platformId,
|
8
9
|
name: 'Save',
|
@@ -10,6 +11,13 @@ exports.platform = {
|
|
10
11
|
defiLlamaId: 'save',
|
11
12
|
website: 'https://save.finance/',
|
12
13
|
};
|
14
|
+
exports.platformDumpy = {
|
15
|
+
id: exports.platformDumpyId,
|
16
|
+
name: 'Dumpy',
|
17
|
+
image: 'https://sonar.watch/img/platforms/dumpy.webp',
|
18
|
+
// defiLlamaId: 'dumpy',
|
19
|
+
website: 'https://dumpy.fun/',
|
20
|
+
};
|
13
21
|
exports.marketsPrefix = `${exports.platformId}-markets`;
|
14
22
|
exports.marketsKey = 'markets';
|
15
23
|
exports.reservesPrefix = `${exports.platformId}-reserves`;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/save/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,MAAM,CAAC;AACpB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,6CAA6C;IACpD,WAAW,EAAE,MAAM;IACnB,OAAO,EAAE,uBAAuB;CACjC,CAAC;
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/save/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,MAAM,CAAC;AACpB,QAAA,eAAe,GAAG,OAAO,CAAC;AAE1B,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,6CAA6C;IACpD,WAAW,EAAE,MAAM;IACnB,OAAO,EAAE,uBAAuB;CACjC,CAAC;AAEW,QAAA,aAAa,GAAa;IACrC,EAAE,EAAE,uBAAe;IACnB,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,8CAA8C;IACrD,wBAAwB;IACxB,OAAO,EAAE,oBAAoB;CAC9B,CAAC;AAEW,QAAA,aAAa,GAAG,GAAG,kBAAU,UAAU,CAAC;AACxC,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,cAAc,GAAG,GAAG,kBAAU,WAAW,CAAC;AAC1C,QAAA,iBAAiB,GAAG,GAAG,kBAAU,eAAe,CAAC;AACjD,QAAA,cAAc,GAAG,cAAc,CAAC;AAEhC,QAAA,GAAG,GAAG,IAAI,mBAAS,CAAC,6CAA6C,CAAC,CAAC;AACnE,QAAA,eAAe,GAAG,IAAI,mBAAS,CAC1C,6CAA6C,CAC9C,CAAC;AACW,QAAA,eAAe,GAAG,6CAA6C,CAAC;AAChE,QAAA,eAAe,GAAG,4CAA4C,CAAC;AAC/D,QAAA,WAAW,GAAG,EAAE,CAAC;AACjB,QAAA,UAAU,GAAG,8CAA8C,CAAC;AAC5D,QAAA,oBAAoB,GAC/B,qEAAqE,CAAC;AAC3D,QAAA,2BAA2B,GACtC,8EAA8E,CAAC;AAEpE,QAAA,QAAQ,GAAG,6CAA6C,CAAC"}
|
@@ -1,9 +1,9 @@
|
|
1
1
|
/// <reference types="node" />
|
2
|
-
import { PortfolioElement
|
3
|
-
import { AccountInfo } from '@solana/web3.js';
|
2
|
+
import { PortfolioElement } from '@sonarwatch/portfolio-core';
|
4
3
|
import { Obligation } from './structs';
|
5
4
|
import { ParsedAccount } from '../../utils/solana';
|
6
5
|
import { MarketInfo, ReserveInfo } from './types';
|
6
|
+
import { Cache } from '../../Cache';
|
7
7
|
export declare const upperFirst: (string: string) => string;
|
8
8
|
export declare function getObligationSeed(marketAddress: string, accountId: number): string;
|
9
9
|
export declare const parseDataflat: (dataFlat: Buffer, depositsLen: number, borrowsLen: number) => {
|
@@ -12,4 +12,4 @@ export declare const parseDataflat: (dataFlat: Buffer, depositsLen: number, borr
|
|
12
12
|
borrows: import("./structs").ObligationLiquidity[];
|
13
13
|
borrowsMap: Map<string, import("./structs").ObligationLiquidity>;
|
14
14
|
};
|
15
|
-
export declare function getElementsFromObligations(obligations: ParsedAccount<Obligation>[], reserveByAddress: Map<string, ReserveInfo>, marketByAddress: Map<string, MarketInfo>,
|
15
|
+
export declare function getElementsFromObligations(obligations: ParsedAccount<Obligation>[], reserveByAddress: Map<string, ReserveInfo>, marketByAddress: Map<string, MarketInfo>, owner: string, cache: Cache): Promise<PortfolioElement[]>;
|