Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 1.51 KB

README.md

File metadata and controls

24 lines (16 loc) · 1.51 KB

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.