@sonarwatch/portfolio-plugins 0.14.3 → 0.14.5
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1604 -1591
- package/README.md +3 -3
- package/package.json +1 -1
- package/src/plugins/01/depostisFetcher.js +4 -3
- package/src/plugins/01/depostisFetcher.js.map +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/debridge/airdropFetcher.d.ts +1 -0
- package/src/plugins/debridge/airdropFetcher.js +42 -11
- package/src/plugins/debridge/airdropFetcher.js.map +1 -1
- package/src/plugins/debridge/dlmmVaultsFetcher.js +29 -87
- package/src/plugins/debridge/dlmmVaultsFetcher.js.map +1 -1
- package/src/plugins/debridge/index.js +1 -1
- package/src/plugins/debridge/index.js.map +1 -1
- package/src/plugins/debridge/types.d.ts +1 -1
- package/src/plugins/nxfinance/constants.js +1 -0
- package/src/plugins/nxfinance/constants.js.map +1 -1
- package/src/plugins/nxfinance/positionsFetcher.js +3 -0
- package/src/plugins/nxfinance/positionsFetcher.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/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
@@ -40,9 +40,10 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
40
40
|
const mint = constants_1.mints[i];
|
41
41
|
if (mint === '1111111111111111111111111111111111111111111')
|
42
42
|
continue;
|
43
|
-
const amount =
|
44
|
-
|
45
|
-
|
43
|
+
const amount = [
|
44
|
+
'So11111111111111111111111111111111111111112',
|
45
|
+
'mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So',
|
46
|
+
].includes(mint)
|
46
47
|
? rawAmount.dividedBy(1000)
|
47
48
|
: rawAmount;
|
48
49
|
if (amount.isLessThan('0.0001'))
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"depostisFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/01/depostisFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAOoC;AACpC,6CAA4C;AAG5C,2CAAgD;AAChD,uCAAmC;AACnC,kFAA+E;AAC/E,qCAAwC;AACxC,iDAAsD;AACtD,iDAA+D;AAC/D,qGAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,GAAG,GAAG,IAAA,gBAAM,EAAC,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IACzC,MAAM,OAAO,GAAG,MAAM,IAAA,2CAAoB,EAAC,MAAM,EAAE,qBAAY,EAAE,GAAG,CAAC,CAAC;IAEtE,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IAExB,MAAM,cAAc,GAAqB,EAAE,CAAC;IAC5C,MAAM,cAAc,GAAc,EAAE,CAAC;IACrC,MAAM,cAAc,GAAqB,EAAE,CAAC;IAC5C,MAAM,cAAc,GAAc,EAAE,CAAC;IACrC,MAAM,YAAY,GAAqB,EAAE,CAAC;IAC1C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACnD,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QACzC,MAAM,SAAS,GAAG,IAAA,kCAAwB,EAAC,UAAU,CAAC,CAAC;QACvD,IAAI,SAAS,CAAC,mBAAmB,CAAC,CAA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AAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,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;
|
@@ -12,7 +12,7 @@ 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.airdropFetcherSolana = exports.airdropFetcherEvm = void 0;
|
15
|
+
exports.fetcher = exports.airdropFetcherSolana = exports.airdropFetcherEvm = void 0;
|
16
16
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
17
17
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
18
18
|
const axios_1 = __importDefault(require("axios"));
|
@@ -23,9 +23,9 @@ const realDistributions = [
|
|
23
23
|
'Claim 50% vested with bonus in 6 months after TGE',
|
24
24
|
'First distribution',
|
25
25
|
];
|
26
|
-
const
|
26
|
+
const executorSolana = (owner) => __awaiter(void 0, void 0, void 0, function* () {
|
27
27
|
const apiRes = yield axios_1.default.get(constants_1.apiUrl + owner, {
|
28
|
-
timeout:
|
28
|
+
timeout: 3000,
|
29
29
|
});
|
30
30
|
if (!apiRes.data.distributions || apiRes.data.distributions.length === 0) {
|
31
31
|
return (0, AirdropFetcher_1.getAirdropRaw)({
|
@@ -59,20 +59,51 @@ const executor = (owner) => __awaiter(void 0, void 0, void 0, function* () {
|
|
59
59
|
items,
|
60
60
|
});
|
61
61
|
});
|
62
|
+
const executorEvm = (owner) => __awaiter(void 0, void 0, void 0, function* () {
|
63
|
+
const apiRes = yield axios_1.default.get(constants_1.apiUrl + owner, {
|
64
|
+
timeout: 3000,
|
65
|
+
});
|
66
|
+
if (!apiRes.data.distributions || apiRes.data.distributions.length === 0) {
|
67
|
+
return (0, AirdropFetcher_1.getAirdropRaw)({
|
68
|
+
statics: constants_1.firstDistribStatics,
|
69
|
+
items: [
|
70
|
+
{
|
71
|
+
amount: 0,
|
72
|
+
isClaimed: false,
|
73
|
+
label: 'DBR',
|
74
|
+
address: undefined,
|
75
|
+
imageUri: constants_1.dbrMint ? undefined : constants_1.platform.image,
|
76
|
+
},
|
77
|
+
],
|
78
|
+
});
|
79
|
+
}
|
80
|
+
const items = [];
|
81
|
+
for (const distribution of apiRes.data.distributions) {
|
82
|
+
if (!realDistributions.includes(distribution.title))
|
83
|
+
continue;
|
84
|
+
const tokens = new bignumber_js_1.default(distribution.tokens).div(dbrFactor);
|
85
|
+
items.push({
|
86
|
+
amount: tokens.toNumber(),
|
87
|
+
isClaimed: false,
|
88
|
+
label: 'DBR',
|
89
|
+
address: undefined,
|
90
|
+
imageUri: constants_1.dbrMint ? undefined : constants_1.platform.image,
|
91
|
+
});
|
92
|
+
}
|
93
|
+
return (0, AirdropFetcher_1.getAirdropRaw)({
|
94
|
+
statics: constants_1.firstDistribStatics,
|
95
|
+
items,
|
96
|
+
});
|
97
|
+
});
|
62
98
|
exports.airdropFetcherEvm = {
|
63
99
|
id: `${constants_1.firstDistribStatics.id}-evm`,
|
64
100
|
networkId: portfolio_core_1.NetworkId.ethereum,
|
65
|
-
executor,
|
101
|
+
executor: executorEvm,
|
66
102
|
};
|
67
103
|
exports.airdropFetcherSolana = {
|
68
104
|
id: `${constants_1.firstDistribStatics.id}-solana`,
|
69
105
|
networkId: portfolio_core_1.NetworkId.solana,
|
70
|
-
executor,
|
106
|
+
executor: executorSolana,
|
71
107
|
};
|
72
|
-
|
73
|
-
// airdropFetcher,
|
74
|
-
// platform.id,
|
75
|
-
// 'deepbook-airdrop',
|
76
|
-
// airdropStatics.claimEnd
|
77
|
-
// );
|
108
|
+
exports.fetcher = (0, AirdropFetcher_1.airdropFetcherToFetcher)(exports.airdropFetcherSolana, constants_1.platform.id, 'debridge-airdrop', constants_1.firstDistribStatics.claimEnd);
|
78
109
|
//# sourceMappingURL=airdropFetcher.js.map
|
@@ -1 +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,
|
1
|
+
{"version":3,"file":"airdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/debridge/airdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,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B,SAAS,EAAE,KAAK;YAChB,KAAK,EAAE,KAAK;YACZ,OAAO,EAAE,SAAS;YAClB,QAAQ,EAAE,mBAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,oBAAW,CAAC,KAAK;SAClD,CAAC,CAAC;IACL,CAAC;IAED,OAAO,IAAA,8BAAa,EAAC;QACnB,OAAO,EAAE,+BAAmB;QAC5B,KAAK;KACN,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEW,QAAA,iBAAiB,GAAmB;IAC/C,EAAE,EAAE,GAAG,+BAAmB,CAAC,EAAE,MAAM;IACnC,SAAS,EAAE,0BAAS,CAAC,QAAQ;IAC7B,QAAQ,EAAE,WAAW;CACtB,CAAC;AAEW,QAAA,oBAAoB,GAAmB;IAClD,EAAE,EAAE,GAAG,+BAAmB,CAAC,EAAE,SAAS;IACtC,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ,EAAE,cAAc;CACzB,CAAC;AACW,QAAA,OAAO,GAAG,IAAA,wCAAuB,EAC5C,4BAAoB,EACpB,oBAAQ,CAAC,EAAE,EACX,kBAAkB,EAClB,+BAAmB,CAAC,QAAQ,CAC7B,CAAC"}
|
@@ -15,7 +15,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
15
|
};
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
17
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
18
|
-
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
19
18
|
const clients_1 = require("../../utils/clients");
|
20
19
|
const constants_1 = require("./constants");
|
21
20
|
const solana_1 = require("../../utils/solana");
|
@@ -25,31 +24,9 @@ const constants_2 = require("../meteora/constants");
|
|
25
24
|
const slotTtl = 30000;
|
26
25
|
let slot = null;
|
27
26
|
let slotUpdate = 0;
|
27
|
+
const pricePerDbrToken = 0.025;
|
28
28
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
29
29
|
const client = (0, clients_1.getClientSolana)();
|
30
|
-
const accounts = yield (0, solana_1.getParsedProgramAccounts)(client, struct_1.escrowStruct, constants_1.dlmmVaultProgramId, [
|
31
|
-
{ dataSize: struct_1.escrowStruct.byteSize },
|
32
|
-
{
|
33
|
-
memcmp: {
|
34
|
-
offset: 40,
|
35
|
-
bytes: owner,
|
36
|
-
},
|
37
|
-
},
|
38
|
-
// {
|
39
|
-
// memcmp: {
|
40
|
-
// offset: 8,
|
41
|
-
// bytes: 'CGZvC5MWsu1bc3vRis619ZBEtvuPqoXrtBMeV9RrKFJp',
|
42
|
-
// },
|
43
|
-
// },
|
44
|
-
// {
|
45
|
-
// memcmp: {
|
46
|
-
// offset: 96,
|
47
|
-
// bytes: '1', // refunded === false
|
48
|
-
// },
|
49
|
-
// },
|
50
|
-
]);
|
51
|
-
if (accounts.length === 0)
|
52
|
-
return [];
|
53
30
|
const vaults = yield cache.getItem(constants_2.dlmmVaultsKey, {
|
54
31
|
prefix: constants_1.platformId,
|
55
32
|
networkId: portfolio_core_1.NetworkId.solana,
|
@@ -62,6 +39,17 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
62
39
|
}
|
63
40
|
if (!slot)
|
64
41
|
return [];
|
42
|
+
const accounts = yield (0, solana_1.getParsedProgramAccounts)(client, struct_1.escrowStruct, constants_1.dlmmVaultProgramId, [
|
43
|
+
{ dataSize: struct_1.escrowStruct.byteSize },
|
44
|
+
{
|
45
|
+
memcmp: {
|
46
|
+
offset: 40,
|
47
|
+
bytes: owner,
|
48
|
+
},
|
49
|
+
},
|
50
|
+
]);
|
51
|
+
if (accounts.length === 0)
|
52
|
+
return [];
|
65
53
|
const tokenPrices = yield cache.getTokenPricesAsMap(accounts
|
66
54
|
.map((a) => {
|
67
55
|
const v = vaults[a.dlmmVault.toString()];
|
@@ -69,70 +57,24 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
69
57
|
})
|
70
58
|
.flat(), portfolio_core_1.NetworkId.solana);
|
71
59
|
const assets = [];
|
72
|
-
|
73
|
-
if (!slot)
|
74
|
-
return;
|
60
|
+
for (const escrow of accounts) {
|
75
61
|
const vault = vaults[escrow.dlmmVault.toString()];
|
76
62
|
if (!vault)
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
.toNumber();
|
93
|
-
if (escrow.refunded === 0 && filledRatio > 1) {
|
94
|
-
const tpQuote = tokenPrices.get(vault.quoteMint);
|
95
|
-
if (!tpQuote)
|
96
|
-
return;
|
97
|
-
const amount = new bignumber_js_1.default(escrow.totalDeposit)
|
98
|
-
.div(Math.pow(10, tpQuote.decimals))
|
99
|
-
.times(1 - 1 / filledRatio)
|
100
|
-
.toNumber();
|
101
|
-
assets.push((0, tokenPriceToAssetToken_1.default)(vault.quoteMint, amount, portfolio_core_1.NetworkId.solana, tpQuote, undefined, {
|
102
|
-
isClaimable: true,
|
103
|
-
}));
|
104
|
-
}
|
105
|
-
const tpBase = tokenPrices.get(vault.baseMint);
|
106
|
-
if (!tpBase)
|
107
|
-
return;
|
108
|
-
const shares = new bignumber_js_1.default(escrow.totalDeposit).div(vault.totalDeposit);
|
109
|
-
const totalAmount = new bignumber_js_1.default(vault.boughtToken).times(shares);
|
110
|
-
const remainingAmount = totalAmount.minus(escrow.claimedToken);
|
111
|
-
if (remainingAmount.isZero())
|
112
|
-
return;
|
113
|
-
let claimableAmount = new bignumber_js_1.default(remainingAmount.toString());
|
114
|
-
if (slot < Number(vault.endVestingSlot)) {
|
115
|
-
const amountPerSlot = new bignumber_js_1.default(totalAmount).div(Number(vault.endVestingSlot) - Number(vault.startVestingSlot));
|
116
|
-
let lastClaimedSlot = escrow.lastClaimedSlot.isZero()
|
117
|
-
? Number(vault.startVestingSlot)
|
118
|
-
: escrow.lastClaimedSlot.toNumber();
|
119
|
-
if (lastClaimedSlot > slot)
|
120
|
-
lastClaimedSlot = slot;
|
121
|
-
claimableAmount = amountPerSlot.times(Math.min(slot, Number(vault.endVestingSlot)) - lastClaimedSlot);
|
122
|
-
}
|
123
|
-
if (claimableAmount.isGreaterThan(0)) {
|
124
|
-
assets.push((0, tokenPriceToAssetToken_1.default)(vault.baseMint, claimableAmount.div(Math.pow(10, tpBase.decimals)).toNumber(), portfolio_core_1.NetworkId.solana, tpBase, undefined, {
|
125
|
-
isClaimable: true,
|
126
|
-
}));
|
127
|
-
}
|
128
|
-
const vestingAmount = remainingAmount.minus(claimableAmount);
|
129
|
-
if (vestingAmount.isGreaterThan(0)) {
|
130
|
-
assets.push((0, tokenPriceToAssetToken_1.default)(vault.baseMint, vestingAmount.div(Math.pow(10, tpBase.decimals)).toNumber(), portfolio_core_1.NetworkId.solana, tpBase, undefined, {
|
131
|
-
tags: ['Vesting'],
|
132
|
-
}));
|
133
|
-
}
|
134
|
-
}
|
135
|
-
});
|
63
|
+
continue;
|
64
|
+
const [quoteTokenPrice, baseTokenPrice] = [
|
65
|
+
tokenPrices.get(vault.quoteMint),
|
66
|
+
tokenPrices.get(vault.baseMint),
|
67
|
+
];
|
68
|
+
if (!quoteTokenPrice)
|
69
|
+
continue;
|
70
|
+
const totalTokenEligible = escrow.totalDeposit
|
71
|
+
.dividedBy(Math.pow(10, quoteTokenPrice.decimals))
|
72
|
+
.dividedBy(pricePerDbrToken);
|
73
|
+
const remainingClaimableTokens = totalTokenEligible.minus(escrow.claimedToken.dividedBy(Math.pow(10, constants_1.dbrDecimals)));
|
74
|
+
if (remainingClaimableTokens.isLessThanOrEqualTo(0))
|
75
|
+
continue;
|
76
|
+
assets.push((0, tokenPriceToAssetToken_1.default)(vault.baseMint, remainingClaimableTokens.toNumber(), portfolio_core_1.NetworkId.solana, baseTokenPrice, undefined, { lockedUntil: 1744876800000 }));
|
77
|
+
}
|
136
78
|
if (assets.length === 0)
|
137
79
|
return [];
|
138
80
|
return [
|
@@ -141,7 +83,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
141
83
|
type: portfolio_core_1.PortfolioElementType.multiple,
|
142
84
|
label: 'Vesting',
|
143
85
|
platformId: constants_1.platformId,
|
144
|
-
name: '
|
86
|
+
name: 'LFG Vault',
|
145
87
|
data: {
|
146
88
|
assets,
|
147
89
|
},
|
@@ -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":"dlmmVaultsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/debridge/dlmmVaultsFetcher.ts"],"names":[],"mappings":";AAAA,2BAA2B;AAC3B,mBAAmB;;;;;;;;;;;;;;AAEnB,+DAKoC;AAIpC,iDAAsD;AACtD,2CAA0E;AAC1E,+CAA8D;AAC9D,qGAA6E;AAC7E,8CAAiD;AAEjD,oDAAqD;AAErD,MAAM,OAAO,GAAG,KAAK,CAAC;AACtB,IAAI,IAAI,GAAkB,IAAI,CAAC;AAC/B,IAAI,UAAU,GAAG,CAAC,CAAC;AACnB,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAE/B,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,OAAO,CAAmB,yBAAa,EAAE;QAClE,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;IACH,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IAEvB,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,G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|
10
10
|
const dlmmVaultsFetcher_1 = __importDefault(require("./dlmmVaultsFetcher"));
|
11
11
|
exports.platforms = [constants_1.platform];
|
12
12
|
exports.jobs = [dlmmVaultsJob_1.default];
|
13
|
-
exports.fetchers = [dlmmVaultsFetcher_1.default];
|
13
|
+
exports.fetchers = [dlmmVaultsFetcher_1.default, airdropFetcher_1.fetcher];
|
14
14
|
exports.airdropFetchers = [
|
15
15
|
airdropFetcher_1.airdropFetcherEvm,
|
16
16
|
airdropFetcher_1.airdropFetcherSolana,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/debridge/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/debridge/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,qDAI0B;AAE1B,oEAA4C;AAC5C,4EAAoD;AAEvC,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,uBAAa,CAAC,CAAC;AAC9B,QAAA,QAAQ,GAAc,CAAC,2BAAiB,EAAE,wBAAO,CAAC,CAAC;AACnD,QAAA,eAAe,GAAqB;IAC/C,kCAAiB;IACjB,qCAAoB;CACrB,CAAC"}
|
@@ -19,6 +19,7 @@ exports.leverageVaultsMints = [
|
|
19
19
|
'27G8MtK7VtTcCHkpASjSDdkWWYfoqT6ggEuKidVJidD4', // JLP
|
20
20
|
'jupSoLaHXQiZZTSfEWMTRRgpnyFm8f6sZdosWBjx93v', // JupSOL
|
21
21
|
'vSoLxydx6akxyMD9XEcPvGYNGq6Nn66oqVb3UkGkei7', // vSOL
|
22
|
+
'sSo14endRuUbvQaJS3dq36Q829a3A6BEfoeeRGJywEh', // sSOL
|
22
23
|
];
|
23
24
|
exports.nxfinanceLeverageIdlItem = {
|
24
25
|
programId: exports.leverageFiProgramID.toString(),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/nxfinance/constants.ts"],"names":[],"mappings":";;;AAEA,6CAA4C;AAC5C,+CAAqD;AACrD,uCAA6C;AAEhC,QAAA,UAAU,GAAG,WAAW,CAAC;AACzB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,kDAAkD;IACzD,OAAO,EAAE,uBAAuB;IAChC,OAAO,EAAE,gCAAgC;IACzC,WAAW,EAAE,YAAY,EAAE,sCAAsC;CAClE,CAAC;AAEW,QAAA,EAAE,GAAG,IAAI,mBAAS,CAAC,6CAA6C,CAAC,CAAC;AAElE,QAAA,mBAAmB,GAAG,IAAI,mBAAS,CAC9C,8CAA8C,CAC/C,CAAC;AAEW,QAAA,mBAAmB,GAAG;IACjC,8CAA8C,EAAE,MAAM;IACtD,6CAA6C,EAAE,SAAS;IACxD,6CAA6C,EAAE,OAAO;CACvD,CAAC;AAEW,QAAA,wBAAwB,GAAG;IACtC,SAAS,EAAE,2BAAmB,CAAC,QAAQ,EAAE;IACzC,GAAG,EAAE,kCAAoB;IACzB,OAAO,EAAE,QAAQ;CACP,CAAC;AAEA,QAAA,aAAa,GAAG,IAAI,mBAAS,CACxC,6CAA6C,CAC9C,CAAC;AAEW,QAAA,oBAAoB,GAAG;IAClC,SAAS,EAAE,qBAAa,CAAC,QAAQ,EAAE;IACnC,GAAG,EAAE,0BAAgB;IACrB,OAAO,EAAE,QAAQ;CACP,CAAC;AAEA,QAAA,cAAc,GAAG,eAAe,CAAC;AAEjC,QAAA,YAAY,GAAG;IAC1B,IAAI,mBAAS,CAAC,8CAA8C,CAAC;CAC9D,CAAC"}
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/nxfinance/constants.ts"],"names":[],"mappings":";;;AAEA,6CAA4C;AAC5C,+CAAqD;AACrD,uCAA6C;AAEhC,QAAA,UAAU,GAAG,WAAW,CAAC;AACzB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,kDAAkD;IACzD,OAAO,EAAE,uBAAuB;IAChC,OAAO,EAAE,gCAAgC;IACzC,WAAW,EAAE,YAAY,EAAE,sCAAsC;CAClE,CAAC;AAEW,QAAA,EAAE,GAAG,IAAI,mBAAS,CAAC,6CAA6C,CAAC,CAAC;AAElE,QAAA,mBAAmB,GAAG,IAAI,mBAAS,CAC9C,8CAA8C,CAC/C,CAAC;AAEW,QAAA,mBAAmB,GAAG;IACjC,8CAA8C,EAAE,MAAM;IACtD,6CAA6C,EAAE,SAAS;IACxD,6CAA6C,EAAE,OAAO;IACtD,6CAA6C,EAAE,OAAO;CACvD,CAAC;AAEW,QAAA,wBAAwB,GAAG;IACtC,SAAS,EAAE,2BAAmB,CAAC,QAAQ,EAAE;IACzC,GAAG,EAAE,kCAAoB;IACzB,OAAO,EAAE,QAAQ;CACP,CAAC;AAEA,QAAA,aAAa,GAAG,IAAI,mBAAS,CACxC,6CAA6C,CAC9C,CAAC;AAEW,QAAA,oBAAoB,GAAG;IAClC,SAAS,EAAE,qBAAa,CAAC,QAAQ,EAAE;IACnC,GAAG,EAAE,0BAAgB;IACrB,OAAO,EAAE,QAAQ;CACP,CAAC;AAEA,QAAA,cAAc,GAAG,eAAe,CAAC;AAEjC,QAAA,YAAY,GAAG;IAC1B,IAAI,mBAAS,CAAC,8CAA8C,CAAC;CAC9D,CAAC"}
|
@@ -60,6 +60,9 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
60
60
|
amount,
|
61
61
|
};
|
62
62
|
if (constants_1.leverageVaultsMints.includes(deposit.tokenMint)) {
|
63
|
+
asset.amount = asset.amount
|
64
|
+
.multipliedBy(marginAccount.leverage)
|
65
|
+
.dividedBy(100);
|
63
66
|
elementBorrowlend.addSuppliedAsset(asset);
|
64
67
|
}
|
65
68
|
else {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"positionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/nxfinance/positionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+
|
1
|
+
{"version":3,"file":"positionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/nxfinance/positionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,6CAA4C;AAC5C,gEAAqC;AAErC,2CAMqB;AAErB,iDAAsD;AACtD,+CAAuE;AAEvE,uCAAiE;AACjE,gFAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,sBAAsB,GAAG,mBAAS,CAAC,sBAAsB,CAC7D;QACE,mBAAS,CAAC,sBAAsB,CAC9B,CAAC,cAAE,CAAC,QAAQ,EAAE,CAAC,EACf,+BAAmB,CACpB,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;QACf,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;QAC/B,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;KACvB,EACD,+BAAmB,CACpB,CAAC,CAAC,CAAC,CAAC;IAEL,MAAM,aAAa,GAAG,CACpB,MAAM,IAAA,0CAAiC,EACrC,UAAU,EACV,oCAAwB,EACxB,CAAC,sBAAsB,CAAC,CACzB,CACF,CAAC,CAAC,CAAC,CAAC;IAEL,IAAI,CAAC,aAAa;QAAE,OAAO,EAAE,CAAC;IAE9B,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,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AY,CAAC,cAAc,CAAC;SAClE,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,YAAY;IAC7B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -54,30 +54,30 @@ function sushiV3PairToUniV2(pair) {
|
|
54
54
|
}
|
55
55
|
function getV3PairsAddresses(url, length = 300) {
|
56
56
|
return __awaiter(this, void 0, void 0, function* () {
|
57
|
-
const query = (0, graphql_request_1.gql) `
|
58
|
-
{
|
59
|
-
pools(
|
60
|
-
orderBy: totalValueLockedUSD
|
61
|
-
first: ${length}
|
62
|
-
orderDirection: desc
|
63
|
-
where: { volumeUSD_not: "0", liquidity_not: "0" }
|
64
|
-
) {
|
65
|
-
id
|
66
|
-
token0Price
|
67
|
-
token1Price
|
68
|
-
liquidity
|
69
|
-
token0 {
|
70
|
-
id
|
71
|
-
totalSupply
|
72
|
-
decimals
|
73
|
-
}
|
74
|
-
token1 {
|
75
|
-
id
|
76
|
-
totalSupply
|
77
|
-
decimals
|
78
|
-
}
|
79
|
-
}
|
80
|
-
}
|
57
|
+
const query = (0, graphql_request_1.gql) `
|
58
|
+
{
|
59
|
+
pools(
|
60
|
+
orderBy: totalValueLockedUSD
|
61
|
+
first: ${length}
|
62
|
+
orderDirection: desc
|
63
|
+
where: { volumeUSD_not: "0", liquidity_not: "0" }
|
64
|
+
) {
|
65
|
+
id
|
66
|
+
token0Price
|
67
|
+
token1Price
|
68
|
+
liquidity
|
69
|
+
token0 {
|
70
|
+
id
|
71
|
+
totalSupply
|
72
|
+
decimals
|
73
|
+
}
|
74
|
+
token1 {
|
75
|
+
id
|
76
|
+
totalSupply
|
77
|
+
decimals
|
78
|
+
}
|
79
|
+
}
|
80
|
+
}
|
81
81
|
`;
|
82
82
|
const res = yield (0, graphql_request_1.default)(url, query);
|
83
83
|
const pools = res.pools;
|
@@ -40,28 +40,28 @@ function getPairKey(version) {
|
|
40
40
|
exports.getPairKey = getPairKey;
|
41
41
|
function getPairsV2FromTheGraph(url, length = 300) {
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
43
|
-
const query = (0, graphql_request_1.gql) `
|
44
|
-
{
|
45
|
-
pairs(
|
46
|
-
orderBy: reserveUSD
|
47
|
-
first: ${length}
|
48
|
-
orderDirection: desc
|
49
|
-
where: { trackedReserveETH_not: "0" }
|
50
|
-
) {
|
51
|
-
id
|
52
|
-
reserve0
|
53
|
-
reserve1
|
54
|
-
totalSupply
|
55
|
-
token0 {
|
56
|
-
id
|
57
|
-
decimals
|
58
|
-
}
|
59
|
-
token1 {
|
60
|
-
id
|
61
|
-
decimals
|
62
|
-
}
|
63
|
-
}
|
64
|
-
}
|
43
|
+
const query = (0, graphql_request_1.gql) `
|
44
|
+
{
|
45
|
+
pairs(
|
46
|
+
orderBy: reserveUSD
|
47
|
+
first: ${length}
|
48
|
+
orderDirection: desc
|
49
|
+
where: { trackedReserveETH_not: "0" }
|
50
|
+
) {
|
51
|
+
id
|
52
|
+
reserve0
|
53
|
+
reserve1
|
54
|
+
totalSupply
|
55
|
+
token0 {
|
56
|
+
id
|
57
|
+
decimals
|
58
|
+
}
|
59
|
+
token1 {
|
60
|
+
id
|
61
|
+
decimals
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
65
|
`;
|
66
66
|
const res = yield (0, graphql_request_1.default)(url, query);
|
67
67
|
const pairs = res.pairs;
|
@@ -42,20 +42,20 @@ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/token
|
|
42
42
|
const clients_1 = require("../../utils/clients");
|
43
43
|
const getMultipleAccountsInfoSafe_1 = require("../../utils/solana/getMultipleAccountsInfoSafe");
|
44
44
|
const helpers_1 = require("./helpers");
|
45
|
-
const query = (0, graphql_request_1.gql) `
|
46
|
-
query GetAirdropFinalFrontend($authority: String!) {
|
47
|
-
getAirdropFinalFrontend(authority: $authority) {
|
48
|
-
authority
|
49
|
-
community_allocation
|
50
|
-
eligibility
|
51
|
-
main_allocation
|
52
|
-
og_allocation
|
53
|
-
s1_allocation
|
54
|
-
s2_allocation
|
55
|
-
total_allocation
|
56
|
-
__typename
|
57
|
-
}
|
58
|
-
}
|
45
|
+
const query = (0, graphql_request_1.gql) `
|
46
|
+
query GetAirdropFinalFrontend($authority: String!) {
|
47
|
+
getAirdropFinalFrontend(authority: $authority) {
|
48
|
+
authority
|
49
|
+
community_allocation
|
50
|
+
eligibility
|
51
|
+
main_allocation
|
52
|
+
og_allocation
|
53
|
+
s1_allocation
|
54
|
+
s2_allocation
|
55
|
+
total_allocation
|
56
|
+
__typename
|
57
|
+
}
|
58
|
+
}
|
59
59
|
`;
|
60
60
|
const networkId = portfolio_core_1.NetworkId.solana;
|
61
61
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
@@ -1,16 +1,16 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.poolQueryMsg = exports.minterQueryMsg = exports.tokenInfoQueryMsg = exports.infoQueryMsg = void 0;
|
4
|
-
exports.infoQueryMsg = JSON.parse(`{
|
5
|
-
"info": {}
|
4
|
+
exports.infoQueryMsg = JSON.parse(`{
|
5
|
+
"info": {}
|
6
6
|
}`);
|
7
|
-
exports.tokenInfoQueryMsg = JSON.parse(`{
|
8
|
-
"token_info": {}
|
7
|
+
exports.tokenInfoQueryMsg = JSON.parse(`{
|
8
|
+
"token_info": {}
|
9
9
|
}`);
|
10
|
-
exports.minterQueryMsg = JSON.parse(`{
|
11
|
-
"minter": {}
|
10
|
+
exports.minterQueryMsg = JSON.parse(`{
|
11
|
+
"minter": {}
|
12
12
|
}`);
|
13
|
-
exports.poolQueryMsg = JSON.parse(`{
|
14
|
-
"pool": {}
|
13
|
+
exports.poolQueryMsg = JSON.parse(`{
|
14
|
+
"pool": {}
|
15
15
|
}`);
|
16
16
|
//# sourceMappingURL=constants.js.map
|
@@ -1,10 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
function getQueryBalanceByOwner(owner) {
|
4
|
-
return JSON.parse(`{
|
5
|
-
"balance": {
|
6
|
-
"address": "${owner}"
|
7
|
-
}
|
4
|
+
return JSON.parse(`{
|
5
|
+
"balance": {
|
6
|
+
"address": "${owner}"
|
7
|
+
}
|
8
8
|
}`);
|
9
9
|
}
|
10
10
|
exports.default = getQueryBalanceByOwner;
|