I am doing unit tests and I notice that my alchemy endpoint lags behind mainnet-beta in several situations. Sometimes it doesn't get a websocket account update, but the worst obvious case is after doing a swap SOL/USDC: my sol balance has changed and the mainnet-beta endpoint captures that, but not the alchemy endpoint. Any explanation?
import {Connection, PublicKey} from "@solana/web3.js";
let connexion_mainnet = new Connection(
"https://api.mainnet-beta.solana.com",
"processed");
let connexion_alchemy = new Connection(
"https://solana-mainnet.g.alchemy.com/v2/my_end_point",
"processed");
let wallet = new PublicKey("my_wallet_address")
let balance_mainnet = await connexion_mainnet.getBalance(wallet, "processed")
let balance_alchemy = await connexion_alchemy.getBalance(wallet, "processed")
// fail, balance_mainnet is the right SOL balance,
// according to solscan and orca UI
assert balance_mainnet === balance_achemy