@sonarwatch/portfolio-plugins 0.11.163 → 0.11.164

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. package/CHANGELOG.md +13 -9
  2. package/package.json +2 -2
  3. package/src/index.js +4 -0
  4. package/src/index.js.map +1 -1
  5. package/src/plugins/jupiter/launchpad/allocationsFetcher.js +8 -4
  6. package/src/plugins/jupiter/launchpad/allocationsFetcher.js.map +1 -1
  7. package/src/plugins/rain/collectionsJob.d.ts +3 -0
  8. package/src/plugins/rain/collectionsJob.js +36 -0
  9. package/src/plugins/rain/collectionsJob.js.map +1 -0
  10. package/src/plugins/rain/constants.d.ts +7 -0
  11. package/src/plugins/rain/constants.js +17 -0
  12. package/src/plugins/rain/constants.js.map +1 -0
  13. package/src/plugins/rain/filters.d.ts +5 -0
  14. package/src/plugins/rain/filters.js +53 -0
  15. package/src/plugins/rain/filters.js.map +1 -0
  16. package/src/plugins/rain/helpers.d.ts +7 -0
  17. package/src/plugins/rain/helpers.js +64 -0
  18. package/src/plugins/rain/helpers.js.map +1 -0
  19. package/src/plugins/rain/index.d.ts +6 -0
  20. package/src/plugins/rain/index.js +13 -0
  21. package/src/plugins/rain/index.js.map +1 -0
  22. package/src/plugins/rain/loansFetcher.d.ts +3 -0
  23. package/src/plugins/rain/loansFetcher.js +105 -0
  24. package/src/plugins/rain/loansFetcher.js.map +1 -0
  25. package/src/plugins/rain/poolsFetcher.d.ts +3 -0
  26. package/src/plugins/rain/poolsFetcher.js +73 -0
  27. package/src/plugins/rain/poolsFetcher.js.map +1 -0
  28. package/src/plugins/rain/structs/loan.d.ts +84 -0
  29. package/src/plugins/rain/structs/loan.js +86 -0
  30. package/src/plugins/rain/structs/loan.js.map +1 -0
  31. package/src/plugins/rain/structs/pool.d.ts +77 -0
  32. package/src/plugins/rain/structs/pool.js +76 -0
  33. package/src/plugins/rain/structs/pool.js.map +1 -0
  34. package/src/plugins/rain/types.d.ts +154 -0
  35. package/src/plugins/rain/types.js +3 -0
  36. package/src/plugins/rain/types.js.map +1 -0
package/CHANGELOG.md CHANGED
@@ -2,18 +2,22 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
- ## [0.11.163](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.162...plugins-0.11.163) (2024-04-04)
6
-
7
-
8
-
9
- ## [0.11.162](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.161...plugins-0.11.162) (2024-04-04)
10
-
11
-
12
-
13
- ## [0.11.161](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.160...plugins-0.11.161) (2024-04-04)
5
+ ## [0.11.164](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.163...plugins-0.11.164) (2024-04-05)
14
6
 
15
7
 
16
8
 
9
+ ## [0.11.163](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.162...plugins-0.11.163) (2024-04-04)
10
+
11
+
12
+
13
+ ## [0.11.162](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.161...plugins-0.11.162) (2024-04-04)
14
+
15
+
16
+
17
+ ## [0.11.161](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.160...plugins-0.11.161) (2024-04-04)
18
+
19
+
20
+
17
21
  ## [0.11.160](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.159...plugins-0.11.160) (2024-04-04)
18
22
 
19
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonarwatch/portfolio-plugins",
3
- "version": "0.11.163",
3
+ "version": "0.11.164",
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.163"
44
+ "@sonarwatch/portfolio-core": "0.11.164"
45
45
  },
46
46
  "main": "./src/index.js",
47
47
  "types": "./src/index.d.ts"
package/src/index.js CHANGED
@@ -73,6 +73,7 @@ const yearn_1 = require("./plugins/yearn");
73
73
  const atrix_1 = require("./plugins/atrix");
74
74
  const _01_1 = require("./plugins/01");
75
75
  const goosefx_1 = require("./plugins/goosefx");
76
+ const rain_1 = require("./plugins/rain");
76
77
  const lifinity_1 = require("./plugins/lifinity");
77
78
  const port_1 = require("./plugins/port");
78
79
  const instadapp_1 = require("./plugins/instadapp");
