@drift-labs/jit-proxy

中文文档
0.21.171发布于 2026/04/02近 30 天下载 6020

JitProxyClient will create and send transactions to the jit proxy program. Instantiate a jit proxy client with a drift client and a program Id. The current public key for the jit proxy program is

原始使用文档
文档目录4 节
  1. Jit Proxy Client
  2. Jitter
  3. Jit Params
  4. Example set up

Jit Proxy SDK

Jit Proxy Client

JitProxyClient will create and send transactions to the jit proxy program. Instantiate a jit proxy client with a drift client and a program Id. The current public key for the jit proxy program is

J1TnP8zvVxbtF5KFp5xRmWuvG9McnhzmBd9XGfCyuxFP. Example instantiation:

const jitProxyClient = new JitProxyClient({
            driftClient,
            programId: new PublicKey('J1TnP8zvVxbtF5KFp5xRmWuvG9McnhzmBd9XGfCyuxFP'),
        });

Jitter

A jitter takes JitParams and uses them to determine when and how to use the JitProxyClient to send a transaction. For bots to make use of the jitter, they should create a jitter instance, and then set the JitParams according to their strategy for each market they are market making. JitParams are set on the Jitter object using updatePerpParams() and updateSpotParams(). There are two kinds of Jitters that can be insantiated: JitterShotgun and JitterSniper. The difference between the two is how orders are sent.

For JitterShotgun, orders are sent immediately when detecting a new eligible auction. The JitterShotgun will try up to 10 times to fill the order, retrying every time the it receives back an error due to the order not crossing the bid/ask in the JitParams or the oracle price being invalid.

For JitterSniper, orders are sent only when it detects that an order might cross the bid/ask of the JitParams, waiting until the right slot, before sending up to 3 orders (retrying on errors). It will not send orders if the price of the order does not cross the bid/ask during the auction, unlike the JitterShotgun, which will immediately attempt.

Jit Params

Type definition for the JitParmas is below:

export type JitParams = {
    bid: BN;
    ask: BN;
    minPosition: BN;
    maxPosition: BN;
    priceType: PriceType;
    subAccountId?: number;
};

PriceType options are ORACLE and LIMIT. Limit price type is the BN representaiton of an absolute price; i.e., price type of LIMIT and a market of bid: 10, ask: 11 means your market is 10@11. Oracle price types are offsets relative to the oralce price for a given slot. They are always added to the oracle price, so if the oracle price is 10.5, to get a market of 10@11 when price type is oracle, bid and ask are -0.5 and 0.5 respectively (Remember that bid and ask are of BN type, this example is for illustration purposes only. Remember to use BN math operations).

Example set up

Example set up for the JitterSniper (assuming parameters are already initialized/subscribed to). JitterShotgun is instantiated and initialized in a similar manner.

const jitProxyClient = new JitProxyClient({
            driftClient,
            programId: new PublicKey('J1TnP8zvVxbtF5KFp5xRmWuvG9McnhzmBd9XGfCyuxFP'),
        });

        const jitter = new JitterSniper({
            auctionSubscriber,
            driftClient,
            slotSubscriber,
            jitProxyClient,
        });
        await jitter.subscribe();

版本与发布记录

@drift-labs/jit-proxy 共发布 1,280 个版本,首次发布于 2023/07/09;过去 12 个月发布了 65 个版本。

版本发布日期距今
0.21.171latest2026/04/027 个月前
0.21.1702026/04/017 个月前
0.21.1692026/03/307 个月前
0.21.1682026/03/277 个月前
0.21.1672026/03/277 个月前
0.21.1662026/03/267 个月前

其他发布通道:stable → 0.19.0。

关于 @drift-labs/jit-proxy 的常见问题

@drift-labs/jit-proxy 是什么?

JitProxyClient will create and send transactions to the jit proxy program. Instantiate a jit proxy client with a drift client and a program Id. The current public key for the jit proxy program is

如何安装 @drift-labs/jit-proxy?

在项目目录运行 npm install @drift-labs/jit-proxy,或使用 pnpm add / yarn add / bun add。

@drift-labs/jit-proxy 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/drift-labs__jit-proxy 是否存在。

@drift-labs/jit-proxy 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=24.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@drift-labs/jit-proxy 可以商用吗?

@drift-labs/jit-proxy 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@drift-labs/jit-proxy 的下载量有多少?

根据 npm 官方下载统计,@drift-labs/jit-proxy 在 2026/10/13 – 2026/11/11 这 30 天内被下载 6,020 次,日均约 201 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@drift-labs/jit-proxy 还在维护吗?

最新版本 0.21.171 发布于 2026/04/02(7 个月前);至今共发布 1280 个版本,其中过去 12 个月发布了 65 个;首次发布于 2023/07/09。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。