Skip to main content

Python JIT Proxy SDK

QuickStart Guide

  1. Run poetry install in the /python directory
  2. Add .env file in /sdk/examples with your RPC_URL and PRIVATE_KEY as a byte array
  3. Customize JitParams in either shotgun.py or sniper.py
  4. Run poetry run python -m examples.sniper or poetry run python -m examples.shotgun while in the sdk directory

Shotgun vs Sniper

The JitterShotgun will immediately spray transactions when it detects an eligible auction. It'll try up to 10 times to fulfill the order, retrying if the order doesn't yet cross or the oracle is stale.

The JitterSniper will wait until it detects an order that has a high chance of crossing the JitParams and retry up to 3 times on errors. It won't send transactions immediately like the JitterShotgun does, but will try to determine that the order will cross the bid/ask during the auction before sending a transaction.

How to set up a JitProxyClient and Jitter

This example uses the JitterShotgun, but the same logic follows for the JitterSniper.

However, the JitterSniper also requires a SlotSubscriber in its constructor.

    jit_proxy_client = JitProxyClient(
        drift_client,
        # JIT program ID
        Pubkey.from_string("J1TnP8zvVxbtF5KFp5xRmWuvG9McnhzmBd9XGfCyuxFP"),
    )

    jitter_shotgun = JitterShotgun(drift_client, auction_subscriber, jit_proxy_client, True) # The boolean is logging verbosity, True = verbose.

    jit_params = JitParams(
        bid=-1_000_000,
        ask=1_010_000,
        min_position=0,
        max_position=2,
        price_type=PriceType.Oracle(),
        sub_account_id=None,
    )

    # Add your parameters to the Jitter before subscribing
    jitter_shotgun.update_perp_params(0, jit_params)

    await jitter_shotgun.subscribe()

Metadata

Release files for drift-jit-proxy 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for drift-jit-proxy 0.1.6
File Size Uploaded Provenance Actions
drift_jit_proxy-0.1.6.tar.gz 7.6 kB Without provenance Details for drift_jit_proxy-0.1.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for drift-jit-proxy 0.1.6
File Interpreter ABI Platform Actions
drift_jit_proxy-0.1.6-py3-none-any.whl Python 3 none any Details for drift_jit_proxy-0.1.6-py3-none-any.whl

Total release size: 17.2 kB

Release files / drift_jit_proxy-0.1.6.tar.gz

Download URL drift_jit_proxy-0.1.6.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
7d1dc9d095985c2b9a6f1ccaf58647c18fa2c5b14a0dea3db2a1d969fc5bf4b6
BLAKE2b-256 checksum
How to use checksums
fc27913c381a360ea92a7eab9a48fc74401cc1e600aa2c9f98f2696f8355079e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.10.10 Linux/6.5.0-1025-azure

Release files / drift_jit_proxy-0.1.6-py3-none-any.whl

Download URL drift_jit_proxy-0.1.6-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
988e15df22c1d2fb0d2ed45fbdabbfe928c5dccd5520166b2b61a3419c43b924
BLAKE2b-256 checksum
How to use checksums
ba45afae92581051ca99c00a95edee88afe148ac22090b3905ec7a2774d824fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.10.10 Linux/6.5.0-1025-azure

Security for drift-jit-proxy 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page