Skip to content

Conversation

@vinayyak
Copy link

@vinayyak vinayyak commented Mar 11, 2025

Added Feature: Implement Optimal Jito Tip Retrieval and add Salt Lake City (Utah) Endpoint for US-West region

GM @MatrixYe,

Great work on the repo!

Additions

  1. This PR includes functionality to fetch optimal Jito fee amounts (tip floors) in lamports for recently landed transactions based on the percentile of landed transactions (25/50/75/95/99 percentiles) fetched from Jito Bundles Tip Floors.

  2. For lower latency in the US-West region, I also added the Salt Lake City, Utah Block Engine Endpoint from Jito Docs to the configuration.

  3. Updated README.md to include a small example.

Examples

Below is an example demonstrating how to use the new SLC endpoint and retrieve the Jito fee data in a single script:

from jito_py.searcher import Searcher
from jito_py.block_engine import BlockEngine

# Create a block engine instance
jito_engines = BlockEngine.get_block_engines(network='mainnet')
block_engine_url = jito_engines["Utah"]["block_engine_url"]

# Check the newly added SLC/Utah endpoint
print(f"Salt Lake City Engine Endpoint: {block_engine_url}")

# Create a searcher instance
searcher = Searcher(block_engine_url)

# Retrieve the BundlesTipsFloorResponse object, which contains the optimal Jito fee amounts
tip_floors = searcher.get_tip_floors()

# Directly access the Jito fee (tip floor) in lamports for different landed transaction percentiles
print(f"Average Jito Tip (99th Percentile): {tip_floors.landed_tips_lamports_99th_percentile} lamports")
print(f"Average Jito Tip (95th Percentile): {tip_floors.landed_tips_lamports_95th_percentile} lamports")
print(f"Average Jito Tip (75th Percentile): {tip_floors.landed_tips_lamports_75th_percentile} lamports")
print(f"Average Jito Tip (50th Percentile): {tip_floors.landed_tips_lamports_50th_percentile} lamports")
print(f"Average Jito Tip (25th Percentile): {tip_floors.landed_tips_lamports_25th_percentile} lamports")

Conclusion

Hope this is fine—let me know if you need any help or have feedback. I'd love to contribute further to this repo!

@vinayyak vinayyak changed the title feat: Add Salt Lake City (Utah) as a US-WEST Block Engine URL feat: Implement Optimal Jito Tip Retrieval and add Salt Lake City (Utah) Endpoint for US-West region Mar 12, 2025
@vinayyak vinayyak changed the title feat: Implement Optimal Jito Tip Retrieval and add Salt Lake City (Utah) Endpoint for US-West region feat: Implement Optimal Jito Tip Retrieval and add Salt Lake City (Utah) Endpoint for US-West region Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant