@sonarwatch/portfolio-plugins 0.11.165 → 0.11.166

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.11.166](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.165...plugins-0.11.166) (2024-04-07)
6
+
7
+
8
+
5
9
  ## [0.11.165](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.164...plugins-0.11.165) (2024-04-06)
6
10
 
7
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonarwatch/portfolio-plugins",
3
- "version": "0.11.165",
3
+ "version": "0.11.166",
4
4
  "type": "commonjs",
5
5
  "generators": "./generators.json",
6
6
  "dependencies": {
@@ -41,7 +41,7 @@
41
41
  "web3-v1": "npm:web3@^1.5.0"
42
42
  },
43
43
  "peerDependencies": {
44
- "@sonarwatch/portfolio-core": "0.11.165"
44
+ "@sonarwatch/portfolio-core": "0.11.166"
45
45
  },
46
46
  "main": "./src/index.js",
47
47
  "types": "./src/index.d.ts"
@@ -4,3 +4,4 @@ export declare const platformId = "drift";
4
4
  export declare const driftPlatform: Platform;
5
5
  export declare const prefixSpotMarkets = "drift-spotMarkets";
6
6
  export declare const driftProgram: PublicKey;
7
+ export declare const preMarketPriceKey = "premarketPrice";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.driftProgram = exports.prefixSpotMarkets = exports.driftPlatform = exports.platformId = void 0;
3
+ exports.preMarketPriceKey = exports.driftProgram = exports.prefixSpotMarkets = exports.driftPlatform = exports.platformId = void 0;
4
4
  const web3_js_1 = require("@solana/web3.js");
5
5
  exports.platformId = 'drift';
6
6
  exports.driftPlatform = {
@@ -12,4 +12,5 @@ exports.driftPlatform = {
12
12
  };
13
13
  exports.prefixSpotMarkets = `${exports.platformId}-spotMarkets`;
14
14
  exports.driftProgram = new web3_js_1.PublicKey('dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH');
15
+ exports.preMarketPriceKey = 'premarketPrice';
15
16
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,OAAO,CAAC;AACrB,QAAA,aAAa,GAAa;IACrC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,6CAA6C;IACpD,WAAW,EAAE,OAAO;IACpB,OAAO,EAAE,0BAA0B;CACpC,CAAC;AACW,QAAA,iBAAiB,GAAG,GAAG,kBAAU,cAAc,CAAC;AAEhD,QAAA,YAAY,GAAG,IAAI,mBAAS,CACvC,6CAA6C,CAC9C,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,OAAO,CAAC;AACrB,QAAA,aAAa,GAAa;IACrC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,6CAA6C;IACpD,WAAW,EAAE,OAAO;IACpB,OAAO,EAAE,0BAA0B;CACpC,CAAC;AACW,QAAA,iBAAiB,GAAG,GAAG,kBAAU,cAAc,CAAC;AAEhD,QAAA,YAAY,GAAG,IAAI,mBAAS,CACvC,6CAA6C,CAC9C,CAAC;AAEW,QAAA,iBAAiB,GAAG,gBAAgB,CAAC"}
@@ -7,7 +7,8 @@ exports.fetchers = exports.jobs = exports.platforms = void 0;
7
7
  const constants_1 = require("./constants");
8
8
  const spotMarketsJob_1 = __importDefault(require("./spotMarketsJob"));
9
9
  const deposits_1 = __importDefault(require("./deposits"));
10
+ const premarketJob_1 = __importDefault(require("./premarketJob"));
10
11
  exports.platforms = [constants_1.driftPlatform];
11
- exports.jobs = [spotMarketsJob_1.default];
12
+ exports.jobs = [spotMarketsJob_1.default, premarketJob_1.default];
12
13
  exports.fetchers = [deposits_1.default];
13
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAA4C;AAC5C,sEAA8C;AAC9C,0DAA8C;AAEjC,QAAA,SAAS,GAAe,CAAC,yBAAa,CAAC,CAAC;AACxC,QAAA,IAAI,GAAU,CAAC,wBAAc,CAAC,CAAC;AAC/B,QAAA,QAAQ,GAAc,CAAC,kBAAoB,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAA4C;AAC5C,sEAA8C;AAC9C,0DAA8C;AAC9C,kEAA0C;AAE7B,QAAA,SAAS,GAAe,CAAC,yBAAa,CAAC,CAAC;AACxC,QAAA,IAAI,GAAU,CAAC,wBAAc,EAAE,sBAAY,CAAC,CAAC;AAC7C,QAAA,QAAQ,GAAc,CAAC,kBAAoB,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Job } from '../../Job';
2
+ declare const job: Job;
3
+ export default job;
@@ -0,0 +1,52 @@
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 web3_js_1 = require("@solana/web3.js");
16
+ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
17
+ const bignumber_js_1 = __importDefault(require("bignumber.js"));
18
+ const getParsedAccountInfo_1 = require("../../utils/solana/getParsedAccountInfo");
19
+ const constants_1 = require("./constants");
20
+ const struct_1 = require("./struct");
21
+ const clients_1 = require("../../utils/clients");
22
+ const oraclesAndIds = [
23
+ { oracle: 'sDAQaZQJQ4RXAxH3x526mbEXyQZT15ktkL84d7hmk7M', id: 'KMNO' },
24
+ ];
25
+ const factor = new bignumber_js_1.default(Math.pow(10, 6));
26
+ const oneDayInSlot = new bignumber_js_1.default(100000);
27
+ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
28
+ const client = (0, clients_1.getClientSolana)();
29
+ const epoch = yield client.getEpochInfo();
30
+ for (const data of oraclesAndIds) {
31
+ const prelaunchOracle = yield (0, getParsedAccountInfo_1.getParsedAccountInfo)(client, struct_1.preLaunchOracleStruct, new web3_js_1.PublicKey(data.oracle));
32
+ if (!prelaunchOracle)
33
+ continue;
34
+ // Check if data is too old, would mean the market is not active anymore.
35
+ if (prelaunchOracle.lastUpdateSlot
36
+ .plus(oneDayInSlot)
37
+ .isLessThan(epoch.absoluteSlot))
38
+ continue;
39
+ const price = prelaunchOracle.price.dividedBy(factor);
40
+ yield cache.setItem(`${constants_1.preMarketPriceKey}-${data.id}`, price.toNumber(), {
41
+ prefix: constants_1.platformId,
42
+ networkId: portfolio_core_1.NetworkId.solana,
43
+ });
44
+ }
45
+ });
46
+ const job = {
47
+ id: `${constants_1.platformId}-premarket`,
48
+ executor,
49
+ label: 'normal',
50
+ };
51
+ exports.default = job;
52
+ //# sourceMappingURL=premarketJob.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"premarketJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src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M,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,YAAY;IAC7B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -64,6 +64,17 @@ export declare enum OracleSource {
64
64
  Pyth1M = 4,
