@exponent-labs/exponent-sdk 0.0.10 → 0.1.1
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/build/addressLookupTableUtil.js.map +1 -1
- package/build/events.d.ts +2 -2
- package/build/events.js +43 -49
- package/build/events.js.map +1 -1
- package/build/flavors.d.ts +3 -3
- package/build/flavors.js +19 -24
- package/build/flavors.js.map +1 -1
- package/build/lpPosition.d.ts +4 -4
- package/build/lpPosition.js +19 -19
- package/build/lpPosition.js.map +1 -1
- package/build/market.d.ts +31 -35
- package/build/market.js +202 -205
- package/build/market.js.map +1 -1
- package/build/syPosition.d.ts +2 -2
- package/build/syPosition.js +19 -16
- package/build/syPosition.js.map +1 -1
- package/build/tokenUtil.d.ts +2 -2
- package/build/tokenUtil.js +4 -4
- package/build/tokenUtil.js.map +1 -1
- package/build/utils/altUtil.d.ts +3 -3
- package/build/utils/altUtil.js +15 -9
- package/build/utils/altUtil.js.map +1 -1
- package/build/utils/binSolver.test.js +6 -5
- package/build/utils/binSolver.test.js.map +1 -1
- package/build/utils/index.js.map +1 -1
- package/build/vault.d.ts +11 -11
- package/build/vault.js +69 -68
- package/build/vault.js.map +1 -1
- package/build/ytPosition.d.ts +7 -7
- package/build/ytPosition.js +33 -33
- package/build/ytPosition.js.map +1 -1
- package/package.json +22 -22
- package/src/addressLookupTableUtil.ts +2 -1
- package/src/events.ts +44 -44
- package/src/flavors.ts +33 -39
- package/src/lpPosition.ts +22 -21
- package/src/market.ts +296 -229
- package/src/syPosition.ts +38 -26
- package/src/tokenUtil.ts +7 -5
- package/src/utils/altUtil.ts +17 -12
- package/src/utils/binSolver.test.ts +2 -0
- package/src/utils/index.ts +2 -0
- package/src/vault.ts +108 -91
- package/src/ytPosition.ts +40 -36
package/build/lpPosition.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lpPosition.js","sourceRoot":"","sources":["../src/lpPosition.ts"],"names":[],"mappings":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CAAC,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAA;YAC3D,IAAI,CAAC,gBAAgB;gBAAE,OAAO,CAAC,CAAA;YAE/B,sEAAsE;YACtE,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,cAAc,CAAC,cAAc,CAAC,CAAA;YACrG,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,cAAc,CAAA;YACzD,MAAM,aAAa,GAAG,UAAU,GAAG,MAAM,CAAC,aAAa,CAAC,CAAA;YACxD,MAAM,YAAY,GAAG,cAAc,CAAC,YAAY,GAAG,aAAa,CAAA;YAEhE,oEAAoE;YACpE,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,GAAG,gBAAgB,CAAC,aAAa,CAAC,CAAA;YACvF,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAA;QAC7D,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AApID,gCAoIC"}
|
package/build/market.d.ts
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
/// <reference types="bn.js" />
|
|
2
|
-
import { Program, Wallet, web3 } from "@coral-xyz/anchor";
|
|
2
|
+
import { BN, Program, Wallet, web3 } from "@coral-xyz/anchor";
|
|
3
3
|
import { LiquidityNetBalanceLimits, LpFarm } from "@exponent-labs/exponent-fetcher";
|
|
4
|
-
import { Environment } from "./environment";
|
|
5
4
|
import { ExponentCore } from "@exponent-labs/exponent-idl";
|
|
6
|
-
import { BN } from "@coral-xyz/anchor";
|
|
7
5
|
import { ExponentPDA } from "@exponent-labs/exponent-pda";
|
|
8
|
-
import {
|
|
6
|
+
import { AnchorizedPNum, CpiAccountsRaw, CpiAccountsRawJson, Flavor, SyPosition } from "@exponent-labs/exponent-types";
|
|
9
7
|
import { LiquidityAdd, MarketCalculator } from "@exponent-labs/market-math";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { CpiAccountsRawJson } from "@exponent-labs/exponent-types";
|
|
8
|
+
import { Environment } from "./environment";
|
|
9
|
+
import { Vault } from "./vault";
|
|
13
10
|
export { LiquidityAdd };
|
|
14
11
|
interface Emission {
|
|
15
12
|
/** Token account that holds emission tokens */
|
|
@@ -100,7 +97,7 @@ export declare class Market {
|
|
|
100
97
|
xponPda: ExponentPDA;
|
|
101
98
|
constructor(state: MarketArgs, selfAddress: web3.PublicKey, env: Environment, connection: web3.Connection);
|
|
102
99
|
static load(env: Environment, connection: web3.Connection, address: web3.PublicKey, vault?: Vault, options?: MarketLoadOptions): Promise<Market>;
|
|
103
|
-
reload(
|
|
100
|
+
reload(connection?: web3.Connection): Promise<Market>;
|
|
104
101
|
/** Convert to a JSON representation */
|
|
105
102
|
toJson(): MarketJson;
|
|
106
103
|
get vault(): Vault;
|
|
@@ -143,8 +140,8 @@ export declare class Market {
|
|
|
143
140
|
get secondsRemaining(): number;
|
|
144
141
|
get absolutePtYield(): number;
|
|
145
142
|
/** Annualize a rate given the number of seconds remaining until maturity */
|
|
146
|
-
static annualize(
|
|
147
|
-
static annualizeApy(
|
|
143
|
+
static annualize(rate: number, secondsRemaining: number): number;
|
|
144
|
+
static annualizeApy(rate: number, secondsRemaining: number): number;
|
|
148
145
|
/** Annualized PT fixed rate */
|
|
149
146
|
get ptApr(): number;
|
|
150
147
|
get ptApy(): number;
|
|
@@ -157,7 +154,7 @@ export declare class Market {
|
|
|
157
154
|
get feeRatePtTrade(): number;
|
|
158
155
|
/** The fee rate taken off of trade fees (typically around 20%) expressed as a rational number */
|
|
159
156
|
get feeTreasuryRate(): number;
|
|
160
|
-
/** Calculate
|
|
157
|
+
/** Calculate amount of LP tokens to expect for tokens in */
|
|
161
158
|
lpOutForTokensIn(syInIntent: bigint, ptInIntent: bigint): LiquidityAdd;
|
|
162
159
|
marketCalculator(): MarketCalculator;
|
|
163
160
|
/** Deposit a pair of tokens as liquidity to the market
|
|
@@ -168,7 +165,7 @@ export declare class Market {
|
|
|
168
165
|
*
|
|
169
166
|
* The token accounts themselves are optional, and will be derived from the depositor's wallet if not provided
|
|
170
167
|
*/
|
|
171
|
-
ixDepositLiquidity({ ptInIntent, syInIntent, minLpOut, depositor, ptSrc, sySrc, lpDst, }: {
|
|
168
|
+
ixDepositLiquidity({ ptInIntent, syInIntent, minLpOut, depositor, ptSrc: ptSrcParam, sySrc: sySrcParam, lpDst: lpDstParam, }: {
|
|
172
169
|
/** Intended (maximum) amount of PT in */
|
|
173
170
|
ptInIntent: bigint;
|
|
174
171
|
/** Intended (maximum) amount of SY in */
|
|
@@ -184,7 +181,7 @@ export declare class Market {
|
|
|
184
181
|
signer: web3.PublicKey;
|
|
185
182
|
adminAction: MarketAdminAction;
|
|
186
183
|
}): Promise<web3.TransactionInstruction>;
|
|
187
|
-
ixModifyFarm({ newRate, untilTimestamp, signer, farmMint, farmTokenProgram, farmTokenSrc, }: {
|
|
184
|
+
ixModifyFarm({ newRate, untilTimestamp, signer, farmMint, farmTokenProgram, farmTokenSrc: farmTokenSrcParam, }: {
|
|
188
185
|
newRate: bigint;
|
|
189
186
|
untilTimestamp: number;
|
|
190
187
|
signer: web3.PublicKey;
|
|
@@ -201,7 +198,7 @@ export declare class Market {
|
|
|
201
198
|
*
|
|
202
199
|
* The token accounts themselves are optional, and will be derived from the withdrawer's wallet if not provided
|
|
203
200
|
*/
|
|
204
|
-
ixWithdrawLiquidity({ lpIn, withdrawer, minPtOut, minSyOut, ptDst, syDst, lpSrc, }: {
|
|
201
|
+
ixWithdrawLiquidity({ lpIn, withdrawer, minPtOut, minSyOut, ptDst: ptDstParam, syDst: syDstParam, lpSrc: lpSrcParam, }: {
|
|
205
202
|
lpIn: bigint;
|
|
206
203
|
withdrawer: web3.PublicKey;
|
|
207
204
|
minPtOut: bigint;
|
|
@@ -249,7 +246,7 @@ export declare class Market {
|
|
|
249
246
|
ixs: web3.TransactionInstruction[];
|
|
250
247
|
setupIxs: web3.TransactionInstruction[];
|
|
251
248
|
}>;
|
|
252
|
-
ixTradePt({ trader, traderPt, syConstraint, isBuy, tokenPt, tokenSy, }: {
|
|
249
|
+
ixTradePt({ trader, traderPt, syConstraint, isBuy, tokenPt: tokenPtParam, tokenSy: tokenSyParam, }: {
|
|
253
250
|
trader: web3.PublicKey;
|
|
254
251
|
traderPt: bigint;
|
|
255
252
|
syConstraint: bigint;
|
|
@@ -270,7 +267,7 @@ export declare class Market {
|
|
|
270
267
|
*
|
|
271
268
|
* The token accounts themselves are optional, and will be derived from the trader's wallet if not provided
|
|
272
269
|
*/
|
|
273
|
-
ixSellYt({ trader, ytIn, minSyOut, ytSrc, ptSrc, syDst, }: {
|
|
270
|
+
ixSellYt({ trader, ytIn, minSyOut, ytSrc: ytSrcParam, ptSrc: ptSrcParam, syDst: syDstParam, }: {
|
|
274
271
|
trader: web3.PublicKey;
|
|
275
272
|
ytIn: bigint;
|
|
276
273
|
minSyOut: bigint;
|
|
@@ -291,7 +288,7 @@ export declare class Market {
|
|
|
291
288
|
*
|
|
292
289
|
* The token accounts themselves are optional, and will be derived from the trader's wallet if not provided
|
|
293
290
|
*/
|
|
294
|
-
ixBuyYt({ trader, ytOut, maxSyIn, ytTrader, ptTrader, syTrader, }: {
|
|
291
|
+
ixBuyYt({ trader, ytOut, maxSyIn, ytTrader: ytTraderParam, ptTrader: ptTraderParam, syTrader: syTraderParam, }: {
|
|
295
292
|
trader: web3.PublicKey;
|
|
296
293
|
ytOut: bigint;
|
|
297
294
|
maxSyIn: bigint;
|
|
@@ -307,25 +304,25 @@ export declare class Market {
|
|
|
307
304
|
feePayer?: web3.PublicKey;
|
|
308
305
|
}): Promise<web3.TransactionInstruction>;
|
|
309
306
|
/** Deposit LP tokens into the farming module to earn rewards */
|
|
310
|
-
ixDepositLp({ owner, amount, lpSrc }: {
|
|
307
|
+
ixDepositLp({ owner, amount, lpSrc: lpSrcParam, }: {
|
|
311
308
|
owner: web3.PublicKey;
|
|
312
309
|
amount: bigint;
|
|
313
310
|
lpSrc?: web3.PublicKey;
|
|
314
311
|
}): Promise<web3.TransactionInstruction>;
|
|
315
312
|
/** Withdraw LP tokens from the farming module */
|
|
316
|
-
ixWithdrawLp({ owner, amount, lpDst }: {
|
|
313
|
+
ixWithdrawLp({ owner, amount, lpDst: lpDstParam, }: {
|
|
317
314
|
owner: web3.PublicKey;
|
|
318
315
|
amount: bigint;
|
|
319
316
|
lpDst?: web3.PublicKey;
|
|
320
317
|
}): Promise<web3.TransactionInstruction>;
|
|
321
|
-
ixWrapperCollectInterest({ claimer, tokenSyDst }: {
|
|
318
|
+
ixWrapperCollectInterest({ claimer, tokenSyDst: tokenSyDstParam, }: {
|
|
322
319
|
claimer: web3.PublicKey;
|
|
323
320
|
tokenSyDst?: web3.PublicKey;
|
|
324
321
|
}): Promise<{
|
|
325
322
|
ixs: web3.TransactionInstruction[];
|
|
326
323
|
setupIxs: web3.TransactionInstruction[];
|
|
327
324
|
}>;
|
|
328
|
-
ixWrapperBuyPt({ owner, ptOut, maxBaseIn, tokenSyTrader, tokenPtTrader, tokenBaseTrader, }: {
|
|
325
|
+
ixWrapperBuyPt({ owner, ptOut, maxBaseIn, tokenSyTrader: tokenSyTraderParam, tokenPtTrader: tokenPtTraderParam, tokenBaseTrader: tokenBaseTraderParam, }: {
|
|
329
326
|
owner: web3.PublicKey;
|
|
330
327
|
ptOut: bigint;
|
|
331
328
|
maxBaseIn: bigint;
|
|
@@ -336,7 +333,7 @@ export declare class Market {
|
|
|
336
333
|
ixs: web3.TransactionInstruction[];
|
|
337
334
|
setupIxs: web3.TransactionInstruction[];
|
|
338
335
|
}>;
|
|
339
|
-
ixWrapperSellPt({ owner, amount, minBaseOut, tokenSyTrader, tokenPtTrader, tokenBaseTrader, }: {
|
|
336
|
+
ixWrapperSellPt({ owner, amount, minBaseOut, tokenSyTrader: tokenSyTraderParam, tokenPtTrader: tokenPtTraderParam, tokenBaseTrader: tokenBaseTraderParam, }: {
|
|
340
337
|
owner: web3.PublicKey;
|
|
341
338
|
amount: bigint;
|
|
342
339
|
minBaseOut: bigint;
|
|
@@ -347,7 +344,7 @@ export declare class Market {
|
|
|
347
344
|
ixs: web3.TransactionInstruction[];
|
|
348
345
|
setupIxs: web3.TransactionInstruction[];
|
|
349
346
|
}>;
|
|
350
|
-
ixWrapperBuyYt({ owner, ytOut, maxBaseIn, tokenSyTrader, tokenPtTrader, tokenYtTrader, tokenBaseTrader, }: {
|
|
347
|
+
ixWrapperBuyYt({ owner, ytOut, maxBaseIn, tokenSyTrader: tokenSyTraderParam, tokenPtTrader: tokenPtTraderParam, tokenYtTrader: tokenYtTraderParam, tokenBaseTrader: tokenBaseTraderParam, }: {
|
|
351
348
|
owner: web3.PublicKey;
|
|
352
349
|
ytOut: bigint;
|
|
353
350
|
maxBaseIn: bigint;
|
|
@@ -359,7 +356,7 @@ export declare class Market {
|
|
|
359
356
|
ixs: web3.TransactionInstruction[];
|
|
360
357
|
setupIxs: web3.TransactionInstruction[];
|
|
361
358
|
}>;
|
|
362
|
-
ixWrapperSellYt({ owner, amount, minBaseOut, tokenBaseTrader, tokenSyTrader, tokenYtTrader, tokenPtTrader, }: {
|
|
359
|
+
ixWrapperSellYt({ owner, amount, minBaseOut, tokenBaseTrader: tokenBaseTraderParam, tokenSyTrader: tokenSyTraderParam, tokenYtTrader: tokenYtTraderParam, tokenPtTrader: tokenPtTraderParam, }: {
|
|
363
360
|
owner: web3.PublicKey;
|
|
364
361
|
amount: bigint;
|
|
365
362
|
minBaseOut: bigint;
|
|
@@ -380,7 +377,7 @@ export declare class Market {
|
|
|
380
377
|
setupIxs: web3.TransactionInstruction[];
|
|
381
378
|
}>;
|
|
382
379
|
/** Provide liquidity from a base asset - and receive YT and LP tokens in return */
|
|
383
|
-
ixProvideLiquidityNoPriceImpact({ depositor, amountBase, minLpOut, tokenSyDepositor, tokenYtDepositor, tokenPtDepositor, tokenBaseDepositor, tokenLpDepositor, }: {
|
|
380
|
+
ixProvideLiquidityNoPriceImpact({ depositor, amountBase, minLpOut, tokenSyDepositor: tokenSyDepositorParam, tokenYtDepositor: tokenYtDepositorParam, tokenPtDepositor: tokenPtDepositorParam, tokenBaseDepositor: tokenBaseDepositorParam, tokenLpDepositor: tokenLpDepositorParam, }: {
|
|
384
381
|
depositor: web3.PublicKey;
|
|
385
382
|
amountBase: bigint;
|
|
386
383
|
minLpOut: bigint;
|
|
@@ -393,7 +390,7 @@ export declare class Market {
|
|
|
393
390
|
ixs: web3.TransactionInstruction[];
|
|
394
391
|
setupIxs: web3.TransactionInstruction[];
|
|
395
392
|
}>;
|
|
396
|
-
ixProvideLiquidityBase({ depositor, amountBase, minLpOut, externalPtToBuy, externalSyConstraint, tokenSyDepositor, tokenYtDepositor, tokenPtDepositor, tokenBaseDepositor, tokenLpDepositor, }: {
|
|
393
|
+
ixProvideLiquidityBase({ depositor, amountBase, minLpOut, externalPtToBuy, externalSyConstraint, tokenSyDepositor: tokenSyDepositorParam, tokenYtDepositor: tokenYtDepositorParam, tokenPtDepositor: tokenPtDepositorParam, tokenBaseDepositor: tokenBaseDepositorParam, tokenLpDepositor: tokenLpDepositorParam, }: {
|
|
397
394
|
depositor: web3.PublicKey;
|
|
398
395
|
amountBase: bigint;
|
|
399
396
|
minLpOut: bigint;
|
|
@@ -408,7 +405,7 @@ export declare class Market {
|
|
|
408
405
|
ixs: web3.TransactionInstruction[];
|
|
409
406
|
setupIxs: web3.TransactionInstruction[];
|
|
410
407
|
}>;
|
|
411
|
-
ixProvideLiquidityClassic({ depositor, amountBase, amountPt, minLpOut, tokenSyDepositor, tokenYtDepositor, tokenPtDepositor, tokenBaseDepositor, tokenLpDepositor, }: {
|
|
408
|
+
ixProvideLiquidityClassic({ depositor, amountBase, amountPt, minLpOut, tokenSyDepositor: tokenSyDepositorParam, tokenYtDepositor: tokenYtDepositorParam, tokenPtDepositor: tokenPtDepositorParam, tokenBaseDepositor: tokenBaseDepositorParam, tokenLpDepositor: tokenLpDepositorParam, }: {
|
|
412
409
|
depositor: web3.PublicKey;
|
|
413
410
|
amountBase: bigint;
|
|
414
411
|
amountPt: bigint;
|
|
@@ -422,7 +419,7 @@ export declare class Market {
|
|
|
422
419
|
ixs: web3.TransactionInstruction[];
|
|
423
420
|
setupIxs: web3.TransactionInstruction[];
|
|
424
421
|
}>;
|
|
425
|
-
ixWithdrawLiquidityToBase({ owner, amountLp, minBaseOut, tokenSyWithdrawer, tokenYtWithdrawer, tokenPtWithdrawer, tokenBaseWithdrawer, tokenLpWithdrawer, }: {
|
|
422
|
+
ixWithdrawLiquidityToBase({ owner, amountLp, minBaseOut, tokenSyWithdrawer: tokenSyWithdrawerParam, tokenYtWithdrawer: tokenYtWithdrawerParam, tokenPtWithdrawer: tokenPtWithdrawerParam, tokenBaseWithdrawer: tokenBaseWithdrawerParam, tokenLpWithdrawer: tokenLpWithdrawerParam, }: {
|
|
426
423
|
owner: web3.PublicKey;
|
|
427
424
|
amountLp: bigint;
|
|
428
425
|
minBaseOut: bigint;
|
|
@@ -435,10 +432,9 @@ export declare class Market {
|
|
|
435
432
|
ixs: web3.TransactionInstruction[];
|
|
436
433
|
setupIxs: web3.TransactionInstruction[];
|
|
437
434
|
}>;
|
|
438
|
-
ixWithdrawLiquidityClassic({ owner, amountLp,
|
|
435
|
+
ixWithdrawLiquidityClassic({ owner, amountLp, tokenSyWithdrawer: tokenSyWithdrawerParam, tokenYtWithdrawer: tokenYtWithdrawerParam, tokenPtWithdrawer: tokenPtWithdrawerParam, tokenBaseWithdrawer: tokenBaseWithdrawerParam, tokenLpWithdrawer: tokenLpWithdrawerParam, }: {
|
|
439
436
|
owner: web3.PublicKey;
|
|
440
437
|
amountLp: bigint;
|
|
441
|
-
minBaseOut: bigint;
|
|
442
438
|
tokenSyWithdrawer?: web3.PublicKey;
|
|
443
439
|
tokenYtWithdrawer?: web3.PublicKey;
|
|
444
440
|
tokenPtWithdrawer?: web3.PublicKey;
|
|
@@ -448,7 +444,7 @@ export declare class Market {
|
|
|
448
444
|
ixs: web3.TransactionInstruction[];
|
|
449
445
|
setupIxs: web3.TransactionInstruction[];
|
|
450
446
|
}>;
|
|
451
|
-
claimFarmEmissions({ owner, mint, tokenProgram, tokenDst, }: {
|
|
447
|
+
claimFarmEmissions({ owner, mint, tokenProgram, tokenDst: tokenDstParam, }: {
|
|
452
448
|
owner: web3.PublicKey;
|
|
453
449
|
mint: web3.PublicKey;
|
|
454
450
|
tokenProgram: web3.PublicKey;
|
|
@@ -467,7 +463,7 @@ export declare class Market {
|
|
|
467
463
|
extendAddressLookupTableExtensionAccounts: web3.PublicKey[];
|
|
468
464
|
addMarketEmissionIx: web3.TransactionInstruction;
|
|
469
465
|
}>;
|
|
470
|
-
addFarm({ signer, farmMint, farmRewardTokenProgram, emissionsRate, untilTimestamp, farmRewardSrc, feePayer, }: {
|
|
466
|
+
addFarm({ signer, farmMint, farmRewardTokenProgram, emissionsRate, untilTimestamp, farmRewardSrc: farmRewardSrcParam, feePayer: feePayerParam, }: {
|
|
471
467
|
signer: web3.PublicKey;
|
|
472
468
|
farmMint: web3.PublicKey;
|
|
473
469
|
farmRewardTokenProgram: web3.PublicKey;
|
|
@@ -479,11 +475,11 @@ export declare class Market {
|
|
|
479
475
|
ixs: web3.TransactionInstruction[];
|
|
480
476
|
}>;
|
|
481
477
|
/** Calculate available liquidity for PT trades
|
|
482
|
-
* @param
|
|
483
|
-
* @param
|
|
478
|
+
* @param isBuy - true if buying PT with SY, false if selling PT for SY
|
|
479
|
+
* @param sizePt - amount of PT to trade (in PT decimals)
|
|
484
480
|
* @returns amount of PT that can be traded given current liquidity
|
|
485
481
|
*/
|
|
486
|
-
liquidityAvailable(
|
|
482
|
+
liquidityAvailable(isBuy: boolean, sizePt: bigint): bigint;
|
|
487
483
|
}
|
|
488
484
|
export type MarketJson = {
|
|
489
485
|
/** The market's public key */
|