@drift-labs/sdk 2.23.0 → 2.25.0-beta.0
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/README.md +1 -1
- package/lib/accounts/fetch.d.ts +1 -1
- package/lib/accounts/pollingDriftClientAccountSubscriber.d.ts +1 -1
- package/lib/accounts/pollingOracleAccountSubscriber.d.ts +1 -1
- package/lib/accounts/pollingTokenAccountSubscriber.d.ts +1 -1
- package/lib/accounts/pollingUserAccountSubscriber.d.ts +1 -1
- package/lib/accounts/pollingUserStatsAccountSubscriber.d.ts +1 -1
- package/lib/accounts/webSocketAccountSubscriber.d.ts +1 -1
- package/lib/accounts/webSocketDriftClientAccountSubscriber.d.ts +1 -1
- package/lib/accounts/webSocketUserAccountSubscriber.d.ts +1 -1
- package/lib/accounts/webSocketUserStatsAccountSubsriber.d.ts +1 -1
- package/lib/addresses/pda.d.ts +1 -2
- package/lib/addresses/pda.js +1 -1
- package/lib/adminClient.d.ts +3 -3
- package/lib/adminClient.js +16 -4
- package/lib/constants/numericConstants.d.ts +59 -61
- package/lib/constants/perpMarkets.js +21 -1
- package/lib/constants/spotMarkets.d.ts +0 -1
- package/lib/dlob/DLOB.d.ts +0 -1
- package/lib/dlob/DLOBNode.d.ts +0 -1
- package/lib/dlob/DLOBOrders.d.ts +1 -1
- package/lib/dlob/DLOBOrders.js +1 -1
- package/lib/dlob/NodeList.d.ts +0 -1
- package/lib/driftClient.d.ts +58 -24
- package/lib/driftClient.js +152 -136
- package/lib/events/eventSubscriber.d.ts +1 -1
- package/lib/events/eventSubscriber.js +3 -2
- package/lib/events/fetchLogs.d.ts +1 -1
- package/lib/events/fetchLogs.js +3 -2
- package/lib/examples/loadDlob.js +1 -1
- package/lib/examples/makeTradeExample.js +1 -1
- package/lib/factory/bigNum.d.ts +8 -9
- package/lib/factory/bigNum.js +1 -1
- package/lib/factory/oracleClient.js +1 -1
- package/lib/idl/drift.json +216 -14
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/math/amm.d.ts +2 -3
- package/lib/math/amm.js +1 -1
- package/lib/math/auction.d.ts +0 -1
- package/lib/math/conversion.d.ts +1 -2
- package/lib/math/funding.d.ts +1 -2
- package/lib/math/funding.js +1 -1
- package/lib/math/insurance.d.ts +1 -1
- package/lib/math/insurance.js +17 -1
- package/lib/math/margin.d.ts +1 -2
- package/lib/math/margin.js +1 -1
- package/lib/math/market.d.ts +1 -2
- package/lib/math/market.js +1 -1
- package/lib/math/oracles.d.ts +0 -1
- package/lib/math/oracles.js +2 -3
- package/lib/math/orders.d.ts +1 -2
- package/lib/math/orders.js +1 -1
- package/lib/math/position.d.ts +0 -1
- package/lib/math/repeg.d.ts +1 -2
- package/lib/math/repeg.js +1 -1
- package/lib/math/spotBalance.d.ts +1 -2
- package/lib/math/spotBalance.js +1 -1
- package/lib/math/spotMarket.d.ts +1 -2
- package/lib/math/spotMarket.js +1 -1
- package/lib/math/spotPosition.d.ts +1 -2
- package/lib/math/trade.d.ts +1 -2
- package/lib/math/trade.js +1 -1
- package/lib/math/utils.d.ts +0 -1
- package/lib/oracles/pythClient.d.ts +2 -3
- package/lib/oracles/pythClient.js +1 -1
- package/lib/oracles/quoteAssetOracleClient.js +1 -1
- package/lib/oracles/types.d.ts +1 -2
- package/lib/orderParams.d.ts +1 -2
- package/lib/serum/serumSubscriber.d.ts +1 -2
- package/lib/serum/serumSubscriber.js +1 -1
- package/lib/tokenFaucet.d.ts +2 -3
- package/lib/tokenFaucet.js +2 -2
- package/lib/tx/retryTxSender.d.ts +1 -1
- package/lib/tx/types.d.ts +1 -1
- package/lib/types.d.ts +9 -3
- package/lib/types.js +2 -1
- package/lib/user.d.ts +0 -1
- package/package.json +2 -2
- package/src/accounts/fetch.ts +1 -1
- package/src/accounts/pollingDriftClientAccountSubscriber.ts +1 -1
- package/src/accounts/pollingOracleAccountSubscriber.ts +1 -1
- package/src/accounts/pollingTokenAccountSubscriber.ts +1 -1
- package/src/accounts/pollingUserAccountSubscriber.ts +1 -1
- package/src/accounts/pollingUserStatsAccountSubscriber.ts +1 -1
- package/src/accounts/webSocketAccountSubscriber.ts +1 -1
- package/src/accounts/webSocketDriftClientAccountSubscriber.ts +1 -1
- package/src/accounts/webSocketUserAccountSubscriber.ts +1 -1
- package/src/accounts/webSocketUserStatsAccountSubsriber.ts +1 -1
- package/src/addresses/pda.ts +2 -2
- package/src/adminClient.ts +30 -2
- package/src/constants/perpMarkets.ts +21 -1
- package/src/dlob/DLOBOrders.ts +2 -2
- package/src/driftClient.ts +266 -163
- package/src/events/eventSubscriber.ts +7 -3
- package/src/events/fetchLogs.ts +7 -3
- package/src/examples/loadDlob.ts +1 -1
- package/src/examples/makeTradeExample.ts +1 -1
- package/src/factory/bigNum.ts +1 -1
- package/src/factory/oracleClient.ts +1 -1
- package/src/idl/drift.json +216 -14
- package/src/index.ts +1 -1
- package/src/math/amm.ts +1 -1
- package/src/math/funding.ts +1 -1
- package/src/math/insurance.ts +29 -0
- package/src/math/margin.ts +1 -1
- package/src/math/market.ts +1 -1
- package/src/math/oracles.ts +2 -3
- package/src/math/orders.ts +1 -1
- package/src/math/repeg.ts +1 -1
- package/src/math/spotBalance.ts +1 -1
- package/src/math/spotMarket.ts +1 -1
- package/src/math/spotPosition.ts +1 -1
- package/src/math/trade.ts +1 -1
- package/src/oracles/pythClient.ts +1 -1
- package/src/oracles/quoteAssetOracleClient.ts +1 -1
- package/src/oracles/types.ts +1 -1
- package/src/orderParams.ts +1 -1
- package/src/serum/serumSubscriber.ts +1 -1
- package/src/tokenFaucet.ts +2 -2
- package/src/tx/retryTxSender.ts +1 -1
- package/src/tx/types.ts +1 -1
- package/src/types.ts +8 -1
- package/src/userMap/userStatsMap.ts +1 -1
package/lib/orderParams.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="bn.js" />
|
|
2
1
|
import { OptionalOrderParams, OrderTriggerCondition } from './types';
|
|
3
|
-
import { BN } from '@
|
|
2
|
+
import { BN } from '@coral-xyz/anchor';
|
|
4
3
|
export declare function getLimitOrderParams(params: Omit<OptionalOrderParams, 'orderType' | 'marketType'> & {
|
|
5
4
|
price: BN;
|
|
6
5
|
}): OptionalOrderParams;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/// <reference types="bn.js" />
|
|
2
1
|
import { Connection, PublicKey } from '@solana/web3.js';
|
|
3
2
|
import { BulkAccountLoader } from '../accounts/bulkAccountLoader';
|
|
4
3
|
import { Market, Orderbook } from '@project-serum/serum';
|
|
5
4
|
import { SerumMarketSubscriberConfig } from './types';
|
|
6
|
-
import { BN } from '@
|
|
5
|
+
import { BN } from '@coral-xyz/anchor';
|
|
7
6
|
export declare class SerumSubscriber {
|
|
8
7
|
connection: Connection;
|
|
9
8
|
programId: PublicKey;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SerumSubscriber = void 0;
|
|
4
4
|
const serum_1 = require("@project-serum/serum");
|
|
5
|
-
const anchor_1 = require("@
|
|
5
|
+
const anchor_1 = require("@coral-xyz/anchor");
|
|
6
6
|
const numericConstants_1 = require("../constants/numericConstants");
|
|
7
7
|
class SerumSubscriber {
|
|
8
8
|
constructor(config) {
|
package/lib/tokenFaucet.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import { AnchorProvider, Program } from '@project-serum/anchor';
|
|
1
|
+
import * as anchor from '@coral-xyz/anchor';
|
|
2
|
+
import { AnchorProvider, Program } from '@coral-xyz/anchor';
|
|
4
3
|
import { AccountInfo } from '@solana/spl-token';
|
|
5
4
|
import { ConfirmOptions, Connection, PublicKey, TransactionInstruction, TransactionSignature } from '@solana/web3.js';
|
|
6
5
|
import { BN } from '.';
|
package/lib/tokenFaucet.js
CHANGED
|
@@ -27,8 +27,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.TokenFaucet = void 0;
|
|
30
|
-
const anchor = __importStar(require("@
|
|
31
|
-
const anchor_1 = require("@
|
|
30
|
+
const anchor = __importStar(require("@coral-xyz/anchor"));
|
|
31
|
+
const anchor_1 = require("@coral-xyz/anchor");
|
|
32
32
|
const spl_token_1 = require("@solana/spl-token");
|
|
33
33
|
const web3_js_1 = require("@solana/web3.js");
|
|
34
34
|
const token_faucet_json_1 = __importDefault(require("./idl/token_faucet.json"));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { TxSender, TxSigAndSlot } from './types';
|
|
3
3
|
import { Commitment, ConfirmOptions, RpcResponseAndContext, Signer, SignatureResult, Transaction, TransactionSignature, Connection, TransactionInstruction, AddressLookupTableAccount } from '@solana/web3.js';
|
|
4
|
-
import { AnchorProvider } from '@
|
|
4
|
+
import { AnchorProvider } from '@coral-xyz/anchor';
|
|
5
5
|
type ResolveReference = {
|
|
6
6
|
resolve?: () => void;
|
|
7
7
|
};
|
package/lib/tx/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Provider } from '@
|
|
1
|
+
import { Provider } from '@coral-xyz/anchor';
|
|
2
2
|
import { AddressLookupTableAccount, ConfirmOptions, Signer, Transaction, TransactionInstruction, TransactionSignature } from '@solana/web3.js';
|
|
3
3
|
export type TxSigAndSlot = {
|
|
4
4
|
txSig: TransactionSignature;
|
package/lib/types.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="bn.js" />
|
|
2
1
|
import { PublicKey, Transaction } from '@solana/web3.js';
|
|
3
2
|
import { BN } from '.';
|
|
4
3
|
export declare enum ExchangeStatus {
|
|
@@ -253,8 +252,11 @@ export declare class OrderTriggerCondition {
|
|
|
253
252
|
};
|
|
254
253
|
}
|
|
255
254
|
export declare class SpotFulfillmentType {
|
|
256
|
-
static readonly
|
|
257
|
-
|
|
255
|
+
static readonly EXTERNAL: {
|
|
256
|
+
external: {};
|
|
257
|
+
};
|
|
258
|
+
static readonly MATCH: {
|
|
259
|
+
match: {};
|
|
258
260
|
};
|
|
259
261
|
}
|
|
260
262
|
export declare class SpotFulfillmentStatus {
|
|
@@ -928,6 +930,9 @@ export type NecessaryOrderParams = {
|
|
|
928
930
|
export type OptionalOrderParams = {
|
|
929
931
|
[Property in keyof OrderParams]?: OrderParams[Property];
|
|
930
932
|
} & NecessaryOrderParams;
|
|
933
|
+
export type ModifyOrderParams = {
|
|
934
|
+
[Property in keyof OrderParams]?: OrderParams[Property] | null;
|
|
935
|
+
};
|
|
931
936
|
export declare const DefaultOrderParams: OrderParams;
|
|
932
937
|
export type MakerInfo = {
|
|
933
938
|
maker: PublicKey;
|
|
@@ -991,6 +996,7 @@ export type OracleGuardRails = {
|
|
|
991
996
|
};
|
|
992
997
|
export type MarginCategory = 'Initial' | 'Maintenance';
|
|
993
998
|
export type InsuranceFundStake = {
|
|
999
|
+
costBasis: BN;
|
|
994
1000
|
marketIndex: number;
|
|
995
1001
|
authority: PublicKey;
|
|
996
1002
|
ifShares: BN;
|
package/lib/types.js
CHANGED
|
@@ -162,7 +162,8 @@ OrderTriggerCondition.TRIGGERED_BELOW = { triggeredBelow: {} }; // below conditi
|
|
|
162
162
|
class SpotFulfillmentType {
|
|
163
163
|
}
|
|
164
164
|
exports.SpotFulfillmentType = SpotFulfillmentType;
|
|
165
|
-
SpotFulfillmentType.
|
|
165
|
+
SpotFulfillmentType.EXTERNAL = { external: {} };
|
|
166
|
+
SpotFulfillmentType.MATCH = { match: {} };
|
|
166
167
|
class SpotFulfillmentStatus {
|
|
167
168
|
}
|
|
168
169
|
exports.SpotFulfillmentStatus = SpotFulfillmentStatus;
|
package/lib/user.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drift-labs/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.25.0-beta.0",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "lib/index.d.ts",
|
|
6
6
|
"author": "crispheaney",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@
|
|
36
|
+
"@coral-xyz/anchor": "0.26.0",
|
|
37
37
|
"@project-serum/serum": "^0.13.38",
|
|
38
38
|
"@pythnetwork/client": "2.5.3",
|
|
39
39
|
"@solana/spl-token": "^0.1.6",
|
package/src/accounts/fetch.ts
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
NotSubscribedError,
|
|
7
7
|
OraclesToPoll,
|
|
8
8
|
} from './types';
|
|
9
|
-
import { Program } from '@
|
|
9
|
+
import { Program } from '@coral-xyz/anchor';
|
|
10
10
|
import StrictEventEmitter from 'strict-event-emitter-types';
|
|
11
11
|
import { EventEmitter } from 'events';
|
|
12
12
|
import {
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
OracleEvents,
|
|
5
5
|
OracleAccountSubscriber,
|
|
6
6
|
} from './types';
|
|
7
|
-
import { Program } from '@
|
|
7
|
+
import { Program } from '@coral-xyz/anchor';
|
|
8
8
|
import StrictEventEmitter from 'strict-event-emitter-types';
|
|
9
9
|
import { EventEmitter } from 'events';
|
|
10
10
|
import { PublicKey } from '@solana/web3.js';
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
TokenAccountEvents,
|
|
5
5
|
TokenAccountSubscriber,
|
|
6
6
|
} from './types';
|
|
7
|
-
import { Program } from '@
|
|
7
|
+
import { Program } from '@coral-xyz/anchor';
|
|
8
8
|
import StrictEventEmitter from 'strict-event-emitter-types';
|
|
9
9
|
import { EventEmitter } from 'events';
|
|
10
10
|
import { PublicKey } from '@solana/web3.js';
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
UserAccountEvents,
|
|
6
6
|
UserAccountSubscriber,
|
|
7
7
|
} from './types';
|
|
8
|
-
import { Program } from '@
|
|
8
|
+
import { Program } from '@coral-xyz/anchor';
|
|
9
9
|
import StrictEventEmitter from 'strict-event-emitter-types';
|
|
10
10
|
import { EventEmitter } from 'events';
|
|
11
11
|
import { PublicKey } from '@solana/web3.js';
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
UserStatsAccountSubscriber,
|
|
6
6
|
UserStatsAccountEvents,
|
|
7
7
|
} from './types';
|
|
8
|
-
import { Program } from '@
|
|
8
|
+
import { Program } from '@coral-xyz/anchor';
|
|
9
9
|
import StrictEventEmitter from 'strict-event-emitter-types';
|
|
10
10
|
import { EventEmitter } from 'events';
|
|
11
11
|
import { PublicKey } from '@solana/web3.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DataAndSlot, BufferAndSlot, AccountSubscriber } from './types';
|
|
2
|
-
import { AnchorProvider, Program } from '@
|
|
2
|
+
import { AnchorProvider, Program } from '@coral-xyz/anchor';
|
|
3
3
|
import { AccountInfo, Context, PublicKey } from '@solana/web3.js';
|
|
4
4
|
import { capitalize } from './utils';
|
|
5
5
|
import * as Buffer from 'buffer';
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from './types';
|
|
6
6
|
import { AccountSubscriber, NotSubscribedError } from './types';
|
|
7
7
|
import { SpotMarketAccount, PerpMarketAccount, StateAccount } from '../types';
|
|
8
|
-
import { Program } from '@
|
|
8
|
+
import { Program } from '@coral-xyz/anchor';
|
|
9
9
|
import StrictEventEmitter from 'strict-event-emitter-types';
|
|
10
10
|
import { EventEmitter } from 'events';
|
|
11
11
|
import {
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
UserAccountEvents,
|
|
6
6
|
UserAccountSubscriber,
|
|
7
7
|
} from './types';
|
|
8
|
-
import { Program } from '@
|
|
8
|
+
import { Program } from '@coral-xyz/anchor';
|
|
9
9
|
import StrictEventEmitter from 'strict-event-emitter-types';
|
|
10
10
|
import { EventEmitter } from 'events';
|
|
11
11
|
import { PublicKey } from '@solana/web3.js';
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
UserStatsAccountSubscriber,
|
|
6
6
|
UserStatsAccountEvents,
|
|
7
7
|
} from './types';
|
|
8
|
-
import { Program } from '@
|
|
8
|
+
import { Program } from '@coral-xyz/anchor';
|
|
9
9
|
import StrictEventEmitter from 'strict-event-emitter-types';
|
|
10
10
|
import { EventEmitter } from 'events';
|
|
11
11
|
import { PublicKey } from '@solana/web3.js';
|
package/src/addresses/pda.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PublicKey } from '@solana/web3.js';
|
|
2
|
-
import * as anchor from '@
|
|
3
|
-
import { BN } from '@
|
|
2
|
+
import * as anchor from '@coral-xyz/anchor';
|
|
3
|
+
import { BN } from '@coral-xyz/anchor';
|
|
4
4
|
|
|
5
5
|
export async function getDriftStateAccountPublicKeyAndNonce(
|
|
6
6
|
programId: PublicKey
|
package/src/adminClient.ts
CHANGED
|
@@ -14,8 +14,8 @@ import {
|
|
|
14
14
|
SpotFulfillmentConfigStatus,
|
|
15
15
|
} from './types';
|
|
16
16
|
import { DEFAULT_MARKET_NAME, encodeName } from './userName';
|
|
17
|
-
import { BN } from '@
|
|
18
|
-
import * as anchor from '@
|
|
17
|
+
import { BN } from '@coral-xyz/anchor';
|
|
18
|
+
import * as anchor from '@coral-xyz/anchor';
|
|
19
19
|
import {
|
|
20
20
|
getDriftStateAccountPublicKeyAndNonce,
|
|
21
21
|
getSpotMarketPublicKey,
|
|
@@ -182,6 +182,7 @@ export class AdminClient extends DriftClient {
|
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
public async initializePerpMarket(
|
|
185
|
+
marketIndex: number,
|
|
185
186
|
priceOracle: PublicKey,
|
|
186
187
|
baseAssetReserve: BN,
|
|
187
188
|
quoteAssetReserve: BN,
|
|
@@ -203,6 +204,7 @@ export class AdminClient extends DriftClient {
|
|
|
203
204
|
const nameBuffer = encodeName(name);
|
|
204
205
|
const initializeMarketTx =
|
|
205
206
|
await this.program.transaction.initializePerpMarket(
|
|
207
|
+
marketIndex,
|
|
206
208
|
baseAssetReserve,
|
|
207
209
|
quoteAssetReserve,
|
|
208
210
|
periodicity,
|
|
@@ -243,6 +245,32 @@ export class AdminClient extends DriftClient {
|
|
|
243
245
|
return txSig;
|
|
244
246
|
}
|
|
245
247
|
|
|
248
|
+
public async deleteInitializedPerpMarket(
|
|
249
|
+
marketIndex: number
|
|
250
|
+
): Promise<TransactionSignature> {
|
|
251
|
+
const perpMarketPublicKey = await getPerpMarketPublicKey(
|
|
252
|
+
this.program.programId,
|
|
253
|
+
marketIndex
|
|
254
|
+
);
|
|
255
|
+
|
|
256
|
+
const deleteInitializeMarketTx =
|
|
257
|
+
await this.program.transaction.deleteInitializedPerpMarket(marketIndex, {
|
|
258
|
+
accounts: {
|
|
259
|
+
state: await this.getStatePublicKey(),
|
|
260
|
+
admin: this.wallet.publicKey,
|
|
261
|
+
perpMarket: perpMarketPublicKey,
|
|
262
|
+
},
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
const { txSig } = await this.sendTransaction(
|
|
266
|
+
deleteInitializeMarketTx,
|
|
267
|
+
[],
|
|
268
|
+
this.opts
|
|
269
|
+
);
|
|
270
|
+
|
|
271
|
+
return txSig;
|
|
272
|
+
}
|
|
273
|
+
|
|
246
274
|
public async moveAmmPrice(
|
|
247
275
|
perpMarketIndex: number,
|
|
248
276
|
baseAssetReserve: BN,
|
|
@@ -56,7 +56,7 @@ export const DevnetPerpMarkets: PerpMarketConfig[] = [
|
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
fullName: 'Bonk',
|
|
59
|
-
category: ['Meme'],
|
|
59
|
+
category: ['Meme', 'Dog'],
|
|
60
60
|
symbol: '1MBONK-PERP',
|
|
61
61
|
baseAssetSymbol: '1MBONK',
|
|
62
62
|
marketIndex: 4,
|
|
@@ -84,6 +84,16 @@ export const DevnetPerpMarkets: PerpMarketConfig[] = [
|
|
|
84
84
|
launchTs: 1679501812000, //todo
|
|
85
85
|
oracleSource: OracleSource.PYTH,
|
|
86
86
|
},
|
|
87
|
+
{
|
|
88
|
+
fullName: 'Doge',
|
|
89
|
+
category: ['Meme', 'Dog'],
|
|
90
|
+
symbol: 'DOGE-PERP',
|
|
91
|
+
baseAssetSymbol: 'DOGE',
|
|
92
|
+
marketIndex: 7,
|
|
93
|
+
oracle: new PublicKey('4L6YhY8VvUgmqG5MvJkUJATtzB2rFqdrJwQCmFLv4Jzy'),
|
|
94
|
+
launchTs: 1680808053000,
|
|
95
|
+
oracleSource: OracleSource.PYTH,
|
|
96
|
+
},
|
|
87
97
|
];
|
|
88
98
|
|
|
89
99
|
export const MainnetPerpMarkets: PerpMarketConfig[] = [
|
|
@@ -157,6 +167,16 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
|
|
|
157
167
|
launchTs: 1679501812000, //todo
|
|
158
168
|
oracleSource: OracleSource.PYTH,
|
|
159
169
|
},
|
|
170
|
+
{
|
|
171
|
+
fullName: 'Doge',
|
|
172
|
+
category: ['Meme', 'Dog'],
|
|
173
|
+
symbol: 'DOGE-PERP',
|
|
174
|
+
baseAssetSymbol: 'DOGE',
|
|
175
|
+
marketIndex: 7,
|
|
176
|
+
oracle: new PublicKey('FsSM3s38PX9K7Dn6eGzuE29S2Dsk1Sss1baytTQdCaQj'),
|
|
177
|
+
launchTs: 1680808053000,
|
|
178
|
+
oracleSource: OracleSource.PYTH,
|
|
179
|
+
},
|
|
160
180
|
];
|
|
161
181
|
|
|
162
182
|
export const PerpMarkets: { [key in DriftEnv]: PerpMarketConfig[] } = {
|
package/src/dlob/DLOBOrders.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PublicKey } from '@solana/web3.js';
|
|
2
|
-
import { Idl } from '@
|
|
3
|
-
import { IdlCoder } from '@
|
|
2
|
+
import { Idl } from '@coral-xyz/anchor';
|
|
3
|
+
import { IdlCoder } from '@coral-xyz/anchor/dist/cjs/coder/borsh/idl';
|
|
4
4
|
import dlobIDL from './dlobIdl.json';
|
|
5
5
|
import { Order } from '../types';
|
|
6
6
|
|