project-serum / swap-ui

React Component for Swapping on the Serum DEX
Apache License 2.0
113 stars 117 forks source link

Transaction was not confirmed in 30.01 seconds: RPC delay breaking UX #73

Open secretshardul opened 3 years ago

secretshardul commented 3 years ago

There's over a 30 second delay before swaps are acknowledged. A red error box shows up, which breaks user experience even though the transaction goes through. We're noticing this for few weeks now. This issue is not faced on Raydium. Tested with v0.2.2.

Screenshot 2021-08-17 at 2 26 09 PM

armaniferrante commented 3 years ago

This can probably be fixed in ones own app by subclassing Provider and listening for transaction confirmations manually. The other aspect is to use an app specific validator. This demo uses solana-api.projectserum.com which is public infrastructure shared across many apps so it's not going to be as reliable as using a private one.

secretshardul commented 3 years ago

We noticed that https://api.mainnet-beta.solana.com RPC gives much lower latency.

secretshardul commented 3 years ago

The swap UI makes a lot of RPC calls, which is probably causing this issue. We tried Figment's private RPC, which immediately timed us out. The price refresh rate needs to be reduced.