@sonarwatch/portfolio-plugins 0.11.163 → 0.11.165
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +14 -6
- package/package.json +2 -2
- package/src/index.js +8 -0
- package/src/index.js.map +1 -1
- package/src/plugins/jupiter/launchpad/allocationsFetcher.js +8 -4
- package/src/plugins/jupiter/launchpad/allocationsFetcher.js.map +1 -1
- package/src/plugins/nosana/constants.d.ts +7 -0
- package/src/plugins/nosana/constants.js +17 -0
- package/src/plugins/nosana/constants.js.map +1 -0
- package/src/plugins/nosana/helpers.d.ts +2 -0
- package/src/plugins/nosana/helpers.js +14 -0
- package/src/plugins/nosana/helpers.js.map +1 -0
- package/src/plugins/nosana/index.d.ts +6 -0
- package/src/plugins/nosana/index.js +12 -0
- package/src/plugins/nosana/index.js.map +1 -0
- package/src/plugins/nosana/stakingFetcher.d.ts +3 -0
- package/src/plugins/nosana/stakingFetcher.js +56 -0
- package/src/plugins/nosana/stakingFetcher.js.map +1 -0
- package/src/plugins/nosana/structs.d.ts +15 -0
- package/src/plugins/nosana/structs.js +17 -0
- package/src/plugins/nosana/structs.js.map +1 -0
- package/src/plugins/rain/collectionsJob.d.ts +3 -0
- package/src/plugins/rain/collectionsJob.js +36 -0
- package/src/plugins/rain/collectionsJob.js.map +1 -0
- package/src/plugins/rain/constants.d.ts +7 -0
- package/src/plugins/rain/constants.js +17 -0
- package/src/plugins/rain/constants.js.map +1 -0
- package/src/plugins/rain/filters.d.ts +5 -0
- package/src/plugins/rain/filters.js +53 -0
- package/src/plugins/rain/filters.js.map +1 -0
- package/src/plugins/rain/helpers.d.ts +7 -0
- package/src/plugins/rain/helpers.js +64 -0
- package/src/plugins/rain/helpers.js.map +1 -0
- package/src/plugins/rain/index.d.ts +6 -0
- package/src/plugins/rain/index.js +13 -0
- package/src/plugins/rain/index.js.map +1 -0
- package/src/plugins/rain/loansFetcher.d.ts +3 -0
- package/src/plugins/rain/loansFetcher.js +105 -0
- package/src/plugins/rain/loansFetcher.js.map +1 -0
- package/src/plugins/rain/poolsFetcher.d.ts +3 -0
- package/src/plugins/rain/poolsFetcher.js +73 -0
- package/src/plugins/rain/poolsFetcher.js.map +1 -0
- package/src/plugins/rain/structs/loan.d.ts +84 -0
- package/src/plugins/rain/structs/loan.js +86 -0
- package/src/plugins/rain/structs/loan.js.map +1 -0
- package/src/plugins/rain/structs/pool.d.ts +77 -0
- package/src/plugins/rain/structs/pool.js +76 -0
- package/src/plugins/rain/structs/pool.js.map +1 -0
- package/src/plugins/rain/types.d.ts +154 -0
- package/src/plugins/rain/types.js +3 -0
- package/src/plugins/rain/types.js.map +1 -0
- package/src/plugins/raydium/constants.d.ts +3 -0
- package/src/plugins/raydium/constants.js +4 -1
- package/src/plugins/raydium/constants.js.map +1 -1
- package/src/plugins/raydium/filters.d.ts +1 -0
- package/src/plugins/raydium/filters.js +11 -1
- package/src/plugins/raydium/filters.js.map +1 -1
- package/src/plugins/raydium/helpers.d.ts +2 -0
- package/src/plugins/raydium/helpers.js +10 -1
- package/src/plugins/raydium/helpers.js.map +1 -1
- package/src/plugins/raydium/index.js +2 -1
- package/src/plugins/raydium/index.js.map +1 -1
- package/src/plugins/raydium/stakingFetcher.d.ts +3 -0
- package/src/plugins/raydium/stakingFetcher.js +50 -0
- package/src/plugins/raydium/stakingFetcher.js.map +1 -0
- package/src/plugins/raydium/structs/staking.d.ts +12 -0
- package/src/plugins/raydium/structs/staking.js +15 -0
- package/src/plugins/raydium/structs/staking.js.map +1 -0
@@ -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;AAC5B,qGAA6E;AAC7E,yCAAkD;AAClD,uCAAuD;AAEvD,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,gDAAgD;IAChD,YAAY;IACZ,gBAAgB;IAChB,eAAe;IACf,8BAA8B;IAC9B,KAAK;IAEL,qCAAqC;IAErC,MAAM,KAAK,GAAG,MAAM,IAAA,kBAAQ,EAAC,KAAK,CAAC,CAAC;IACpC,IAAI,KAAK,CAAC,MAAM,KA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AA,EAAE,EAAI,gBAAgB,CAAC,QAAQ,CAAA,CAChC,CAAC;QACF,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE;YAC3B,cAAc,CAAC,IAAI,CACjB,IAAA,gCAAsB,EACpB,gBAAgB,CAAC,OAAO,EACxB,eAAe,CAAC,QAAQ,EAAE,EAC1B,0BAAS,CAAC,MAAM,EAChB,gBAAgB,CACjB,CACF,CAAC;QAEJ,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QAEzE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,GACrE,IAAA,wCAAuB,EAAC,cAAc,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC;QAExE,QAAQ,CAAC,IAAI,CAAC;YACZ,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,YAAY;gBACZ,WAAW;gBACX,eAAe,EAAE,IAAI;gBACrB,WAAW;gBACX,KAAK;aACN;SACF,CAAC,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;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,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 @@
|
|
1
|
+
{"version":3,"file":"poolsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/r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AE,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,0B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AC,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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