65
65
  PythStableCoin = 5
66
66
  }
67
+ export declare enum ContractType {
68
+ Perpetual = 0,
69
+ Future = 1
70
+ }
71
+ export declare enum ContractTier {
72
+ A = 0,
73
+ B = 1,
74
+ C = 2,
75
+ Speculative = 3,
76
+ Isolated = 4
77
+ }
67
78
  export type Order = {
68
79
  slot: BigNumber;
69
80
  price: BigNumber;
@@ -256,3 +267,142 @@ export type InsuranceFundStake = {
256
267
  padding: number[];
257
268
  };
258
269
  export declare const insuranceFundStakeStruct: BeetStruct<InsuranceFundStake, Partial<InsuranceFundStake>>;
270
+ export type AMM = {
271
+ oracle: PublicKey;
272
+ historicalOracleData: HistoricalOracleData;
273
+ baseAssetAmountPerLp: BigNumber;
274
+ quoteAssetAmountPerLp: BigNumber;
275
+ feePool: PoolBalance;
276
+ baseAssetReserve: BigNumber;
277
+ quoteAssetReserve: BigNumber;
278
+ concentrationCoef: BigNumber;
279
+ minBaseAssetReserve: BigNumber;
280
+ maxBaseAssetReserve: BigNumber;
281
+ sqrtK: BigNumber;
282
+ pegMultiplier: BigNumber;
283
+ terminalQuoteAssetReserve: BigNumber;
284
+ baseAssetAmountLong: BigNumber;
285
+ baseAssetAmountShort: BigNumber;
286
+ baseAssetAmountWithAmm: BigNumber;
287
+ baseAssetAmountWithUnsettledLp: BigNumber;
288
+ maxOpenInterest: BigNumber;
289
+ quoteAssetAmount: BigNumber;
290
+ quoteEntryAmountLong: BigNumber;
291
+ quoteEntryAmountShort: BigNumber;
292
+ quoteBreakEvenAmountLong: BigNumber;
293
+ quoteBreakEvenAmountShort: BigNumber;
294
+ userLpShares: BigNumber;
295
+ lastFundingRate: BigNumber;
296
+ lastFundingRateLong: BigNumber;
297
+ lastFundingRateShort: BigNumber;
298
+ last24hAvgFundingRate: BigNumber;
299
+ totalFee: BigNumber;
300
+ totalMmFee: BigNumber;
301
+ totalExchangeFee: BigNumber;
302
+ totalFeeMinusDistributions: BigNumber;
303
+ totalFeeWithdrawn: BigNumber;
304
+ totalLiquidationFee: BigNumber;
305
+ cumulativeFundingRateLong: BigNumber;
306
+ cumulativeFundingRateShort: BigNumber;
307
+ totalSocialLoss: BigNumber;
308
+ askBaseAssetReserve: BigNumber;
309
+ askQuoteAssetReserve: BigNumber;
310
+ bidBaseAssetReserve: BigNumber;
311
+ bidQuoteAssetReserve: BigNumber;
312
+ lastOracleNormalisedPrice: BigNumber;
313
+ lastOracleReservePriceSpreadPct: BigNumber;
314
+ lastBidPriceTwap: BigNumber;
315
+ lastAskPriceTwap: BigNumber;
316
+ lastMarkPriceTwap: BigNumber;
317
+ lastMarkPriceTwap5min: BigNumber;
318
+ lastUpdateSlot: BigNumber;
319
+ lastOracleConfPct: BigNumber;
320
+ netRevenueSinceLastFunding: BigNumber;
321
+ lastFundingRateTs: BigNumber;
322
+ fundingPeriod: BigNumber;
323
+ orderStepSize: BigNumber;
324
+ orderTickSize: BigNumber;
325
+ minOrderSize: BigNumber;
326
+ maxPositionSize: BigNumber;
327
+ volume24h: BigNumber;
328
+ longIntensityVolume: BigNumber;
329
+ shortIntensityVolume: BigNumber;
330
+ lastTradeTs: BigNumber;
331
+ markStd: BigNumber;
332
+ oracleStd: BigNumber;
333
+ lastMarkPriceTwapTs: BigNumber;
334
+ baseSpread: number;
335
+ maxSpread: number;
336
+ longSpread: number;
337
+ shortSpread: number;
338
+ longIntensityCount: number;
339
+ shortIntensityCount: number;
340
+ maxFillReserveFraction: number;
341
+ maxSlippageRatio: number;
342
+ curveUpdateIntensity: number;
343
+ ammJitIntensity: number;
344
+ oracleSource: OracleSource;
345
+ lastOracleValid: boolean;
346
+ targetBaseAssetAmountPerLp: number;
347
+ perLpBase: number;
348
+ padding1: number;
349
+ padding2: number;
350
+ totalFeeEarnedPerLp: BigNumber;
351
+ netUnsettledFundingPnl: BigNumber;
352
+ quoteAssetAmountWithUnsettledLp: BigNumber;
353
+ referencePriceOffset: number;
354
+ padding: number[];
355
+ };
356
+ export declare const ammStruct: BeetStruct<AMM, Partial<AMM>>;
357
+ export type InsuranceClaim = {
358
+ revenueWithdrawSinceLastSettle: BigNumber;
359
+ maxRevenueWithdrawPerPeriod: BigNumber;
360
+ quoteMaxInsurance: BigNumber;
361
+ quoteSettledInsurance: BigNumber;
362
+ lastRevenueWithdrawTs: BigNumber;
363
+ };
364
+ export declare const insuranceClaimStruct: BeetStruct<InsuranceClaim, Partial<InsuranceClaim>>;
365
+ export type PerpMarket = {
366
+ buffer: Buffer;
367
+ pubkey: PublicKey;
368
+ amm: AMM;
369
+ pnlPool: PoolBalance;
370
+ name: number[];
371
+ insuranceClaim: InsuranceClaim;
372
+ unrealizedPnlMaxImbalance: BigNumber;
373
+ expiryTs: BigNumber;
374
+ expiryPrice: BigNumber;
375
+ nextFillRecordId: BigNumber;
376
+ nextFundingRateRecordId: BigNumber;
377
+ nextCurveRecordId: BigNumber;
378
+ imfFactor: number;
379
+ unrealizedPnlImfFactor: number;
380
+ liquidatorFee: number;
381
+ ifLiquidationFee: number;
382
+ marginRatioInitial: number;
383
+ marginRatioMaintenance: number;
384
+ unrealizedPnlInitialAssetWeight: number;
385
+ unrealizedPnlMaintenanceAssetWeight: number;
386
+ numberOfUsersWithBase: number;
387
+ numberOfUsers: number;
388
+ marketIndex: number;
389
+ status: MarketStatus;
390
+ contractType: ContractType;
391
+ contractTier: ContractTier;
392
+ pausedOperations: number;
393
+ quoteSpotMarketIndex: number;
394
+ feeAdjustment: number;
395
+ padding: number[];
396
+ };
397
+ export declare const perpMarketStruct: BeetStruct<PerpMarket, Partial<PerpMarket>>;
398
+ export type PreLaunchOracle = {
399
+ buffer: Buffer;
400
+ price: BigNumber;
401
+ maxPrice: BigNumber;
402
+ confidence: BigNumber;
403
+ lastUpdateSlot: BigNumber;
404
+ ammLastUpdateSlot: BigNumber;
405
+ perpMarketIndex: number;
406
+ padding: number[];
407
+ };
408
+ export declare const preLaunchOracleStruct: BeetStruct<PreLaunchOracle, Partial<PreLaunchOracle>>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.insuranceFundStakeStruct = exports.userAccountStruct = exports.spotPositionStruct = exports.spotMarketStruct = exports.insuranceFundStruct = exports.historicalOracleDataStruct = exports.historicalIndexDataStruct = exports.poolBalanceStruct = exports.perpPositionStruct = exports.orderStruct = exports.OracleSource = exports.MarketStatus = exports.AssetTier = exports.UserStatus = exports.SpotBalanceType = exports.OrderStatus = exports.OrderType = exports.MarketType = exports.PositionDirection = exports.OrderTriggerCondition = void 0;
3
+ exports.preLaunchOracleStruct = exports.perpMarketStruct = exports.insuranceClaimStruct = exports.ammStruct = exports.insuranceFundStakeStruct = exports.userAccountStruct = exports.spotPositionStruct = exports.spotMarketStruct = exports.insuranceFundStruct = exports.historicalOracleDataStruct = exports.historicalIndexDataStruct = exports.poolBalanceStruct = exports.perpPositionStruct = exports.orderStruct = exports.ContractTier = exports.ContractType = exports.OracleSource = exports.MarketStatus = exports.AssetTier = exports.UserStatus = exports.SpotBalanceType = exports.OrderStatus = exports.OrderType = exports.MarketType = exports.PositionDirection = exports.OrderTriggerCondition = void 0;
4
4
  const beet_1 = require("@metaplex-foundation/beet");
5
5
  const beet_solana_1 = require("@metaplex-foundation/beet-solana");
6
6
  const solana_1 = require("../../utils/solana");
@@ -76,6 +76,19 @@ var OracleSource;
76
76
  OracleSource[OracleSource["Pyth1M"] = 4] = "Pyth1M";
77
77
  OracleSource[OracleSource["PythStableCoin"] = 5] = "PythStableCoin";
78
78
  })(OracleSource || (exports.OracleSource = OracleSource = {}));