@@ -166,6 +167,7 @@ exports.platforms = [
166
167
  ...atrix_1.platforms,
167
168
  ..._01_1.platforms,
168
169
  ...goosefx_1.platforms,
170
+ ...rain_1.platforms,
169
171
  ...lifinity_1.platforms,
170
172
  ...port_1.platforms,
171
173
  ...instadapp_1.platforms,
@@ -244,6 +246,7 @@ exports.jobs = [
244
246
  ...atrix_1.jobs,
245
247
  ..._01_1.jobs,
246
248
  ...goosefx_1.jobs,
249
+ ...rain_1.jobs,
247
250
  ...lifinity_1.jobs,
248
251
  ...port_1.jobs,
249
252
  ...instadapp_1.jobs,
@@ -322,6 +325,7 @@ exports.fetchers = [
322
325
  ...atrix_1.fetchers,
323
326
  ..._01_1.fetchers,
324
327
  ...goosefx_1.fetchers,
328
+ ...rain_1.fetchers,
325
329
  ...lifinity_1.fetchers,
326
330
  ...port_1.fetchers,
327
331
  ...instadapp_1.fetchers,
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/plugins/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAGA,wFAAqF;AACrF,sEAA8C;AAC9C,6CAI0B;AAC1B,yDAIgC;AAChC,iDAG4B;AAC5B,iDAI4B;AAC5B,2CAGyB;AACzB,6CAI0B;AAC1B,+CAI2B;AAC3B,yCAIwB;AACxB,+CAI2B;AAC3B,2CAIyB;AACzB,6CAI0B;AAC1B,2CAIyB;AACzB,6CAG0B;AAC1B,6CAI0B;AAC1B,yCAIwB;AACxB,2DAGiC;AACjC,6CAI0B;AAC1B,2CAIyB;AACzB,2CAIyB;AACzB,qDAA6D;AAC7D,qEA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,GAAG,mBAAgB;IACnB,GAAG,kBAAe;IAClB,GAAG,eAAY;IACf,GAAG,gBAAa;IAChB,GAAG,oBAAiB;IACpB,GAAG,gBAAa;IAChB,GAAG,gBAAa;IAChB,GAAG,cAAe;IAClB,GAAG,kBAAe;IAClB,GAAG,mBAAgB;IACnB,GAAG,eAAY;IACf,GAAG,oBAAiB;IACpB,GAAG,kBAAe;IAClB,GAAG,qBAAkB;IACrB,GAAG,gBAAa;IAChB,GAAG,gBAAa;IAChB,GAAG,eAAY;IACf,GAAG,kBAAe;IAClB,GAAG,gBAAa;IAChB,GAAG,gBAAa;IAChB,GAAG,sBAAmB;IACtB,GAAG,yBAAsB;IACzB,GAAG,gBAAa;IAChB,GAAG,eAAY;IACf,GAAG,oBAAiB;IACpB,GAAG,iBAAc;IACjB,GAAG,2BAAsB;IACzB,GAAG,yBAAkB;IACrB,GAAG,eAAY;IACf,GAAG,cAAW;IACd,GAAG,kBAAe;IAClB,GAAG,mBAAgB;IACnB,GAAG,oBAAiB;IACpB,GAAG,gBAAa;IAChB,GAAG,kBAAe;IAClB,GAAG,cAAW;IACd,GAAG,mBAAgB;IACnB,GAAG,eAAY;CAChB,CAAC;AACW,QAAA,uBAAuB,GAAG,IAAA,uDAA0B,EAAC,gBAAQ,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/plugins/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAGA,wFAAqF;AACrF,sEAA8C;AAC9C,6CAI0B;AAC1B,yDAIgC;AAChC,iDAG4B;AAC5B,iDAI4B;AAC5B,2CAGyB;AACzB,6CAI0B;AAC1B,+CAI2B;AAC3B,yCAIwB;AACxB,+CAI2B;AAC3B,2CAIyB;AACzB,6CAI0B;AAC1B,2CAIyB;AACzB,6CAG0B;AAC1B,6CAI0B;AAC1B,yCAIwB;AACxB,2DAGiC;AACjC,6CAI0B;AAC1B,2CAIyB;AACzB,2CAIyB;AACzB,qDAA6D;A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ACpB,GAAG,eAAc;IACjB,GAAG,gBAAa;IAChB,GAAG,mBAAgB;IACnB,GAAG,mBAAgB;IACnB,GAAG,kBAAe;IAClB,GAAG,eAAY;IACf,GAAG,gBAAa;IAChB,GAAG,oBAAiB;IACpB,GAAG,gBAAa;IAChB,GAAG,gBAAa;IAChB,GAAG,cAAe;IAClB,GAAG,kBAAe;IAClB,GAAG,eAAY;IACf,GAAG,mBAAgB;IACnB,GAAG,eAAY;IACf,GAAG,oBAAiB;IACpB,GAAG,kBAAe;IAClB,GAAG,qBAAkB;IACrB,GAAG,gBAAa;IAChB,GAAG,gBAAa;IAChB,GAAG,eAAY;IACf,GAAG,kBAAe;IAClB,GAAG,gBAAa;IAChB,GAAG,gBAAa;IAChB,GAAG,sBAAmB;IACtB,GAAG,yBAAsB;IACzB,GAAG,gBAAa;IAChB,GAAG,eAAY;IACf,GAAG,oBAAiB;IACpB,GAAG,iBAAc;IACjB,GAAG,2BAAsB;IACzB,GAAG,yBAAkB;IACrB,GAAG,eAAY;IACf,GAAG,cAAW;IACd,GAAG,kBAAe;IAClB,GAAG,mBAAgB;IACnB,GAAG,oBAAiB;IACpB,GAAG,gBAAa;IAChB,GAAG,kBAAe;IAClB,GAAG,cAAW;IACd,GAAG,mBAAgB;IACnB,GAAG,eAAY;CAChB,CAAC;AACW,QAAA,uBAAuB,GAAG,IAAA,uDAA0B,EAAC,gBAAQ,CAAC,CAAC"}
@@ -24,7 +24,13 @@ const constants_1 = require("./constants");
24
24
  const solana_1 = require("../../../utils/solana");
25
25
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
26
26
  const client = (0, clients_1.getClientSolana)();
27
- const claimsProof = yield Promise.all(constants_1.airdropsInfo.map((info) => axios_1.default.get(`${constants_1.merkleApi}/${info.mint}/${owner}`).catch(() => null)));
27
+ const claimsProof = yield Promise.all(constants_1.airdropsInfo.map((info) => {
28
+ if (info.claimUntilTs < Date.now())
29
+ return axios_1.default
30
+ .get(`${constants_1.merkleApi}/${info.mint}/${owner}`)
31
+ .catch(() => null);
32
+ return null;
33
+ }));
28
34
  const eligibleAirdrops = [];
29
35
  const proofs = [];
30
36
  for (let i = 0; i < claimsProof.length; i++) {
@@ -44,9 +50,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
44
50
  if (claimStatus)
45
51
  continue;
46
52
  const proof = proofs[j];
47
- const { claimUntilTs, decimals, mint } = eligibleAirdrops[j];
48
- if (claimUntilTs < Date.now())
49
- continue;
53
+ const { decimals, mint } = eligibleAirdrops[j];
50
54
  const tokenPrice = tokenPriceById.get(mint);
51
55
  const amount = new bignumber_js_1.default(proof.amount)
52
56
  .dividedBy(Math.pow(10, decimals))
@@ -1 +1 @@
1
- {"version":3,"file":"allocationsFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/launchpad/allocationsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,kDAA6C;AAC7C,6CAA4C;AAC5C,gEAAqC;AAGrC,oDAAyD;AAEzD,wCAA+C;AAC/C,wGAAgF;AAChF,uCAA8C;AAC9C,2CAMqB;AACrB,kDAAsE;AAEtE,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,WAAW,GACf,MAAM,OAAO,CAAC,GAAG,CACf,wBAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACxB,eAAK,CAAC,GAAG,CAAC,GAAG,qBAAS,IAAI,IAAI,CAAC,IAAI,IAAI,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAClE,CACF,CAAC;IAEJ,MAAM,gBAAgB,GAAkB,EAAE,CAAC;IAC3C,MAAM,MAAM,GAAyB,EAAE,CAAC;IACxC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,W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AAE;YAAE,SAAS;QAExC,MAAM,UAAU,GAAG,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAE5C,MAAM,MAAM,GAAG,IAAI,sBAAS,CAAC,KAAK,CAAC,MAAM,CAAC;aACvC,SAAS,CAAC,SAAA,EAAE,EAAI,QAAQ,CAAA,CAAC;aACzB,QAAQ,EAAE,CAAC;QACd,MAAM,KAAK,GAAG,IAAA,gCAAsB,EAClC,IAAI,EACJ,MAAM,EACN,0BAAS,CAAC,MAAM,EAChB,UAAU,EACV,SAAS,EACT,EAAE,WAAW,EAAE,IAAI,EAAE,CACtB,CAAC;QAEF,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnC,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,QAAQ;YACnC,KAAK,EAAE,SAAS;YAChB,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAE,kCAAsB;YAClC,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE;gBACJ,MAAM;aACP;YACD,KAAK,EAAE,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SAC1D;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,kCAAsB,aAAa;IAC1C,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"allocationsFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/launchpad/allocationsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,kDAA6C;AAC7C,6CAA4C;AAC5C,gEAAqC;AAGrC,oDA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E,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAE,kCAAsB;YAClC,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE;gBACJ,MAAM;aACP;YACD,KAAK,EAAE,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SAC1D;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,kCAAsB,aAAa;IAC1C,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Job } from '../../Job';
2
+ declare const job: Job;
3
+ export default job;
@@ -0,0 +1,36 @@
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 helpers_1 = require("./helpers");
15
+ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
16
+ const collections = yield (0, helpers_1.getCollections)();
17
+ const promises = [];
18
+ for (const collecion of collections) {
19
+ promises.push(cache.setItem(collecion.collectionId.toString(), collecion, {
20
+ prefix: constants_1.platformId,
21
+ networkId: portfolio_core_1.NetworkId.solana,
22
+ }));
23
+ }
24
+ promises.push(cache.setItem(constants_1.collectionsKey, collections, {
25
+ prefix: constants_1.platformId,
26
+ networkId: portfolio_core_1.NetworkId.solana,
27
+ }));
28
+ yield Promise.all(promises);
29
+ });
30
+ const job = {
31
+ id: `${constants_1.platformId}-collections`,
32
+ executor,
33
+ label: 'normal',
34
+ };
35
+ exports.default = job;
36
+ //# sourceMappingURL=collectionsJob.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collectionsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/rain/collectionsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,2CAAyD;AACzD,uCAA2C;AAE3C,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,WAAW,GAAG,MAAM,IAAA,wBAAc,GAAE,CAAC;IAC3C,MAAM,QAAQ,GAAG,EAAE,CAAC;IACpB,KAAK,MAAM,SAAS,IAAI,WAAW,EAAE,CAAC;QACpC,QAAQ,CAAC,IAAI,CACX,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE;YAC1D,MAAM,EAAE,sBAAU;YAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;SAC5B,CAAC,CACH,CAAC;IACJ,CAAC;IACD,QAAQ,CAAC,IAAI,CACX,KAAK,CAAC,OAAO,CAAC,0BAAc,EAAE,WAAW,EAAE;QACzC,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CACH,CAAC;IAEF,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC9B,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { PublicKey } from '@solana/web3.js';
2
+ import { Platform } from '@sonarwatch/portfolio-core';
3
+ export declare const platformId = "rain";
4
+ export declare const platform: Platform;
5
+ export declare const programId: PublicKey;
6
+ export declare const rainApi = "https://api-v2.rain.fi";
7
+ export declare const collectionsKey = "collections";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.collectionsKey = exports.rainApi = exports.programId = exports.platform = exports.platformId = void 0;
4
+ const web3_js_1 = require("@solana/web3.js");
5
+ exports.platformId = 'rain';
6
+ exports.platform = {
7
+ id: exports.platformId,
8
+ name: 'Rain',
9
+ image: 'https://sonar.watch/img/platforms/rain.png',
10
+ defiLlamaId: 'rain.fi', // from https://defillama.com/docs/api
11
+ website: 'https://rain.fi/',
12
+ twitter: 'https://twitter.com/RainFi_',
13
+ };
14
+ exports.programId = new web3_js_1.PublicKey('RainEraPU5yDoJmTrHdYynK9739GkEfDsE4ffqce2BR');
15
+ exports.rainApi = 'https://api-v2.rain.fi';
16
+ exports.collectionsKey = 'collections';
17
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/rain/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,MAAM,CAAC;AACpB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,4CAA4C;IACnD,WAAW,EAAE,SAAS,EAAE,sCAAsC;IAC9D,OAAO,EAAE,kBAAkB;IAC3B,OAAO,EAAE,6BAA6B;CACvC,CAAC;AAEW,QAAA,SAAS,GAAG,IAAI,mBAAS,CACpC,6CAA6C,CAC9C,CAAC;AAEW,QAAA,OAAO,GAAG,wBAAwB,CAAC;AACnC,QAAA,cAAc,GAAG,aAAa,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { GetProgramAccountsFilter } from '@solana/web3.js';
2
+ export declare const poolFilter: (owner: string) => GetProgramAccountsFilter[];
3
+ export declare const loanBorrowerFilter: (owner: string) => GetProgramAccountsFilter[];
4
+ export declare const loanLenderFilter: (owner: string) => GetProgramAccountsFilter[];
5
+ export declare const assetFilters: (owner: string) => GetProgramAccountsFilter[];
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assetFilters = exports.loanLenderFilter = exports.loanBorrowerFilter = exports.poolFilter = void 0;
4
+ const loan_1 = require("./structs/loan");
5
+ const poolFilter = (owner) => [
6
+ {
7
+ memcmp: {
8
+ offset: 9,
9
+ bytes: owner,
10
+ },
11
+ },
12
+ {
13
+ dataSize: 1331,
14
+ },
15
+ ];
16
+ exports.poolFilter = poolFilter;
17
+ const loanBorrowerFilter = (owner) => [
18
+ {
19
+ memcmp: {
20
+ offset: 10,
21
+ bytes: owner,
22
+ },
23
+ },
24
+ {
25
+ dataSize: 1080,
26
+ },
27
+ ];
28
+ exports.loanBorrowerFilter = loanBorrowerFilter;
29
+ const loanLenderFilter = (owner) => [
30
+ {
31
+ memcmp: {
32
+ offset: 42,
33
+ bytes: owner,
34
+ },
35
+ },
36
+ {
37
+ dataSize: 1080,
38
+ },
39
+ ];
40
+ exports.loanLenderFilter = loanLenderFilter;
41
+ const assetFilters = (owner) => [
42
+ {
43
+ memcmp: {
44
+ offset: 16,
45
+ bytes: owner,
46
+ },
47
+ },
48
+ {
49
+ dataSize: loan_1.assetStruct.byteSize,
50
+ },
51
+ ];
52
+ exports.assetFilters = assetFilters;
53
+ //# sourceMappingURL=filters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/rain/filters.ts"],"names":[],"mappings":";;;AACA,yCAA6C;AAEtC,MAAM,UAAU,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IACvE;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,KAAK;SACb;KACF;IACD;QACE,QAAQ,EAAE,IAAI;KACf;CACF,CAAC;AAVW,QAAA,UAAU,cAUrB;AAEK,MAAM,kBAAkB,GAAG,CAChC,KAAa,EACe,EAAE,CAAC;IAC/B;QACE,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,KAAK;SACb;KACF;IACD;QACE,QAAQ,EAAE,IAAI;KACf;CACF,CAAC;AAZW,QAAA,kBAAkB,sBAY7B;AAEK,MAAM,gBAAgB,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IAC7E;QACE,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,KAAK;SACb;KACF;IACD;QACE,QAAQ,EAAE,IAAI;KACf;CACF,CAAC;AAVW,QAAA,gBAAgB,oBAU3B;AAEK,MAAM,YAAY,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IACzE;QACE,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,KAAK;SACb;KACF;IACD;QACE,QAAQ,EAAE,kBAAW,CAAC,QAAQ;KAC/B;CACF,CAAC;AAVW,QAAA,YAAY,gBAUvB"}
@@ -0,0 +1,7 @@
1
+ import { PublicKey } from '@solana/web3.js';
2
+ import { Collection, Pool } from './types';
3
+ export declare function getPool(pool: string): Promise<Pool | undefined>;
4
+ export declare function getCollections(): Promise<Collection[]>;
5
+ export declare function getPoolPda(owner: PublicKey): PublicKey;
6
+ export declare function getLoans(owner: string): Promise<import("./types").Loan[]>;
7
+ export declare function daysBetweenDates(start: Date, end: Date): number;
@@ -0,0 +1,64 @@
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
+ exports.daysBetweenDates = exports.getLoans = exports.getPoolPda = exports.getCollections = exports.getPool = void 0;
16
+ const axios_1 = __importDefault(require("axios"));
17
+ const web3_js_1 = require("@solana/web3.js");
18
+ const bignumber_js_1 = __importDefault(require("bignumber.js"));
19
+ const constants_1 = require("./constants");
20
+ const oneDay = 1000 * 60 * 60 * 24;
21
+ function getPool(pool) {
22
+ return __awaiter(this, void 0, void 0, function* () {
23
+ const getPoolsRes = yield axios_1.default
24
+ .get(`${constants_1.rainApi}/pools/pool?pubkey=${pool}`)
25
+ .catch(() => null);
26
+ if (!getPoolsRes || !getPoolsRes.data)
27
+ return undefined;
28
+ return getPoolsRes.data.pool;
29
+ });
30
+ }
31
+ exports.getPool = getPool;
32
+ function getCollections() {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ const getCollectionsRes = yield axios_1.default.get(`${constants_1.rainApi}/collections`).catch(() => null);
35
+ if (!getCollectionsRes || !getCollectionsRes.data)
36
+ return [];
37
+ return getCollectionsRes.data.collections;
38
+ });
39
+ }
40
+ exports.getCollections = getCollections;
41
+ function getPoolPda(owner) {
42
+ return web3_js_1.PublicKey.findProgramAddressSync([Buffer.from('poolv2', 'utf-8'), owner.toBuffer()], constants_1.programId)[0];
43
+ }
44
+ exports.getPoolPda = getPoolPda;
45
+ function getLoans(owner) {
46
+ return __awaiter(this, void 0, void 0, function* () {
47
+ const getLoansRes = yield axios_1.default
48
+ .get(`${constants_1.rainApi}/loans/user?pubkey=${owner}`)
49
+ .catch(() => null);
50
+ if (!getLoansRes || getLoansRes.data.ongoingCount === 0)
51
+ return [];
52
+ return getLoansRes.data.loans;
53
+ });
54
+ }
55
+ exports.getLoans = getLoans;
56
+ function daysBetweenDates(start, end) {
57
+ return new bignumber_js_1.default(end.getTime())
58
+ .minus(start.getTime())
59
+ .dividedBy(oneDay)
60
+ .decimalPlaces(0, bignumber_js_1.default.ROUND_DOWN)
61
+ .toNumber();
62
+ }
63
+ exports.daysBetweenDates = daysBetweenDates;
64
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/rain/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAA6C;AAC7C,6CAA4C;AAC5C,gEAAqC;AACrC,2CAAiD;AASjD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAEnC,SAAsB,OAAO,CAAC,IAAY;;QACxC,MAAM,WAAW,GAAuC,MAAM,eAAK;aAChE,GAAG,CAAC,GAAG,mBAAO,sBAAsB,IAAI,EAAE,CAAC;aAC3C,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;QACrB,IAAI,CAAC,WAAW,IAAI,CAAC,WAAW,CAAC,IAAI;YAAE,OAAO,SAAS,CAAC;QACxD,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;IAC/B,CAAC;CAAA;AAND,0BAMC;AAED,SAAsB,cAAc;;QAClC,MAAM,iBAAiB,GACrB,MAAM,eAAK,CAAC,GAAG,CAAC,GAAG,mBAAO,cAAc,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;QAC9D,IAAI,CAAC,iBAAiB,IAAI,CAAC,iBAAiB,CAAC,IAAI;YAAE,OAAO,EAAE,CAAC;QAC7D,OAAO,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC;IAC5C,CAAC;CAAA;AALD,wCAKC;AAED,SAAgB,UAAU,CAAC,KAAgB;IACzC,OAAO,mBAAS,CAAC,sBAAsB,CACrC,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,EAClD,qBAAS,CACV,CAAC,CAAC,CAAC,CAAC;AACP,CAAC;AALD,gCAKC;AAED,SAAsB,QAAQ,CAAC,KAAa;;QAC1C,MAAM,WAAW,GAAwC,MAAM,eAAK;aACjE,GAAG,CAAC,GAAG,mBAAO,sBAAsB,KAAK,EAAE,CAAC;aAC5C,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;QACrB,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,IAAI,CAAC,YAAY,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QACnE,OAAO,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC;IAChC,CAAC;CAAA;AAND,4BAMC;AAED,SAAgB,gBAAgB,CAAC,KAAW,EAAE,GAAS;IACrD,OAAO,IAAI,sBAAS,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;SAChC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;SACtB,SAAS,CAAC,MAAM,CAAC;SACjB,aAAa,CAAC,CAAC,EAAE,sBAAS,CAAC,UAAU,CAAC;SACtC,QAAQ,EAAE,CAAC;AAChB,CAAC;AAND,4CAMC"}
@@ -0,0 +1,6 @@
1
+ import { Platform } from '@sonarwatch/portfolio-core';
2
+ import { Fetcher } from '../../Fetcher';
3
+ import { Job } from '../../Job';
4
+ export declare const platforms: Platform[];
5
+ export declare const jobs: Job[];
6
+ export declare const fetchers: Fetcher[];
@@ -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 poolsFetcher_1 = __importDefault(require("./poolsFetcher"));
9
+ const loansFetcher_1 = __importDefault(require("./loansFetcher"));
10
+ exports.platforms = [constants_1.platform];
11
+ exports.jobs = [];
12
+ exports.fetchers = [poolsFetcher_1.default, loansFetcher_1.default];
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/rain/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,kEAA0C;AAC1C,kEAA0C;AAE7B,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,EAAE,CAAC;AACjB,QAAA,QAAQ,GAAc,CAAC,sBAAY,EAAE,sBAAY,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Fetcher } from '../../Fetcher';
2
+ declare const fetcher: Fetcher;
3
+ export default fetcher;
@@ -0,0 +1,105 @@
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 web3_js_1 = require("@solana/web3.js");
17
+ const bignumber_js_1 = __importDefault(require("bignumber.js"));
18
+ const constants_1 = require("./constants");
19
+ const clients_1 = require("../../utils/clients");
20
+ const solana_1 = require("../../utils/solana");
21
+ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
22
+ const pool_1 = require("./structs/pool");
23
+ const helpers_1 = require("./helpers");
24
+ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
25
+ const client = (0, clients_1.getClientSolana)();
26
+ // const loans = await getParsedProgramAccounts(
27
+ // client,
28
+ // loanStruct,
29
+ // programId,
30
+ // loanBorrowerFilter(owner)
31
+ // );
32
+ // if (loans.length === 0) return [];
33
+ const loans = yield (0, helpers_1.getLoans)(owner);
34
+ if (loans.length === 0)
35
+ return [];
36
+ const mints = new Set();
37
+ const pools = new Set();
38
+ loans.forEach((loan) => {
39
+ pools.add(loan.pool.toString());
40
+ mints.add(loan.currency.toString());
41
+ mints.add(loan.mint.toString());
42
+ });
43
+ const tokenPriceById = yield cache.getTokenPricesAsMap(Array.from(mints), portfolio_core_1.NetworkId.solana);
44
+ const poolsAccounts = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, pool_1.poolStruct, Array.from(pools).map((pool) => new web3_js_1.PublicKey(pool)));
45
+ const poolById = new Map();
46
+ poolsAccounts.forEach((account) => account ? poolById.set(account.pubkey.toString(), account) : undefined);
47
+ const elements = [];
48
+ for (const loan of loans) {
49
+ if (new bignumber_js_1.default(loan.amount).isZero())
50
+ continue;
51
+ if (loan.status !== 'Ongoing')
52
+ continue;
53
+ if (!loan.isDefi)
54
+ continue;
55
+ const collateraMint = loan.mint.toString();
56
+ const borrowMint = loan.currency.toString();
57
+ const collatTokenPrice = tokenPriceById.get(collateraMint);
58
+ const borrowTokenPrice = tokenPriceById.get(borrowMint);
59
+ if (!collatTokenPrice || !borrowTokenPrice)
60
+ continue;
61
+ const borrowedAssets = [];
62
+ const borrowedYields = [];
63
+ const suppliedAssets = [];
64
+ const suppliedYields = [];
65
+ const rewardAssets = [];
66
+ const amountBorrowed = new bignumber_js_1.default(loan.amount).dividedBy(Math.pow(10, borrowTokenPrice.decimals));
67
+ const daysRemaining = (0, helpers_1.daysBetweenDates)(new Date(), new Date(loan.expiredAt));
68
+ if (!amountBorrowed.isZero())
69
+ borrowedAssets.push((0, tokenPriceToAssetToken_1.default)(borrowTokenPrice.address, amountBorrowed.toNumber(), portfolio_core_1.NetworkId.solana, borrowTokenPrice, undefined, { tags: [`Refund in ${daysRemaining} days`] }));
70
+ const amountDeposited = new bignumber_js_1.default(loan.collateralAmount).dividedBy(Math.pow(10, collatTokenPrice.decimals));
71
+ if (!amountDeposited.isZero())
72
+ suppliedAssets.push((0, tokenPriceToAssetToken_1.default)(collatTokenPrice.address, amountDeposited.toNumber(), portfolio_core_1.NetworkId.solana, collatTokenPrice));
73
+ if (suppliedAssets.length === 0 && borrowedAssets.length === 0)
74
+ continue;
75
+ const { borrowedValue, healthRatio, suppliedValue, value, rewardValue } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets);
76
+ elements.push({
77
+ type: portfolio_core_1.PortfolioElementType.borrowlend,
78
+ networkId: portfolio_core_1.NetworkId.solana,
79
+ platformId: constants_1.platformId,
80
+ label: 'Lending',
81
+ value,
82
+ data: {
83
+ borrowedAssets,
84
+ borrowedValue,
85
+ borrowedYields,
86
+ suppliedAssets,
87
+ suppliedValue,
88
+ suppliedYields,
89
+ rewardAssets,
90
+ healthRatio,
91
+ collateralRatio: null,
92
+ rewardValue,
93
+ value,
94
+ },
95
+ });
96
+ }
97
+ return elements;
98
+ });
99
+ const fetcher = {
100
+ id: `${constants_1.platformId}-loans`,
101
+ networkId: portfolio_core_1.NetworkId.solana,
102
+ executor,
103
+ };
104
+ exports.default = fetcher;
105
+ //# sourceMappingURL=loansFetcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loansFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/rain/loansFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAOoC;AACpC,6CAA4C;AAC5C,gEAAqC;AAGrC,2CAAyC;AACzC,iDAAsD;AACtD,+CAG4B;AAC5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AAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Fetcher } from '../../Fetcher';
2
+ declare const fetcher: Fetcher;
3
+ export default fetcher;
@@ -0,0 +1,73 @@
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 spl_name_service_1 = require("@bonfida/spl-name-service");
17
+ const js_1 = require("@metaplex-foundation/js");
18
+ const web3_js_1 = require("@solana/web3.js");
19
+ const constants_1 = require("./constants");
20
+ const clients_1 = require("../../utils/clients");
21
+ const pool_1 = require("./structs/pool");
22
+ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
23
+ const helpers_1 = require("./helpers");
24
+ const getParsedAccountInfo_1 = require("../../utils/solana/getParsedAccountInfo");
25
+ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
26
+ const client = (0, clients_1.getClientSolana)();
27
+ // Trying to get https://solscan.io/account/4g5zooignaoVrS6NdUWEcNLxZmJGN9UJBAGtrUiBwieF
28
+ const pda = (0, helpers_1.getPoolPda)(new web3_js_1.PublicKey(owner));
29
+ const poolAccount = yield (0, getParsedAccountInfo_1.getParsedAccountInfo)(client, pool_1.poolStruct, pda);
30
+ const tokenPriceById = yield cache.getTokenPricesAsMap([spl_name_service_1.USDC_MINT.toString(), js_1.WRAPPED_SOL_MINT.toString()], portfolio_core_1.NetworkId.solana);
31
+ if (!poolAccount || poolAccount.totalAmount.isZero())
32
+ return [];
33
+ const usdcTokenPrice = tokenPriceById.get(spl_name_service_1.USDC_MINT.toString());
34
+ const borrowedAssets = [];
35
+ const borrowedYields = [];
36
+ const suppliedAssets = [];
37
+ const suppliedYields = [];
38
+ const rewardAssets = [];
39
+ const amount = poolAccount.totalAmount.dividedBy(Math.pow(10, 6)).toNumber();
40
+ suppliedAssets.push((0, tokenPriceToAssetToken_1.default)(spl_name_service_1.USDC_MINT.toString(), amount, portfolio_core_1.NetworkId.solana, usdcTokenPrice));
41
+ if (suppliedAssets.length === 0 && borrowedAssets.length === 0)
42
+ return [];
43
+ const { borrowedValue, healthRatio, rewardValue, suppliedValue, value } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets);
44
+ return [
45
+ {
46
+ type: portfolio_core_1.PortfolioElementType.borrowlend,
47
+ networkId: portfolio_core_1.NetworkId.solana,
48
+ platformId: constants_1.platformId,
49
+ label: 'Lending',
50
+ value,
51
+ data: {
52
+ borrowedAssets,
53
+ borrowedValue,
54
+ borrowedYields,
55
+ suppliedAssets,
56
+ suppliedValue,
57
+ suppliedYields,
58
+ collateralRatio: null,
59
+ healthRatio,
60
+ rewardValue,
61
+ rewardAssets,
62
+ value,
63
+ },
64
+ },
65
+ ];
66
+ });
67
+ const fetcher = {
68
+ id: `${constants_1.platformId}-pools`,
69
+ networkId: portfolio_core_1.NetworkId.solana,
70
+ executor,
71
+ };
72
+ exports.default = fetcher;
73
+ //# sourceMappingURL=poolsFetcher.js.map
@@ -0,0 +1 @@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E,cAAc,CAAC,IAAI,CACjB,IAAA,gCAAsB,EACpB,4BAAS,CAAC,QAAQ,EAAE,EACpB,MAAM,EACN,0BAAS,CAAC,MAAM,EAChB,cAAc,CACf,CACF,CAAC;IAEF,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAE1E,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,KAAK,EAAE,GACrE,IAAA,wCAAuB,EAAC,cAAc,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC;IAExE,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,UAAU;YACrC,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,SAAS;YAChB,KAAK;YACL,IAAI,EAAE;gBACJ,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,eAAe,EAAE,IAAI;gBACrB,WAAW;gBACX,WAAW;gBACX,YAAY;gBACZ,KAAK;aACN;SACF;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -0,0 +1,84 @@
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 LoanKind {
6
+ Loan = 0,
7
+ Mortgage = 1
8
+ }
9
+ export declare enum LoanStatus {
10
+ Ongoing = 0,
11
+ Repaid = 1,
12
+ Liquidated = 2,
13
+ Sold = 3
14
+ }
15
+ export declare enum Marketplace {
16
+ None = 0,
17
+ Auctionhouse = 1,
18
+ Solanart = 2,
19
+ Hyperspace = 3,
20
+ Yaww = 4,
21
+ Hadeswap = 5,
22
+ Rain = 6,
23
+ TensorswapOrder = 7,
24
+ TensorswapListing = 8,
25
+ MagicEden = 9
26
+ }
27
+ export type Sale = {
28
+ isForSale: boolean;
29
+ salePrice: BigNumber;
30
+ currency: PublicKey;
31
+ };
32
+ export declare const saleStruct: BeetStruct<Sale, Partial<Sale>>;
33
+ export type Listing = {
34
+ isListed: boolean;
35
+ price: BigNumber;
36
+ };
37
+ export declare const listingStruct: BeetStruct<Listing, Partial<Listing>>;
38
+ export type Loan = {
39
+ buffer: Buffer;
40
+ kind: LoanKind;
41
+ status: LoanStatus;
42
+ borrower: PublicKey;
43
+ lender: PublicKey;
44
+ pool: PublicKey;
45
+ mint: PublicKey;
46
+ currency: PublicKey;
47
+ isCustom: boolean;
48
+ isFrozen: boolean;
49
+ price: BigNumber;
50
+ interest: BigNumber;
51
+ amount: BigNumber;
52
+ duration: BigNumber;
53
+ collection: number;
54
+ liquidation: number;
55
+ marketplace: Marketplace;
56
+ sale: Sale;
57
+ createdAt: BigNumber;
58
+ expiredAt: BigNumber;
59
+ repaidAt: BigNumber;
60
+ soldAt: BigNumber;
61
+ liquidatedAt: BigNumber;
62
+ listing: Listing;
63
+ isCompressedLoan: boolean;
64
+ isDefi: boolean;
65
+ padding: BigNumber[];
66
+ padding1: BigNumber;
67
+ padding2: number;
68
+ };
69
+ export declare const loanStruct: BeetStruct<Loan, Partial<Loan>>;
70
+ export type Asset = {
71
+ buffer: Buffer;
72
+ discriminator: BigNumber;
73
+ borrower: PublicKey;
74
+ nft: PublicKey;
75
+ currencyIn: PublicKey;
76
+ currencyOut: PublicKey;
77
+ pythInFeed: PublicKey;
78
+ pythOutFeed: PublicKey;
79
+ amount: BigNumber;
80
+ decimals: number;
81
+ createdAt: BigNumber;
82
+ padding: BigNumber[];
83
+ };
84
+ export declare const assetStruct: BeetStruct<Asset, Partial<Asset>>;
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assetStruct = exports.loanStruct = exports.listingStruct = exports.saleStruct = exports.Marketplace = exports.LoanStatus = exports.LoanKind = 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 LoanKind;
8
+ (function (LoanKind) {
9
+ LoanKind[LoanKind["Loan"] = 0] = "Loan";
10
+ LoanKind[LoanKind["Mortgage"] = 1] = "Mortgage";
11
+ })(LoanKind || (exports.LoanKind = LoanKind = {}));
12
+ var LoanStatus;
13
+ (function (LoanStatus) {
14
+ LoanStatus[LoanStatus["Ongoing"] = 0] = "Ongoing";
15
+ LoanStatus[LoanStatus["Repaid"] = 1] = "Repaid";
16
+ LoanStatus[LoanStatus["Liquidated"] = 2] = "Liquidated";
17
+ LoanStatus[LoanStatus["Sold"] = 3] = "Sold";
18
+ })(LoanStatus || (exports.LoanStatus = LoanStatus = {}));
19
+ var Marketplace;
20
+ (function (Marketplace) {
21
+ Marketplace[Marketplace["None"] = 0] = "None";
22
+ Marketplace[Marketplace["Auctionhouse"] = 1] = "Auctionhouse";
23
+ Marketplace[Marketplace["Solanart"] = 2] = "Solanart";
24
+ Marketplace[Marketplace["Hyperspace"] = 3] = "Hyperspace";
25
+ Marketplace[Marketplace["Yaww"] = 4] = "Yaww";
26
+ Marketplace[Marketplace["Hadeswap"] = 5] = "Hadeswap";
27
+ Marketplace[Marketplace["Rain"] = 6] = "Rain";
28
+ Marketplace[Marketplace["TensorswapOrder"] = 7] = "TensorswapOrder";
29
+ Marketplace[Marketplace["TensorswapListing"] = 8] = "TensorswapListing";
30
+ Marketplace[Marketplace["MagicEden"] = 9] = "MagicEden";
31
+ })(Marketplace || (exports.Marketplace = Marketplace = {}));
32
+ exports.saleStruct = new beet_1.BeetStruct([
33
+ ['isForSale', beet_1.bool],
34
+ ['salePrice', solana_1.u64],
35
+ ['currency', beet_solana_1.publicKey],
36
+ ], (args) => args);
37
+ exports.listingStruct = new beet_1.BeetStruct([
38
+ ['isListed', beet_1.bool],
39
+ ['price', solana_1.u64],
40
+ ], (args) => args);
41
+ exports.loanStruct = new beet_1.BeetStruct([
42
+ ['buffer', (0, solana_1.blob)(8)],
43
+ ['kind', beet_1.u8],
44
+ ['status', beet_1.u8],
45
+ ['borrower', beet_solana_1.publicKey],
46
+ ['lender', beet_solana_1.publicKey],
47
+ ['pool', beet_solana_1.publicKey],
48
+ ['mint', beet_solana_1.publicKey],
49
+ ['currency', beet_solana_1.publicKey],
50
+ ['isCustom', beet_1.bool],
51
+ ['isFrozen', beet_1.bool],
52
+ ['price', solana_1.u64],
53
+ ['interest', solana_1.u64],
54
+ ['amount', solana_1.u64],
55
+ ['duration', solana_1.u64],
56
+ ['collection', beet_1.u32],
57
+ ['liquidation', beet_1.u16],
58
+ ['marketplace', beet_1.u8],
59
+ ['sale', exports.saleStruct],
60
+ ['createdAt', solana_1.u64],
61
+ ['expiredAt', solana_1.u64],
62
+ ['repaidAt', solana_1.u64],
63
+ ['soldAt', solana_1.u64],
64
+ ['liquidatedAt', solana_1.u64],
65
+ ['listing', exports.listingStruct],
66
+ ['isCompressedLoan', beet_1.bool],
67
+ ['isDefi', beet_1.bool],
68
+ ['padding', (0, beet_1.uniformFixedSizeArray)(solana_1.u64, 6)],
69
+ ['padding1', beet_1.u32],
70
+ ['padding2', beet_1.u8],
71
+ ], (args) => args);
72
+ exports.assetStruct = new beet_1.BeetStruct([
73
+ ['buffer', (0, solana_1.blob)(8)],
74
+ ['discriminator', solana_1.u64],
75
+ ['borrower', beet_solana_1.publicKey],
76
+ ['nft', beet_solana_1.publicKey],
77
+ ['currencyIn', beet_solana_1.publicKey],
78
+ ['currencyOut', beet_solana_1.publicKey],
79
+ ['pythInFeed', beet_solana_1.publicKey],
80
+ ['pythOutFeed', beet_solana_1.publicKey],
81
+ ['amount', solana_1.u64],
82
+ ['decimals', beet_1.u8],
83
+ ['createdAt', solana_1.u64],
84
+ ['padding', (0, beet_1.uniformFixedSizeArray)(solana_1.u64, 32)],
85
+ ], (args) => args);
86
+ //# sourceMappingURL=loan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loan.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/rain/structs/loan.ts"],"names":[],"mappings":";;;AAAA,oDAOmC;AACnC,kEAA6D;AAG7D,kDAAkD;AAElD,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,uCAAI,CAAA;IACJ,+CAAQ,CAAA;AACV,CAAC,EAHW,QAAQ,wBAAR,QAAQ,QAGnB;AAED,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,iDAAO,CAAA;IACP,+CAAM,CAAA;IACN,uDAAU,CAAA;IACV,2CAAI,CAAA;AACN,CAAC,EALW,UAAU,0BAAV,UAAU,QAKrB;AAED,IAAY,WAWX;AAXD,WAAY,WAAW;IACrB,6CAAI,CAAA;IACJ,6DAAY,CAAA;IACZ,qDAAQ,CAAA;IACR,yDAAU,CAAA;IACV,6CAAI,CAAA;IACJ,qDAAQ,CAAA;IACR,6CAAI,CAAA;IACJ,mEAAe,CAAA;IACf,uEAAiB,CAAA;IACjB,uDAAS,CAAA;AACX,CAAC,EAXW,WAAW,2BAAX,WAAW,QAWtB;AAMY,QAAA,UAAU,GAAG,IAAI,iBAAU,CACtC;IACE,CAAC,WAAW,EAAE,WAAI,CAAC;IACnB,CAAC,WAAW,EAAE,YAAG,CAAC;IAClB,CAAC,UAAU,EAAE,uBAAS,CAAC;CACxB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAY,CACvB,CAAC;AAMW,QAAA,aAAa,GAAG,IAAI,iBAAU,CACzC;IACE,CAAC,UAAU,EAAE,WAAI,CAAC;IAClB,CAAC,OAAO,EAAE,YAAG,CAAC;CACf,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAe,CAC1B,CAAC;AAkCW,QAAA,UAAU,GAAG,IAAI,iBAA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ACvC;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,eAAe,EAAE,YAAG,CAAC;IACtB,CAAC,UAAU,EAAE,uBAAS,CAAC;IACvB,CAAC,KAAK,EAAE,uBAAS,CAAC;IAClB,CAAC,YAAY,EAAE,uBAAS,CAAC;IACzB,CAAC,aAAa,EAAE,uBAAS,CAAC;IAC1B,CAAC,YAAY,EAAE,uBAAS,CAAC;IACzB,CAAC,aAAa,EAAE,uBAAS,CAAC;IAC1B,CAAC,QAAQ,EAAE,YAAG,CAAC;IACf,CAAC,UAAU,EAAE,SAAE,CAAC;IAChB,CAAC,WAAW,EAAE,YAAG,CAAC;IAClB,CAAC,SAAS,EAAE,IAAA,4BAAqB,EAAC,YAAG,EAAE,EAAE,CAAC,CAAC;CAC5C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAa,CACxB,CAAC"}
@@ -0,0 +1,77 @@
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 PoolStatus {
6
+ Ready = 0,
7
+ Disabled = 1
8
+ }
9
+ export type Curve = {
10
+ baseInterest: number;
11
+ interestRate: number;
12
+ curveRate: number;
13
+ curveRateDay: number;
14
+ maxDuration: BigNumber;
15
+ maxAmount: BigNumber;
16
+ };
17
+ export declare const curveStruct: BeetStruct<Curve, Partial<Curve>>;
18
+ export type PoolCondition = {
19
+ isEnabled: boolean;
20
+ minAge: BigNumber;
21
+ minLoan: BigNumber;
22
+ minVolume: number;
23
+ liquidationThreshold: number;
24
+ padding1: number;
25
+ padding2: number;
26
+ padding3: number;
27
+ };
28
+ export declare const poolConditionStruct: BeetStruct<PoolCondition, Partial<PoolCondition>>;
29
+ export type PoolLiquidation = {
30
+ loanLiquidation: number;
31
+ mortgageLiquidation: number;
32
+ isAutoSellEnabled: boolean;
33
+ percentageMaxLoss: number;
34
+ };
35
+ export declare const poolLiquidationStruct: BeetStruct<PoolLiquidation, Partial<PoolLiquidation>>;
36
+ export type PoolCollection = {
37
+ collection: number;
38
+ collectionLtv: number;
39
+ exposure: number;
40
+ amountUsed: BigNumber;
41
+ };
42
+ export declare const poolCollectionStruct: BeetStruct<PoolCollection, Partial<PoolCollection>>;
43
+ export type Pool = {
44
+ buffer: Buffer;
45
+ bump: number;
46
+ owner: PublicKey;
47
+ currency: PublicKey;
48
+ oraclePoolUsd: PublicKey;
49
+ oracleSolUsd: PublicKey;
50
+ status: PoolStatus;
51
+ isCompounded: boolean;
52
+ isShared: boolean;
53
+ totalAmount: BigNumber;
54
+ borrowedAmount: BigNumber;
55
+ availableAmount: BigNumber;
56
+ usableAmount: BigNumber;
57
+ loanCurve: Curve;
58
+ mortgageCurve: Curve;
59
+ isMortgageEnabled: boolean;
60
+ nftLocked: BigNumber;
61
+ totalLiquidations: BigNumber;
62
+ totalLoans: BigNumber;
63
+ totalMortgages: BigNumber;
64
+ totalInterest: BigNumber;
65
+ depositedAt: BigNumber;
66
+ createdAt: BigNumber;
67
+ updatedAt: BigNumber;
68
+ collectionsUpdatedAt: BigNumber;
69
+ lastLoanAt: BigNumber;
70
+ lastMortgageAt: BigNumber;
71
+ conditions: PoolCondition;
72
+ liquidation: PoolLiquidation;
73
+ whitelist: PublicKey;
74
+ padding: BigNumber[];
75
+ collections: PoolCollection[];
76
+ };
77
+ export declare const poolStruct: BeetStruct<Pool, Partial<Pool>>;
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.poolStruct = exports.poolCollectionStruct = exports.poolLiquidationStruct = exports.poolConditionStruct = exports.curveStruct = exports.PoolStatus = 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 PoolStatus;
8
+ (function (PoolStatus) {
9
+ PoolStatus[PoolStatus["Ready"] = 0] = "Ready";
10
+ PoolStatus[PoolStatus["Disabled"] = 1] = "Disabled";
11
+ })(PoolStatus || (exports.PoolStatus = PoolStatus = {}));
12
+ exports.curveStruct = new beet_1.BeetStruct([
13
+ ['baseInterest', beet_1.u16],
14
+ ['interestRate', beet_1.u16],
15
+ ['curveRate', beet_1.u16],
16
+ ['curveRateDay', beet_1.u16],
17
+ ['maxDuration', solana_1.u64],
18
+ ['maxAmount', solana_1.u64],
19
+ ], (args) => args);
20
+ exports.poolConditionStruct = new beet_1.BeetStruct([
21
+ ['isEnabled', beet_1.bool],
22
+ ['minAge', solana_1.u64],
23
+ ['minLoan', solana_1.u64],
24
+ ['minVolume', solana_1.u64],
25
+ ['liquidationThreshold', beet_1.u16],
26
+ ['padding1', beet_1.u16],
27
+ ['padding2', beet_1.u16],
28
+ ['padding3', beet_1.u8],
29
+ ], (args) => args);
30
+ exports.poolLiquidationStruct = new beet_1.BeetStruct([
31
+ ['loanLiquidation', beet_1.u16],
32
+ ['mortgageLiquidation', beet_1.u16],
33
+ ['isAutoSellEnabled', beet_1.bool],
34
+ ['percentageMaxLoss', beet_1.u16],
35
+ ], (args) => args);
36
+ exports.poolCollectionStruct = new beet_1.BeetStruct([
37
+ ['collection', beet_1.u32],
38
+ ['collectionLtv', beet_1.u16],
39
+ ['exposure', beet_1.u16],
40
+ ['amountUsed', solana_1.u64],
41
+ ], (args) => args);
42
+ exports.poolStruct = new beet_1.BeetStruct([
43
+ ['buffer', (0, solana_1.blob)(8)],
44
+ ['bump', beet_1.u8],
45
+ ['owner', beet_solana_1.publicKey],
46
+ ['currency', beet_solana_1.publicKey],
47
+ ['oraclePoolUsd', beet_solana_1.publicKey],
48
+ ['oracleSolUsd', beet_solana_1.publicKey],
49
+ ['status', beet_1.u8],
50
+ ['isCompounded', beet_1.bool],
51
+ ['isShared', beet_1.bool],
52
+ ['totalAmount', solana_1.u64],
53
+ ['borrowedAmount', solana_1.u64],
54
+ ['availableAmount', solana_1.u64],
55
+ ['usableAmount', solana_1.u64],
56
+ ['loanCurve', exports.curveStruct],
57
+ ['mortgageCurve', exports.curveStruct],
58
+ ['isMortgageEnabled', beet_1.bool],
59
+ ['nftLocked', solana_1.u64],
60
+ ['totalLiquidations', solana_1.u64],
61
+ ['totalLoans', solana_1.u64],
62
+ ['totalMortgages', solana_1.u64],
63
+ ['totalInterest', solana_1.u64],
64
+ ['depositedAt', solana_1.u64],
65
+ ['createdAt', solana_1.u64],
66
+ ['updatedAt', solana_1.u64],
67
+ ['collectionsUpdatedAt', solana_1.u64],
68
+ ['lastLoanAt', solana_1.u64],
69
+ ['lastMortgageAt', solana_1.u64],
70
+ ['conditions', exports.poolConditionStruct],
71
+ ['liquidation', exports.poolLiquidationStruct],
72
+ ['whitelist', beet_solana_1.publicKey],
73
+ ['padding', (0, beet_1.uniformFixedSizeArray)(solana_1.u64, 16)],
74
+ ['collections', (0, beet_1.uniformFixedSizeArray)(exports.poolCollectionStruct, 50)],
75
+ ], (args) => args);
76
+ //# sourceMappingURL=pool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pool.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/rain/structs/pool.ts"],"names":[],"mappings":";;;AAAA,oDAOmC;AACnC,kEAA6D;AAG7D,kDAAkD;AAElD,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,6CAAK,CAAA;IACL,mDAAQ,CAAA;AACV,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB;AAWY,QAAA,WAAW,GAAG,IAAI,iBAAU,CACvC;IACE,CAAC,cAAc,EAAE,UAAG,CAAC;IACrB,CAAC,cAAc,EAAE,UAAG,CAAC;IACrB,CAAC,WAAW,EAAE,UAAG,CAAC;IAClB,CAAC,cAAc,EAAE,UAAG,CAAC;IACrB,CAAC,aAAa,EAAE,YAAG,CAAC;IACpB,CAAC,WAAW,EAAE,YAAG,CAAC;CACnB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAa,CACx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,SAAE,CAAC;IACd,CAAC,cAAc,EAAE,WAAI,CAAC;IACtB,CAAC,UAAU,EAAE,WAAI,CAAC;IAClB,CAAC,aAAa,EAAE,YAAG,CAAC;IACpB,CAAC,gBAAgB,EAAE,YAAG,CAAC;IACvB,CAAC,iBAAiB,EAAE,YAAG,CAAC;IACxB,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,WAAW,EAAE,mBAAW,CAAC;IAC1B,CAAC,eAAe,EAAE,mBAAW,CAAC;IAC9B,CAAC,mBAAmB,EAAE,WAAI,CAAC;IAC3B,CAAC,WAAW,EAAE,YAAG,CAAC;IAClB,CAAC,mBAAmB,EAAE,YAAG,CAAC;IAC1B,CAAC,YAAY,EAAE,YAAG,CAAC;IACnB,CAAC,gBAAgB,EAAE,YAAG,CAAC;IACvB,CAAC,eAAe,EAAE,YAAG,CAAC;IACtB,CAAC,aAAa,EAAE,YAAG,CAAC;IACpB,CAAC,WAAW,EAAE,YAAG,CAAC;IAClB,CAAC,WAAW,EAAE,YAAG,CAAC;IAClB,CAAC,sBAAsB,EAAE,YAAG,CAAC;IAC7B,CAAC,YAAY,EAAE,YAAG,CAAC;IACnB,CAAC,gBAAgB,EAAE,YAAG,CAAC;IACvB,CAAC,YAAY,EAAE,2BAAmB,CAAC;IACnC,CAAC,aAAa,EAAE,6BAAqB,CAAC;IACtC,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,SAAS,EAAE,IAAA,4BAAqB,EAAC,YAAG,EAAE,EAAE,CAAC,CAAC;IAC3C,CAAC,aAAa,EAAE,IAAA,4BAAqB,EAAC,4BAAoB,EAAE,EAAE,CAAC,CAAC;CACjE,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAY,CACvB,CAAC"}
@@ -0,0 +1,154 @@
1
+ import { PoolStatus } from './structs/pool';
2
+ export type PoolResponse = {
3
+ pubkey: string;
4
+ pool: Pool;
5
+ };
6
+ export type CollectionResponse = {
7
+ collections: Collection[];
8
+ };
9
+ export type Pool = {
10
+ owner: string;
11
+ currency: string;
12
+ oraclePoolUsd: string;
13
+ oracleSolUsd: string;
14
+ status: PoolStatus;
15
+ isCompounded: boolean;
16
+ isShared: boolean;
17
+ totalAmount: string;
18
+ borrowedAmount: string;
19
+ availableAmount: string;
20
+ usableAmount: string;
21
+ loanCurve: Curve;
22
+ mortgageCurve: Curve;
23
+ isMortgageEnabled: boolean;
24
+ nftLocked: string;
25
+ totalLiquidations: string;
26
+ totalLoans: string;
27
+ totalMortgages: string;
28
+ totalInterest: string;
29
+ depositedAt: string;
30
+ createdAt: string;
31
+ updatedAt: string;
32
+ collectionsUpdatedAt: string;
33
+ lastLoanAt: string;
34
+ lastMortgageAt: string;
35
+ conditions: PoolCondition;
36
+ liquidation: PoolLiquidation;
37
+ whitelist: string;
38
+ padding: string[];
39
+ collections: PoolCollection[];
40
+ };
41
+ export type PoolCollection = {
42
+ collection: string;
43
+ collectionLtv: number;
44
+ exposure: number;
45
+ amountUsed: string;
46
+ };
47
+ export type PoolLiquidation = {
48
+ loanLiquidation: number;
49
+ mortgageLiquidation: number;
50
+ isAutoSellEnabled: boolean;
51
+ percentageMaxLoss: number;
52
+ };
53
+ export type PoolCondition = {
54
+ isEnabled: boolean;
55
+ minAge: string;
56
+ minLoan: string;
57
+ minVolume: number;
58
+ liquidationThreshold: number;
59
+ padding1: number;
60
+ padding2: number;
61
+ padding3: number;
62
+ };
63
+ export type Curve = {
64
+ baseInterest: number;
65
+ interestRate: number;
66
+ curveRate: number;
67
+ curveRateDay: number;
68
+ maxDuration: string;
69
+ maxAmount: string;
70
+ };
71
+ export type Collection = {
72
+ collectionId: number;
73
+ pubkey: string;
74
+ slug: string;
75
+ name: string;
76
+ thumbnail: string;
77
+ banner: string;
78
+ nftLocked: string;
79
+ supply: string;
80
+ floorPrice: string;
81
+ isLocked: boolean;
82
+ offChainData: {
83
+ collectionNameMe: string;
84
+ collectionNameTensor: string;
85
+ collectionName: string;
86
+ image: string;
87
+ collectionSolanart: string;
88
+ isMortgageEnabled: boolean;
89
+ isPnft: boolean;
90
+ isClaimable: boolean;
91
+ collectionHyperspace: string;
92
+ sharkyApy: number;
93
+ _id: string;
94
+ };
95
+ createdAt: string;
96
+ updatedAt: string;
97
+ deletedAt: string;
98
+ version: number;
99
+ };
100
+ export type LoansResponse = {
101
+ user: string;
102
+ platform: string;
103
+ limit: number;
104
+ offset: number;
105
+ isAdmin: number;
106
+ totalCount: number;
107
+ ongoingCount: number;
108
+ loans: Loan[];
109
+ };
110
+ export type Loan = {
111
+ pubkey: string;
112
+ kind: string;
113
+ status: string;
114
+ borrower: string;
115
+ lender: string;
116
+ pool: string;
117
+ mint: string;
118
+ currency: string;
119
+ isCustom: boolean;
120
+ isFrozen: boolean;
121
+ isCompressedLoan: boolean;
122
+ isDefi: boolean;
123
+ collateralAmount: string;
124
+ collateralDecimals: number;
125
+ price: string;
126
+ interest: string;
127
+ amount: string;
128
+ duration: string;
129
+ collectionId: number;
130
+ liquidation: number;
131
+ marketplace: string;
132
+ sale: Sale;
133
+ listing: Listing;
134
+ createdAt: Date;
135
+ expiredAt: Date;
136
+ repaidAt: Date;
137
+ soldAt: Date;
138
+ liquidatedAt: Date;
139
+ updatedAt: Date;
140
+ deletedAt: null;
141
+ version: number;
142
+ amountUsd: string;
143
+ };
144
+ export type Listing = {
145
+ isListed: boolean;
146
+ price: string;
147
+ _id: string;
148
+ };
149
+ export type Sale = {
150
+ isForSale: boolean;
151
+ salePrice: string;
152
+ currency: string;
153
+ _id: string;
154
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/rain/types.ts"],"names":[],"mappings":""}