Integrate

MEV Protect API.

A server-to-server path for platforms that send transactions from their own backend: one base URL per chain, one key for all of them.

Endpoint

One base URL per chain, with the chain's id in the path. The same key works on every chain your account sends on.

Base URL
BSC
https://api.mevlabs.xyz/v1/bsc
Arbitrum
https://api.mevlabs.xyz/v1/arbitrum
Base
https://api.mevlabs.xyz/v1/base
Robinhood
https://api.mevlabs.xyz/v1/robinhood
Arc
https://api.mevlabs.xyz/v1/arc
Elysium
https://api.mevlabs.xyz/v1/elysium

Authentication

Send your key as a bearer token on every request. Keep it on your server; it must not ship in a client. Every error has the same shape (see Errors).

Header
Response · 401

Submit a transaction

Post a signed transaction to the chain it is for. The answer is its hash, or an error. Sending the same transaction again returns the same hash: nothing is sent twice.

POST /v1/{chain}/transactions
Response · 202
Response · 400
rawTransaction
The signed transaction, hex encoded. It is executed exactly as signed. A transaction signed for another chain than the URL's is refused with chain_mismatch.

Read a transaction

Ask for a transaction by its hash, on the chain it was sent on. The answer is a transaction object.

GET /v1/{chain}/transactions/{hash}
Response · 200
Response · 404

List transactions

The transactions sent with your keys on one chain, newest first, a page at a time. Pass the cursor of a page to get the next one.

GET /v1/{chain}/transactions
Response · 200
Response · 400
status
Optional. One of the statuses.
key
Optional. The id of one of your keys.
since
Optional. Only transactions submitted at or after this time, as a Unix timestamp in milliseconds.
limit
Optional. Up to 100; 50 when left out.
cursor
Optional. The nextCursor of the page before. A page with no nextCursor is the last.

Revert protection

On chains with revert protection, a key can keep transactions that would revert out of the block, so no gas is paid for them. It is off until you turn it on for the key in the dashboard. The submit answers the same either way; such a transaction ends as dropped.

WebSocket

One connection per chain. Each submit is answered with the hash or an error, as over HTTPS. To follow what happens to a transaction, read it over HTTPS or receive webhooks. Send your key in the Authorization header when you open the connection.

URL
Submit
Reply
Reply · error
id
Any number you choose. The reply to a message carries the same id.
result
The transaction's hash. When the submit is refused, error comes back in its place, in the same shape as over HTTPS.