79
+ var ContractType;
80
+ (function (ContractType) {
81
+ ContractType[ContractType["Perpetual"] = 0] = "Perpetual";
82
+ ContractType[ContractType["Future"] = 1] = "Future";
83
+ })(ContractType || (exports.ContractType = ContractType = {}));
84
+ var ContractTier;
85
+ (function (ContractTier) {
86
+ ContractTier[ContractTier["A"] = 0] = "A";
87
+ ContractTier[ContractTier["B"] = 1] = "B";
88
+ ContractTier[ContractTier["C"] = 2] = "C";
89
+ ContractTier[ContractTier["Speculative"] = 3] = "Speculative";
90
+ ContractTier[ContractTier["Isolated"] = 4] = "Isolated";
91
+ })(ContractTier || (exports.ContractTier = ContractTier = {}));
79
92
  exports.orderStruct = new beet_1.BeetStruct([
80
93
  ['slot', solana_1.u64],
81
94
  ['price', solana_1.u64],
@@ -258,4 +271,139 @@ exports.insuranceFundStakeStruct = new beet_1.BeetStruct([
258
271
  ['marketIndex', beet_1.u16],
259
272
  ['padding', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 14)],
260
273
  ], (args) => args);
274
+ exports.ammStruct = new beet_1.BeetStruct([
275
+ ['oracle', beet_solana_1.publicKey],
276
+ ['historicalOracleData', exports.historicalOracleDataStruct],
277
+ ['baseAssetAmountPerLp', solana_1.i128],
278
+ ['quoteAssetAmountPerLp', solana_1.i128],
279
+ ['feePool', exports.poolBalanceStruct],
280
+ ['baseAssetReserve', solana_1.u128],
281
+ ['quoteAssetReserve', solana_1.u128],
282
+ ['concentrationCoef', solana_1.u128],
283
+ ['minBaseAssetReserve', solana_1.u128],
284
+ ['maxBaseAssetReserve', solana_1.u128],
285
+ ['sqrtK', solana_1.u128],
286
+ ['pegMultiplier', solana_1.u128],
287
+ ['terminalQuoteAssetReserve', solana_1.u128],
288
+ ['baseAssetAmountLong', solana_1.i128],
289
+ ['baseAssetAmountShort', solana_1.i128],
290
+ ['baseAssetAmountWithAmm', solana_1.i128],
291
+ ['baseAssetAmountWithUnsettledLp', solana_1.i128],
292
+ ['maxOpenInterest', solana_1.u128],
293
+ ['quoteAssetAmount', solana_1.i128],
294
+ ['quoteEntryAmountLong', solana_1.i128],
295
+ ['quoteEntryAmountShort', solana_1.i128],
296
+ ['quoteBreakEvenAmountLong', solana_1.i128],
297
+ ['quoteBreakEvenAmountShort', solana_1.i128],
298
+ ['userLpShares', solana_1.u128],
299
+ ['lastFundingRate', solana_1.i64],
300
+ ['lastFundingRateLong', solana_1.i64],
301
+ ['lastFundingRateShort', solana_1.i64],
302
+ ['last24hAvgFundingRate', solana_1.i64],
303
+ ['totalFee', solana_1.i128],
304
+ ['totalMmFee', solana_1.i128],
305
+ ['totalExchangeFee', solana_1.u128],
306
+ ['totalFeeMinusDistributions', solana_1.i128],
307
+ ['totalFeeWithdrawn', solana_1.u128],
308
+ ['totalLiquidationFee', solana_1.u128],
309
+ ['cumulativeFundingRateLong', solana_1.i128],
310
+ ['cumulativeFundingRateShort', solana_1.i128],
311
+ ['totalSocialLoss', solana_1.u128],
312
+ ['askBaseAssetReserve', solana_1.u128],
313
+ ['askQuoteAssetReserve', solana_1.u128],
314
+ ['bidBaseAssetReserve', solana_1.u128],
315
+ ['bidQuoteAssetReserve', solana_1.u128],
316
+ ['lastOracleNormalisedPrice', solana_1.i64],
317
+ ['lastOracleReservePriceSpreadPct', solana_1.i64],
318
+ ['lastBidPriceTwap', solana_1.u64],
319
+ ['lastAskPriceTwap', solana_1.u64],
320
+ ['lastMarkPriceTwap', solana_1.u64],
321
+ ['lastMarkPriceTwap5min', solana_1.u64],
322
+ ['lastUpdateSlot', solana_1.u64],
323
+ ['lastOracleConfPct', solana_1.u64],
324
+ ['netRevenueSinceLastFunding', solana_1.i64],
325
+ ['lastFundingRateTs', solana_1.i64],
326
+ ['fundingPeriod', solana_1.i64],
327
+ ['orderStepSize', solana_1.u64],
328
+ ['orderTickSize', solana_1.u64],
329
+ ['minOrderSize', solana_1.u64],
330
+ ['maxPositionSize', solana_1.u64],
331
+ ['volume24h', solana_1.u64],
332
+ ['longIntensityVolume', solana_1.u64],
333
+ ['shortIntensityVolume', solana_1.u64],
334
+ ['lastTradeTs', solana_1.i64],
335
+ ['markStd', solana_1.u64],
336
+ ['oracleStd', solana_1.u64],
337
+ ['lastMarkPriceTwapTs', solana_1.i64],
338
+ ['baseSpread', beet_1.u32],
339
+ ['maxSpread', beet_1.u32],
340
+ ['longSpread', beet_1.u32],
341
+ ['shortSpread', beet_1.u32],
342
+ ['longIntensityCount', beet_1.u32],
343
+ ['shortIntensityCount', beet_1.u32],
344
+ ['maxFillReserveFraction', beet_1.u16],
345
+ ['maxSlippageRatio', beet_1.u16],
346
+ ['curveUpdateIntensity', beet_1.u8],
347
+ ['ammJitIntensity', beet_1.u8],
348
+ ['oracleSource', beet_1.u8],
349
+ ['lastOracleValid', beet_1.bool],
350
+ ['targetBaseAssetAmountPerLp', beet_1.i32],
351
+ ['perLpBase', beet_1.i8],
352
+ ['padding1', beet_1.u8],
353
+ ['padding2', beet_1.u16],
354
+ ['totalFeeEarnedPerLp', solana_1.u64],
355
+ ['netUnsettledFundingPnl', solana_1.i64],
356
+ ['quoteAssetAmountWithUnsettledLp', solana_1.i64],
357
+ ['referencePriceOffset', beet_1.i32],
358
+ ['padding', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 12)],
359
+ ], (args) => args);
360
+ exports.insuranceClaimStruct = new beet_1.BeetStruct([
361
+ ['revenueWithdrawSinceLastSettle', solana_1.i64],
362
+ ['maxRevenueWithdrawPerPeriod', solana_1.u64],
363
+ ['quoteMaxInsurance', solana_1.u64],
364
+ ['quoteSettledInsurance', solana_1.u64],
365
+ ['lastRevenueWithdrawTs', solana_1.i64],
366
+ ], (args) => args);
367
+ exports.perpMarketStruct = new beet_1.BeetStruct([
368
+ ['buffer', (0, solana_1.blob)(8)],
369
+ ['pubkey', beet_solana_1.publicKey],
370
+ ['amm', exports.ammStruct],
371
+ ['pnlPool', exports.poolBalanceStruct],
372
+ ['name', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 32)],
373
+ ['insuranceClaim', exports.insuranceClaimStruct],
374
+ ['unrealizedPnlMaxImbalance', solana_1.u64],
375
+ ['expiryTs', solana_1.i64],
376
+ ['expiryPrice', solana_1.i64],
377
+ ['nextFillRecordId', solana_1.u64],
378
+ ['nextFundingRateRecordId', solana_1.u64],
379
+ ['nextCurveRecordId', solana_1.u64],
380
+ ['imfFactor', beet_1.u32],
381
+ ['unrealizedPnlImfFactor', beet_1.u32],
382
+ ['liquidatorFee', beet_1.u32],
383
+ ['ifLiquidationFee', beet_1.u32],
384
+ ['marginRatioInitial', beet_1.u32],
385
+ ['marginRatioMaintenance', beet_1.u32],
386
+ ['unrealizedPnlInitialAssetWeight', beet_1.u32],
387
+ ['unrealizedPnlMaintenanceAssetWeight', beet_1.u32],
388
+ ['numberOfUsersWithBase', beet_1.u32],
389
+ ['numberOfUsers', beet_1.u32],
390
+ ['marketIndex', beet_1.u16],
391
+ ['status', beet_1.u8],
392
+ ['contractType', beet_1.u8],
393
+ ['contractTier', beet_1.u8],
394
+ ['pausedOperations', beet_1.u8],
395
+ ['quoteSpotMarketIndex', beet_1.u16],
396
+ ['feeAdjustment', beet_1.i16],
397
+ ['padding', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 46)],
398
+ ], (args) => args);
399
+ exports.preLaunchOracleStruct = new beet_1.BeetStruct([
400
+ ['buffer', (0, solana_1.blob)(8)],
401
+ ['price', solana_1.i64],
402
+ ['maxPrice', solana_1.i64],
403
+ ['confidence', solana_1.u64],
404
+ ['lastUpdateSlot', solana_1.u64],
405
+ ['ammLastUpdateSlot', solana_1.u64],
406
+ ['perpMarketIndex', beet_1.u16],
407
+ ['padding', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 70)],
408
+ ], (args) => args);
261
409
  //# sourceMappingURL=struct.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"struct.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift/struct.ts"],"names":[],"mappings":";;;AAAA,oDAQmC;AACnC,kEAA6D;AAG7D,+CAA0D;AAE1D,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC/B,mEAAK,CAAA;IACL,mEAAK,CAAA;IACL,qFAAc,CAAA;IACd,qFAAc,CA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,iBAAU,CACpD;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,UAAU,EAAE,aAAI,CAAC;IAClB,CAAC,2BAA2B,EAAE,aAAI,CAAC;IACnC,CAAC,QAAQ,EAAE,aAAI,CAAC;IAChB,CAAC,aAAa,EAAE,YAAG,CAAC;IACpB,CAAC,0BAA0B,EAAE,YAAG,CAAC;IACjC,CAAC,uBAAuB,EAAE,YAAG,CAAC;IAC9B,CAAC,WAAW,EAAE,YAAG,CAAC;IAClB,CAAC,aAAa,EAAE,UAAG,CAAC;IACpB,CAAC,SAAS,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,EAAE,CAAC,CAAC;CAC3C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAA0B,CACrC,CAAC"}
