Hyperliquid API in Node.js: a quick slippage check with impactPxs

Before a bot sends a market order on Hyperliquid, it helps to know roughly what the fill will cost. The Hyperliquid API already publishes a number for this on every perp, and most code ignores it: impactPxs. This post reads it for every perp in one request, turns it into a spread in basis points, and checks it against a walk of the live order book. Everything uses public data, so no wallet or key is needed. What impactPxs is The asset contexts response (metaAndAssetCtxs in the Hyperliquid doc...
Read post