@sonarwatch/portfolio-plugins 0.14.0 → 0.14.2
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +21 -0
- package/package.json +2 -2
- package/src/index.js +4 -0
- package/src/index.js.map +1 -1
- package/src/plugins/debridge/airdropFetcher.js +6 -0
- package/src/plugins/debridge/airdropFetcher.js.map +1 -1
- package/src/plugins/debridge/constants.d.ts +3 -1
- package/src/plugins/debridge/constants.js +4 -2
- package/src/plugins/debridge/constants.js.map +1 -1
- package/src/plugins/debridge/dlmmVaultsFetcher.d.ts +3 -0
- package/src/plugins/debridge/dlmmVaultsFetcher.js +158 -0
- package/src/plugins/debridge/dlmmVaultsFetcher.js.map +1 -0
- package/src/plugins/debridge/dlmmVaultsJob.d.ts +3 -0
- package/src/plugins/debridge/dlmmVaultsJob.js +42 -0
- package/src/plugins/debridge/dlmmVaultsJob.js.map +1 -0
- package/src/plugins/debridge/index.js +7 -2
- package/src/plugins/debridge/index.js.map +1 -1
- package/src/plugins/deepbook/airdropFetcher.js +36 -14
- package/src/plugins/deepbook/airdropFetcher.js.map +1 -1
- package/src/plugins/jupiter/launchpad/constants.js +1 -1
- package/src/plugins/kamino/{s2AirdropFetcher.js → s2AirdropFetcher.old.js} +1 -1
- package/src/plugins/kamino/s2AirdropFetcher.old.js.map +1 -0
- package/src/plugins/native-stake/solana/constants.js +0 -1
- package/src/plugins/native-stake/solana/constants.js.map +1 -1
- package/src/plugins/native-stake/solana/solanaFetcher.js +11 -7
- package/src/plugins/native-stake/solana/solanaFetcher.js.map +1 -1
- package/src/plugins/nxfinance/positionsFetcher.js +1 -1
- package/src/plugins/nxfinance/positionsFetcher.js.map +1 -1
- package/src/plugins/scallop/cnyAirdropFetcher.js +1 -1
- package/src/plugins/scallop/cnyAirdropFetcher.js.map +1 -1
- package/src/plugins/scallop/constants.d.ts +9 -16
- package/src/plugins/scallop/constants.js +28 -44
- package/src/plugins/scallop/constants.js.map +1 -1
- package/src/plugins/scallop/index.js +7 -1
- package/src/plugins/scallop/index.js.map +1 -1
- package/src/plugins/scallop/lendingsFetcher.js +149 -79
- package/src/plugins/scallop/lendingsFetcher.js.map +1 -1
- package/src/plugins/scallop/marketJob.js.map +1 -1
- package/src/plugins/scallop/obligationsFetcher.js +2 -2
- package/src/plugins/scallop/obligationsFetcher.js.map +1 -1
- package/src/plugins/scallop/poolsJob.js +14 -5
- package/src/plugins/scallop/poolsJob.js.map +1 -1
- package/src/plugins/scallop/sCoinJob.js +2 -1
- package/src/plugins/scallop/sCoinJob.js.map +1 -1
- package/src/plugins/scallop/types/address.d.ts +1 -0
- package/src/plugins/scallop/types/basic.d.ts +4 -0
- package/src/plugins/scallop/types/coin.d.ts +18 -8
- package/src/plugins/scallop/types/coin.js +50 -2
- package/src/plugins/scallop/types/coin.js.map +1 -1
- package/src/plugins/scallop/types/data.d.ts +7 -5
- package/src/plugins/scallop/types/index.d.ts +2 -0
- package/src/plugins/scallop/types/index.js +2 -0
- package/src/plugins/scallop/types/index.js.map +1 -1
- package/src/plugins/scallop/types/spool.d.ts +10 -0
- package/src/plugins/scallop/types/spool.js +3 -0
- package/src/plugins/scallop/types/spool.js.map +1 -0
- package/src/plugins/scallop/types/sui.d.ts +2 -0
- package/src/plugins/scallop/types/sui.js +3 -0
- package/src/plugins/scallop/types/sui.js.map +1 -0
- package/src/plugins/scallop/types/vesca.d.ts +9 -12
- package/src/plugins/scallop/veScaFetcher.js +1 -1
- package/src/plugins/scallop/veScaFetcher.js.map +1 -1
- package/src/plugins/vaultka/constants.d.ts +8 -0
- package/src/plugins/vaultka/constants.js +31 -0
- package/src/plugins/vaultka/constants.js.map +1 -0
- package/src/plugins/vaultka/index.d.ts +6 -0
- package/src/plugins/vaultka/index.js +15 -0
- package/src/plugins/vaultka/index.js.map +1 -0
- package/src/plugins/vaultka/lendingFetcher.d.ts +3 -0
- package/src/plugins/vaultka/lendingFetcher.js +58 -0
- package/src/plugins/vaultka/lendingFetcher.js.map +1 -0
- package/src/plugins/vaultka/lendingJob.d.ts +3 -0
- package/src/plugins/vaultka/lendingJob.js +32 -0
- package/src/plugins/vaultka/lendingJob.js.map +1 -0
- package/src/plugins/vaultka/strategyFetcher.d.ts +3 -0
- package/src/plugins/vaultka/strategyFetcher.js +63 -0
- package/src/plugins/vaultka/strategyFetcher.js.map +1 -0
- package/src/plugins/vaultka/strategyJob.d.ts +3 -0
- package/src/plugins/vaultka/strategyJob.js +32 -0
- package/src/plugins/vaultka/strategyJob.js.map +1 -0
- package/src/plugins/vaultka/structs.d.ts +59 -0
- package/src/plugins/vaultka/structs.js +58 -0
- package/src/plugins/vaultka/structs.js.map +1 -0
- package/src/utils/sui/types.d.ts +4 -0
- package/src/plugins/kamino/s2AirdropFetcher.js.map +0 -1
- /package/src/plugins/kamino/{s2AirdropFetcher.d.ts → s2AirdropFetcher.old.d.ts} +0 -0
@@ -0,0 +1,32 @@
|
|
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 web3_js_1 = require("@solana/web3.js");
|
14
|
+
const constants_1 = require("./constants");
|
15
|
+
const structs_1 = require("./structs");
|
16
|
+
const clients_1 = require("../../utils/clients");
|
17
|
+
const getParsedAccountInfo_1 = require("../../utils/solana/getParsedAccountInfo");
|
18
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
19
|
+
const connection = (0, clients_1.getClientSolana)();
|
20
|
+
const lendings = yield Promise.all(constants_1.lendingProgramIds.map((lendingProgramId) => (0, getParsedAccountInfo_1.getParsedAccountInfo)(connection, structs_1.lendingStruct, web3_js_1.PublicKey.findProgramAddressSync([Buffer.from('LENDING')], lendingProgramId)[0])));
|
21
|
+
yield cache.setItem(constants_1.lendingsCacheKey, lendings, {
|
22
|
+
prefix: constants_1.platformId,
|
23
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
24
|
+
});
|
25
|
+
});
|
26
|
+
const job = {
|
27
|
+
id: `${constants_1.platformId}-lending`,
|
28
|
+
executor,
|
29
|
+
label: 'normal',
|
30
|
+
};
|
31
|
+
exports.default = job;
|
32
|
+
//# sourceMappingURL=lendingJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"lendingJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/vaultka/lendingJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AACvD,6CAA4C;AAG5C,2CAA8E;AAC9E,uCAA0C;AAC1C,iDAAsD;AACtD,kFAA+E;AAE/E,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAChC,6BAAiB,CAAC,GAAG,CAAC,CAAC,gBAAgB,EAAE,EAAE,CACzC,IAAA,2CAAoB,EAClB,UAAU,EACV,uBAAa,EACb,mBAAS,CAAC,sBAAsB,CAC9B,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EACxB,gBAAgB,CACjB,CAAC,CAAC,CAAC,CACL,CACF,CACF,CAAC;IAEF,MAAM,KAAK,CAAC,OAAO,CAAC,4BAAgB,EAAE,QAAQ,EAAE;QAC9C,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -0,0 +1,63 @@
|
|
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 web3_js_1 = require("@solana/web3.js");
|
14
|
+
const constants_1 = require("./constants");
|
15
|
+
const clients_1 = require("../../utils/clients");
|
16
|
+
const solana_1 = require("../../utils/solana");
|
17
|
+
const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
|
18
|
+
const structs_1 = require("./structs");
|
19
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
20
|
+
const connection = (0, clients_1.getClientSolana)();
|
21
|
+
const positionInfos = yield Promise.all(constants_1.strategies.map((strategy) => (0, solana_1.getParsedProgramAccounts)(connection, structs_1.positionInfoStruct, new web3_js_1.PublicKey(strategy), [
|
22
|
+
{
|
23
|
+
memcmp: {
|
24
|
+
offset: 24,
|
25
|
+
bytes: owner,
|
26
|
+
},
|
27
|
+
},
|
28
|
+
])));
|
29
|
+
if (!positionInfos || positionInfos.filter((u) => u !== null).length === 0)
|
30
|
+
return [];
|
31
|
+
const strategiesInfo = yield cache.getItem(constants_1.strategiesCacheKey, {
|
32
|
+
prefix: constants_1.platformId,
|
33
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
34
|
+
});
|
35
|
+
if (!strategiesInfo)
|
36
|
+
return [];
|
37
|
+
const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.solana, constants_1.platformId);
|
38
|
+
positionInfos.forEach((positionInfo, i) => {
|
39
|
+
if (positionInfo[0] &&
|
40
|
+
!positionInfo[0].liquidated &&
|
41
|
+
!positionInfo[0].closed) {
|
42
|
+
const element = elementRegistry.addElementBorrowlend({
|
43
|
+
label: 'Leverage',
|
44
|
+
});
|
45
|
+
element.addSuppliedAsset({
|
46
|
+
address: strategiesInfo[i].token_mint,
|
47
|
+
amount: positionInfo[0].position_amount,
|
48
|
+
});
|
49
|
+
element.addBorrowedAsset({
|
50
|
+
address: strategiesInfo[i].collateral_mint,
|
51
|
+
amount: positionInfo[0].leverage_amount,
|
52
|
+
});
|
53
|
+
}
|
54
|
+
});
|
55
|
+
return elementRegistry.getElements(cache);
|
56
|
+
});
|
57
|
+
const fetcher = {
|
58
|
+
id: `${constants_1.platformId}-strategy`,
|
59
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
60
|
+
executor,
|
61
|
+
};
|
62
|
+
exports.default = fetcher;
|
63
|
+
//# sourceMappingURL=strategyFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"strategyFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/vaultka/strategyFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AACvD,6CAA4C;AAE5C,2CAAyE;AAEzE,iDAAsD;AACtD,+CAA8D;AAC9D,gFAA6E;AAC7E,uCAAuE;AAEvE,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU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AAC,CAAC;YACH,OAAO,CAAC,gBAAgB,CAAC;gBACvB,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,eAAe;gBAC1C,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,eAAe;aACxC,CAAC,CAAC;QACL,CAAC;IACH,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,WAAW;IAC5B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -0,0 +1,32 @@
|
|
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 web3_js_1 = require("@solana/web3.js");
|
14
|
+
const constants_1 = require("./constants");
|
15
|
+
const structs_1 = require("./structs");
|
16
|
+
const clients_1 = require("../../utils/clients");
|
17
|
+
const getParsedAccountInfo_1 = require("../../utils/solana/getParsedAccountInfo");
|
18
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
19
|
+
const connection = (0, clients_1.getClientSolana)();
|
20
|
+
const strategys = yield Promise.all(constants_1.strategies.map((strategy) => (0, getParsedAccountInfo_1.getParsedAccountInfo)(connection, structs_1.strategyStruct, web3_js_1.PublicKey.findProgramAddressSync([Buffer.from('STRATEGY')], new web3_js_1.PublicKey(strategy))[0])));
|
21
|
+
yield cache.setItem(constants_1.strategiesCacheKey, strategys, {
|
22
|
+
prefix: constants_1.platformId,
|
23
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
24
|
+
});
|
25
|
+
});
|
26
|
+
const job = {
|
27
|
+
id: `${constants_1.platformId}-strategy`,
|
28
|
+
executor,
|
29
|
+
label: 'normal',
|
30
|
+
};
|
31
|
+
exports.default = job;
|
32
|
+
//# sourceMappingURL=strategyJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"strategyJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/vaultka/strategyJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AACvD,6CAA4C;AAG5C,2CAAyE;AACzE,uCAA2C;AAC3C,iDAAsD;AACtD,kFAA+E;AAE/E,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,GAAG,CACjC,sBAAU,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAC1B,IAAA,2CAAoB,EAClB,UAAU,EACV,wBAAc,EACd,mBAAS,CAAC,sBAAsB,CAC9B,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,EACzB,IAAI,mBAAS,CAAC,QAAQ,CAAC,CACxB,CAAC,CAAC,CAAC,CACL,CACF,CACF,CAAC;IAEF,MAAM,KAAK,CAAC,OAAO,CAAC,8BAAkB,EAAE,SAAS,EAAE;QACjD,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import { BeetStruct } from '@metaplex-foundation/beet';
|
3
|
+
import BigNumber from 'bignumber.js';
|
4
|
+
import { PublicKey } from '@solana/web3.js';
|
5
|
+
export type UserInfo = {
|
6
|
+
buffer: Buffer;
|
7
|
+
shares: BigNumber;
|
8
|
+
};
|
9
|
+
export declare const userInfoStruct: BeetStruct<UserInfo, Partial<UserInfo>>;
|
10
|
+
export type Lending = {
|
11
|
+
buffer: Buffer;
|
12
|
+
vault_balance: BigNumber;
|
13
|
+
borrowed_amount: BigNumber;
|
14
|
+
owner: PublicKey;
|
15
|
+
total_shares: BigNumber;
|
16
|
+
max_utilization_rate: BigNumber;
|
17
|
+
water_fee_receiver: PublicKey;
|
18
|
+
withdraw_fee: BigNumber;
|
19
|
+
withdraw_fee_receiver_ata: PublicKey;
|
20
|
+
mint: PublicKey;
|
21
|
+
};
|
22
|
+
export declare const lendingStruct: BeetStruct<Lending, Partial<Lending>>;
|
23
|
+
export type PositionInfo = {
|
24
|
+
buffer: Buffer;
|
25
|
+
amount: BigNumber;
|
26
|
+
pos_id: BigNumber;
|
27
|
+
user: PublicKey;
|
28
|
+
leverage: number;
|
29
|
+
closed: boolean;
|
30
|
+
liquidated: boolean;
|
31
|
+
leverage_amount: BigNumber;
|
32
|
+
is_in_deposit_request: boolean;
|
33
|
+
is_in_withdraw_request: boolean;
|
34
|
+
position_amount: BigNumber;
|
35
|
+
to_be_liquidated: boolean;
|
36
|
+
open_timestamp: BigNumber;
|
37
|
+
close_timestamp: BigNumber;
|
38
|
+
expected_amount_out_token: BigNumber;
|
39
|
+
expected_amount_out_collateral: BigNumber;
|
40
|
+
increase_position_collateral_pendings: BigNumber;
|
41
|
+
requests_slippage: number;
|
42
|
+
};
|
43
|
+
export declare const positionInfoStruct: BeetStruct<PositionInfo, Partial<PositionInfo>>;
|
44
|
+
export type Strategy = {
|
45
|
+
buffer: Buffer;
|
46
|
+
keeper: PublicKey;
|
47
|
+
keeper_ata: PublicKey;
|
48
|
+
next_position_id: BigNumber;
|
49
|
+
dtv_limit: BigNumber;
|
50
|
+
leverage_limit: BigNumber;
|
51
|
+
fixed_fee_split: BigNumber;
|
52
|
+
mfee_percent: BigNumber;
|
53
|
+
usdt_usd_feed: number[];
|
54
|
+
jlp_sol_feed: number[];
|
55
|
+
token_mint: PublicKey;
|
56
|
+
keeper_fees: BigNumber;
|
57
|
+
collateral_mint: PublicKey;
|
58
|
+
};
|
59
|
+
export declare const strategyStruct: BeetStruct<Strategy, Partial<Strategy>>;
|
@@ -0,0 +1,58 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.strategyStruct = exports.positionInfoStruct = exports.lendingStruct = exports.userInfoStruct = 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
|
+
exports.userInfoStruct = new beet_1.BeetStruct([
|
8
|
+
['buffer', (0, solana_1.blob)(8)],
|
9
|
+
['shares', solana_1.u128],
|
10
|
+
], (args) => args);
|
11
|
+
exports.lendingStruct = new beet_1.BeetStruct([
|
12
|
+
['buffer', (0, solana_1.blob)(8)],
|
13
|
+
['vault_balance', solana_1.u128],
|
14
|
+
['borrowed_amount', solana_1.u128],
|
15
|
+
['owner', beet_solana_1.publicKey],
|
16
|
+
['total_shares', solana_1.u128],
|
17
|
+
['max_utilization_rate', solana_1.u64],
|
18
|
+
['water_fee_receiver', beet_solana_1.publicKey],
|
19
|
+
['withdraw_fee', solana_1.u64],
|
20
|
+
['withdraw_fee_receiver_ata', beet_solana_1.publicKey],
|
21
|
+
['mint', beet_solana_1.publicKey],
|
22
|
+
], (args) => args);
|
23
|
+
exports.positionInfoStruct = new beet_1.BeetStruct([
|
24
|
+
['buffer', (0, solana_1.blob)(8)],
|
25
|
+
['amount', solana_1.u64],
|
26
|
+
['pos_id', solana_1.u64],
|
27
|
+
['user', beet_solana_1.publicKey],
|
28
|
+
['leverage', beet_1.u8],
|
29
|
+
['closed', beet_1.bool],
|
30
|
+
['liquidated', beet_1.bool],
|
31
|
+
['leverage_amount', solana_1.u64],
|
32
|
+
['is_in_deposit_request', beet_1.bool],
|
33
|
+
['is_in_withdraw_request', beet_1.bool],
|
34
|
+
['position_amount', solana_1.u64],
|
35
|
+
['to_be_liquidated', beet_1.bool],
|
36
|
+
['open_timestamp', solana_1.i64],
|
37
|
+
['close_timestamp', solana_1.i64],
|
38
|
+
['expected_amount_out_token', solana_1.u64],
|
39
|
+
['expected_amount_out_collateral', solana_1.u64],
|
40
|
+
['increase_position_collateral_pendings', solana_1.u64],
|
41
|
+
['requests_slippage', beet_1.u8],
|
42
|
+
], (args) => args);
|
43
|
+
exports.strategyStruct = new beet_1.BeetStruct([
|
44
|
+
['buffer', (0, solana_1.blob)(8)],
|
45
|
+
['keeper', beet_solana_1.publicKey],
|
46
|
+
['keeper_ata', beet_solana_1.publicKey],
|
47
|
+
['next_position_id', solana_1.u64],
|
48
|
+
['dtv_limit', solana_1.u64],
|
49
|
+
['leverage_limit', solana_1.u64],
|
50
|
+
['fixed_fee_split', solana_1.u64],
|
51
|
+
['mfee_percent', solana_1.u64],
|
52
|
+
['usdt_usd_feed', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 32)],
|
53
|
+
['jlp_sol_feed', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 32)],
|
54
|
+
['token_mint', beet_solana_1.publicKey],
|
55
|
+
['keeper_fees', solana_1.u64],
|
56
|
+
['collateral_mint', beet_solana_1.publicKey],
|
57
|
+
], (args) => args);
|
58
|
+
//# sourceMappingURL=structs.js.map
|
@@ -0,0 +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Root":"","sources":["../../../../../../packages/plugins/src/plugins/kamino/s2AirdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,kDAA6C;AAC7C,yDAK8B;AAC9B,2CAAmE;AAGnE,MAAM,QAAQ,GAA2B,CAAO,KAAa,EAAE,EAAE;IAC/D,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,GAAG,CAC9B,kDAAkD,KAAK,6BAA6B,EACpF,EAAE,OAAO,EAAE,IAAI,EAAE,CAClB,CAAC;IAEF,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CACrC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,iBAAiB,CACpC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;IAEvB,OAAO,IAAA,8BAAa,EAAC;QACnB,OAAO,EAAE,4BAAgB;QACzB,KAAK,EAAE;YACL;gBACE,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC;gBACxB,SAAS,EAAE,IAAI;gBACf,KAAK,EAAE,MAAM;gBACb,OAAO,EAAE,oBAAQ;aAClB;SACF;KACF,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AACF,MAAM,cAAc,GAAmB;IACrC,EAAE,EAAE,4BAAgB,CAAC,EAAE;IACvB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AASO,wCAAc;AAPvB,MAAM,OAAO,GAAG,IAAA,wCAAuB,EACrC,cAAc,EACd,oBAAQ,CAAC,EAAE,EACX,GAAG,oBAAQ,CAAC,EAAE,aAAa,EAC3B,4BAAgB,CAAC,QAAQ,CAC1B,CAAC;AAEuB,0BAAO"}
|
File without changes
|