1
+ {"version":3,"file":"struct.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift/struct.ts"],"names":[],"mappings":";;;AAAA,oDAUmC;AACnC,kEAA6D;AAG7D,+CAAgE;AAEhE,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC/B,mEAAK,CAAA;IACL,mEAAK,CAAA;IACL,qFAAc,CAAA;IACd,qFAAc,CAAA;AAChB,CAAC,EALW,qBAAqB,qCAArB,qBAAqB,QAKhC;AAED,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,yDAAI,CAAA;IACJ,2DAAK,CAAA;AACP,CAAC,EAHW,iBAAiB,iCAAjB,iBAAiB,QAG5B;AAED,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,2CAAI,CAAA;IACJ,2CAAI,CAAA;AACN,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB;AAED,IAAY,SAMX;AAND,WAAY,SAAS;IACnB,6CAAM,CAAA;IACN,2CAAK,CAAA;IACL,2DAAa,CAAA;IACb,yDAAY,CAAA;IACZ,6CAAM,CAAA;AACR,CAAC,EANW,S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G,CAAC;IAC5C,CAAC,uBAAuB,EAAE,UAAG,CAAC;IAC9B,CAAC,eAAe,EAAE,UAAG,CAAC;IACtB,CAAC,aAAa,EAAE,UAAG,CAAC;IACpB,CAAC,QAAQ,EAAE,SAAE,CAAC;IACd,CAAC,cAAc,EAAE,SAAE,CAAC;IACpB,CAAC,cAAc,EAAE,SAAE,CAAC;IACpB,CAAC,kBAAkB,EAAE,SAAE,CAAC;IACxB,CAAC,sBAAsB,EAAE,UAAG,CAAC;IAC7B,CAAC,eAAe,EAAE,UAAG,CAAC;IACtB,CAAC,SAAS,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,EAAE,CAAC,CAAC;CAC3C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAkB,CAC7B,CAAC;AAaW,QAAA,qBAAqB,GAAG,IAAI,iBAAU,CACjD;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,OAAO,EAAE,YAAG,CAAC;IACd,CAAC,UAAU,EAAE,YAAG,CAAC;IACjB,CAAC,YAAY,EAAE,YAAG,CAAC;IACnB,CAAC,gBAAgB,EAAE,YAAG,CAAC;IACvB,CAAC,mBAAmB,EAAE,YAAG,CAAC;IAC1B,CAAC,iBAAiB,EAAE,UAAG,CAAC;IACxB,CAAC,SAAS,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,EAAE,CAAC,CAAC;CAC3C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAuB,CAClC,CAAC"}
@@ -3,3 +3,7 @@ export type SpotMarketEnhanced = SpotMarket & {
3
3
  depositApr: number;
4
4
  borrowApr: number;
5
5
  };
