flash-sdk 11.4.3 → 11.4.4
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/PerpetualsClient.d.ts +11 -0
- package/dist/PerpetualsClient.js +13 -5
- package/dist/PoolConfig.d.ts +2 -1
- package/dist/PoolConfig.js +23 -2
- package/dist/PoolConfig.json +66 -78
- package/dist/idl/fbnft_rewards.d.ts +290 -0
- package/dist/idl/fbnft_rewards.js +292 -0
- package/dist/idl/perp_composability.d.ts +760 -0
- package/dist/idl/perp_composability.js +762 -0
- package/dist/idl/perpetuals.d.ts +148 -304
- package/dist/idl/perpetuals.js +148 -304
- package/dist/idl/reward_distribution.d.ts +347 -0
- package/dist/idl/reward_distribution.js +349 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/index.d.ts +4 -0
- package/package.json +3 -1
|
@@ -6,6 +6,9 @@ import { AddLiquidityAmountAndFee, InternalPrice, BorrowRateParams, ExitPriceAnd
|
|
|
6
6
|
import { OraclePrice } from "./OraclePrice";
|
|
7
7
|
import { CustodyAccount } from "./CustodyAccount";
|
|
8
8
|
import { Perpetuals } from "./idl/perpetuals";
|
|
9
|
+
import { PerpComposability } from "./idl/perp_composability";
|
|
10
|
+
import { FbnftRewards } from "./idl/fbnft_rewards";
|
|
11
|
+
import { RewardDistribution } from "./idl/reward_distribution";
|
|
9
12
|
import { SendTransactionOpts } from "./utils/rpc";
|
|
10
13
|
import { MarketConfig, PoolConfig, Token } from "./PoolConfig";
|
|
11
14
|
import { MarketAccount } from "./MarketAccount";
|
|
@@ -19,8 +22,12 @@ export type PerpClientOptions = {
|
|
|
19
22
|
export declare class PerpetualsClient {
|
|
20
23
|
provider: AnchorProvider;
|
|
21
24
|
program: Program<Perpetuals>;
|
|
25
|
+
programPerpComposability: Program<PerpComposability>;
|
|
26
|
+
programFbnftReward: Program<FbnftRewards>;
|
|
27
|
+
programRewardDistribution: Program<RewardDistribution>;
|
|
22
28
|
admin: PublicKey;
|
|
23
29
|
programId: PublicKey;
|
|
30
|
+
composabilityProgramId: PublicKey;
|
|
24
31
|
multisig: {
|
|
25
32
|
publicKey: PublicKey;
|
|
26
33
|
bump: number;
|
|
@@ -41,6 +48,10 @@ export declare class PerpetualsClient {
|
|
|
41
48
|
publicKey: PublicKey;
|
|
42
49
|
bump: number;
|
|
43
50
|
};
|
|
51
|
+
eventAuthorityRewardDistribution: {
|
|
52
|
+
publicKey: PublicKey;
|
|
53
|
+
bump: number;
|
|
54
|
+
};
|
|
44
55
|
prioritizationFee: number;
|
|
45
56
|
minimumBalanceForRentExemptAccountLamports: number;
|
|
46
57
|
private postSendTxCallback?;
|
package/dist/PerpetualsClient.js
CHANGED
|
@@ -69,6 +69,9 @@ var PositionAccount_1 = require("./PositionAccount");
|
|
|
69
69
|
var types_1 = require("./types");
|
|
70
70
|
var OraclePrice_1 = require("./OraclePrice");
|
|
71
71
|
var perpetuals_1 = require("./idl/perpetuals");
|
|
72
|
+
var perp_composability_1 = require("./idl/perp_composability");
|
|
73
|
+
var fbnft_rewards_1 = require("./idl/fbnft_rewards");
|
|
74
|
+
var reward_distribution_1 = require("./idl/reward_distribution");
|
|
72
75
|
var rpc_1 = require("./utils/rpc");
|
|
73
76
|
var utils_1 = require("./utils");
|
|
74
77
|
var constants_1 = require("./constants");
|
|
@@ -7122,12 +7125,12 @@ var PerpetualsClient = (function () {
|
|
|
7122
7125
|
});
|
|
7123
7126
|
}); };
|
|
7124
7127
|
this.moveProtocolFees = function (rewardSymbol, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
|
|
7125
|
-
var publicKey,
|
|
7128
|
+
var publicKey, custodyConfig, instructions, additionalSigners, moveProtocolFeesIx, err_45;
|
|
7126
7129
|
return __generator(this, function (_a) {
|
|
7127
7130
|
switch (_a.label) {
|
|
7128
7131
|
case 0:
|
|
7129
7132
|
publicKey = this.provider.wallet.publicKey;
|
|
7130
|
-
|
|
7133
|
+
custodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(rewardSymbol).mintKey); });
|
|
7131
7134
|
instructions = [];
|
|
7132
7135
|
additionalSigners = [];
|
|
7133
7136
|
_a.label = 1;
|
|
@@ -7140,15 +7143,15 @@ var PerpetualsClient = (function () {
|
|
|
7140
7143
|
perpetuals: this.perpetuals.publicKey,
|
|
7141
7144
|
tokenVault: poolConfig.tokenVault,
|
|
7142
7145
|
pool: poolConfig.poolAddress,
|
|
7143
|
-
|
|
7144
|
-
|
|
7146
|
+
custody: custodyConfig.custodyAccount,
|
|
7147
|
+
custodyTokenAccount: custodyConfig.tokenAccount,
|
|
7145
7148
|
revenueTokenAccount: poolConfig.revenueTokenAccount,
|
|
7146
7149
|
protocolVault: poolConfig.protocolVault,
|
|
7147
7150
|
protocolTokenAccount: poolConfig.protocolTokenAccount,
|
|
7148
7151
|
tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
|
|
7149
7152
|
eventAuthority: this.eventAuthority.publicKey,
|
|
7150
7153
|
program: this.program.programId,
|
|
7151
|
-
tokenMint:
|
|
7154
|
+
tokenMint: custodyConfig.mintKey,
|
|
7152
7155
|
})
|
|
7153
7156
|
.instruction()];
|
|
7154
7157
|
case 2:
|
|
@@ -8161,12 +8164,17 @@ var PerpetualsClient = (function () {
|
|
|
8161
8164
|
this.provider = provider;
|
|
8162
8165
|
(0, anchor_1.setProvider)(provider);
|
|
8163
8166
|
this.program = new anchor_1.Program(perpetuals_1.IDL, programId);
|
|
8167
|
+
this.programPerpComposability = new anchor_1.Program(perp_composability_1.IDL, composabilityProgramId);
|
|
8168
|
+
this.programFbnftReward = new anchor_1.Program(fbnft_rewards_1.IDL, fbNftRewardProgramId);
|
|
8169
|
+
this.programRewardDistribution = new anchor_1.Program(reward_distribution_1.IDL, rewardDistributionProgramId);
|
|
8164
8170
|
this.programId = programId;
|
|
8171
|
+
this.composabilityProgramId = composabilityProgramId;
|
|
8165
8172
|
this.admin = this.provider.wallet.publicKey;
|
|
8166
8173
|
this.multisig = this.findProgramAddress("multisig");
|
|
8167
8174
|
this.authority = this.findProgramAddress("transfer_authority");
|
|
8168
8175
|
this.perpetuals = this.findProgramAddress("perpetuals");
|
|
8169
8176
|
this.eventAuthority = this.findProgramAddress("__event_authority");
|
|
8177
|
+
this.eventAuthorityRewardDistribution = this.findProgramAddressFromProgramId("__event_authority", null, this.programRewardDistribution.programId);
|
|
8170
8178
|
this.minimumBalanceForRentExemptAccountLamports = 2039280;
|
|
8171
8179
|
this.prioritizationFee = (opts === null || opts === void 0 ? void 0 : opts.prioritizationFee) || 0;
|
|
8172
8180
|
this.useExtOracleAccount = useExtOracleAccount;
|
package/dist/PoolConfig.d.ts
CHANGED
|
@@ -87,13 +87,14 @@ export declare class PoolConfig {
|
|
|
87
87
|
tokens: Token[];
|
|
88
88
|
custodies: CustodyConfig[];
|
|
89
89
|
markets: MarketConfig[];
|
|
90
|
+
marketsDeprecated: MarketConfig[];
|
|
90
91
|
constructor(programId: PublicKey, perpComposibilityProgramId: PublicKey, fbNftRewardProgramId: PublicKey, cluster: Cluster, poolName: string, poolAddress: PublicKey, stakedLpTokenMint: PublicKey, compoundingTokenMint: PublicKey, stakedLpVault: PublicKey, compoundingLpVault: PublicKey, lpDecimals: number, compoundingLpTokenSymbol: string, stakedLpTokenSymbol: string, perpetuals: PublicKey, transferAuthority: PublicKey, tokenMint: PublicKey, tokenVault: PublicKey, tokenVaultTokenAccount: PublicKey, rebateVault: PublicKey, rebateTokenAccount: PublicKey, revenueTokenAccount: PublicKey, protocolVault: PublicKey, protocolTokenAccount: PublicKey, multisig: PublicKey, addressLookupTableAddresses: PublicKey[], pusherAddressLookupTableAddress: PublicKey, backupOracle: PublicKey, nftCollectionAddress: PublicKey, rewardDistributionProgram: {
|
|
91
92
|
programId: PublicKey;
|
|
92
93
|
transferAuthority: PublicKey;
|
|
93
94
|
rewardVault: PublicKey;
|
|
94
95
|
rewardMint: PublicKey;
|
|
95
96
|
rewardTokenAccount: PublicKey;
|
|
96
|
-
}, tokens: Token[], custodies: CustodyConfig[], markets: MarketConfig[]);
|
|
97
|
+
}, tokens: Token[], custodies: CustodyConfig[], markets: MarketConfig[], marketsDeprecated: MarketConfig[]);
|
|
97
98
|
getAllTokenMints(): PublicKey[];
|
|
98
99
|
getMarketConfigByPk(marketAccountPk: PublicKey): MarketConfig;
|
|
99
100
|
getMarketConfig(targetCustody: PublicKey, collateralCustody: PublicKey, side: Side): MarketConfig | null;
|
package/dist/PoolConfig.js
CHANGED
|
@@ -19,7 +19,7 @@ var web3_js_1 = require("@solana/web3.js");
|
|
|
19
19
|
var PoolConfig_json_1 = __importDefault(require("./PoolConfig.json"));
|
|
20
20
|
var types_1 = require("./types");
|
|
21
21
|
var PoolConfig = (function () {
|
|
22
|
-
function PoolConfig(programId, perpComposibilityProgramId, fbNftRewardProgramId, cluster, poolName, poolAddress, stakedLpTokenMint, compoundingTokenMint, stakedLpVault, compoundingLpVault, lpDecimals, compoundingLpTokenSymbol, stakedLpTokenSymbol, perpetuals, transferAuthority, tokenMint, tokenVault, tokenVaultTokenAccount, rebateVault, rebateTokenAccount, revenueTokenAccount, protocolVault, protocolTokenAccount, multisig, addressLookupTableAddresses, pusherAddressLookupTableAddress, backupOracle, nftCollectionAddress, rewardDistributionProgram, tokens, custodies, markets) {
|
|
22
|
+
function PoolConfig(programId, perpComposibilityProgramId, fbNftRewardProgramId, cluster, poolName, poolAddress, stakedLpTokenMint, compoundingTokenMint, stakedLpVault, compoundingLpVault, lpDecimals, compoundingLpTokenSymbol, stakedLpTokenSymbol, perpetuals, transferAuthority, tokenMint, tokenVault, tokenVaultTokenAccount, rebateVault, rebateTokenAccount, revenueTokenAccount, protocolVault, protocolTokenAccount, multisig, addressLookupTableAddresses, pusherAddressLookupTableAddress, backupOracle, nftCollectionAddress, rewardDistributionProgram, tokens, custodies, markets, marketsDeprecated) {
|
|
23
23
|
var _this = this;
|
|
24
24
|
this.programId = programId;
|
|
25
25
|
this.perpComposibilityProgramId = perpComposibilityProgramId;
|
|
@@ -53,6 +53,7 @@ var PoolConfig = (function () {
|
|
|
53
53
|
this.tokens = tokens;
|
|
54
54
|
this.custodies = custodies;
|
|
55
55
|
this.markets = markets;
|
|
56
|
+
this.marketsDeprecated = marketsDeprecated;
|
|
56
57
|
this.getTokenFromSymbol = function (symbol) {
|
|
57
58
|
return _this.tokens.find(function (f) { return f.symbol.toUpperCase() === symbol.toUpperCase(); });
|
|
58
59
|
};
|
|
@@ -68,6 +69,9 @@ var PoolConfig = (function () {
|
|
|
68
69
|
};
|
|
69
70
|
PoolConfig.prototype.getMarketConfigByPk = function (marketAccountPk) {
|
|
70
71
|
var market = this.markets.find(function (f) { return f.marketAccount.equals(marketAccountPk); });
|
|
72
|
+
if (!market) {
|
|
73
|
+
market = this.marketsDeprecated.find(function (f) { return f.marketAccount.equals(marketAccountPk); });
|
|
74
|
+
}
|
|
71
75
|
if (!market)
|
|
72
76
|
throw new Error("No such market ".concat(marketAccountPk.toBase58(), " exists."));
|
|
73
77
|
return market;
|
|
@@ -75,6 +79,9 @@ var PoolConfig = (function () {
|
|
|
75
79
|
PoolConfig.prototype.getMarketConfig = function (targetCustody, collateralCustody, side) {
|
|
76
80
|
var marketAccountPk = this.getMarketPk(targetCustody, collateralCustody, side);
|
|
77
81
|
var market = this.markets.find(function (f) { return f.marketAccount.equals(marketAccountPk); });
|
|
82
|
+
if (!market) {
|
|
83
|
+
market = this.marketsDeprecated.find(function (f) { return f.marketAccount.equals(marketAccountPk); });
|
|
84
|
+
}
|
|
78
85
|
if (!market)
|
|
79
86
|
return null;
|
|
80
87
|
return market;
|
|
@@ -196,13 +203,27 @@ var PoolConfig = (function () {
|
|
|
196
203
|
catch (error) {
|
|
197
204
|
console.log("ERROR: buildPoolconfigFromJson unable to load markets ");
|
|
198
205
|
}
|
|
206
|
+
var marketsDeprecated;
|
|
207
|
+
try {
|
|
208
|
+
if (!poolConfig['marketsDeprecated']) {
|
|
209
|
+
marketsDeprecated = [];
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
marketsDeprecated = poolConfig['marketsDeprecated'].map(function (i) {
|
|
213
|
+
return __assign(__assign({}, i), { marketAccount: new web3_js_1.PublicKey(i.marketAccount), marketCorrelation: i.marketCorrelation, pool: new web3_js_1.PublicKey(i.pool), targetCustody: new web3_js_1.PublicKey(i.targetCustody), collateralCustody: new web3_js_1.PublicKey(i.collateralCustody), side: i.side === 'long' ? types_1.Side.Long : types_1.Side.Short, maxLev: i.maxLev, degenMinLev: i.degenMinLev, degenMaxLev: i.degenMaxLev, targetMint: new web3_js_1.PublicKey(i.targetMint), collateralMint: new web3_js_1.PublicKey(i.collateralMint) });
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
catch (error) {
|
|
218
|
+
console.log("ERROR: buildPoolconfigFromJson unable to load markets ");
|
|
219
|
+
}
|
|
199
220
|
return new PoolConfig(new web3_js_1.PublicKey(poolConfig.programId), new web3_js_1.PublicKey(poolConfig.perpComposibilityProgramId), new web3_js_1.PublicKey(poolConfig.fbNftRewardProgramId), poolConfig.cluster, poolConfig.poolName, new web3_js_1.PublicKey(poolConfig.poolAddress), new web3_js_1.PublicKey(poolConfig.stakedLpTokenMint), new web3_js_1.PublicKey(poolConfig.compoundingTokenMint), new web3_js_1.PublicKey(poolConfig.stakedLpVault), new web3_js_1.PublicKey(poolConfig.compoundingLpVault), poolConfig.lpDecimals, poolConfig.compoundingLpTokenSymbol, poolConfig.stakedLpTokenSymbol, new web3_js_1.PublicKey(poolConfig.perpetuals), new web3_js_1.PublicKey(poolConfig.transferAuthority), new web3_js_1.PublicKey(poolConfig.tokenMint), new web3_js_1.PublicKey(poolConfig.tokenVault), new web3_js_1.PublicKey(poolConfig.tokenVaultTokenAccount), new web3_js_1.PublicKey(poolConfig.rebateVault), new web3_js_1.PublicKey(poolConfig.rebateTokenAccount), new web3_js_1.PublicKey(poolConfig.revenueTokenAccount), new web3_js_1.PublicKey(poolConfig.protocolVault), new web3_js_1.PublicKey(poolConfig.protocolTokenAccount), new web3_js_1.PublicKey(poolConfig.multisig), addressLookupTableAddresses, pusherAddressLookupTableAddress, new web3_js_1.PublicKey(poolConfig.backupOracle), new web3_js_1.PublicKey(poolConfig.nftCollectionAddress), {
|
|
200
221
|
programId: new web3_js_1.PublicKey(poolConfig.rewardDistributionProgram.programId),
|
|
201
222
|
rewardMint: new web3_js_1.PublicKey(poolConfig.rewardDistributionProgram.rewardMint),
|
|
202
223
|
rewardTokenAccount: new web3_js_1.PublicKey(poolConfig.rewardDistributionProgram.rewardTokenAccount),
|
|
203
224
|
rewardVault: new web3_js_1.PublicKey(poolConfig.rewardDistributionProgram.rewardVault),
|
|
204
225
|
transferAuthority: new web3_js_1.PublicKey(poolConfig.rewardDistributionProgram.transferAuthority),
|
|
205
|
-
}, tokens, custodies, markets);
|
|
226
|
+
}, tokens, custodies, markets, marketsDeprecated);
|
|
206
227
|
};
|
|
207
228
|
PoolConfig.fromIdsByName = function (name, cluster) {
|
|
208
229
|
var poolConfig = PoolConfig_json_1.default.pools.find(function (pool) { return pool['poolName'] === name && cluster === pool['cluster']; });
|
package/dist/PoolConfig.json
CHANGED
|
@@ -387,6 +387,24 @@
|
|
|
387
387
|
"targetMint": "A7bdiYdS5GjqGFtxf17ppRHtDKPkkRqbKtR27dxvQXaS",
|
|
388
388
|
"collateralMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
|
|
389
389
|
}
|
|
390
|
+
],
|
|
391
|
+
"marketsDeprecated": [
|
|
392
|
+
{
|
|
393
|
+
"marketId": 0,
|
|
394
|
+
"marketAccount": "88zawd3Rw6tknWvgEm8QBgBuf5Y2GTeA18S788qUrSnM",
|
|
395
|
+
"marketCorrelation": false,
|
|
396
|
+
"pool": "KwhpybQPe9xuZFmAfcjLHj3ukownWex1ratyascAC1X",
|
|
397
|
+
"targetCustody": "3j1xiP6GckKCzsTm6sni5iy6zrpZX5BWZGbKCq5buk4d",
|
|
398
|
+
"collateralCustody": "9yANuRkTRxb9jjxnG1h3xcUz2kM8fJgDbdYJV4PfZ7dy",
|
|
399
|
+
"side": "long",
|
|
400
|
+
"maxLev": 100,
|
|
401
|
+
"degenMinLev": 1,
|
|
402
|
+
"degenMaxLev": 100,
|
|
403
|
+
"targetCustodyId": 1,
|
|
404
|
+
"collateralCustodyId": 0,
|
|
405
|
+
"targetMint": "XAUfcdPHmEBnj78YnZ5YxqdwBmgbwoY5VfrRwETnKuQ",
|
|
406
|
+
"collateralMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
|
|
407
|
+
}
|
|
390
408
|
]
|
|
391
409
|
},
|
|
392
410
|
{
|
|
@@ -643,6 +661,22 @@
|
|
|
643
661
|
}
|
|
644
662
|
],
|
|
645
663
|
"markets": [
|
|
664
|
+
{
|
|
665
|
+
"marketId": 0,
|
|
666
|
+
"marketAccount": "88zawd3Rw6tknWvgEm8QBgBuf5Y2GTeA18S788qUrSnM",
|
|
667
|
+
"marketCorrelation": false,
|
|
668
|
+
"pool": "KwhpybQPe9xuZFmAfcjLHj3ukownWex1ratyascAC1X",
|
|
669
|
+
"targetCustody": "3j1xiP6GckKCzsTm6sni5iy6zrpZX5BWZGbKCq5buk4d",
|
|
670
|
+
"collateralCustody": "9yANuRkTRxb9jjxnG1h3xcUz2kM8fJgDbdYJV4PfZ7dy",
|
|
671
|
+
"side": "long",
|
|
672
|
+
"maxLev": 100,
|
|
673
|
+
"degenMinLev": 1,
|
|
674
|
+
"degenMaxLev": 100,
|
|
675
|
+
"targetCustodyId": 1,
|
|
676
|
+
"collateralCustodyId": 0,
|
|
677
|
+
"targetMint": "XAUfcdPHmEBnj78YnZ5YxqdwBmgbwoY5VfrRwETnKuQ",
|
|
678
|
+
"collateralMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
|
|
679
|
+
},
|
|
646
680
|
{
|
|
647
681
|
"marketId": 1,
|
|
648
682
|
"marketAccount": "G2rj5artQzevbsQtCJ1rkDt3Pd5b6ZYAf8e9AjZPipui",
|
|
@@ -786,22 +820,6 @@
|
|
|
786
820
|
"collateralCustodyId": 0,
|
|
787
821
|
"targetMint": "o1Lw5djE8o6wMbPXU7U8Us8a6DJhWJc9WrWWUc1LHAo",
|
|
788
822
|
"collateralMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
|
|
789
|
-
},
|
|
790
|
-
{
|
|
791
|
-
"marketId": 12,
|
|
792
|
-
"marketAccount": "AKD5nCQRH2NvBbCD9eGhhu7w1auX1cG8x9XAUNrwQMm1",
|
|
793
|
-
"marketCorrelation": true,
|
|
794
|
-
"pool": "KwhpybQPe9xuZFmAfcjLHj3ukownWex1ratyascAC1X",
|
|
795
|
-
"targetCustody": "3j1xiP6GckKCzsTm6sni5iy6zrpZX5BWZGbKCq5buk4d",
|
|
796
|
-
"collateralCustody": "HymsKV4bGdSbf4AyaBqCrK1438jZu6ubCqcws516vRXx",
|
|
797
|
-
"side": "long",
|
|
798
|
-
"maxLev": 100,
|
|
799
|
-
"degenMinLev": 1,
|
|
800
|
-
"degenMaxLev": 100,
|
|
801
|
-
"targetCustodyId": 1,
|
|
802
|
-
"collateralCustodyId": 7,
|
|
803
|
-
"targetMint": "XAUfcdPHmEBnj78YnZ5YxqdwBmgbwoY5VfrRwETnKuQ",
|
|
804
|
-
"collateralMint": "AymATz4TCL9sWNEEV9Kvyz45CHVhDZ6kUgjTJPzLpU9P"
|
|
805
823
|
}
|
|
806
824
|
]
|
|
807
825
|
},
|
|
@@ -2939,19 +2957,6 @@
|
|
|
2939
2957
|
"pythTicker": "Commodities.WTIG6/USD",
|
|
2940
2958
|
"pythPriceId": "0x7e91242dfd2cea64715b26edaa3e51bafc712a56ac4228a77bd53b51fd66db52",
|
|
2941
2959
|
"isToken2022": false
|
|
2942
|
-
},
|
|
2943
|
-
{
|
|
2944
|
-
"symbol": "XAUt",
|
|
2945
|
-
"mintKey": "xaut1dB1uihYCwjReVgwZ4mBBJzwkXn4picqqmk4v2H",
|
|
2946
|
-
"decimals": 6,
|
|
2947
|
-
"usdPrecision": 4,
|
|
2948
|
-
"tokenPrecision": 4,
|
|
2949
|
-
"isStable": false,
|
|
2950
|
-
"isVirtual": false,
|
|
2951
|
-
"lazerId": 172,
|
|
2952
|
-
"pythTicker": "Crypto.XAUT/USD",
|
|
2953
|
-
"pythPriceId": "0x44465e17d2e9d390e70c999d5a11fda4f092847fcd2e3e5aa089d96c98a30e67",
|
|
2954
|
-
"isToken2022": false
|
|
2955
2960
|
}
|
|
2956
2961
|
],
|
|
2957
2962
|
"custodies": [
|
|
@@ -3056,26 +3061,25 @@
|
|
|
3056
3061
|
"lazerId": 2691,
|
|
3057
3062
|
"pythTicker": "Commodities.WTIG6/USD",
|
|
3058
3063
|
"pythPriceId": "0x7e91242dfd2cea64715b26edaa3e51bafc712a56ac4228a77bd53b51fd66db52"
|
|
3059
|
-
},
|
|
3060
|
-
{
|
|
3061
|
-
"custodyId": 7,
|
|
3062
|
-
"custodyAccount": "8sriDinQT789N7AJrEtQ2Q1jvVm7jGHhkdw4zTLKZxGe",
|
|
3063
|
-
"tokenAccount": "DpnfaMR5kJhVyy5SGk6yB1JHXYuqJhsm53wdewd8gNd1",
|
|
3064
|
-
"symbol": "XAUt",
|
|
3065
|
-
"mintKey": "xaut1dB1uihYCwjReVgwZ4mBBJzwkXn4picqqmk4v2H",
|
|
3066
|
-
"decimals": 6,
|
|
3067
|
-
"usdPrecision": 4,
|
|
3068
|
-
"tokenPrecision": 4,
|
|
3069
|
-
"isStable": false,
|
|
3070
|
-
"isVirtual": false,
|
|
3071
|
-
"intOracleAddress": "6fCDXgCYMnY29RENXKE2yGxvtMVUCMU59kkmS212MjMc",
|
|
3072
|
-
"extOracleAddress": "2uPQGpm8X4ZkxMHxrAW1QuhXcse1AHEgPih6Xp9NuEWW",
|
|
3073
|
-
"lazerId": 172,
|
|
3074
|
-
"pythTicker": "Crypto.XAUT/USD",
|
|
3075
|
-
"pythPriceId": "0x44465e17d2e9d390e70c999d5a11fda4f092847fcd2e3e5aa089d96c98a30e67"
|
|
3076
3064
|
}
|
|
3077
3065
|
],
|
|
3078
3066
|
"markets": [
|
|
3067
|
+
{
|
|
3068
|
+
"marketId": 0,
|
|
3069
|
+
"marketAccount": "6VaKMhU9mtWUVXSj73VMj5RAXfLiE7mRn1myyWEwBC6S",
|
|
3070
|
+
"marketCorrelation": false,
|
|
3071
|
+
"pool": "Ar7yp9PJkRpvXasLB4NYdbDHnuvAZ1gDA8ALnkPKivbb",
|
|
3072
|
+
"targetCustody": "EXumu4qqjXYpv1RUzTGiVJAvjvL3BWzn592SSwxrtZwW",
|
|
3073
|
+
"collateralCustody": "4nkiPSMJb4hpLhpaXbebkYF73Ub5vjeked8mWkPafMBm",
|
|
3074
|
+
"side": "long",
|
|
3075
|
+
"maxLev": 100,
|
|
3076
|
+
"degenMinLev": 1,
|
|
3077
|
+
"degenMaxLev": 100,
|
|
3078
|
+
"targetCustodyId": 1,
|
|
3079
|
+
"collateralCustodyId": 0,
|
|
3080
|
+
"targetMint": "xaucSYSxjZF4EbsLqAGRvPcuD1uXAj9awmsxYkUAavx",
|
|
3081
|
+
"collateralMint": "Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr"
|
|
3082
|
+
},
|
|
3079
3083
|
{
|
|
3080
3084
|
"marketId": 1,
|
|
3081
3085
|
"marketAccount": "HH56JHJojhexo4eAE6dCC8XAKKoHiUzEg5fkFRmVGh2S",
|
|
@@ -3092,6 +3096,22 @@
|
|
|
3092
3096
|
"targetMint": "xaucSYSxjZF4EbsLqAGRvPcuD1uXAj9awmsxYkUAavx",
|
|
3093
3097
|
"collateralMint": "Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr"
|
|
3094
3098
|
},
|
|
3099
|
+
{
|
|
3100
|
+
"marketId": 2,
|
|
3101
|
+
"marketAccount": "F2ro3DdrYJB59JS18wekPKU8yKG5YKFejypPkEX7wYzK",
|
|
3102
|
+
"marketCorrelation": false,
|
|
3103
|
+
"pool": "Ar7yp9PJkRpvXasLB4NYdbDHnuvAZ1gDA8ALnkPKivbb",
|
|
3104
|
+
"targetCustody": "H9KvJwG7qB5hcuqdx5Ac3mVFiSdTsms92NLQnGC9eGkx",
|
|
3105
|
+
"collateralCustody": "4nkiPSMJb4hpLhpaXbebkYF73Ub5vjeked8mWkPafMBm",
|
|
3106
|
+
"side": "long",
|
|
3107
|
+
"maxLev": 100,
|
|
3108
|
+
"degenMinLev": 1,
|
|
3109
|
+
"degenMaxLev": 100,
|
|
3110
|
+
"targetCustodyId": 2,
|
|
3111
|
+
"collateralCustodyId": 0,
|
|
3112
|
+
"targetMint": "xagGMhSCG8WDsf3zFep6sGtvyY1D78roKCHTJtEWg4Z",
|
|
3113
|
+
"collateralMint": "Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr"
|
|
3114
|
+
},
|
|
3095
3115
|
{
|
|
3096
3116
|
"marketId": 3,
|
|
3097
3117
|
"marketAccount": "GofqHEVEZDEEzLtsGzHszvQAjEuByXR2jK5d7Y94ioQ3",
|
|
@@ -3203,38 +3223,6 @@
|
|
|
3203
3223
|
"collateralCustodyId": 0,
|
|
3204
3224
|
"targetMint": "oi1DkCGa5CVm379ZuznLMevqjg7KGWnDDFB96JXAi7a",
|
|
3205
3225
|
"collateralMint": "Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr"
|
|
3206
|
-
},
|
|
3207
|
-
{
|
|
3208
|
-
"marketId": 12,
|
|
3209
|
-
"marketAccount": "HCHwtnbLgZPPkYqrbXF1oF688dxHW6cbhfU7yFLgfCpY",
|
|
3210
|
-
"marketCorrelation": true,
|
|
3211
|
-
"pool": "Ar7yp9PJkRpvXasLB4NYdbDHnuvAZ1gDA8ALnkPKivbb",
|
|
3212
|
-
"targetCustody": "EXumu4qqjXYpv1RUzTGiVJAvjvL3BWzn592SSwxrtZwW",
|
|
3213
|
-
"collateralCustody": "8sriDinQT789N7AJrEtQ2Q1jvVm7jGHhkdw4zTLKZxGe",
|
|
3214
|
-
"side": "long",
|
|
3215
|
-
"maxLev": 50,
|
|
3216
|
-
"degenMinLev": 1,
|
|
3217
|
-
"degenMaxLev": 50,
|
|
3218
|
-
"targetCustodyId": 1,
|
|
3219
|
-
"collateralCustodyId": 7,
|
|
3220
|
-
"targetMint": "xaucSYSxjZF4EbsLqAGRvPcuD1uXAj9awmsxYkUAavx",
|
|
3221
|
-
"collateralMint": "xaut1dB1uihYCwjReVgwZ4mBBJzwkXn4picqqmk4v2H"
|
|
3222
|
-
},
|
|
3223
|
-
{
|
|
3224
|
-
"marketId": 13,
|
|
3225
|
-
"marketAccount": "6L3TrWrCSVq46N6zyTufVV6hpmMaLQgohkXntkf2fkzc",
|
|
3226
|
-
"marketCorrelation": false,
|
|
3227
|
-
"pool": "Ar7yp9PJkRpvXasLB4NYdbDHnuvAZ1gDA8ALnkPKivbb",
|
|
3228
|
-
"targetCustody": "H9KvJwG7qB5hcuqdx5Ac3mVFiSdTsms92NLQnGC9eGkx",
|
|
3229
|
-
"collateralCustody": "8sriDinQT789N7AJrEtQ2Q1jvVm7jGHhkdw4zTLKZxGe",
|
|
3230
|
-
"side": "long",
|
|
3231
|
-
"maxLev": 50,
|
|
3232
|
-
"degenMinLev": 1,
|
|
3233
|
-
"degenMaxLev": 50,
|
|
3234
|
-
"targetCustodyId": 2,
|
|
3235
|
-
"collateralCustodyId": 7,
|
|
3236
|
-
"targetMint": "xagGMhSCG8WDsf3zFep6sGtvyY1D78roKCHTJtEWg4Z",
|
|
3237
|
-
"collateralMint": "xaut1dB1uihYCwjReVgwZ4mBBJzwkXn4picqqmk4v2H"
|
|
3238
3226
|
}
|
|
3239
3227
|
]
|
|
3240
3228
|
},
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
export type FbnftRewards = {
|
|
2
|
+
"version": "0.1.0";
|
|
3
|
+
"name": "fbnft_rewards";
|
|
4
|
+
"instructions": [
|
|
5
|
+
{
|
|
6
|
+
"name": "initRewardVault";
|
|
7
|
+
"accounts": [
|
|
8
|
+
{
|
|
9
|
+
"name": "admin";
|
|
10
|
+
"isMut": true;
|
|
11
|
+
"isSigner": true;
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "transferAuthority";
|
|
15
|
+
"isMut": true;
|
|
16
|
+
"isSigner": false;
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "rewardVault";
|
|
20
|
+
"isMut": true;
|
|
21
|
+
"isSigner": false;
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "rewardMint";
|
|
25
|
+
"isMut": false;
|
|
26
|
+
"isSigner": false;
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "rewardTokenAccount";
|
|
30
|
+
"isMut": true;
|
|
31
|
+
"isSigner": false;
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "collectionMint";
|
|
35
|
+
"isMut": false;
|
|
36
|
+
"isSigner": false;
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "programData";
|
|
40
|
+
"isMut": false;
|
|
41
|
+
"isSigner": false;
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "systemProgram";
|
|
45
|
+
"isMut": false;
|
|
46
|
+
"isSigner": false;
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "tokenProgram";
|
|
50
|
+
"isMut": false;
|
|
51
|
+
"isSigner": false;
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "rent";
|
|
55
|
+
"isMut": false;
|
|
56
|
+
"isSigner": false;
|
|
57
|
+
}
|
|
58
|
+
];
|
|
59
|
+
"args": [
|
|
60
|
+
{
|
|
61
|
+
"name": "params";
|
|
62
|
+
"type": {
|
|
63
|
+
"defined": "InitRewardVaultParams";
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
];
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"name": "distributeRewards";
|
|
70
|
+
"accounts": [
|
|
71
|
+
{
|
|
72
|
+
"name": "admin";
|
|
73
|
+
"isMut": false;
|
|
74
|
+
"isSigner": true;
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"name": "fundingAccount";
|
|
78
|
+
"isMut": true;
|
|
79
|
+
"isSigner": false;
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"name": "rewardVault";
|
|
83
|
+
"isMut": true;
|
|
84
|
+
"isSigner": false;
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "rewardTokenAccount";
|
|
88
|
+
"isMut": true;
|
|
89
|
+
"isSigner": false;
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"name": "tokenProgram";
|
|
93
|
+
"isMut": false;
|
|
94
|
+
"isSigner": false;
|
|
95
|
+
}
|
|
96
|
+
];
|
|
97
|
+
"args": [
|
|
98
|
+
{
|
|
99
|
+
"name": "params";
|
|
100
|
+
"type": {
|
|
101
|
+
"defined": "DistributeRewardsParams";
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
];
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"name": "collectReward";
|
|
108
|
+
"accounts": [
|
|
109
|
+
{
|
|
110
|
+
"name": "owner";
|
|
111
|
+
"isMut": true;
|
|
112
|
+
"isSigner": true;
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"name": "feePayer";
|
|
116
|
+
"isMut": true;
|
|
117
|
+
"isSigner": true;
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "nftMint";
|
|
121
|
+
"isMut": true;
|
|
122
|
+
"isSigner": false;
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"name": "nftTokenAccount";
|
|
126
|
+
"isMut": false;
|
|
127
|
+
"isSigner": false;
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"name": "metadataAccount";
|
|
131
|
+
"isMut": true;
|
|
132
|
+
"isSigner": false;
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"name": "receivingAccount";
|
|
136
|
+
"isMut": true;
|
|
137
|
+
"isSigner": false;
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"name": "rewardRecord";
|
|
141
|
+
"isMut": true;
|
|
142
|
+
"isSigner": false;
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"name": "rewardVault";
|
|
146
|
+
"isMut": true;
|
|
147
|
+
"isSigner": false;
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"name": "rewardTokenAccount";
|
|
151
|
+
"isMut": true;
|
|
152
|
+
"isSigner": false;
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"name": "transferAuthority";
|
|
156
|
+
"isMut": false;
|
|
157
|
+
"isSigner": false;
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"name": "systemProgram";
|
|
161
|
+
"isMut": false;
|
|
162
|
+
"isSigner": false;
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"name": "tokenProgram";
|
|
166
|
+
"isMut": false;
|
|
167
|
+
"isSigner": false;
|
|
168
|
+
}
|
|
169
|
+
];
|
|
170
|
+
"args": [];
|
|
171
|
+
}
|
|
172
|
+
];
|
|
173
|
+
"accounts": [
|
|
174
|
+
{
|
|
175
|
+
"name": "rewardVault";
|
|
176
|
+
"type": {
|
|
177
|
+
"kind": "struct";
|
|
178
|
+
"fields": [
|
|
179
|
+
{
|
|
180
|
+
"name": "admin";
|
|
181
|
+
"type": "publicKey";
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"name": "collection";
|
|
185
|
+
"type": "publicKey";
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"name": "rewardMint";
|
|
189
|
+
"type": "publicKey";
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"name": "transferAuthority";
|
|
193
|
+
"type": "publicKey";
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"name": "rewardTokenAccount";
|
|
197
|
+
"type": "publicKey";
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"name": "lpTokenAccount";
|
|
201
|
+
"type": "publicKey";
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"name": "nftCount";
|
|
205
|
+
"type": "u64";
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"name": "accruedAmount";
|
|
209
|
+
"type": "u128";
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"name": "paidAmount";
|
|
213
|
+
"type": "u128";
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"name": "rewardsPerNft";
|
|
217
|
+
"type": "u64";
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"name": "bump";
|
|
221
|
+
"type": "u8";
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"name": "transferAuthorityBump";
|
|
225
|
+
"type": "u8";
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"name": "tokenAccountBump";
|
|
229
|
+
"type": "u8";
|
|
230
|
+
}
|
|
231
|
+
];
|
|
232
|
+
};
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"name": "rewardRecord";
|
|
236
|
+
"type": {
|
|
237
|
+
"kind": "struct";
|
|
238
|
+
"fields": [
|
|
239
|
+
{
|
|
240
|
+
"name": "mint";
|
|
241
|
+
"type": "publicKey";
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"name": "rewardDebt";
|
|
245
|
+
"type": "u64";
|
|
246
|
+
}
|
|
247
|
+
];
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
];
|
|
251
|
+
"types": [
|
|
252
|
+
{
|
|
253
|
+
"name": "InitRewardVaultParams";
|
|
254
|
+
"type": {
|
|
255
|
+
"kind": "struct";
|
|
256
|
+
"fields": [
|
|
257
|
+
{
|
|
258
|
+
"name": "nftCount";
|
|
259
|
+
"type": "u64";
|
|
260
|
+
}
|
|
261
|
+
];
|
|
262
|
+
};
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"name": "DistributeRewardsParams";
|
|
266
|
+
"type": {
|
|
267
|
+
"kind": "struct";
|
|
268
|
+
"fields": [
|
|
269
|
+
{
|
|
270
|
+
"name": "rewardAmount";
|
|
271
|
+
"type": "u64";
|
|
272
|
+
}
|
|
273
|
+
];
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
];
|
|
277
|
+
"errors": [
|
|
278
|
+
{
|
|
279
|
+
"code": 6000;
|
|
280
|
+
"name": "InvalidCollection";
|
|
281
|
+
"msg": "Unsuppported NFT collection";
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"code": 6001;
|
|
285
|
+
"name": "InvalidCount";
|
|
286
|
+
"msg": "Invalid NFT Count";
|
|
287
|
+
}
|
|
288
|
+
];
|
|
289
|
+
};
|
|
290
|
+
export declare const IDL: FbnftRewards;
|