@sonarwatch/portfolio-plugins 0.14.132 → 0.14.133
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/src/plugins/citrus/loansFetcher.js +34 -68
- package/src/plugins/citrus/loansFetcher.js.map +1 -1
- package/src/plugins/debridge/dlmmVaultsFetcher.js +1 -0
- package/src/plugins/debridge/dlmmVaultsFetcher.js.map +1 -1
- package/src/plugins/jupiter/exchange/valueAverageFetcher.js +1 -1
- package/src/plugins/jupiter/exchange/valueAverageFetcher.js.map +1 -1
- package/src/plugins/rain/banksFetcher.js +47 -0
- package/src/plugins/rain/banksFetcher.js.map +1 -0
- package/src/plugins/rain/collectionsJob.js +9 -7
- package/src/plugins/rain/collectionsJob.js.map +1 -1
- package/src/plugins/rain/constants.d.ts +7 -2
- package/src/plugins/rain/constants.js +11 -3
- package/src/plugins/rain/constants.js.map +1 -1
- package/src/plugins/rain/defiBorrowsFetcher.d.ts +3 -0
- package/src/plugins/rain/defiBorrowsFetcher.js +52 -0
- package/src/plugins/rain/defiBorrowsFetcher.js.map +1 -0
- package/src/plugins/rain/index.js +10 -3
- package/src/plugins/rain/index.js.map +1 -1
- package/src/plugins/rain/nftBorrowsFetcher.d.ts +3 -0
- package/src/plugins/rain/nftBorrowsFetcher.js +76 -0
- package/src/plugins/rain/nftBorrowsFetcher.js.map +1 -0
- package/src/plugins/rain/poolsFetcher.js +79 -42
- package/src/plugins/rain/poolsFetcher.js.map +1 -1
- package/src/plugins/rain/structs.d.ts +455 -0
- package/src/plugins/rain/structs.js +425 -0
- package/src/plugins/rain/structs.js.map +1 -0
- package/src/plugins/rain/types.d.ts +18 -144
- package/src/plugins/sharky/loansFetcher.js +38 -73
- package/src/plugins/sharky/loansFetcher.js.map +1 -1
- package/src/utils/elementbuilder/AssetCollectibleBuilder.d.ts +10 -0
- package/src/utils/elementbuilder/AssetCollectibleBuilder.js +53 -0
- package/src/utils/elementbuilder/AssetCollectibleBuilder.js.map +1 -0
- package/src/utils/elementbuilder/ElementBorrowlendBuilder.d.ts +9 -1
- package/src/utils/elementbuilder/ElementBorrowlendBuilder.js +41 -3
- package/src/utils/elementbuilder/ElementBorrowlendBuilder.js.map +1 -1
- package/src/utils/elementbuilder/ElementRegistry.js +9 -1
- package/src/utils/elementbuilder/ElementRegistry.js.map +1 -1
- package/src/utils/elementbuilder/Params.d.ts +14 -0
- package/src/utils/solana/das/heliusAssetToAssetCollectible.js +3 -2
- package/src/utils/solana/das/heliusAssetToAssetCollectible.js.map +1 -1
- package/src/plugins/rain/filters.d.ts +0 -7
- package/src/plugins/rain/filters.js +0 -53
- package/src/plugins/rain/filters.js.map +0 -1
- package/src/plugins/rain/helpers.d.ts +0 -9
- package/src/plugins/rain/helpers.js +0 -66
- package/src/plugins/rain/helpers.js.map +0 -1
- package/src/plugins/rain/loansFetcher.js +0 -139
- package/src/plugins/rain/loansFetcher.js.map +0 -1
- package/src/plugins/rain/structs/loan.d.ts +0 -86
- package/src/plugins/rain/structs/loan.js +0 -86
- package/src/plugins/rain/structs/loan.js.map +0 -1
- package/src/plugins/rain/structs/pool.d.ts +0 -79
- package/src/plugins/rain/structs/pool.js +0 -76
- package/src/plugins/rain/structs/pool.js.map +0 -1
- /package/src/plugins/rain/{loansFetcher.d.ts → banksFetcher.d.ts} +0 -0
@@ -1,66 +0,0 @@
|
|
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'), new web3_js_1.PublicKey(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}&status=Ongoing`, {
|
49
|
-
timeout: 1000,
|
50
|
-
})
|
51
|
-
.catch(() => null);
|
52
|
-
if (!getLoansRes || getLoansRes.data.ongoingCount === 0)
|
53
|
-
return [];
|
54
|
-
return getLoansRes.data.loans;
|
55
|
-
});
|
56
|
-
}
|
57
|
-
exports.getLoans = getLoans;
|
58
|
-
function daysBetweenDates(start, end) {
|
59
|
-
return new bignumber_js_1.default(end.getTime())
|
60
|
-
.minus(start.getTime())
|
61
|
-
.dividedBy(oneDay)
|
62
|
-
.decimalPlaces(0, bignumber_js_1.default.ROUND_DOWN)
|
63
|
-
.toNumber();
|
64
|
-
}
|
65
|
-
exports.daysBetweenDates = daysBetweenDates;
|
66
|
-
//# sourceMappingURL=helpers.js.map
|
@@ -1 +0,0 @@
|
|
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,KAA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_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 getAssetBatchDas_1 = require("../../utils/solana/das/getAssetBatchDas");
|
25
|
-
const getSolanaDasEndpoint_1 = __importDefault(require("../../utils/clients/getSolanaDasEndpoint"));
|
26
|
-
const heliusAssetToAssetCollectible_1 = require("../../utils/solana/das/heliusAssetToAssetCollectible");
|
27
|
-
const MemoizedCache_1 = require("../../utils/misc/MemoizedCache");
|
28
|
-
const collectionMemo = new MemoizedCache_1.MemoizedCache(constants_1.collectionsKey, {
|
29
|
-
prefix: constants_1.platformId,
|
30
|
-
networkId: portfolio_core_1.NetworkId.solana,
|
31
|
-
});
|
32
|
-
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
33
|
-
const client = (0, clients_1.getClientSolana)();
|
34
|
-
const dasUrl = (0, getSolanaDasEndpoint_1.default)();
|
35
|
-
const loans = yield (0, helpers_1.getLoans)(owner);
|
36
|
-
if (loans.length === 0)
|
37
|
-
return [];
|
38
|
-
const tokenMints = new Set();
|
39
|
-
const nftMints = new Set();
|
40
|
-
const pools = new Set();
|
41
|
-
tokenMints.add(portfolio_core_1.solanaNativeAddress);
|
42
|
-
loans.forEach((loan) => {
|
43
|
-
pools.add(loan.pool.toString());
|
44
|
-
tokenMints.add(loan.currency.toString());
|
45
|
-
if (loan.isDefi)
|
46
|
-
tokenMints.add(loan.mint.toString());
|
47
|
-
else
|
48
|
-
nftMints.add(loan.mint.toString());
|
49
|
-
});
|
50
|
-
const [tokenPriceById, heliusAssets, collections, poolsAccounts] = yield Promise.all([
|
51
|
-
cache.getTokenPricesAsMap(Array.from(tokenMints), portfolio_core_1.NetworkId.solana),
|
52
|
-
(0, getAssetBatchDas_1.getAssetBatchDasAsMap)(dasUrl, Array.from(nftMints)),
|
53
|
-
collectionMemo.getItem(cache),
|
54
|
-
(0, solana_1.getParsedMultipleAccountsInfo)(client, pool_1.poolStruct, Array.from(pools).map((pool) => new web3_js_1.PublicKey(pool))),
|
55
|
-
]);
|
56
|
-
const poolById = new Map();
|
57
|
-
poolsAccounts.forEach((account) => account ? poolById.set(account.pubkey.toString(), account) : undefined);
|
58
|
-
const elements = [];
|
59
|
-
for (const loan of loans) {
|
60
|
-
if (new bignumber_js_1.default(loan.amount).isZero())
|
61
|
-
continue;
|
62
|
-
const collateralMint = loan.mint.toString();
|
63
|
-
const borrowMint = loan.currency.toString();
|
64
|
-
const borrowedAssets = [];
|
65
|
-
const borrowedYields = [];
|
66
|
-
const suppliedAssets = [];
|
67
|
-
const suppliedYields = [];
|
68
|
-
const rewardAssets = [];
|
69
|
-
const daysRemaining = (0, helpers_1.daysBetweenDates)(new Date(), new Date(loan.expiredAt));
|
70
|
-
const borrowTokenPrice = tokenPriceById.get(borrowMint);
|
71
|
-
if (!borrowTokenPrice)
|
72
|
-
continue;
|
73
|
-
if (loan.isDefi) {
|
74
|
-
// mint is a token
|
75
|
-
const collatTokenPrice = tokenPriceById.get(collateralMint);
|
76
|
-
if (!collatTokenPrice)
|
77
|
-
continue;
|
78
|
-
const amountDeposited = new bignumber_js_1.default(loan.collateralAmount).dividedBy(Math.pow(10, collatTokenPrice.decimals));
|
79
|
-
if (!amountDeposited.isZero())
|
80
|
-
suppliedAssets.push((0, tokenPriceToAssetToken_1.default)(collatTokenPrice.address, amountDeposited.toNumber(), portfolio_core_1.NetworkId.solana, collatTokenPrice));
|
81
|
-
}
|
82
|
-
else {
|
83
|
-
// mint is a nft
|
84
|
-
const heliusAsset = heliusAssets.get(loan.mint);
|
85
|
-
if (heliusAsset && collections) {
|
86
|
-
const collection = collections.find((c) => c.collectionId === loan.collectionId);
|
87
|
-
const solTokenPrice = tokenPriceById.get(portfolio_core_1.solanaNativeAddress);
|
88
|
-
const assetValue = collection && solTokenPrice
|
89
|
-
? new bignumber_js_1.default(collection.floorPrice)
|
90
|
-
.dividedBy(Math.pow(10, solTokenPrice.decimals))
|
91
|
-
.multipliedBy(solTokenPrice.price)
|
92
|
-
.toNumber()
|
93
|
-
: undefined;
|
94
|
-
const asset = (0, heliusAssetToAssetCollectible_1.heliusAssetToAssetCollectible)(heliusAsset, {
|
95
|
-
tags: [portfolio_core_1.collectibleFreezedTag],
|
96
|
-
collection: {
|
97
|
-
name: collection === null || collection === void 0 ? void 0 : collection.name,
|
98
|
-
floorPrice: assetValue,
|
99
|
-
},
|
100
|
-
});
|
101
|
-
if (asset)
|
102
|
-
suppliedAssets.push(asset);
|
103
|
-
}
|
104
|
-
}
|
105
|
-
const amountBorrowed = new bignumber_js_1.default(loan.amount).dividedBy(Math.pow(10, borrowTokenPrice.decimals));
|
106
|
-
if (!amountBorrowed.isZero())
|
107
|
-
borrowedAssets.push((0, tokenPriceToAssetToken_1.default)(borrowTokenPrice.address, amountBorrowed.toNumber(), portfolio_core_1.NetworkId.solana, borrowTokenPrice, undefined, { tags: [`Refund in ${daysRemaining} days`] }));
|
108
|
-
if (suppliedAssets.length === 0 && borrowedAssets.length === 0)
|
109
|
-
continue;
|
110
|
-
const { borrowedValue, healthRatio, suppliedValue, value, rewardValue } = (0, portfolio_core_1.getElementLendingValues)({ suppliedAssets, borrowedAssets, rewardAssets });
|
111
|
-
elements.push({
|
112
|
-
type: portfolio_core_1.PortfolioElementType.borrowlend,
|
113
|
-
networkId: portfolio_core_1.NetworkId.solana,
|
114
|
-
platformId: constants_1.platformId,
|
115
|
-
label: 'Lending',
|
116
|
-
value,
|
117
|
-
data: {
|
118
|
-
borrowedAssets,
|
119
|
-
borrowedValue,
|
120
|
-
borrowedYields,
|
121
|
-
suppliedAssets,
|
122
|
-
suppliedValue,
|
123
|
-
suppliedYields,
|
124
|
-
rewardAssets,
|
125
|
-
healthRatio,
|
126
|
-
rewardValue,
|
127
|
-
value,
|
128
|
-
},
|
129
|
-
});
|
130
|
-
}
|
131
|
-
return elements;
|
132
|
-
});
|
133
|
-
const fetcher = {
|
134
|
-
id: `${constants_1.platformId}-loans`,
|
135
|
-
networkId: portfolio_core_1.NetworkId.solana,
|
136
|
-
executor,
|
137
|
-
};
|
138
|
-
exports.default = fetcher;
|
139
|
-
//# sourceMappingURL=loansFetcher.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"loansFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/rain/loansFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DASoC;AACpC,6CAA4C;AAC5C,gEAAqC;AAGrC,2CAAyD;AACzD,iDAAsD;AACtD,+CAG4B;AAC5B,qGAA6E;AAC7E,yCAAkD;AAClD,uCAAuD;AACvD,8EAAgF;AAChF,oGAA4E;AAC5E,wGAAqG;AAErG,kEAA+D;AAE/D,MAAM,cAAc,GAAG,IAAI,6BAAa,CAAqB,0BAAc,EAAE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,WAAW;gBACX,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"}
|
@@ -1,86 +0,0 @@
|
|
1
|
-
/// <reference types="node" />
|
2
|
-
/// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
|
3
|
-
/// <reference types="jito-ts/node_modules/@solana/web3.js" />
|
4
|
-
import { BeetStruct } from '@metaplex-foundation/beet';
|
5
|
-
import { PublicKey } from '@solana/web3.js';
|
6
|
-
import BigNumber from 'bignumber.js';
|
7
|
-
export declare enum LoanKind {
|
8
|
-
Loan = 0,
|
9
|
-
Mortgage = 1
|
10
|
-
}
|
11
|
-
export declare enum LoanStatus {
|
12
|
-
Ongoing = 0,
|
13
|
-
Repaid = 1,
|
14
|
-
Liquidated = 2,
|
15
|
-
Sold = 3
|
16
|
-
}
|
17
|
-
export declare enum Marketplace {
|
18
|
-
None = 0,
|
19
|
-
Auctionhouse = 1,
|
20
|
-
Solanart = 2,
|
21
|
-
Hyperspace = 3,
|
22
|
-
Yaww = 4,
|
23
|
-
Hadeswap = 5,
|
24
|
-
Rain = 6,
|
25
|
-
TensorswapOrder = 7,
|
26
|
-
TensorswapListing = 8,
|
27
|
-
MagicEden = 9
|
28
|
-
}
|
29
|
-
export type Sale = {
|
30
|
-
isForSale: boolean;
|
31
|
-
salePrice: BigNumber;
|
32
|
-
currency: PublicKey;
|
33
|
-
};
|
34
|
-
export declare const saleStruct: BeetStruct<Sale, Partial<Sale>>;
|
35
|
-
export type Listing = {
|
36
|
-
isListed: boolean;
|
37
|
-
price: BigNumber;
|
38
|
-
};
|
39
|
-
export declare const listingStruct: BeetStruct<Listing, Partial<Listing>>;
|
40
|
-
export type Loan = {
|
41
|
-
buffer: Buffer;
|
42
|
-
kind: LoanKind;
|
43
|
-
status: LoanStatus;
|
44
|
-
borrower: PublicKey;
|
45
|
-
lender: PublicKey;
|
46
|
-
pool: PublicKey;
|
47
|
-
mint: PublicKey;
|
48
|
-
currency: PublicKey;
|
49
|
-
isCustom: boolean;
|
50
|
-
isFrozen: boolean;
|
51
|
-
price: BigNumber;
|
52
|
-
interest: BigNumber;
|
53
|
-
amount: BigNumber;
|
54
|
-
duration: BigNumber;
|
55
|
-
collection: number;
|
56
|
-
liquidation: number;
|
57
|
-
marketplace: Marketplace;
|
58
|
-
sale: Sale;
|
59
|
-
createdAt: BigNumber;
|
60
|
-
expiredAt: BigNumber;
|
61
|
-
repaidAt: BigNumber;
|
62
|
-
soldAt: BigNumber;
|
63
|
-
liquidatedAt: BigNumber;
|
64
|
-
listing: Listing;
|
65
|
-
isCompressedLoan: boolean;
|
66
|
-
isDefi: boolean;
|
67
|
-
padding: BigNumber[];
|
68
|
-
padding1: BigNumber;
|
69
|
-
padding2: number;
|
70
|
-
};
|
71
|
-
export declare const loanStruct: BeetStruct<Loan, Partial<Loan>>;
|
72
|
-
export type Asset = {
|
73
|
-
buffer: Buffer;
|
74
|
-
discriminator: BigNumber;
|
75
|
-
borrower: PublicKey;
|
76
|
-
nft: PublicKey;
|
77
|
-
currencyIn: PublicKey;
|
78
|
-
currencyOut: PublicKey;
|
79
|
-
pythInFeed: PublicKey;
|
80
|
-
pythOutFeed: PublicKey;
|
81
|
-
amount: BigNumber;
|
82
|
-
decimals: number;
|
83
|
-
createdAt: BigNumber;
|
84
|
-
padding: BigNumber[];
|
85
|
-
};
|
86
|
-
export declare const assetStruct: BeetStruct<Asset, Partial<Asset>>;
|
@@ -1,86 +0,0 @@
|
|
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
|
@@ -1 +0,0 @@
|
|
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,EAA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,SAAS,EAAE,IAAA,4BAAqB,EAAC,YAAG,EAAE,CAAC,CAAC,CAAC;IAC1C,CAAC,UAAU,EAAE,UAAG,CAAC;IACjB,CAAC,UAAU,EAAE,SAAE,CAAC;CACjB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAY,CACvB,CAAC;AAiBW,QAAA,WAAW,GAAG,IAAI,iBAAU,CACvC;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"}
|
@@ -1,79 +0,0 @@
|
|
1
|
-
/// <reference types="node" />
|
2
|
-
/// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
|
3
|
-
/// <reference types="jito-ts/node_modules/@solana/web3.js" />
|
4
|
-
import { BeetStruct } from '@metaplex-foundation/beet';
|
5
|
-
import { PublicKey } from '@solana/web3.js';
|
6
|
-
import BigNumber from 'bignumber.js';
|
7
|
-
export declare enum PoolStatus {
|
8
|
-
Ready = 0,
|
9
|
-
Disabled = 1
|
10
|
-
}
|
11
|
-
export type Curve = {
|
12
|
-
baseInterest: number;
|
13
|
-
interestRate: number;
|
14
|
-
curveRate: number;
|
15
|
-
curveRateDay: number;
|
16
|
-
maxDuration: BigNumber;
|
17
|
-
maxAmount: BigNumber;
|
18
|
-
};
|
19
|
-
export declare const curveStruct: BeetStruct<Curve, Partial<Curve>>;
|
20
|
-
export type PoolCondition = {
|
21
|
-
isEnabled: boolean;
|
22
|
-
minAge: BigNumber;
|
23
|
-
minLoan: BigNumber;
|
24
|
-
minVolume: number;
|
25
|
-
liquidationThreshold: number;
|
26
|
-
padding1: number;
|
27
|
-
padding2: number;
|
28
|
-
padding3: number;
|
29
|
-
};
|
30
|
-
export declare const poolConditionStruct: BeetStruct<PoolCondition, Partial<PoolCondition>>;
|
31
|
-
export type PoolLiquidation = {
|
32
|
-
loanLiquidation: number;
|
33
|
-
mortgageLiquidation: number;
|
34
|
-
isAutoSellEnabled: boolean;
|
35
|
-
percentageMaxLoss: number;
|
36
|
-
};
|
37
|
-
export declare const poolLiquidationStruct: BeetStruct<PoolLiquidation, Partial<PoolLiquidation>>;
|
38
|
-
export type PoolCollection = {
|
39
|
-
collection: number;
|
40
|
-
collectionLtv: number;
|
41
|
-
exposure: number;
|
42
|
-
amountUsed: BigNumber;
|
43
|
-
};
|
44
|
-
export declare const poolCollectionStruct: BeetStruct<PoolCollection, Partial<PoolCollection>>;
|
45
|
-
export type Pool = {
|
46
|
-
buffer: Buffer;
|
47
|
-
bump: number;
|
48
|
-
owner: PublicKey;
|
49
|
-
currency: PublicKey;
|
50
|
-
oraclePoolUsd: PublicKey;
|
51
|
-
oracleSolUsd: PublicKey;
|
52
|
-
status: PoolStatus;
|
53
|
-
isCompounded: boolean;
|
54
|
-
isShared: boolean;
|
55
|
-
totalAmount: BigNumber;
|
56
|
-
borrowedAmount: BigNumber;
|
57
|
-
availableAmount: BigNumber;
|
58
|
-
usableAmount: BigNumber;
|
59
|
-
loanCurve: Curve;
|
60
|
-
mortgageCurve: Curve;
|
61
|
-
isMortgageEnabled: boolean;
|
62
|
-
nftLocked: BigNumber;
|
63
|
-
totalLiquidations: BigNumber;
|
64
|
-
totalLoans: BigNumber;
|
65
|
-
totalMortgages: BigNumber;
|
66
|
-
totalInterest: BigNumber;
|
67
|
-
depositedAt: BigNumber;
|
68
|
-
createdAt: BigNumber;
|
69
|
-
updatedAt: BigNumber;
|
70
|
-
collectionsUpdatedAt: BigNumber;
|
71
|
-
lastLoanAt: BigNumber;
|
72
|
-
lastMortgageAt: BigNumber;
|
73
|
-
conditions: PoolCondition;
|
74
|
-
liquidation: PoolLiquidation;
|
75
|
-
whitelist: PublicKey;
|
76
|
-
padding: BigNumber[];
|
77
|
-
collections: PoolCollection[];
|
78
|
-
};
|
79
|
-
export declare const poolStruct: BeetStruct<Pool, Partial<Pool>>;
|
@@ -1,76 +0,0 @@
|
|
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
|
@@ -1 +0,0 @@
|
|
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,CACxB,CAAC;AAaW,QAAA,mBAAmB,GAAG,IAAI,iBAAU,CAC/C;IACE,CAAC,WAAW,EAAE,WAAI,CAAC;IACnB,CAAC,QAAQ,EAAE,YAAG,CAAC;IACf,CAAC,SAAS,EAAE,YAAG,CAAC;IAChB,CAAC,WAAW,EAAE,YAAG,CAAC;IAClB,CAAC,sBAAs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