6
+ export type PreMarketPrice = {
7
+ id: string;
8
+ price: number;
9
+ };
@@ -0,0 +1,3 @@
1
+ import { Fetcher } from '../../Fetcher';
2
+ declare const fetcher: Fetcher;
3
+ export default fetcher;
@@ -0,0 +1,76 @@
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 bignumber_js_1 = __importDefault(require("bignumber.js"));
17
+ const constants_1 = require("./constants");
18
+ const constants_2 = require("../drift/constants");
19
+ const common_1 = require("./helpers/common");
20
+ const oneDayInMs = 1 * 24 * 60 * 60 * 1000;
21
+ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
22
+ const premarketPrice = yield cache.getItem(`${constants_2.preMarketPriceKey}-KMNO`, { prefix: constants_2.driftPlatform.id, networkId: portfolio_core_1.NetworkId.solana });
23
+ if (!premarketPrice)
24
+ return [];
25
+ const cachedAllocation = yield cache.getItem(owner, {
26
+ prefix: constants_1.allocationPrefix,
27
+ networkId: portfolio_core_1.NetworkId.solana,
28
+ });
29
+ let amount = new bignumber_js_1.default(0);
30
+ if (cachedAllocation) {
31
+ amount = amount.plus(cachedAllocation);
32
+ }
33
+ else {
34
+ const allocations = yield (0, common_1.getAllocationsBySeason)(owner, 1);
35
+ if (allocations) {
36
+ amount = allocations
37
+ .map((alloc) => new bignumber_js_1.default(alloc.quantity))
38
+ .reduce((alloc, sum) => sum.plus(alloc), new bignumber_js_1.default(0));
39
+ yield cache.setItem(owner, amount.toNumber(), {
40
+ prefix: constants_1.allocationPrefix,
41
+ networkId: portfolio_core_1.NetworkId.solana,
42
+ ttl: oneDayInMs,
43
+ });
44
+ }
45
+ }
46
+ if (amount.isZero())
47
+ return [];
48
+ const asset = {
49
+ networkId: portfolio_core_1.NetworkId.solana,
50
+ type: 'generic',
51
+ value: amount.times(premarketPrice).toNumber(),
52
+ data: {
53
+ name: 'KMNO',
54
+ amount: amount.toNumber(),
55
+ },
56
+ attributes: { isClaimable: false },
57
+ };
58
+ return [
59
+ {
60
+ value: asset.value,
61
+ type: portfolio_core_1.PortfolioElementType.multiple,
62
+ platformId: constants_1.platformId,
63
+ name: 'Season 1 Allocation',
64
+ networkId: portfolio_core_1.NetworkId.solana,
65
+ label: 'Rewards',
66
+ data: { assets: [asset] },
67
+ },
68
+ ];
69
+ });
70
+ const fetcher = {
71
+ id: `${constants_1.platformId}-airdrop`,
72
+ networkId: portfolio_core_1.NetworkId.solana,
73
+ executor,
74
+ };
75
+ exports.default = fetcher;
76
+ //# sourceMappingURL=airdropFetcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"airdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kamino/airdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AACpC,gEAAqC;AAGrC,2CAA2D;AAC3D,kDAAsE;AACtE,6CAA0D;AAE1D,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAE3C,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,OAAO,CACxC,GAAG,6BAAiB,OAAO,EAC3B,EAAE,MAAM,EAAE,yBAAa,CAAC,EAAE,EAAE,SAAS,EAAE,0BAAS,CAAC,MAAM,EAAE,CAC1D,CAAC;IACF,IAAI,CAAC,cAAc;QAAE,OAAO,EAAE,CAAC;IAE/B,MAAM,gBAAgB,GAAG,MAAM,KAAK,CAAC,OAAO,CAAS,KAAK,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ACnC,CAAC;IACF,OAAO;QACL;YACE,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,IAAI,EAAE,qCAAoB,CAAC,QAAQ;YACnC,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE,qBAAqB;YAC3B,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE;SAC1B;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -4,6 +4,8 @@ import { LendingMarketConfig } from './types';
4
4
  export declare const platformId = "kamino";
