@drift-labs/jit-proxy 0.18.30 → 0.19.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/lib/jitProxyClient.d.ts +4 -0
- package/lib/jitProxyClient.js +4 -4
- package/lib/jitter/baseJitter.d.ts +4 -0
- package/lib/jitter/jitterShotgun.d.ts +3 -0
- package/lib/jitter/jitterSniper.d.ts +3 -0
- package/lib/jitter/jitterSniper.js +1 -1
- package/lib/types/jit_proxy.d.ts +1 -1
- package/lib/types/jit_proxy.js +1 -1
- package/package.json +5 -3
- package/src/jitter/jitterSniper.ts +1 -1
- package/src/types/jit_proxy.ts +2 -2
package/lib/jitProxyClient.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/// <reference types="bn.js" />
|
|
2
|
+
/// <reference types="solana-bankrun/node_modules/@solana/web3.js" />
|
|
3
|
+
/// <reference types="@pythnetwork/pyth-solana-receiver/node_modules/@solana/web3.js" />
|
|
4
|
+
/// <reference types="jito-ts/node_modules/@solana/web3.js" />
|
|
1
5
|
import { BN, DriftClient, MakerInfo, MarketType, PostOnlyParams, ReferrerInfo, SignedMsgOrderParams, TxParams, UserAccount } from '@drift-labs/sdk';
|
|
2
6
|
import { PublicKey, TransactionInstruction } from '@solana/web3.js';
|
|
3
7
|
import { TxSigAndSlot } from '@drift-labs/sdk';
|
package/lib/jitProxyClient.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.JitProxyClient = exports.PriceType = exports.DEFAULT_CU_LIMIT = void 0;
|
|
4
|
-
exports.validatePriceType = validatePriceType;
|
|
5
|
-
exports.validatePostOnlyParams = validatePostOnlyParams;
|
|
6
|
-
exports.validateMarketType = validateMarketType;
|
|
3
|
+
exports.JitProxyClient = exports.validateMarketType = exports.validatePostOnlyParams = exports.validatePriceType = exports.PriceType = exports.DEFAULT_CU_LIMIT = void 0;
|
|
7
4
|
const sdk_1 = require("@drift-labs/sdk");
|
|
8
5
|
const jit_proxy_1 = require("./types/jit_proxy");
|
|
9
6
|
const web3_js_1 = require("@solana/web3.js");
|
|
@@ -26,6 +23,7 @@ function validatePriceType(priceType) {
|
|
|
26
23
|
}
|
|
27
24
|
throw new Error('Invalid price type');
|
|
28
25
|
}
|
|
26
|
+
exports.validatePriceType = validatePriceType;
|
|
29
27
|
/**
|
|
30
28
|
* Validates the PostOnlyParams and returns the corresponding enum value. (required for type checking because of how anchor handles recursive types in IDL)
|
|
31
29
|
*/
|
|
@@ -47,6 +45,7 @@ function validatePostOnlyParams(postOnly) {
|
|
|
47
45
|
}
|
|
48
46
|
throw new Error('Invalid post only params');
|
|
49
47
|
}
|
|
48
|
+
exports.validatePostOnlyParams = validatePostOnlyParams;
|
|
50
49
|
/**
|
|
51
50
|
* Validates the market type and returns the corresponding enum value. (required for type checking because of how anchor handles recursive types in IDL)
|
|
52
51
|
*/
|
|
@@ -59,6 +58,7 @@ function validateMarketType(marketType) {
|
|
|
59
58
|
}
|
|
60
59
|
throw new Error('Invalid market type');
|
|
61
60
|
}
|
|
61
|
+
exports.validateMarketType = validateMarketType;
|
|
62
62
|
class JitProxyClient {
|
|
63
63
|
constructor({ driftClient, programId, }) {
|
|
64
64
|
this.driftClient = driftClient;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/// <reference types="bn.js" />
|
|
2
|
+
/// <reference types="solana-bankrun/node_modules/@solana/web3.js" />
|
|
3
|
+
/// <reference types="@pythnetwork/pyth-solana-receiver/node_modules/@solana/web3.js" />
|
|
4
|
+
/// <reference types="jito-ts/node_modules/@solana/web3.js" />
|
|
1
5
|
import { JitProxyClient, PriceType } from '../jitProxyClient';
|
|
2
6
|
import { PublicKey } from '@solana/web3.js';
|
|
3
7
|
import { AuctionSubscriber, BN, DriftClient, Order, PostOnlyParams, SwiftOrderSubscriber, SlotSubscriber, SignedMsgOrderParams, UserAccount, UserStatsMap } from '@drift-labs/sdk';
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/// <reference types="solana-bankrun/node_modules/@solana/web3.js" />
|
|
2
|
+
/// <reference types="@pythnetwork/pyth-solana-receiver/node_modules/@solana/web3.js" />
|
|
3
|
+
/// <reference types="jito-ts/node_modules/@solana/web3.js" />
|
|
1
4
|
import { JitProxyClient } from '../jitProxyClient';
|
|
2
5
|
import { PublicKey } from '@solana/web3.js';
|
|
3
6
|
import { AuctionSubscriber, DriftClient, Order, SlotSubscriber, SignedMsgOrderParams, SwiftOrderSubscriber, UserAccount, UserStatsMap } from '@drift-labs/sdk';
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/// <reference types="solana-bankrun/node_modules/@solana/web3.js" />
|
|
2
|
+
/// <reference types="@pythnetwork/pyth-solana-receiver/node_modules/@solana/web3.js" />
|
|
3
|
+
/// <reference types="jito-ts/node_modules/@solana/web3.js" />
|
|
1
4
|
import { JitProxyClient } from '../jitProxyClient';
|
|
2
5
|
import { PublicKey } from '@solana/web3.js';
|
|
3
6
|
import { AuctionSubscriber, DriftClient, OraclePriceData, Order, SignedMsgOrderParams, SwiftOrderSubscriber, SlotSubscriber, UserAccount, UserStatsMap } from '@drift-labs/sdk';
|
|
@@ -284,7 +284,7 @@ class JitterSniper extends baseJitter_1.BaseJitter {
|
|
|
284
284
|
? this.perpParams.get(order.marketIndex)
|
|
285
285
|
: this.spotParams.get(order.marketIndex);
|
|
286
286
|
const oraclePrice = (0, sdk_1.isVariant)(order.marketType, 'perp')
|
|
287
|
-
? this.driftClient.
|
|
287
|
+
? this.driftClient.getMMOracleDataForPerpMarket(order.marketIndex)
|
|
288
288
|
: this.driftClient.getOracleDataForSpotMarket(order.marketIndex);
|
|
289
289
|
const makerOrderDir = (0, sdk_1.isVariant)(order.direction, 'long') ? 'sell' : 'buy';
|
|
290
290
|
const auctionStartPrice = (0, sdk_1.convertToNumber)((0, sdk_1.isVariant)(order.orderType, 'oracle')
|
package/lib/types/jit_proxy.d.ts
CHANGED
package/lib/types/jit_proxy.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drift-labs/jit-proxy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"clean": "rm -rf lib",
|
|
6
6
|
"build": "yarn clean && tsc"
|
|
@@ -8,8 +8,10 @@
|
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@coral-xyz/anchor": "0.29.0",
|
|
10
10
|
"@drift-labs/sdk": "2.133.0-beta.0",
|
|
11
|
-
"@solana/web3.js": "1.
|
|
12
|
-
"tweetnacl-util": "^0.15.1"
|
|
11
|
+
"@solana/web3.js": "1.98.0",
|
|
12
|
+
"tweetnacl-util": "^0.15.1",
|
|
13
|
+
"typescript": "5.4.5"
|
|
14
|
+
|
|
13
15
|
},
|
|
14
16
|
"engines": {
|
|
15
17
|
"node": ">=18"
|
|
@@ -444,7 +444,7 @@ export class JitterSniper extends BaseJitter {
|
|
|
444
444
|
? this.perpParams.get(order.marketIndex)
|
|
445
445
|
: this.spotParams.get(order.marketIndex);
|
|
446
446
|
const oraclePrice = isVariant(order.marketType, 'perp')
|
|
447
|
-
? this.driftClient.
|
|
447
|
+
? this.driftClient.getMMOracleDataForPerpMarket(order.marketIndex)
|
|
448
448
|
: this.driftClient.getOracleDataForSpotMarket(order.marketIndex);
|
|
449
449
|
|
|
450
450
|
const makerOrderDir = isVariant(order.direction, 'long') ? 'sell' : 'buy';
|
package/src/types/jit_proxy.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type JitProxy = {
|
|
2
|
-
version: '0.
|
|
2
|
+
version: '0.19.0';
|
|
3
3
|
name: 'jit_proxy';
|
|
4
4
|
instructions: [
|
|
5
5
|
{
|
|
@@ -382,7 +382,7 @@ export type JitProxy = {
|
|
|
382
382
|
};
|
|
383
383
|
|
|
384
384
|
export const IDL: JitProxy = {
|
|
385
|
-
version: '0.
|
|
385
|
+
version: '0.19.0',
|
|
386
386
|
name: 'jit_proxy',
|
|
387
387
|
instructions: [
|
|
388
388
|
{
|