@sonarwatch/portfolio-plugins 0.12.178 → 0.12.180
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1514 -1506
- package/README.md +3 -3
- package/package.json +1 -1
- package/src/index.js +12 -0
- package/src/index.js.map +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/joule/constants.d.ts +6 -0
- package/src/plugins/joule/constants.js +16 -0
- package/src/plugins/joule/constants.js.map +1 -0
- package/src/plugins/joule/depositFetcher.d.ts +3 -0
- package/src/plugins/joule/depositFetcher.js +71 -0
- package/src/plugins/joule/depositFetcher.js.map +1 -0
- package/src/plugins/joule/index.d.ts +6 -0
- package/src/plugins/joule/index.js +13 -0
- package/src/plugins/joule/index.js.map +1 -0
- package/src/plugins/{loopscale → joule}/marketsJob.js +10 -3
- package/src/plugins/joule/marketsJob.js.map +1 -0
- package/src/plugins/joule/structs.d.ts +19 -0
- package/src/plugins/joule/structs.js +22 -0
- package/src/plugins/joule/structs.js.map +1 -0
- package/src/plugins/joule/types.d.ts +50 -0
- package/src/plugins/joule/types.js +3 -0
- package/src/plugins/joule/types.js.map +1 -0
- package/src/plugins/loopscale/constants.d.ts +3 -1
- package/src/plugins/loopscale/constants.js +4 -4
- package/src/plugins/loopscale/constants.js.map +1 -1
- package/src/plugins/loopscale/filters.d.ts +7 -0
- package/src/plugins/loopscale/filters.js +62 -0
- package/src/plugins/loopscale/filters.js.map +1 -0
- package/src/plugins/loopscale/helpers.d.ts +33 -0
- package/src/plugins/loopscale/helpers.js +162 -0
- package/src/plugins/loopscale/helpers.js.map +1 -0
- package/src/plugins/loopscale/index.js +1 -2
- package/src/plugins/loopscale/index.js.map +1 -1
- package/src/plugins/loopscale/positionsFetcher.js +89 -40
- package/src/plugins/loopscale/positionsFetcher.js.map +1 -1
- package/src/plugins/loopscale/structs.d.ts +95 -14
- package/src/plugins/loopscale/structs.js +87 -13
- package/src/plugins/loopscale/structs.js.map +1 -1
- package/src/plugins/meso/constants.d.ts +7 -0
- package/src/plugins/meso/constants.js +17 -0
- package/src/plugins/meso/constants.js.map +1 -0
- package/src/plugins/meso/depositFetcher.d.ts +3 -0
- package/src/plugins/meso/depositFetcher.js +93 -0
- package/src/plugins/meso/depositFetcher.js.map +1 -0
- package/src/plugins/meso/index.d.ts +6 -0
- package/src/plugins/meso/index.js +13 -0
- package/src/plugins/meso/index.js.map +1 -0
- package/src/plugins/meso/marketsJob.d.ts +3 -0
- package/src/plugins/meso/marketsJob.js +37 -0
- package/src/plugins/meso/marketsJob.js.map +1 -0
- package/src/plugins/meso/structs.d.ts +19 -0
- package/src/plugins/meso/structs.js +22 -0
- package/src/plugins/meso/structs.js.map +1 -0
- package/src/plugins/meso/types.d.ts +100 -0
- package/src/plugins/meso/types.js +9 -0
- package/src/plugins/meso/types.js.map +1 -0
- package/src/plugins/orca/getWhirlpoolPositions.js +4 -0
- package/src/plugins/orca/getWhirlpoolPositions.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/src/plugins/loopscale/marketsJob.js.map +0 -1
- /package/src/plugins/{loopscale → joule}/marketsJob.d.ts +0 -0
@@ -0,0 +1,93 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
13
|
+
const constants_1 = require("./constants");
|
14
|
+
const aptos_1 = require("../../utils/aptos");
|
15
|
+
const clients_1 = require("../../utils/clients");
|
16
|
+
const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
|
17
|
+
const MemoizedCache_1 = require("../../utils/misc/MemoizedCache");
|
18
|
+
const poolsMemo = new MemoizedCache_1.MemoizedCache(constants_1.marketsCacheKey, {
|
19
|
+
prefix: constants_1.platformId,
|
20
|
+
networkId: portfolio_core_1.NetworkId.aptos,
|
21
|
+
});
|
22
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
23
|
+
const client = (0, clients_1.getClientAptos)();
|
24
|
+
const userPosition = yield (0, aptos_1.getAccountResource)(client, owner, constants_1.userPositionType);
|
25
|
+
if (!userPosition)
|
26
|
+
return [];
|
27
|
+
const poolsData = yield poolsMemo.getItem(cache);
|
28
|
+
let lendingPools;
|
29
|
+
const tokenByInner = new Map();
|
30
|
+
const poolDataByInner = new Map();
|
31
|
+
if (!poolsData) {
|
32
|
+
lendingPools = yield Promise.all([
|
33
|
+
...userPosition.debt_shares.data.map((debt) => (0, aptos_1.getAccountResource)(client, debt.key.inner, constants_1.lendingPoolType)),
|
34
|
+
...userPosition.deposit_shares.data.map((dep) => (0, aptos_1.getAccountResource)(client, dep.key.inner, constants_1.lendingPoolType)),
|
35
|
+
]);
|
36
|
+
lendingPools.forEach((lP) => {
|
37
|
+
if (lP) {
|
38
|
+
tokenByInner.set(lP.extend_ref.self, lP.token);
|
39
|
+
}
|
40
|
+
});
|
41
|
+
}
|
42
|
+
else {
|
43
|
+
poolsData.forEach((pD) => poolDataByInner.set(pD.poolAddress, pD));
|
44
|
+
}
|
45
|
+
const registry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.aptos, constants_1.platformId);
|
46
|
+
const element = registry.addElementBorrowlend({
|
47
|
+
label: 'Lending',
|
48
|
+
});
|
49
|
+
for (const lendingPos of userPosition.deposit_shares.data) {
|
50
|
+
const poolData = poolDataByInner.get(lendingPos.key.inner);
|
51
|
+
const address = (poolData === null || poolData === void 0 ? void 0 : poolData.token) || tokenByInner.get(lendingPos.key.inner);
|
52
|
+
if (!address)
|
53
|
+
continue;
|
54
|
+
element.addSuppliedAsset({
|
55
|
+
address,
|
56
|
+
amount: Number(lendingPos.value),
|
57
|
+
});
|
58
|
+
if (!poolData)
|
59
|
+
continue;
|
60
|
+
element.addSuppliedYield([
|
61
|
+
{
|
62
|
+
apr: (0, portfolio_core_1.apyToApr)(poolData.depositApy / 100),
|
63
|
+
apy: poolData.depositApy / 100,
|
64
|
+
},
|
65
|
+
]);
|
66
|
+
}
|
67
|
+
for (const borrowPos of userPosition.debt_shares.data) {
|
68
|
+
const poolData = poolDataByInner.get(borrowPos.key.inner);
|
69
|
+
const address = (poolData === null || poolData === void 0 ? void 0 : poolData.token) || tokenByInner.get(borrowPos.key.inner);
|
70
|
+
if (!address)
|
71
|
+
continue;
|
72
|
+
element.addBorrowedAsset({
|
73
|
+
address,
|
74
|
+
amount: Number(borrowPos.value),
|
75
|
+
});
|
76
|
+
if (!poolData)
|
77
|
+
continue;
|
78
|
+
element.addBorrowedYield([
|
79
|
+
{
|
80
|
+
apr: (0, portfolio_core_1.apyToApr)(poolData.borrowApy / 100),
|
81
|
+
apy: poolData.borrowApy / 100,
|
82
|
+
},
|
83
|
+
]);
|
84
|
+
}
|
85
|
+
return registry.getElements(cache);
|
86
|
+
});
|
87
|
+
const fetcher = {
|
88
|
+
id: `${constants_1.platformId}-deposits`,
|
89
|
+
networkId: portfolio_core_1.NetworkId.aptos,
|
90
|
+
executor,
|
91
|
+
};
|
92
|
+
exports.default = fetcher;
|
93
|
+
//# sourceMappingURL=depositFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"depositFetcher.js","sourceRoot":"","sources":["../../../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CAAC;IAED,KAAK,MAAM,SAAS,IAAI,YAAY,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;QACtD,MAAM,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAC1D,MAAM,OAAO,GAAG,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK,KAAI,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACzE,IAAI,CAAC,OAAO;YAAE,SAAS;QAEvB,OAAO,CAAC,gBAAgB,CAAC;YACvB,OAAO;YACP,MAAM,EAAE,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC;SAChC,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ;YAAE,SAAS;QAExB,OAAO,CAAC,gBAAgB,CAAC;YACvB;gBACE,GAAG,EAAE,IAAA,yBAAQ,EAAC,QAAQ,CAAC,SAAS,GAAG,GAAG,CAAC;gBACvC,GAAG,EAAE,QAAQ,CAAC,SAAS,GAAG,GAAG;aAC9B;SACF,CAAC,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,SAAS,EAAE,0BAAS,CAAC,KAAK;IAC1B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -0,0 +1,13 @@
|
|
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.fetchers = exports.jobs = exports.platforms = void 0;
|
7
|
+
const constants_1 = require("./constants");
|
8
|
+
const marketsJob_1 = __importDefault(require("./marketsJob"));
|
9
|
+
const depositFetcher_1 = __importDefault(require("./depositFetcher"));
|
10
|
+
exports.platforms = [constants_1.platform];
|
11
|
+
exports.jobs = [marketsJob_1.default];
|
12
|
+
exports.fetchers = [depositFetcher_1.default];
|
13
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/meso/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,8DAAsC;AACtC,sEAA8C;AAEjC,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,oBAAU,CAAC,CAAC;AAC3B,QAAA,QAAQ,GAAc,CAAC,wBAAc,CAAC,CAAC"}
|
@@ -0,0 +1,37 @@
|
|
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 axios_1 = __importDefault(require("axios"));
|
16
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
17
|
+
const constants_1 = require("./constants");
|
18
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
19
|
+
const pools = yield axios_1.default.get(constants_1.poolsApi);
|
20
|
+
const poolsData = pools.data.datas.map((pool) => ({
|
21
|
+
borrowApy: pool.borrowApy,
|
22
|
+
depositApy: pool.supplyApy,
|
23
|
+
poolAddress: pool.poolAddress,
|
24
|
+
token: pool.tokenAddress,
|
25
|
+
}));
|
26
|
+
yield cache.setItem(constants_1.marketsCacheKey, poolsData, {
|
27
|
+
prefix: constants_1.platformId,
|
28
|
+
networkId: portfolio_core_1.NetworkId.aptos,
|
29
|
+
});
|
30
|
+
});
|
31
|
+
const job = {
|
32
|
+
id: `${constants_1.platformId}-markets`,
|
33
|
+
executor,
|
34
|
+
label: 'normal',
|
35
|
+
};
|
36
|
+
exports.default = job;
|
37
|
+
//# sourceMappingURL=marketsJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"marketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/meso/marketsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kDAA6C;AAC7C,+DAAuD;AAGvD,2CAAoE;AAGpE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,KAAK,GAAmC,MAAM,eAAK,CAAC,GAAG,CAAC,oBAAQ,CAAC,CAAC;IAExE,MAAM,SAAS,GAAe,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC5D,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,UAAU,EAAE,IAAI,CAAC,SAAS;QAC1B,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,KAAK,EAAE,IAAI,CAAC,YAAY;KACzB,CAAC,CAAC,CAAC;IAEJ,MAAM,KAAK,CAAC,OAAO,CAAC,2BAAe,EAAE,SAAS,EAAE;QAC9C,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,KAAK;KAC3B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import { BeetStruct } from '@metaplex-foundation/beet';
|
3
|
+
import { PublicKey } from '@solana/web3.js';
|
4
|
+
import BigNumber from 'bignumber.js';
|
5
|
+
export declare enum State {
|
6
|
+
Uninitialized = 0,
|
7
|
+
StakePool = 1,
|
8
|
+
InactiveStakePool = 2,
|
9
|
+
StakeAccount = 3
|
10
|
+
}
|
11
|
+
export type Liquidity = {
|
12
|
+
buffer: Buffer;
|
13
|
+
state: State;
|
14
|
+
mint: PublicKey;
|
15
|
+
owner: PublicKey;
|
16
|
+
amountDeposited: BigNumber;
|
17
|
+
space: number[];
|
18
|
+
};
|
19
|
+
export declare const liquidityStruct: BeetStruct<Liquidity, Partial<Liquidity>>;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.liquidityStruct = exports.State = void 0;
|
4
|
+
const beet_1 = require("@metaplex-foundation/beet");
|
5
|
+
const beet_solana_1 = require("@metaplex-foundation/beet-solana");
|
6
|
+
const solana_1 = require("../../utils/solana");
|
7
|
+
var State;
|
8
|
+
(function (State) {
|
9
|
+
State[State["Uninitialized"] = 0] = "Uninitialized";
|
10
|
+
State[State["StakePool"] = 1] = "StakePool";
|
11
|
+
State[State["InactiveStakePool"] = 2] = "InactiveStakePool";
|
12
|
+
State[State["StakeAccount"] = 3] = "StakeAccount";
|
13
|
+
})(State || (exports.State = State = {}));
|
14
|
+
exports.liquidityStruct = new beet_1.BeetStruct([
|
15
|
+
['buffer', (0, solana_1.blob)(8)],
|
16
|
+
['state', beet_1.u8],
|
17
|
+
['mint', beet_solana_1.publicKey],
|
18
|
+
['owner', beet_solana_1.publicKey],
|
19
|
+
['amountDeposited', solana_1.u64],
|
20
|
+
['space', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 128)],
|
21
|
+
], (args) => args);
|
22
|
+
//# sourceMappingURL=structs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/meso/structs.ts"],"names":[],"mappings":";;;AAAA,oDAImC;AACnC,kEAA6D;AAG7D,+CAA+C;AAE/C,IAAY,KAKX;AALD,WAAY,KAAK;IACf,mDAAa,CAAA;IACb,2CAAS,CAAA;IACT,2DAAiB,CAAA;IACjB,iDAAY,CAAA;AACd,CAAC,EALW,KAAK,qBAAL,KAAK,QAKhB;AAWY,QAAA,eAAe,GAAG,IAAI,iBAAU,CAC3C;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,OAAO,EAAE,SAAE,CAAC;IACb,CAAC,MAAM,EAAE,uBAAS,CAAC;IACnB,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,iBAAiB,EAAE,YAAG,CAAC;IACxB,CAAC,OAAO,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,GAAG,CAAC,CAAC;CAC1C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAiB,CAC5B,CAAC"}
|
@@ -0,0 +1,100 @@
|
|
1
|
+
export type UserPosition = {
|
2
|
+
debt_shares: ShareData;
|
3
|
+
deposit_shares: ShareData;
|
4
|
+
emode_id: string;
|
5
|
+
};
|
6
|
+
export type ShareData = {
|
7
|
+
data: ShareInfo[];
|
8
|
+
};
|
9
|
+
export type ShareInfo = {
|
10
|
+
key: Key;
|
11
|
+
value: string;
|
12
|
+
};
|
13
|
+
export type Key = {
|
14
|
+
inner: string;
|
15
|
+
};
|
16
|
+
export type LendingPool = {
|
17
|
+
borrow_rewards_pool: BorrowRewardsPool;
|
18
|
+
emode_id: string;
|
19
|
+
extend_ref: ExtendRef;
|
20
|
+
fungible_asset: BorrowRewardsPool;
|
21
|
+
supply_rewards_pool: BorrowRewardsPool;
|
22
|
+
token: string;
|
23
|
+
};
|
24
|
+
export type BorrowRewardsPool = {
|
25
|
+
inner: string;
|
26
|
+
};
|
27
|
+
export type ExtendRef = {
|
28
|
+
self: string;
|
29
|
+
};
|
30
|
+
export type PoolApiResponse = {
|
31
|
+
datas: Pool[];
|
32
|
+
total: number;
|
33
|
+
totalPages: number;
|
34
|
+
};
|
35
|
+
export type Pool = {
|
36
|
+
_id: string;
|
37
|
+
poolAddress: string;
|
38
|
+
__v: number;
|
39
|
+
baseBps: number;
|
40
|
+
borrowApy: number;
|
41
|
+
borrowCap: number;
|
42
|
+
borrowFeeBps: number;
|
43
|
+
borrowRewardsPool: string;
|
44
|
+
closeFactorBps: number;
|
45
|
+
createdAt: Date;
|
46
|
+
emodeBps: number;
|
47
|
+
emodeId: string;
|
48
|
+
emodeLiquidationThresholdBps: number;
|
49
|
+
fungibleAsset: string;
|
50
|
+
incentiveBorrowApy: number;
|
51
|
+
incentiveSupplyApy: number;
|
52
|
+
isPaused: boolean;
|
53
|
+
liquidationFeeBps: number;
|
54
|
+
liquidationThresholdBps: number;
|
55
|
+
maxBps: number;
|
56
|
+
normaBps: number;
|
57
|
+
optimalBps: number;
|
58
|
+
optimalUtilizationBps: number;
|
59
|
+
poolSupply: number;
|
60
|
+
protocolInterestFeeBps: number;
|
61
|
+
protocolLiquidationFeeBps: number;
|
62
|
+
supplyApy: number;
|
63
|
+
supplyCap: number;
|
64
|
+
supplyRewardsPool: string;
|
65
|
+
token: Token;
|
66
|
+
tokenAddress: string;
|
67
|
+
totalDebt: number;
|
68
|
+
totalDebtShares: number;
|
69
|
+
totalFees: number;
|
70
|
+
totalReserves: number;
|
71
|
+
totalSupplyShares: number;
|
72
|
+
updatedAt: Date;
|
73
|
+
stakingApr: number;
|
74
|
+
orderValue?: number;
|
75
|
+
};
|
76
|
+
export type Token = {
|
77
|
+
_id: string;
|
78
|
+
symbol: string;
|
79
|
+
name: string;
|
80
|
+
address: string;
|
81
|
+
decimals: number;
|
82
|
+
type: Type;
|
83
|
+
wrapAddress: string;
|
84
|
+
createdAt: Date;
|
85
|
+
updatedAt: Date;
|
86
|
+
__v: number;
|
87
|
+
price: number;
|
88
|
+
icon_uri?: string;
|
89
|
+
project_uri?: string;
|
90
|
+
};
|
91
|
+
export declare enum Type {
|
92
|
+
Coin = "COIN",
|
93
|
+
FungibleAsset = "FUNGIBLE_ASSET"
|
94
|
+
}
|
95
|
+
export type PoolData = {
|
96
|
+
borrowApy: number;
|
97
|
+
depositApy: number;
|
98
|
+
poolAddress: string;
|
99
|
+
token: string;
|
100
|
+
};
|
@@ -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["Coin"] = "COIN";
|
7
|
+
Type["FungibleAsset"] = "FUNGIBLE_ASSET";
|
8
|
+
})(Type || (exports.Type = Type = {}));
|
9
|
+
//# sourceMappingURL=types.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/meso/types.ts"],"names":[],"mappings":";;;AAoGA,IAAY,IAGX;AAHD,WAAY,IAAI;IACd,qBAAa,CAAA;IACb,wCAAgC,CAAA;AAClC,CAAC,EAHW,IAAI,oBAAJ,IAAI,QAGf"}
|
@@ -96,6 +96,9 @@ function getOrcaNftFetcher(platformId, programId) {
|
|
96
96
|
continue;
|
97
97
|
const assetTokenA = (0, tokenPriceToAssetToken_1.default)(whirlpoolInfo.tokenMintA.toString(), tokenAmountA.dividedBy(Math.pow(10, tokenPriceA.decimals)).toNumber(), portfolio_core_1.NetworkId.solana, tokenPriceA);
|
98
98
|
const assetTokenB = (0, tokenPriceToAssetToken_1.default)(whirlpoolInfo.tokenMintB.toString(), tokenAmountB.dividedBy(Math.pow(10, tokenPriceB.decimals)).toNumber(), portfolio_core_1.NetworkId.solana, tokenPriceB);
|
99
|
+
const tags = [];
|
100
|
+
if (tokenAmountA.isZero() || tokenAmountB.isZero())
|
101
|
+
tags.push('Out Of Range');
|
99
102
|
/* const feesAndRewards = calcFeesAndRewards(
|
100
103
|
whirlpoolInfo,
|
101
104
|
positionInfo,
|
@@ -209,6 +212,7 @@ function getOrcaNftFetcher(platformId, programId) {
|
|
209
212
|
},
|
210
213
|
],
|
211
214
|
},
|
215
|
+
tags,
|
212
216
|
});
|
213
217
|
}
|
214
218
|
return elements;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getWhirlpoolPositions.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/orca/getWhirlpoolPositions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAOoC;AACpC,6CAA4C;AAC5C,2CAIqB;AACrB,iDAAsD;AACtD,+CAG4B;AAE5B,mDAAgE;AAChE,qGAA6E;AAC7E,wFAAyF;AAEzF,iDAIwB;AAEX,QAAA,qBAAqB,GAAG,iBAAiB,CACpD,sBAAc,EACd,4BAAgB,CACjB,CAAC;AAEF,SAAgB,iBAAiB,CAC/B,UAAkB,EAClB,SAAoB;IAEpB,OAAO,CACL,KAAY,EACZ,IAAiC,EACJ,EAAE;QAC/B,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;QACjC,MAAM,uBAAuB,GAAgB,EAAE,CAAC;QAEhD,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACnB,MAAM,OAAO,GAAG,IAAI,mBAAS,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAEhD,MAAM,YAAY,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;YAEnE,MAAM,CAAC,cAAc,CAAC,GAAG,mBAAS,CAAC,sBAAsB,CACvD,YAAY,EACZ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C,QAAQ,EAAE,EAC7D,0BAAS,CAAC,MAAM,EAChB,WAAW,CACZ,CAAC;YAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAsFI;YAEJ,IACE,CAAC,WAAW;gBACZ,CAAC,WAAW;gBACZ,WAAW,CAAC,KAAK,KAAK,IAAI;gBAC1B,WAAW,CAAC,KAAK,KAAK,IAAI;gBAE1B,SAAS;YAEX,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC;YACpD,MAAM,iBAAiB,GAAG,IAAA,+BAAc,EACtC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CACjC,CAAC;YAEF,QAAQ,CAAC,IAAI,CAAC;gBACZ,IAAI,EAAE,qCAAoB,CAAC,SAAS;gBACpC,SAAS,EAAE,0BAAS,CAAC,MAAM;gBAC3B,UAAU;gBACV,KAAK,EAAE,eAAe;gBACtB,IAAI,EAAE,cAAc;gBACpB,KAAK,EAAE,KAAK,GAAG,CAAC,iBAAiB,IAAI,CAAC,CAAC;gBACvC,IAAI,EAAE;oBACJ,WAAW,EAAE;wBACX;4BACE,MAAM,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC;4BAClC,WAAW,EAAE,KAAK;4BAClB,YAAY;4BACZ,iBAAiB;4BACjB,KAAK,EAAE,KAAK,GAAG,CAAC,iBAAiB,IAAI,CAAC,CAAC;4BACvC,MAAM,EAAE,EAAE;yBACX;qBACF;iBACF;
|
1
|
+
{"version":3,"file":"getWhirlpoolPositions.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/orca/getWhirlpoolPositions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAOoC;AACpC,6CAA4C;AAC5C,2CAIqB;AACrB,iDAAsD;AACtD,+CAG4B;AAE5B,mDAA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CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CACjC,CAAC;YAEF,QAAQ,CAAC,IAAI,CAAC;gBACZ,IAAI,EAAE,qCAAoB,CAAC,SAAS;gBACpC,SAAS,EAAE,0BAAS,CAAC,MAAM;gBAC3B,UAAU;gBACV,KAAK,EAAE,eAAe;gBACtB,IAAI,EAAE,cAAc;gBACpB,KAAK,EAAE,KAAK,GAAG,CAAC,iBAAiB,IAAI,CAAC,CAAC;gBACvC,IAAI,EAAE;oBACJ,WAAW,EAAE;wBACX;4BACE,MAAM,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC;4BAClC,WAAW,EAAE,KAAK;4BAClB,YAAY;4BACZ,iBAAiB;4BACjB,KAAK,EAAE,KAAK,GAAG,CAAC,iBAAiB,IAAI,CAAC,CAAC;4BACvC,MAAM,EAAE,EAAE;yBACX;qBACF;iBACF;gBACD,IAAI;aACL,CAAC,CAAC;QACL,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAA,CAAC;AACJ,CAAC;AArPD,8CAqPC"}
|
@@ -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;
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"marketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/loopscale/marketsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,2CAA6D;AAE7D,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,eAAe,EAAE;QAChD,MAAM,EAAE,8BAAkB;QAC1B,SAAS,EAAE,0BAAS,CAAC,QAAQ;KAC9B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
File without changes
|