5
5
  export declare const kaminoPlatform: Platform;
6
6
  export declare const programId: PublicKey;
7
+ export declare const allocationApiUrl = "https://api.hubbleprotocol.io/v2/airdrop/users/";
8
+ export declare const allocationPrefix = "kamino/allocation";
7
9
  export declare const klendProgramId: PublicKey;
8
10
  export declare const farmProgramId: PublicKey;
9
11
  export declare const farmsKey = "farms";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.reservesKey = exports.marketsKey = exports.lendingConfigs = exports.mainMarket = exports.farmsKey = exports.farmProgramId = exports.klendProgramId = exports.programId = exports.kaminoPlatform = exports.platformId = void 0;
3
+ exports.reservesKey = exports.marketsKey = exports.lendingConfigs = exports.mainMarket = exports.farmsKey = exports.farmProgramId = exports.klendProgramId = exports.allocationPrefix = exports.allocationApiUrl = exports.programId = exports.kaminoPlatform = exports.platformId = void 0;
4
4
  const web3_js_1 = require("@solana/web3.js");
5
5
  exports.platformId = 'kamino';
6
6
  exports.kaminoPlatform = {
@@ -11,6 +11,8 @@ exports.kaminoPlatform = {
11
11
  defiLlamaId: 'parent#kamino-finance',
12
12
  };
13
13
  exports.programId = new web3_js_1.PublicKey('6LtLpnUFNByNXLyCoK9wA2MykKAmQNZKBdY8s47dehDc');
14
+ exports.allocationApiUrl = 'https://api.hubbleprotocol.io/v2/airdrop/users/';
15
+ exports.allocationPrefix = `${exports.platformId}/allocation`;
14
16
  exports.klendProgramId = new web3_js_1.PublicKey('KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD');
15
17
  exports.farmProgramId = new web3_js_1.PublicKey('FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr');
16
18
  exports.farmsKey = 'farms';
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kamino/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAI/B,QAAA,UAAU,GAAG,QAAQ,CAAC;AACtB,QAAA,cAAc,GAAa;IACtC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,qCAAqC,kBAAU,MAAM;IAC5D,OAAO,EAAE,yBAAyB;IAClC,WAAW,EAAE,uBAAuB;CACrC,CAAC;AACW,QAAA,SAAS,GAAG,IAAI,mBAAS,CACpC,8CAA8C,CAC/C,CAAC;AAEW,QAAA,cAAc,GAAG,IAAI,mBAAS,CACzC,6CAA6C,CAC9C,CAAC;AACW,QAAA,aAAa,GAAG,IAAI,mBAAS,CACxC,8CAA8C,CAC/C,CAAC;AACW,QAAA,QAAQ,GAAG,OAAO,CAAC;AACnB,QAAA,UAAU,GAAG,8CAA8C,CAAC;AAE5D,QAAA,cAAc,GAAqC,IAAI,GAAG,CAAC;IACtE;QACE,8CAA8C;QAC9C;YACE,IAAI,EAAE,aAAa;YACnB,aAAa,EAAE;gBACb;oBACE,6CAA6C;oBAC7C,6CAA6C;iBAC9C;gBACD;oBACE,8CAA8C;oBAC9C,6CAA6C;iBAC9C;gBACD;oBACE,6CAA6C;oBAC7C,6CAA6C;iBAC9C;aACF;YACD,aAAa,EAAE;gBACb;oBACE,8CAA8C;oBAC9C,8CAA8C;iBAC/C;gBACD;oBACE,8CAA8C;oBAC9C,8CAA8C;iBAC/C;gBACD;oBACE,6CAA6C;oBAC7C,8CAA8C;iBAC/C;gBACD;oBACE,6CAA6C;oBAC7C,8CAA8C;iBAC/C;gBACD;oBACE,6CAA6C;oBAC7C,8CAA8C;iBAC/C;gBACD;oBACE,8CAA8C;oBAC9C,8CAA8C;iBAC/C;gBACD;oBACE,8CAA8C;oBAC9C,8CAA8C;iBAC/C;aACF;SACF;KACF;IACD,CAAC,8CAA8C,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;IACxE,CAAC,8CAA8C,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC;CAC9E,CAAC,CAAC;AAEU,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,WAAW,GAAG,UAAU,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kamino/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAI/B,QAAA,UAAU,GAAG,QAAQ,CAAC;AACtB,QAAA,cAAc,GAAa;IACtC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,qCAAqC,kBAAU,MAAM;IAC5D,OAAO,EAAE,yBAAyB;IAClC,WAAW,EAAE,uBAAuB;CACrC,CAAC;AACW,QAAA,SAAS,GAAG,IAAI,mBAAS,CACpC,8CAA8C,CAC/C,CAAC;AAEW,QAAA,gBAAgB,GAC3B,iDAAiD,CAAC;AACvC,QAAA,gBAAgB,GAAG,GAAG,kBAAU,aAAa,CAAC;AAE9C,QAAA,cAAc,GAAG,IAAI,mBAAS,CACzC,6CAA6C,CAC9C,CAAC;AACW,QAAA,aAAa,GAAG,IAAI,mBAAS,CACxC,8CAA8C,CAC/C,CAAC;AACW,QAAA,QAAQ,GAAG,OAAO,CAAC;AACnB,QAAA,UAAU,GAAG,8CAA8C,CAAC;AAE5D,QAAA,cAAc,GAAqC,IAAI,GAAG,CAAC;IACtE;QACE,8CAA8C;QAC9C;YACE,IAAI,EAAE,aAAa;YACnB,aAAa,EAAE;gBACb;oBACE,6CAA6C;oBAC7C,6CAA6C;iBAC9C;gBACD;oBACE,8CAA8C;oBAC9C,6CAA6C;iBAC9C;gBACD;oBACE,6CAA6C;oBAC7C,6CAA6C;iBAC9C;aACF;YACD,aAAa,EAAE;gBACb;oBACE,8CAA8C;oBAC9C,8CAA8C;iBAC/C;gBACD;oBACE,8CAA8C;oBAC9C,8CAA8C;iBAC/C;gBACD;oBACE,6CAA6C;oBAC7C,8CAA8C;iBAC/C;gBACD;oBACE,6CAA6C;oBAC7C,8CAA8C;iBAC/C;gBACD;oBACE,6CAA6C;oBAC7C,8CAA8C;iBAC/C;gBACD;oBACE,8CAA8C;oBAC9C,8CAA8C;iBAC/C;gBACD;oBACE,8CAA8C;oBAC9C,8CAA8C;iBAC/C;aACF;SACF;KACF;IACD,CAAC,8CAA8C,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;IACxE,CAAC,8CAA8C,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC;CAC9E,CAAC,CAAC;AAEU,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,WAAW,GAAG,UAAU,CAAC"}
@@ -1,3 +1,9 @@
1
1
  import { ParsedAccount } from '../../../utils/solana';
2
2
  import { Reserve } from '../structs/klend';
3
3
  export declare function getEchangeRate(reserve: ParsedAccount<Reserve>): number;
4
+ type Allocation = {
5
+ quantity: string;
6
+ name: string;
7
+ };
8
+ export declare function getAllocationsBySeason(owner: string, season: 1 | 2): Promise<Allocation[] | undefined>;
9
+ export {};
@@ -1,11 +1,22 @@
1
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
+ };
2
11
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
13
  };
