Skip to content

feat: add Ultrasound MEV bundle sender - #220

Merged
thanhpp merged 1 commit into
feat/eth-mev-bomborafrom
feat/eth-mev-ultrasound
Aug 21, 2026
Merged

feat: add Ultrasound MEV bundle sender#220
thanhpp merged 1 commit into
feat/eth-mev-bomborafrom
feat/eth-mev-ultrasound

Conversation

@thanhpp

@thanhpp thanhpp commented Aug 21, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds the Ultrasound (ultrasound.money) builder as BundleSenderTypeUltrasound, appended as enum value 29 so that no existing value is renumbered, plus EndpointUltrasoundEU/US/JP and BuilderUltrasoundID.
  • Reuses the generic Client. Ultrasound accepts a plain eth_sendBundle, so it needs no builder-specific client file.
  • Adds SetUltrasoundFields, gated on the sender type in SendBundleV2. It copies the four extra bundle fields that Ultrasound documents (droppingTxHashes, refundPercent, refundRecipient, refundTxHashes) and validates the same two limits as Bombora, reusing ErrInvalidRefundPercent and ErrInvalidLenRefundTxHashes.
  • Deliberately does not widen the Bombora gate. Ultrasound does not document replacementSeqNumber, so a shared gate would put that key on the wire whenever a caller reuses one SendBundleV2Request across builders. replacementUuid needs no new code, because SetUUID already writes it under that key. The wire struct needs no new fields for the same reason.
  • Rewords the field comments that said "Bombora only" for the four now-shared fields. ReplacementSeqNumber stays Bombora only.

Test plan

  • go build ./... passes.
  • go test -race ./pkg/mev/... passes.
  • golangci-lint run --config=.golangci.yml ./pkg/mev/... stays at the pre-existing baseline of 7 issues (1 gosec, 6 modernize), none in the new code.
  • Payload shape and both validation errors checked with a temporary test, then deleted per the guide in .claude/MEV_Integration.md: the bundle carries the four documented keys and no replacementSeqNumber, a refund percent of 100 fails, and two refund tx hashes fail.
  • One manual submission to https://builder-rpc-eu.ultrasound.money to confirm that the builder accepts the payload. No live-endpoint check ran.

Out of scope

  • ultrasound_getBundleTrace is not wired. getGetBundleStatsMethod returns flashbots_getBundleStatsV2 for every sender type, and the trace response shape (indexedUpToBlock, data.status, builderPayment) does not fit GetBundleStatsResponse. Wiring it needs new response types.
  • The optional X-Api-Key header is not plumbed. It only raises the rate limit. Adding it needs a new client option plus a header change in sendRawBundle and its sibling methods, which every builder shares.
  • Hoodi testnet endpoints are not added, because the repository holds no testnet endpoint for any builder.
  • allowBuilderNetRefunds and builderNetRefundAddress carry no omitempty, so every bundle sends them, Ultrasound included, even though Ultrasound documents neither key. This is pre-existing shared behaviour that also affects Bombora.
  • CancelBundle already sends eth_cancelBundle with replacementUuid, which matches the Ultrasound document. It is builder-agnostic and unchanged, and it is unverified against the live endpoint.

Stack

🤖 Generated with Claude Code

Adds BundleSenderTypeUltrasound (value 29), the three mainnet
endpoints, the builder ID, and SetUltrasoundFields.

Ultrasound accepts four of the five extra Bombora bundle fields;
it does not document replacementSeqNumber. A separate setter keeps
that key off the wire when a caller reuses one SendBundleV2Request
across builders. replacementUuid needs no work, because SetUUID
already writes that key.

Co-Authored-By: Claude <noreply@anthropic.com>
@thanhpp
thanhpp requested a review from vaigay August 21, 2026 10:13
@thanhpp thanhpp self-assigned this Aug 21, 2026
@thanhpp
thanhpp merged commit 81ab89d into feat/eth-mev-bombora Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants