Skip to the article
Crypto Execution Weekly Crypto news on trading systems, liquidity and execution

Transaction ordering and execution costs

Crypto Execution Weekly

The RPC Endpoint Is Part of Every Wallet Fill

A stale RPC read can poison a wallet nonce or quote; head-aware fallbacks and duplicate raw broadcasts improve execution without changing the order.

By The Crypto Execution Weekly Editors 3 min read
The RPC Endpoint Is Part of Every Wallet Fill

RPC providers carry the reads and broadcasts behind a wallet swap, so a stale pending nonce or dropped submission can stop an otherwise valid order before the liquidity pool sees it. The visible failure may be “nonce too low,” an expired quote or a transaction that remains absent from explorers. The responsible component is often neither wallet signing nor the exchange contract. It is the node endpoint supplying state and relaying the signed bytes.

Consider one token swap. The interface first reads balances and allowance, simulates the router call, estimates gas and requests the account nonce. The wallet signs locally; the provider does not receive the private key. It receives the resulting raw transaction and returns a hash after eth_sendRawTransaction. That acknowledgment proves the endpoint accepted the request, not that peers received it or a block included it.

How does an RPC provider carry a wallet order?

The provider supplies every state-dependent input surrounding the signature, then introduces the signed transaction to its node’s peer network. A typical order crosses these RPC methods:

  • eth_call simulates the router against a specified block state.
  • eth_getTransactionCount obtains the account nonce, preferably with the pending tag.
  • eth_estimateGas tests an execution path without adding it to a block.
  • eth_sendRawTransaction submits the signed payload; receipt polling later tests inclusion.

The chain identifier and router address must also match the quote. A venue-specific instruction such as Frax Swap’s network-selection note is therefore execution context, not interface decoration. A correct signature for the wrong network cannot rescue the intended trade.

Why can a healthy chain still produce a failed swap?

A healthy chain can look broken when one provider trails the head, lacks another node’s pending transactions or accepts a broadcast without propagating it promptly. Suppose the wallet already has nonce 18 pending. An endpoint that reports only confirmed state may return 18 again; the replacement can be rejected, underpriced or compete with the original transaction. A stale simulation can likewise approve a route whose reserves move before inclusion, causing the router’s minimum-output check to revert.

The trader bears that trade-off. Reads are free, but a reverted included transaction still consumes gas, and a delayed broadcast increases exposure to price movement and quote expiry. The pool never promised the displayed output independently of the block state used for the call.

Does dual-provider routing improve wallet execution?

Dual-provider routing improves execution when it checks read freshness and sends identical signed bytes through independent endpoints. The mechanism is testable: place a proxy before provider A, make its block-number response lag by two blocks, then drop its broadcast. With one endpoint, the test produces zero accepted submissions. With provider B as a head-aware fallback, it produces one transaction candidate.

Broadcasting the same raw transaction twice does not create two fills: the signature, sender and nonce are identical, so both providers derive the same transaction hash and the chain can execute that nonce once. This is better than rebuilding and re-signing through the fallback, which risks different fee fields or accidental replacement behavior.

The cost is another infrastructure dependency, extra request volume and wider disclosure of the wallet’s IP-address-to-account relationship. Builders should expose the active chain, latest block seen, selected nonce, transaction hash and receipt status. Traders can inspect those values live, switch endpoints, submit the same signed payload to a second provider and verify that both routes converge on one receipt.

Filed under

  • Transaction ordering and execution costs
  • Liquidity pools and order routing