5
14
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getEchangeRate = void 0;
15
+ exports.getAllocationsBySeason = exports.getEchangeRate = void 0;
7
16
  const bignumber_js_1 = __importDefault(require("bignumber.js"));
17
+ const axios_1 = __importDefault(require("axios"));
8
18
  const apr_1 = require("./apr");
19
+ const constants_1 = require("../constants");
9
20
  const INITIAL_COLLATERAL_RATE = 1;
10
21
  function getEchangeRate(reserve) {
11
22
  const totalSupply = new bignumber_js_1.default((0, apr_1.getTotalSupply)(reserve.liquidity).toString());
@@ -18,4 +29,13 @@ function getEchangeRate(reserve) {
18
29
  .toNumber();
19
30
  }
20
31
  exports.getEchangeRate = getEchangeRate;
32
+ function getAllocationsBySeason(owner, season) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ const res = yield axios_1.default
35
+ .get(`${constants_1.allocationApiUrl}${owner}/allocations?source=Season${season}`)
36
+ .catch(() => null);
37
+ return res ? res.data : undefined;
38
+ });
39
+ }
40
+ exports.getAllocationsBySeason = getAllocationsBySeason;
21
41
  //# sourceMappingURL=common.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/kamino/helpers/common.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAqC;AAGrC,+BAAuC;AAEvC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAElC,SAAgB,cAAc,CAAC,OAA+B;IAC5D,MAAM,WAAW,GAAG,IAAI,sBAAS,CAC/B,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C;aACrE,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;QACrB,OAAO,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IACpC,CAAC;CAAA;AARD,wDAQC"}
