@haven-fi/solauto-sdk 1.0.670 → 1.0.672
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/dist/generated/types/positionData.d.ts +3 -3
- package/dist/generated/types/positionData.d.ts.map +1 -1
- package/dist/generated/types/positionData.js +2 -2
- package/dist/idls/switchboard.json +0 -1949
- package/dist/services/rebalance/rebalanceTxBuilder.d.ts.map +1 -1
- package/dist/services/rebalance/rebalanceTxBuilder.js +3 -0
- package/dist/services/solauto/solautoClient.d.ts +1 -1
- package/dist/services/solauto/solautoClient.d.ts.map +1 -1
- package/dist/services/solauto/solautoClient.js +2 -25
- package/dist/services/solauto/solautoMarginfiClient.js +1 -1
- package/dist/solautoPosition/marginfiSolautoPositionEx.d.ts +0 -2
- package/dist/solautoPosition/marginfiSolautoPositionEx.d.ts.map +1 -1
- package/dist/solautoPosition/marginfiSolautoPositionEx.js +3 -17
- package/dist/solautoPosition/positionUtils.d.ts.map +1 -1
- package/dist/solautoPosition/positionUtils.js +6 -1
- package/dist/solautoPosition/solautoPositionEx.d.ts +5 -7
- package/dist/solautoPosition/solautoPositionEx.d.ts.map +1 -1
- package/dist/solautoPosition/solautoPositionEx.js +8 -11
- package/dist/utils/marginfi/data.d.ts +2 -2
- package/dist/utils/marginfi/data.d.ts.map +1 -1
- package/dist/utils/marginfi/data.js +6 -2
- package/local/txSandbox.ts +67 -12
- package/package.json +1 -1
- package/src/generated/types/positionData.ts +4 -7
- package/src/services/rebalance/rebalanceTxBuilder.ts +4 -0
- package/src/services/solauto/solautoClient.ts +3 -27
- package/src/services/solauto/solautoMarginfiClient.ts +1 -1
- package/src/solautoPosition/marginfiSolautoPositionEx.ts +4 -32
- package/src/solautoPosition/positionUtils.ts +8 -1
- package/src/solautoPosition/solautoPositionEx.ts +14 -18
- package/src/utils/marginfi/data.ts +16 -7
- package/dist/constants/generalConstants.d.ts +0 -7
- package/dist/constants/generalConstants.d.ts.map +0 -1
- package/dist/constants/generalConstants.js +0 -10
- package/dist/constants/index.d.ts +0 -7
- package/dist/constants/index.d.ts.map +0 -1
- package/dist/constants/index.js +0 -22
- package/dist/constants/marginfiAccounts.d.ts +0 -17
- package/dist/constants/marginfiAccounts.d.ts.map +0 -1
- package/dist/constants/marginfiAccounts.js +0 -234
- package/dist/constants/pythConstants.d.ts +0 -24
- package/dist/constants/pythConstants.d.ts.map +0 -1
- package/dist/constants/pythConstants.js +0 -52
- package/dist/constants/solautoConstants.d.ts +0 -19
- package/dist/constants/solautoConstants.d.ts.map +0 -1
- package/dist/constants/solautoConstants.js +0 -40
- package/dist/constants/switchboardConstants.d.ts +0 -9
- package/dist/constants/switchboardConstants.d.ts.map +0 -1
- package/dist/constants/switchboardConstants.js +0 -54
- package/dist/constants/tokenConstants.d.ts +0 -40
- package/dist/constants/tokenConstants.d.ts.map +0 -1
- package/dist/constants/tokenConstants.js +0 -174
- package/dist/index.d.ts +0 -12
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -27
- package/dist/utils/index.d.ts +0 -14
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -29
- package/dist/utils/switchboardUtils.d.ts +0 -12
- package/dist/utils/switchboardUtils.d.ts.map +0 -1
- package/dist/utils/switchboardUtils.js +0 -81
@@ -75,7 +75,7 @@ export class SolautoMarginfiClient extends SolautoClient {
|
|
75
75
|
|
76
76
|
this.mfiAccounts = getMarginfiAccounts(this.lpEnv);
|
77
77
|
|
78
|
-
this.marginfiGroup =
|
78
|
+
this.marginfiGroup = this.pos.lpPoolAccount;
|
79
79
|
|
80
80
|
if (this.pos.selfManaged) {
|
81
81
|
this.marginfiAccount =
|
@@ -1,12 +1,6 @@
|
|
1
1
|
import { PublicKey } from "@solana/web3.js";
|
2
|
-
import {
|
3
|
-
Bank,
|
4
|
-
fetchMarginfiAccount,
|
5
|
-
MarginfiAccount,
|
6
|
-
safeFetchAllBank,
|
7
|
-
} from "../marginfi-sdk";
|
2
|
+
import { Bank, safeFetchAllBank } from "../marginfi-sdk";
|
8
3
|
import { publicKey } from "@metaplex-foundation/umi";
|
9
|
-
import { toWeb3JsPublicKey } from "@metaplex-foundation/umi-web3js-adapters";
|
10
4
|
import {
|
11
5
|
calcMarginfiMaxLtvAndLiqThresholdBps,
|
12
6
|
fetchTokenPrices,
|
@@ -23,34 +17,12 @@ import { LendingPlatform, PriceType } from "../generated";
|
|
23
17
|
export class MarginfiSolautoPositionEx extends SolautoPositionEx {
|
24
18
|
lendingPlatform = LendingPlatform.Marginfi;
|
25
19
|
|
26
|
-
private marginfiAccountData: MarginfiAccount | null = null;
|
27
20
|
private supplyBank: Bank | null = null;
|
28
21
|
private debtBank: Bank | null = null;
|
29
22
|
|
30
|
-
public async lendingPool(): Promise<PublicKey> {
|
31
|
-
if (this.lp) {
|
32
|
-
return this.lp;
|
33
|
-
}
|
34
|
-
|
35
|
-
if (!this.marginfiAccountData && validPubkey(this.lpUserAccount)) {
|
36
|
-
this.marginfiAccountData = await fetchMarginfiAccount(
|
37
|
-
this.umi,
|
38
|
-
publicKey(this.lpUserAccount!),
|
39
|
-
{ commitment: "confirmed" }
|
40
|
-
);
|
41
|
-
this.lp = toWeb3JsPublicKey(this.marginfiAccountData.group);
|
42
|
-
}
|
43
|
-
|
44
|
-
if (!this.lp) {
|
45
|
-
this.lp = getMarginfiAccounts(this.lpEnv).defaultGroup;
|
46
|
-
}
|
47
|
-
|
48
|
-
return this.lp;
|
49
|
-
}
|
50
|
-
|
51
23
|
async getBanks(): Promise<Bank[]> {
|
52
24
|
if (!this.supplyBank || !this.debtBank) {
|
53
|
-
const group =
|
25
|
+
const group = this.lpPoolAccount.toString();
|
54
26
|
const bankAccounts = getMarginfiAccounts(this.lpEnv).bankAccounts;
|
55
27
|
const supplyBank = bankAccounts[group][this.supplyMint.toString()].bank;
|
56
28
|
const debtBank = bankAccounts[group][this.debtMint.toString()].bank;
|
@@ -102,10 +74,9 @@ export class MarginfiSolautoPositionEx extends SolautoPositionEx {
|
|
102
74
|
const resp = await getMarginfiAccountPositionState(
|
103
75
|
this.umi,
|
104
76
|
{ pk: this.lpUserAccount },
|
105
|
-
|
77
|
+
this._lpPoolAccount,
|
106
78
|
useDesignatedMint ? { mint: this.supplyMint } : undefined,
|
107
79
|
useDesignatedMint ? { mint: this.debtMint } : undefined,
|
108
|
-
this.lpEnv,
|
109
80
|
this.contextUpdates,
|
110
81
|
priceType
|
111
82
|
);
|
@@ -113,6 +84,7 @@ export class MarginfiSolautoPositionEx extends SolautoPositionEx {
|
|
113
84
|
if (resp) {
|
114
85
|
this.supplyBank = resp.supplyBank;
|
115
86
|
this.debtBank = resp.debtBank;
|
87
|
+
this._lpPoolAccount = resp.marginfiGroup;
|
116
88
|
this._data.state = resp.state;
|
117
89
|
}
|
118
90
|
}
|
@@ -113,11 +113,18 @@ export async function getOrCreatePositionEx(
|
|
113
113
|
contextUpdates,
|
114
114
|
};
|
115
115
|
|
116
|
+
let position: SolautoPositionEx;
|
116
117
|
switch (lendingPlatform) {
|
117
118
|
case LendingPlatform.Marginfi:
|
118
|
-
|
119
|
+
position = new MarginfiSolautoPositionEx(args);
|
119
120
|
// TODO: PF
|
120
121
|
}
|
122
|
+
|
123
|
+
if (position.selfManaged) {
|
124
|
+
await position.refreshPositionState();
|
125
|
+
}
|
126
|
+
|
127
|
+
return position;
|
121
128
|
}
|
122
129
|
|
123
130
|
interface AssetProps {
|
@@ -5,7 +5,6 @@ import {
|
|
5
5
|
toWeb3JsPublicKey,
|
6
6
|
} from "@metaplex-foundation/umi-web3js-adapters";
|
7
7
|
import {
|
8
|
-
DCASettings,
|
9
8
|
fetchSolautoPosition,
|
10
9
|
LendingPlatform,
|
11
10
|
PositionState,
|
@@ -51,7 +50,7 @@ export interface PositionCustomArgs {
|
|
51
50
|
lendingPlatform: LendingPlatform;
|
52
51
|
supplyMint?: PublicKey;
|
53
52
|
debtMint?: PublicKey;
|
54
|
-
|
53
|
+
lpPoolAccount?: PublicKey;
|
55
54
|
lpUserAccount?: PublicKey;
|
56
55
|
lpEnv?: ProgramEnv;
|
57
56
|
}
|
@@ -79,12 +78,12 @@ export abstract class SolautoPositionEx {
|
|
79
78
|
public lendingPlatform!: LendingPlatform;
|
80
79
|
public positionId!: number;
|
81
80
|
public authority!: PublicKey;
|
82
|
-
protected
|
83
|
-
protected lp?: PublicKey = undefined;
|
81
|
+
protected _lpPoolAccount?: PublicKey;
|
84
82
|
public lpUserAccount?: PublicKey = undefined;
|
85
83
|
protected lpEnv!: ProgramEnv;
|
86
84
|
private _supplyMint?: PublicKey;
|
87
85
|
private _debtMint?: PublicKey;
|
86
|
+
protected _data!: SolautoPositionExData;
|
88
87
|
|
89
88
|
private readonly firstState!: PositionState;
|
90
89
|
|
@@ -107,15 +106,15 @@ export abstract class SolautoPositionEx {
|
|
107
106
|
this.positionId = args.positionId ?? args.data.positionId![0];
|
108
107
|
this.authority = args.authority ?? toWeb3JsPublicKey(args.data.authority!);
|
109
108
|
|
110
|
-
this.
|
111
|
-
this._debtMint = args.customArgs?.debtMint;
|
112
|
-
this.lp = args.customArgs?.lendingPool;
|
109
|
+
this._lpPoolAccount = args.customArgs?.lpPoolAccount;
|
113
110
|
this.lpUserAccount =
|
114
111
|
args.customArgs?.lpUserAccount ??
|
115
112
|
(args.data.position
|
116
113
|
? toWeb3JsPublicKey(args.data.position!.lpUserAccount)
|
117
114
|
: undefined);
|
118
115
|
this.lpEnv = args.customArgs?.lpEnv ?? "Prod";
|
116
|
+
this._supplyMint = args.customArgs?.supplyMint;
|
117
|
+
this._debtMint = args.customArgs?.debtMint;
|
119
118
|
|
120
119
|
this._data = args.data;
|
121
120
|
this.firstState = { ...args.data.state };
|
@@ -123,8 +122,6 @@ export abstract class SolautoPositionEx {
|
|
123
122
|
this.rebalance = new PositionRebalanceHelper(this);
|
124
123
|
}
|
125
124
|
|
126
|
-
abstract lendingPool(): Promise<PublicKey>;
|
127
|
-
|
128
125
|
get exists() {
|
129
126
|
return this._data.position !== undefined;
|
130
127
|
}
|
@@ -141,6 +138,13 @@ export abstract class SolautoPositionEx {
|
|
141
138
|
return solautoStrategyName(this.supplyMint, this.debtMint);
|
142
139
|
}
|
143
140
|
|
141
|
+
get lpPoolAccount() {
|
142
|
+
return (
|
143
|
+
this._lpPoolAccount ??
|
144
|
+
toWeb3JsPublicKey(this.data.position!.lpPoolAccount)
|
145
|
+
);
|
146
|
+
}
|
147
|
+
|
144
148
|
liqUtilizationRateBps(priceType?: PriceType): number {
|
145
149
|
return getLiqUtilzationRateBps(
|
146
150
|
this.supplyUsd(priceType),
|
@@ -165,14 +169,6 @@ export abstract class SolautoPositionEx {
|
|
165
169
|
this.data.position!.settings = settings;
|
166
170
|
}
|
167
171
|
|
168
|
-
get dca(): DCASettings | undefined {
|
169
|
-
return this.contextUpdates?.dca ?? this.data.position?.dca;
|
170
|
-
}
|
171
|
-
|
172
|
-
updateDca(dca: DCASettings) {
|
173
|
-
this.data.position!.dca = dca;
|
174
|
-
}
|
175
|
-
|
176
172
|
get supplyMint(): PublicKey {
|
177
173
|
return this._supplyMint ?? toWeb3JsPublicKey(this.state.supply.mint);
|
178
174
|
}
|
@@ -488,7 +484,7 @@ class PositionRebalanceHelper {
|
|
488
484
|
bpsDistanceThreshold: number,
|
489
485
|
skipExtraChecks?: boolean
|
490
486
|
): RebalanceAction | undefined {
|
491
|
-
if (
|
487
|
+
if (this.pos.selfManaged || !this.pos.supplyUsd()) {
|
492
488
|
return undefined;
|
493
489
|
}
|
494
490
|
|
@@ -1,8 +1,6 @@
|
|
1
1
|
import { PublicKey } from "@solana/web3.js";
|
2
2
|
import { publicKey, Umi } from "@metaplex-foundation/umi";
|
3
|
-
import {
|
4
|
-
toWeb3JsPublicKey,
|
5
|
-
} from "@metaplex-foundation/umi-web3js-adapters";
|
3
|
+
import { toWeb3JsPublicKey } from "@metaplex-foundation/umi-web3js-adapters";
|
6
4
|
import { ProgramEnv } from "../../types";
|
7
5
|
import { PositionState, PositionTokenState, PriceType } from "../../generated";
|
8
6
|
import {
|
@@ -31,7 +29,10 @@ import {
|
|
31
29
|
toBaseUnit,
|
32
30
|
toBps,
|
33
31
|
} from "../numberUtils";
|
34
|
-
import {
|
32
|
+
import {
|
33
|
+
calcMarginfiMaxLtvAndLiqThresholdBps,
|
34
|
+
marginfiAccountEmpty,
|
35
|
+
} from "./general";
|
35
36
|
|
36
37
|
export async function getMarginfiMaxLtvAndLiqThresholdBps(
|
37
38
|
umi: Umi,
|
@@ -309,11 +310,15 @@ export async function getMarginfiAccountPositionState(
|
|
309
310
|
marginfiGroup?: PublicKey,
|
310
311
|
supply?: BankSelection,
|
311
312
|
debt?: BankSelection,
|
312
|
-
programEnv?: ProgramEnv,
|
313
313
|
contextUpdates?: ContextUpdates,
|
314
314
|
priceType?: PriceType
|
315
315
|
): Promise<
|
316
|
-
| {
|
316
|
+
| {
|
317
|
+
supplyBank: Bank | null;
|
318
|
+
debtBank: Bank | null;
|
319
|
+
marginfiGroup: PublicKey;
|
320
|
+
state: PositionState;
|
321
|
+
}
|
317
322
|
| undefined
|
318
323
|
> {
|
319
324
|
let marginfiAccount =
|
@@ -437,10 +442,13 @@ export async function getMarginfiAccountPositionState(
|
|
437
442
|
);
|
438
443
|
}
|
439
444
|
|
445
|
+
if (!marginfiGroup) {
|
446
|
+
marginfiGroup = toWeb3JsPublicKey(supplyBank.group);
|
447
|
+
}
|
440
448
|
const supplyPrice = safeGetPrice(toWeb3JsPublicKey(supplyBank.mint))!;
|
441
449
|
let [maxLtvBps, liqThresholdBps] = await getMarginfiMaxLtvAndLiqThresholdBps(
|
442
450
|
umi,
|
443
|
-
marginfiGroup
|
451
|
+
marginfiGroup,
|
444
452
|
{
|
445
453
|
mint: toWeb3JsPublicKey(supplyBank.mint),
|
446
454
|
bank: supplyBank,
|
@@ -463,6 +471,7 @@ export async function getMarginfiAccountPositionState(
|
|
463
471
|
return {
|
464
472
|
supplyBank,
|
465
473
|
debtBank,
|
474
|
+
marginfiGroup,
|
466
475
|
state: {
|
467
476
|
liqUtilizationRateBps: getLiqUtilzationRateBps(
|
468
477
|
supplyUsd,
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import { PublicKey } from "@solana/web3.js";
|
2
|
-
export declare const USD_DECIMALS = 9;
|
3
|
-
export declare const SOLAUTO_FEES_WALLET: PublicKey;
|
4
|
-
export declare const SOLAUTO_MANAGER: PublicKey;
|
5
|
-
export declare const LOCAL_IRONFORGE_API_URL: string;
|
6
|
-
export declare const BASIS_POINTS = 10000;
|
7
|
-
//# sourceMappingURL=generalConstants.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"generalConstants.d.ts","sourceRoot":"","sources":["../../src/constants/generalConstants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,eAAO,MAAM,YAAY,IAAI,CAAC;AAC9B,eAAO,MAAM,mBAAmB,WAAgE,CAAC;AACjG,eAAO,MAAM,eAAe,WAA+D,CAAC;AAE5F,eAAO,MAAM,uBAAuB,QAAuD,CAAC;AAE5F,eAAO,MAAM,YAAY,QAAQ,CAAC"}
|
@@ -1,10 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.BASIS_POINTS = exports.LOCAL_IRONFORGE_API_URL = exports.SOLAUTO_MANAGER = exports.SOLAUTO_FEES_WALLET = exports.USD_DECIMALS = void 0;
|
4
|
-
const web3_js_1 = require("@solana/web3.js");
|
5
|
-
const utils_1 = require("../utils");
|
6
|
-
exports.USD_DECIMALS = 9;
|
7
|
-
exports.SOLAUTO_FEES_WALLET = new web3_js_1.PublicKey("AprYCPiVeKMCgjQ2ZufwChMzvQ5kFjJo2ekTLSkXsQDm");
|
8
|
-
exports.SOLAUTO_MANAGER = new web3_js_1.PublicKey("MNGRcX4nc7quPdzBbNKJ4ScK5EE73JnwJVGxuJXhHCY");
|
9
|
-
exports.LOCAL_IRONFORGE_API_URL = (0, utils_1.buildIronforgeApiUrl)(process.env.IRONFORGE_API_KEY);
|
10
|
-
exports.BASIS_POINTS = 10000;
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC"}
|
package/dist/constants/index.js
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
-
};
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
__exportStar(require("./generalConstants"), exports);
|
18
|
-
__exportStar(require("./marginfiAccounts"), exports);
|
19
|
-
__exportStar(require("./pythConstants"), exports);
|
20
|
-
__exportStar(require("./solautoConstants"), exports);
|
21
|
-
__exportStar(require("./switchboardConstants"), exports);
|
22
|
-
__exportStar(require("./tokenConstants"), exports);
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import { PublicKey } from "@solana/web3.js";
|
2
|
-
import { MarginfiAssetAccounts } from "../types/accounts";
|
3
|
-
import { ProgramEnv } from "../types";
|
4
|
-
export type MarginfiBankAccountsMap = {
|
5
|
-
[group: string]: {
|
6
|
-
[token: string]: MarginfiAssetAccounts;
|
7
|
-
};
|
8
|
-
};
|
9
|
-
export interface MarginfiProgramAccounts {
|
10
|
-
program: PublicKey;
|
11
|
-
defaultGroup: PublicKey;
|
12
|
-
lookupTable: PublicKey;
|
13
|
-
bankAccounts: MarginfiBankAccountsMap;
|
14
|
-
}
|
15
|
-
export declare function getMarginfiAccounts(programEnv?: ProgramEnv, marginfiGroup?: PublicKey): MarginfiProgramAccounts;
|
16
|
-
export declare function isMarginfiProgram(programId: PublicKey): boolean;
|
17
|
-
//# sourceMappingURL=marginfiAccounts.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"marginfiAccounts.d.ts","sourceRoot":"","sources":["../../src/constants/marginfiAccounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAetC,MAAM,MAAM,uBAAuB,GAAG;IACpC,CAAC,KAAK,EAAE,MAAM,GAAG;QAAE,CAAC,KAAK,EAAE,MAAM,GAAG,qBAAqB,CAAA;KAAE,CAAC;CAC7D,CAAC;AAgLF,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,SAAS,CAAC;IACnB,YAAY,EAAE,SAAS,CAAC;IACxB,WAAW,EAAE,SAAS,CAAC;IACvB,YAAY,EAAE,uBAAuB,CAAC;CACvC;AAED,wBAAgB,mBAAmB,CACjC,UAAU,CAAC,EAAE,UAAU,EACvB,aAAa,CAAC,EAAE,SAAS,GACxB,uBAAuB,CA4BzB;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,WAKrD"}
|
@@ -1,234 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
-
}) : function(o, v) {
|
16
|
-
o["default"] = v;
|
17
|
-
});
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
-
if (mod && mod.__esModule) return mod;
|
20
|
-
var result = {};
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
-
__setModuleDefault(result, mod);
|
23
|
-
return result;
|
24
|
-
};
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
-
exports.getMarginfiAccounts = getMarginfiAccounts;
|
27
|
-
exports.isMarginfiProgram = isMarginfiProgram;
|
28
|
-
const web3_js_1 = require("@solana/web3.js");
|
29
|
-
const spl_token_1 = require("@solana/spl-token");
|
30
|
-
const tokens = __importStar(require("./tokenConstants"));
|
31
|
-
const MARGINFI_PROD_PROGRAM = new web3_js_1.PublicKey("MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA");
|
32
|
-
const MARGINFI_STAGING_PROGRAM = new web3_js_1.PublicKey("stag8sTKds2h4KzjUw3zKTsxbqvT4XKHdaR9X9E6Rct");
|
33
|
-
const PROD_DEFAULT_MARGINFI_GROUP = "4qp6Fx6tnZkY5Wropq9wUYgtFxXKwE6viZxFHg3rdAG8";
|
34
|
-
const STAGING_DEFAULT_MARGINFI_GROUP = "FCPfpHA69EbS8f9KKSreTRkXbzFpunsKuYf5qNmnJjpo";
|
35
|
-
const MARGINFI_STAGING_ACCOUNTS = {
|
36
|
-
[STAGING_DEFAULT_MARGINFI_GROUP]: {
|
37
|
-
[spl_token_1.NATIVE_MINT.toString()]: {
|
38
|
-
bank: "3evdJSa25nsUiZzEUzd92UNa13TPRJrje1dRyiQP5Lhp",
|
39
|
-
liquidityVault: "FVXESa7wCd1tf3o9LGroBc3Ym8Gpcq1HdsLek6oo7Ykv",
|
40
|
-
vaultAuthority: "DuYk1WGq8UsjW5ThLtaehFLrnJeupTjtF7TaPzja9LBQ",
|
41
|
-
},
|
42
|
-
[tokens.USDC]: {
|
43
|
-
bank: "Ek5JSFJFD8QgXM6rPDCzf31XhDp1q3xezaWYSkJWqbqc",
|
44
|
-
liquidityVault: "6n7xXMni5WJKUMb4Vm5Zis6UaUtGF5xEGmagZNVWWoKB",
|
45
|
-
vaultAuthority: "9mXNyA5yS4WSTpYUa5gi3yBrSJWWM7XNPNDWRzWGjdVe",
|
46
|
-
},
|
47
|
-
[tokens.USDT]: {
|
48
|
-
bank: "4WFCsVXwfnQvZG52VvPwae7CtL13PUFVWdjkw5YCRBo6",
|
49
|
-
liquidityVault: "BFSyniKfXU9rHqUvHLKeZMivQsAKWTE7HZ1fW6vZcvJp",
|
50
|
-
vaultAuthority: "Fgxe3SUMzcNuLtT9Xkv8QhhWXCmu4VxynzUMwCF4HvJd",
|
51
|
-
},
|
52
|
-
},
|
53
|
-
};
|
54
|
-
const MARGINFI_PROD_ACCOUNTS = {
|
55
|
-
[PROD_DEFAULT_MARGINFI_GROUP.toString()]: {
|
56
|
-
[spl_token_1.NATIVE_MINT.toString()]: {
|
57
|
-
bank: "CCKtUs6Cgwo4aaQUmBPmyoApH2gUDErxNZCAntD6LYGh",
|
58
|
-
liquidityVault: "2eicbpitfJXDwqCuFAmPgDP7t2oUotnAzbGzRKLMgSLe",
|
59
|
-
vaultAuthority: "DD3AeAssFvjqTvRTrRAtpfjkBF8FpVKnFuwnMLN9haXD",
|
60
|
-
},
|
61
|
-
[tokens.B_SOL]: {
|
62
|
-
bank: "6hS9i46WyTq1KXcoa2Chas2Txh9TJAVr6n1t3tnrE23K",
|
63
|
-
liquidityVault: "2WMipeKDB2CENxbzdmnVrRbsxCA2LY6kCtBe6AAqDP9p",
|
64
|
-
vaultAuthority: "8RcZHucpVHkHWRRdMhJZsxBK9mqKSYnMKGqtF84U8YEo",
|
65
|
-
},
|
66
|
-
[tokens.M_SOL]: {
|
67
|
-
bank: "22DcjMZrMwC5Bpa5AGBsmjc5V9VuQrXG6N9ZtdUNyYGE",
|
68
|
-
liquidityVault: "B6HqNn83a2bLqo4i5ygjLHJgD11ePtQksUyx4MjD55DV",
|
69
|
-
vaultAuthority: "6YxGd65JbXzgFGWjE44jsyVeCnZp7Bb1wfL9jDia1n8w",
|
70
|
-
},
|
71
|
-
[tokens.JITO_SOL]: {
|
72
|
-
bank: "Bohoc1ikHLD7xKJuzTyiTyCwzaL5N7ggJQu75A8mKYM8",
|
73
|
-
liquidityVault: "38VGtXd2pDPq9FMh1z6AVjcHCoHgvWyMhdNyamDTeeks",
|
74
|
-
vaultAuthority: "7Ng54qf7BrCcZLqXmKA9WSR7SVRn4q6RX1YpLksBQ21A",
|
75
|
-
},
|
76
|
-
[tokens.LST]: {
|
77
|
-
bank: "DMoqjmsuoru986HgfjqrKEvPv8YBufvBGADHUonkadC5",
|
78
|
-
liquidityVault: "DMQUXpb6K5L8osgV4x3NeEPUoJCf2VBgnA8FQusDjSou",
|
79
|
-
vaultAuthority: "6PWVauGLhBFHUJspsnBVZHr56ZnbvmhSD2gS7czBHGpE",
|
80
|
-
},
|
81
|
-
[tokens.INF]: {
|
82
|
-
bank: "AwLRW3aPMMftXEjgWhTkYwM9CGBHdtKecvahCJZBwAqY",
|
83
|
-
liquidityVault: "HQ1CGcqRshMhuonTGTnnmgw9ffcXxizGdZ6F6PKffWWi",
|
84
|
-
vaultAuthority: "AEZb1XH5bfLwqk3hBKDuLfWyJKdLTgDPCkgn64BJKcvV",
|
85
|
-
},
|
86
|
-
[tokens.H_SOL]: {
|
87
|
-
bank: "GJCi1uj3kYPZ64puA5sLUiCQfFapxT2xnREzrbDzFkYY",
|
88
|
-
liquidityVault: "8M97jkdr4rJtPnQ4yQ9stD6qVwaUvjrBdDPDbHJnPJLf",
|
89
|
-
vaultAuthority: "8x7mgTn5RvHR8Tn3CJqexSuQwrs6MLEy8csuXCDVvvpt",
|
90
|
-
},
|
91
|
-
[tokens.JUP_SOL]: {
|
92
|
-
bank: "8LaUZadNqtzuCG7iCvZd7d5cbquuYfv19KjAg6GPuuCb",
|
93
|
-
liquidityVault: "B1zjqKPoYp9bTMhzFADaAvjyGb49FMitLpi6P3Pa3YR6",
|
94
|
-
vaultAuthority: "93Qqsge2jHVsWLd8vas4cWghrsZJooMUr5JKN5DtcfMX",
|
95
|
-
},
|
96
|
-
[tokens.JUP]: {
|
97
|
-
bank: "Guu5uBc8k1WK1U2ihGosNaCy57LSgCkpWAabtzQqrQf8",
|
98
|
-
liquidityVault: "4w49W4fNDn778wsBa6TNq9hvebZKU17ymsptrEZ8zrsm",
|
99
|
-
vaultAuthority: "2MBwwAhL3c73Jy7HkWd9ofzh1bU39JBabrZCFQR2tUof",
|
100
|
-
},
|
101
|
-
[tokens.JTO]: {
|
102
|
-
bank: "EdB7YADw4XUt6wErT8kHGCUok4mnTpWGzPUU9rWDebzb",
|
103
|
-
liquidityVault: "3bY1DEkXodGmPMG5f7ABA12228MBG5JdAAKf5cgkB6G1",
|
104
|
-
vaultAuthority: "H2b4f2fGSKFortxwzrMZBnYVfr2yrKVUakg4Md9be3Wv",
|
105
|
-
},
|
106
|
-
[tokens.JLP]: {
|
107
|
-
bank: "Amtw3n7GZe5SWmyhMhaFhDTi39zbTkLeWErBsmZXwpDa",
|
108
|
-
liquidityVault: "9xfyL8gxbV77VvhdgFmacHyLEG4h7d2eDWkSMfhXUPQ",
|
109
|
-
vaultAuthority: "F4RSGd4BRXscCqAVG3rFLiPVpo7v6j1drVqnvSM3rBKH",
|
110
|
-
},
|
111
|
-
[tokens.WBTC]: {
|
112
|
-
bank: "BKsfDJCMbYep6gr9pq8PsmJbb5XGLHbAJzUV8vmorz7a",
|
113
|
-
liquidityVault: "CMNdnjfaDQZo3VMoX31wZQBnSGu5FMmb1CnBaU4tApZk",
|
114
|
-
vaultAuthority: "7P2TQHYgVJkXv1VPaREsL5Pi1gnNjVif5aF3pJewZ9kj",
|
115
|
-
},
|
116
|
-
[tokens.WETH]: {
|
117
|
-
bank: "BkUyfXjbBBALcfZvw76WAFRvYQ21xxMWWeoPtJrUqG3z",
|
118
|
-
liquidityVault: "AxPJtiTEDksJWvCqNHCziK4uUcabqfmwW41dqtZrPFkp",
|
119
|
-
vaultAuthority: "ELXogWuyXrFyUG1vevffVbEhVxdFrHf2GCJTtRGKBWdM",
|
120
|
-
},
|
121
|
-
[tokens.HNT]: {
|
122
|
-
bank: "JBcir4DPRPYVUpks9hkS1jtHMXejfeBo4xJGv3AYYHg6",
|
123
|
-
liquidityVault: "E8Q7u5e9L9Uykx16em75ERT9wfbBPtkNL8gsRjoP8GB9",
|
124
|
-
vaultAuthority: "AjsyrYpgaH275DBSnvNWdGK33hVycSFuXN87FKnX6fVY",
|
125
|
-
},
|
126
|
-
[tokens.PYTH]: {
|
127
|
-
bank: "E4td8i8PT2BZkMygzW4MGHCv2KPPs57dvz5W2ZXf9Twu",
|
128
|
-
liquidityVault: "DUrAkkaMAckzes7so9T5frXm9YFFgjAAm3MMwHwTfVJq",
|
129
|
-
vaultAuthority: "9b5KdVnbbfEQ2qhLeFjWvcAx2VWe9XHx7ZgayZyL9a6C",
|
130
|
-
},
|
131
|
-
[tokens.USDC]: {
|
132
|
-
bank: "2s37akK2eyBbp8DZgCm7RtsaEz8eJP3Nxd4urLHQv7yB",
|
133
|
-
liquidityVault: "7jaiZR5Sk8hdYN9MxTpczTcwbWpb5WEoxSANuUwveuat",
|
134
|
-
vaultAuthority: "3uxNepDbmkDNq6JhRja5Z8QwbTrfmkKP8AKZV5chYDGG",
|
135
|
-
},
|
136
|
-
[tokens.USDT]: {
|
137
|
-
bank: "HmpMfL8942u22htC4EMiWgLX931g3sacXFR6KjuLgKLV",
|
138
|
-
liquidityVault: "77t6Fi9qj4s4z22K1toufHtstM8rEy7Y3ytxik7mcsTy",
|
139
|
-
vaultAuthority: "9r6z6KgkEytHCdQWNxvDQH98PsfU98f1m5PCg47mY2XE",
|
140
|
-
},
|
141
|
-
[tokens.BONK]: {
|
142
|
-
bank: "DeyH7QxWvnbbaVB4zFrf4hoq7Q8z1ZT14co42BGwGtfM",
|
143
|
-
liquidityVault: "7FdQsXmCW3N5JQbknj3F9Yqq73er9VZJjGhEEMS8Ct2A",
|
144
|
-
vaultAuthority: "26kcZkdjJc94PdhqiLiEaGiLCYgAVVUfpDaZyK4cqih3",
|
145
|
-
},
|
146
|
-
[tokens.WIF]: {
|
147
|
-
bank: "9dpu8KL5ABYiD3WP2Cnajzg1XaotcJvZspv29Y1Y3tn1",
|
148
|
-
liquidityVault: "4kT3EXc5dDVndUU9mV6EH3Jh3CSEvpcCZjuMkwqrtxUy",
|
149
|
-
vaultAuthority: "9gNrvvZ9RuTyRWooiEEypwcXU6kyXW8yWuhXU8tWUH5L",
|
150
|
-
},
|
151
|
-
},
|
152
|
-
["DQ2jqDJw9uzTwttf6h6r217BQ7kws3jZbJXDkfbCJa1q"]: {
|
153
|
-
[tokens.POPCAT]: {
|
154
|
-
bank: "845oEvt1oduoBj5zQxTr21cWWaUVnRjGerJuW3yMo2nn",
|
155
|
-
liquidityVault: "At6R64ip51zay4dT6k1WnVGETSMcaiY5vggD5DVTgxri",
|
156
|
-
vaultAuthority: "dNraDCWb5usDSoW4kD1Mi2E9WsNu6EABcQZqnrDfjNb",
|
157
|
-
},
|
158
|
-
[tokens.USDC]: {
|
159
|
-
bank: "EXrnNVfLagt3j4hCHSD9WqK75o6dkZBtjpnrSrSC78MA",
|
160
|
-
liquidityVault: "D9HSUYz3Rg2cTH65dUPaQS1MYxofNTeLecsAjiBgVPur",
|
161
|
-
vaultAuthority: "5ivKgJnxQ9CewJcKYSPQUiQFdfJki6YS87FqohnMSsFM",
|
162
|
-
},
|
163
|
-
},
|
164
|
-
["EpzY5EYF1A5eFDRfjtsPXSYMPmEx1FXKaXPnouTMF4dm"]: {
|
165
|
-
[tokens.RETARDIO]: {
|
166
|
-
bank: "3J5rKmCi7JXG6qmiobFJyAidVTnnNAMGj4jomfBxKGRM",
|
167
|
-
liquidityVault: "863K9YPVT3xbUGFZevrQJLqMux3UdRkwNQ6usAp4hJyy",
|
168
|
-
vaultAuthority: "Qsv2rnNRdv59AwRU3YmGPMCTdKT41CDAKyYAr4srCJR",
|
169
|
-
},
|
170
|
-
[tokens.USDC]: {
|
171
|
-
bank: "6cgYhBFWCc5sNHxkvSRhd5H9AdAHR41zKwuF37HmLry5",
|
172
|
-
liquidityVault: "7orVfNL5ZjqvdSaDgYLgBk4i5B3AnwFXNqqAvJbx6DFy",
|
173
|
-
vaultAuthority: "G4Azxk4PYtNRmDZkJppYo3rNAinkZXzYpQPG5dVDh4Nj",
|
174
|
-
},
|
175
|
-
},
|
176
|
-
["G1rt3EpQ43K3bY457rhukQGRAo2QxydFAGRKqnjKzyr5"]: {
|
177
|
-
[tokens.BILLY]: {
|
178
|
-
bank: "Dj3PndQ3j1vuga5ApiFWWAfQ4h3wBtgS2SeLZBT2LD4g",
|
179
|
-
liquidityVault: "BRcRMDVPBQzXNXWtSS6bNotcGxhVsxfiAt1qf8nFVUpx",
|
180
|
-
vaultAuthority: "36SgFh1qBRyj1PEhsn7Kg9Sfwbrn7rHP7kvTM5o5n6AL",
|
181
|
-
},
|
182
|
-
[tokens.USDC]: {
|
183
|
-
bank: "A7vBgCowCYeja7GTc3pyqUBdC9Gkue2gWaMjGZW38meM",
|
184
|
-
liquidityVault: "DBGhZ8TJTG2Pacdva27zY9etaro24o1tTA3LToSjYHbx",
|
185
|
-
vaultAuthority: "Cg6BCqkGny7A2AXCV8rikhHXM82wqqfzmdsTobEeTQkH",
|
186
|
-
},
|
187
|
-
},
|
188
|
-
["DESG67cExEcw7d6MmENLEzaocR8pLrhfiw9VrNtGWUKD"]: {
|
189
|
-
[tokens.HMTR]: {
|
190
|
-
bank: "Br3yzg2WSb81RaFWK9UsKtq8fD5viwooZG34mKqQWxdM",
|
191
|
-
liquidityVault: "J45Je52qv2rDBuCQWPwp3bjRhf3bGzRWhKZtGDuLooCX",
|
192
|
-
vaultAuthority: "CKDsAKjNruDSz4tmUairh8PDGD1Rqh9WMTLWERYnnZrH",
|
193
|
-
},
|
194
|
-
[tokens.USDC]: {
|
195
|
-
bank: "9yNnhJ8c1vGbu3DMf6eeeUi6TDJ2ddGgaRA88rL2R3rP",
|
196
|
-
liquidityVault: "4U1UBjXrPrW7JuQ894JbLUBqcb5LFfK9rfkWFwT7EdQ9",
|
197
|
-
vaultAuthority: "CY74V1r48kuuHA6APD3AaU2oPV1mBqe9srikrQQSHNR6",
|
198
|
-
},
|
199
|
-
},
|
200
|
-
};
|
201
|
-
const MARGINFI_PROD_ACCOUNTS_LOOKUP_TABLE = "GAjmWmBPcH5Gxbiykasydj6RsCEaCLyHEvK6kHdFigc6";
|
202
|
-
const MARGINFI_STAGING_ACCOUNTS_LOOKUP_TABLE = "EoEVYjz3MnsX6fKyxrwJkRhzMCHKjj6dvnjTCHoZLMc7";
|
203
|
-
function getMarginfiAccounts(programEnv, marginfiGroup) {
|
204
|
-
if (programEnv === undefined) {
|
205
|
-
if (Boolean(marginfiGroup)) {
|
206
|
-
programEnv = Object.keys(MARGINFI_PROD_ACCOUNTS).includes(marginfiGroup.toString())
|
207
|
-
? "Prod"
|
208
|
-
: "Staging";
|
209
|
-
}
|
210
|
-
else {
|
211
|
-
programEnv = "Prod";
|
212
|
-
}
|
213
|
-
}
|
214
|
-
if (programEnv === "Prod") {
|
215
|
-
return {
|
216
|
-
program: MARGINFI_PROD_PROGRAM,
|
217
|
-
defaultGroup: new web3_js_1.PublicKey(PROD_DEFAULT_MARGINFI_GROUP),
|
218
|
-
lookupTable: new web3_js_1.PublicKey(MARGINFI_PROD_ACCOUNTS_LOOKUP_TABLE),
|
219
|
-
bankAccounts: MARGINFI_PROD_ACCOUNTS,
|
220
|
-
};
|
221
|
-
}
|
222
|
-
else {
|
223
|
-
return {
|
224
|
-
program: MARGINFI_STAGING_PROGRAM,
|
225
|
-
defaultGroup: new web3_js_1.PublicKey(STAGING_DEFAULT_MARGINFI_GROUP),
|
226
|
-
lookupTable: new web3_js_1.PublicKey(MARGINFI_STAGING_ACCOUNTS_LOOKUP_TABLE),
|
227
|
-
bankAccounts: MARGINFI_STAGING_ACCOUNTS,
|
228
|
-
};
|
229
|
-
}
|
230
|
-
}
|
231
|
-
function isMarginfiProgram(programId) {
|
232
|
-
return (programId.equals(MARGINFI_PROD_PROGRAM) ||
|
233
|
-
programId.equals(MARGINFI_STAGING_PROGRAM));
|
234
|
-
}
|
@@ -1,24 +0,0 @@
|
|
1
|
-
import { PublicKey } from "@solana/web3.js";
|
2
|
-
export declare const PYTH_PUSH_PROGRAM: PublicKey;
|
3
|
-
export declare const PYTH_SPONSORED_SHARD_ID = 0;
|
4
|
-
export declare const MARGINFI_SPONSORED_SHARD_ID = 3301;
|
5
|
-
export declare const PYTH_PRICE_FEED_IDS: {
|
6
|
-
[x: string]: string;
|
7
|
-
bSo13r4TkiE4KumL71LsHTPpL2euBYLFx6h9HP3piy1: string;
|
8
|
-
mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So: string;
|
9
|
-
J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn: string;
|
10
|
-
LSTxxxnJzKDFSLr4dUkPcmCf5VyryEqzPLz5j4bpxFp: string;
|
11
|
-
"5oVNBeEEQvYi1cX3ir8Dx5n1P7pdxydbGF2X4TxVusJm": string;
|
12
|
-
JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN: string;
|
13
|
-
jtojtomepa8beP8AuQc6eXt5FriJwfFMwQx2v2f9mCL: string;
|
14
|
-
"27G8MtK7VtTcCHkpASjSDdkWWYfoqT6ggEuKidVJidD4": string;
|
15
|
-
"3NZ9JMVBmGAqocybic2c7LQCJScmgsAZ6vQqTDzcqmJh": string;
|
16
|
-
"7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs": string;
|
17
|
-
hntyVP6YFm1Hg25TN9WGLqM12b8TQmcknKrdu1oxWux: string;
|
18
|
-
HZ1JovNiVvGrGNiiYvEozEVgZ58xaU3RKwX8eACQBCt3: string;
|
19
|
-
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v: string;
|
20
|
-
Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB: string;
|
21
|
-
DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263: string;
|
22
|
-
EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm: string;
|
23
|
-
};
|
24
|
-
//# sourceMappingURL=pythConstants.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"pythConstants.d.ts","sourceRoot":"","sources":["../../src/constants/pythConstants.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,eAAO,MAAM,iBAAiB,WAE7B,CAAC;AAEF,eAAO,MAAM,uBAAuB,IAAI,CAAC;AACzC,eAAO,MAAM,2BAA2B,OAAO,CAAC;AAGhD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;CAmC/B,CAAC"}
|
@@ -1,52 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
-
}) : function(o, v) {
|
16
|
-
o["default"] = v;
|
17
|
-
});
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
-
if (mod && mod.__esModule) return mod;
|
20
|
-
var result = {};
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
-
__setModuleDefault(result, mod);
|
23
|
-
return result;
|
24
|
-
};
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
-
exports.PYTH_PRICE_FEED_IDS = exports.MARGINFI_SPONSORED_SHARD_ID = exports.PYTH_SPONSORED_SHARD_ID = exports.PYTH_PUSH_PROGRAM = void 0;
|
27
|
-
const spl_token_1 = require("@solana/spl-token");
|
28
|
-
const tokens = __importStar(require("./tokenConstants"));
|
29
|
-
const web3_js_1 = require("@solana/web3.js");
|
30
|
-
exports.PYTH_PUSH_PROGRAM = new web3_js_1.PublicKey("pythWSnswVUd12oZpeFP8e9CVaEqJg25g1Vtc2biRsT");
|
31
|
-
exports.PYTH_SPONSORED_SHARD_ID = 0;
|
32
|
-
exports.MARGINFI_SPONSORED_SHARD_ID = 3301;
|
33
|
-
// https://pyth.network/developers/price-feed-ids#solana-stable
|
34
|
-
exports.PYTH_PRICE_FEED_IDS = {
|
35
|
-
[spl_token_1.NATIVE_MINT.toString()]: "0xef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d",
|
36
|
-
[tokens.B_SOL]: "0x89875379e70f8fbadc17aef315adf3a8d5d160b811435537e03c97e8aac97d9c",
|
37
|
-
[tokens.M_SOL]: "0xc2289a6a43d2ce91c6f55caec370f4acc38a2ed477f58813334c6d03749ff2a4",
|
38
|
-
[tokens.JITO_SOL]: "0x67be9f519b95cf24338801051f9a808eff0a578ccb388db73b7f6fe1de019ffb",
|
39
|
-
[tokens.LST]: "0x12fb674ee496045b1d9cf7d5e65379acb026133c2ad69f3ed996fb9fe68e3a37",
|
40
|
-
[tokens.INF]: "0xf51570985c642c49c2d6e50156390fdba80bb6d5f7fa389d2f012ced4f7d208f",
|
41
|
-
[tokens.JUP]: "0x0a0408d619e9380abad35060f9192039ed5042fa6f82301d0e48bb52be830996",
|
42
|
-
[tokens.JTO]: "0xb43660a5f790c69354b0729a5ef9d50d68f1df92107540210b9cccba1f947cc2",
|
43
|
-
[tokens.JLP]: "0xc811abc82b4bad1f9bd711a2773ccaa935b03ecef974236942cec5e0eb845a3a",
|
44
|
-
[tokens.WBTC]: "0xc9d8b075a5c69303365ae23633d4e085199bf5c520a3b90fed1322a0342ffc33",
|
45
|
-
[tokens.WETH]: "0x9d4294bbcd1174d6f2003ec365831e64cc31d9f6f15a2b85399db8d5000960f6",
|
46
|
-
[tokens.HNT]: "0x649fdd7ec08e8e2a20f425729854e90293dcbe2376abc47197a14da6ff339756",
|
47
|
-
[tokens.PYTH]: "0x0bbf28e9a841a1cc788f6a361b17ca072d0ea3098a1e5df1c3922d06719579ff",
|
48
|
-
[tokens.USDC]: "0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",
|
49
|
-
[tokens.USDT]: "0x2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b",
|
50
|
-
[tokens.BONK]: "0x72b021217ca3fe68922a19aaf990109cb9d84e9ad004b4d2025ad6f529314419",
|
51
|
-
[tokens.WIF]: "0x4ca4beeca86f0d164160323817a4e42b10010a724c2217c6ee41b54cd4cc61fc",
|
52
|
-
};
|