jup-ag / jupiter-swap-api

The jupiter swap api binary
72 stars 20 forks source link

Api not updating the prices often #26

Closed czaacza closed 1 month ago

czaacza commented 2 months ago

The jupiter swap api using yellowstone plugin does not update the prices as often as the available public swap api.

When sending the example request every 200ms, te api updates the prices once a few seconds. The price update times can reach up to tens of seconds. What might be an issue here? Has anyone encountered this error and knows a solution for it? I would highly appreciate your help :)

Request: http://127.0.0.1:8080/quote?inputMint=So11111111111111111111111111111111111111112&outputMint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount=1000000&slippageBps=1

Example logs: RUST_LOG=info ./jupiter-swap-api --rpc-url http://127.0.0.1:8899/ --yellowstone-grpc-endpoint http://127.0.0.1:10000/ --snapshot-poll-interval-ms 30000 [2024-06-14T09:20:32.814449Z INFO jupiter_swap_api] Found 48 logical cores, using 48 for the api [2024-06-14T09:20:32.815794Z INFO jupiter_swap_api] Loading Jupiter router... [2024-06-14T09:20:38.160244Z INFO jupiter_core::amms::loader] markets len(): 92187 [2024-06-14T09:20:39.731046Z INFO jupiter_core::amms::loader] Found 11 not supported markets for owners: {Gswppe6ERWKpUTXvRPfXdzHhiCyJvLadVvXGfdpBqcE1} [2024-06-14T09:20:39.762548Z WARN jupiter_core::amms::loader] Stakedex AMMs where not found in the cache, 354 out of 1827 [2024-06-14T09:20:39.762571Z INFO jupiter_core::amms::loader] New dexes are disabled, ["Clone Protocol", "Sanctum Infinity"] are not loaded [2024-06-14T09:20:39.765646Z INFO jupiter_core::amms::loader] updating amms with account_keys.len(): 62 [2024-06-14T09:20:40.267733Z INFO jupiter_core::amms::loader] Loaded 91843 amms from market cache [2024-06-14T09:20:40.418582Z INFO jupiter_core::amms::loader] AMMS per label loaded: {"Lifinity V1": 2, "Token Swap": 32, "StepN": 3, "Lifinity V2": 25, "Raydium CLMM": 664, "GooseFX": 15, "Sanctum": 354, "Perps": 1, "Saber (Decimals)": 16, "Mercurial": 13, "Penguin": 11, "Helium Network": 2, "Saber": 66, "Orca V2": 115, "Whirlpool": 1901, "Raydium": 79361, "Phoenix": 36, "Invariant": 38, "Meteora": 1908, "Saros": 26, "FluxBeam": 3894, "Raydium CP": 853, "Openbook": 40, "Crema": 8, "Meteora DLMM": 2197, "Aldrin V2": 26, "OpenBook V2": 28, "Aldrin": 16, "Cropper": 18, "Cropper Legacy": 25, "Bonkswap": 15, "Dexlab": 109, "Marinade": 1, "Oasis": 10, "Orca V1": 14} [2024-06-14T09:20:40.778461Z INFO jupiter_core::address_lookup_table_cache] Loading AddressLookupTableCache... [2024-06-14T09:20:40.783635Z INFO jupiter_core::address_lookup_table_cache] Fetching 10973 address lookup tables [2024-06-14T09:20:42.352399Z INFO jupiter_core::address_lookup_table_cache] Update 10972 ALTs into the AddressLookupTableCache in 1.568902487s [2024-06-14T09:20:42.352419Z INFO jupiter_core::router] 91843 amms for 91843 lookup tables [2024-06-14T09:20:53.783464Z INFO jupiter_core::router] Fetched 84755 mints [2024-06-14T09:20:54.216121Z INFO jupiter_core::slippage] Loaded 1363 jupiter strict tokens [2024-06-14T09:20:54.446856Z INFO jupiter_core::router] Perform initial update #1 [2024-06-14T09:20:54.527500Z INFO jupiter_core::router] create key_set: 80.62ms [2024-06-14T09:21:11.790343Z INFO jupiter_core::router] getMA + insert 17.26s [2024-06-14T09:21:12.550820Z INFO jupiter_core::router] update: 760.45ms [2024-06-14T09:21:12.550843Z INFO jupiter_core::router] Perform initial update #2 [2024-06-14T09:21:12.616563Z INFO jupiter_core::router] create key_set: 65.71ms [2024-06-14T09:21:15.698172Z INFO jupiter_core::router] getMA + insert 3.08s [2024-06-14T09:21:16.063904Z INFO jupiter_core::router] update: 365.71ms [2024-06-14T09:21:16.063922Z INFO jupiter_core::router] Perform initial update #3 [2024-06-14T09:21:16.114220Z INFO jupiter_core::router] create key_set: 50.29ms [2024-06-14T09:21:16.402548Z INFO jupiter_core::router] getMA + insert 288.31ms [2024-06-14T09:21:16.519984Z INFO jupiter_core::router] update: 117.41ms [2024-06-14T09:21:17.577756Z INFO jupiter_core::price_tracker] Price tracker updated 84374 prices in 1.057750042s [2024-06-14T09:21:17.579522Z INFO jupiter_swap_api] Started jupiter swap api on 0.0.0.0:8080, in 44.763728108s [2024-06-14T09:21:17.653466Z INFO jupiter_core::geyser_client] geyser_subscribe_accounts_loop start, initial filter with 287587 ... [2024-06-14T09:56:35.482530Z INFO jupiter_core::geyser_client] subscribed to new accounts [2024-06-14T09:56:35.487093Z INFO jupiter_core::update_from_geyser] Fetched 1 new accounts, first slot Some(271771528) [2024-06-14T09:56:36.476117Z INFO jupiter_core::update_from_geyser] Maintenance poll, minimum context slot 271771481 in 29.109298763s [2024-06-14T09:56:37.109231Z INFO jupiter_core::price_tracker] Price tracker updated 84380 prices in 937.505054ms [2024-06-14T09:56:41.833646Z INFO jupiter_core::price_tracker] Price tracker updated 84380 prices in 661.035568ms [2024-06-14T09:56:41.836495Z INFO jupiter_core::geyser_client] Received geyser ping: SubscribeUpdatePing [2024-06-14T09:56:41.837024Z INFO jupiter_core::geyser_client] Received geyser ping: SubscribeUpdatePing [2024-06-14T09:56:41.839819Z INFO jupiter_core::geyser_client] Received geyser ping: SubscribeUpdatePing [2024-06-14T09:56:45.002606Z INFO jupiter_core::update_from_geyser] Fetched 1 new accounts, first slot Some(271771546) [2024-06-14T09:56:45.006593Z INFO jupiter_core::geyser_client] subscribed to new accounts [2024-06-14T09:56:46.848307Z INFO jupiter_core::price_tracker] Price tracker updated 84380 prices in 676.279246ms [2024-06-14T09:56:47.497582Z INFO jupiter_core::update_from_geyser] Fetched 1 new accounts, first slot Some(271771551) [2024-06-14T09:56:47.500474Z INFO jupiter_core::geyser_client] subscribed to new accounts [2024-06-14T09:56:51.841002Z INFO jupiter_core::price_tracker] Price tracker updated 84380 prices in 668.340944ms [2024-06-14T09:56:51.841144Z INFO jupiter_core::geyser_client] Received geyser ping: SubscribeUpdatePing [2024-06-14T09:56:51.852457Z INFO jupiter_core::geyser_client] Received geyser ping: SubscribeUpdatePing [2024-06-14T09:56:51.856803Z INFO jupiter_core::geyser_client] Received geyser ping: SubscribeUpdatePing [2024-06-14T09:56:57.013141Z INFO jupiter_core::price_tracker] Price tracker updated 84380 prices in 742.650542ms [2024-06-14T09:57:01.434502Z INFO jupiter_core::geyser_client] Received geyser ping: SubscribeUpdatePing [2024-06-14T09:57:01.610052Z INFO jupiter_core::geyser_client] Received geyser ping: SubscribeUpdatePing [2024-06-14T09:57:01.802848Z INFO jupiter_core::geyser_client] Received geyser ping: SubscribeUpdatePing

Geyser plugin config: { "libpath": "/home/sol/yellowstone-grpc-geyser-release/lib/libyellowstone_grpc_geyser.so", "log": { "level": "debug" }, "grpc": { "address": "0.0.0.0:10000", "max_decoding_message_size": "8_338_608", "snapshot_plugin_channel_capacity": null, "snapshot_client_channel_capacity": "50_000_000", "channel_capacity": "100_000", "unary_concurrency_limit": 100, "unary_disabled": false, "filters": {} }, "prometheus": { "address": "0.0.0.0:8999" }, "block_fail_action": "log" }

siong1987 commented 1 month ago

the price update here has nothing to do with the quoting.