@@ -11,7 +11,8 @@ const reservesJob_1 = __importDefault(require("./reservesJob"));
11
11
  const marketsJob_1 = __importDefault(require("./marketsJob"));
12
12
  const lendsFetcher_1 = __importDefault(require("./lendsFetcher"));
13
13
  const farmsFetcher_1 = __importDefault(require("./farmsFetcher"));
14
+ const airdropFetcher_1 = __importDefault(require("./airdropFetcher"));
14
15
  exports.platforms = [constants_1.kaminoPlatform];
15
16
  exports.jobs = [poolsJob_1.default, reservesJob_1.default, farmsJob_1.default, marketsJob_1.default];
16
- exports.fetchers = [lendsFetcher_1.default, farmsFetcher_1.default];
17
+ exports.fetchers = [lendsFetcher_1.default, farmsFetcher_1.default, airdropFetcher_1.default];
17
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kamino/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAA6C;AAC7C,0DAAkC;AAClC,0DAAkC;AAClC,gEAAwC;AACxC,8DAAsC;AACtC,kEAA0C;AAC1C,kEAA0C;AAE7B,QAAA,SAAS,GAAe,CAAC,0BAAc,CAAC,CAAC;AACzC,QAAA,IAAI,GAAU,CAAC,kBAAQ,EAAE,qBAAW,EAAE,kBAAQ,EAAE,oBAAU,CAAC,CAAC;AAC5D,QAAA,QAAQ,GAAc,CAAC,sBAAY,EAAE,sBAAY,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kamino/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAA6C;AAC7C,0DAAkC;AAClC,0DAAkC;AAClC,gEAAwC;AACxC,8DAAsC;AACtC,kEAA0C;AAC1C,kEAA0C;AAC1C,sEAA8C;AAEjC,QAAA,SAAS,GAAe,CAAC,0BAAc,CAAC,CAAC;AACzC,QAAA,IAAI,GAAU,CAAC,kBAAQ,EAAE,qBAAW,EAAE,kBAAQ,EAAE,oBAAU,CAAC,CAAC;AAC5D,QAAA,QAAQ,GAAc,CAAC,sBAAY,EAAE,sBAAY,EAAE,wBAAc,CAAC,CAAC"}