Skip to content

Extension for Alloy to subscribe to the MEV Blocker Searchers API

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

cakevm/alloy-mev-blocker-client

Repository files navigation

Alloy MEV Blocker Client

This crate allows to subscribe to events from the Searchers API of MEV Blocker with Alloy. Since the signature fields are stripped, the parsing of the transaction fails silently in Alloy. To address this, the extension dynamically adds these fields during deserialization, enabling a pending MEV Blocker transaction to be deserialized into an alloy_rpc_types_eth::Transaction.

Why not fix this in Alloy?

It is hard to tell who is right here. Alloy has a valid point to require all fields for a valid transaction. For some clients with less strict typing, the parsing of the transaction works. This does not require any workaround and for that reason, the API of MEV Blocker is for many people easy to use. For Alloy, it is not possible to parse the transaction without the signature fields.

Usage

See subscribe_mev_blocker.rs in examples for a full usage examples.

Example usage:

let ws_client = WsConnect::new(MEV_BLOCKER_SEARCHERS_URL);
let provider = ProviderBuilder::new().on_ws(ws_client).await?;

let subscription = provider.subscribe_mev_blocker_pending_transactions().await?;

Acknowledgements

Many thanks to the CoW DAO to provide such an API. And many thanks to the alloy-rs team.

License

This project is licensed under the Apache 2.0 or MIT.

About

Extension for Alloy to subscribe to the MEV Blocker Searchers API

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published