SnipeMe

SnipeMe allows DeFi projects to submit MEV bundle for their initial token offering while giving MEV searchers (snipers) an opportunity to snipe the transaction bundle to produce extra backrunning profit. This offering makes it possible for DeFi projects to receive additional rewards from their initial offering. The usage of MEV bundle keeps DeFi projects’ token offering information hidden from frontrunning bots, and the DeFi projects can receive a portion of the sniper bid (backrunning profit) when a bid is available.

With SnipeMe, DeFi projects can submit a bundle that contains the pool creation (or start trading) transaction, together with several swaps made by the project. The sniper bid has no negative impact on the MEV bundle submitted by the DeFi project because the sniper’s transaction would always be executed after the DeFi project’s transaction is confirmed.

Integration steps for DeFi projects

REQUEST

Method: blxr_snipe_me

The DeFi project sends bundle to bloXroute SnipeMe program with blxr_snipe_me method.

Parameters

Parameter

Description

transaction

A list of raw transaction bytes without a 0x prefix that are meant to immediately follow the trigger transaction.

mev_builders

recipient_address

ETH wallet address for the DeFi project to collect “cash back”. This address can be the From address of the “start trading” transaction or a separate address.

number_of_blocks

[Optional, default 5] A window of blocks that the bundle is valid for. Suppose the latest confirmed block number is 1000, and a value 5 is used for this parameter, then the bundle may be included in any block from block number 1001 to block number 1005

platform

[Optional, default empty string] The DeFi project can use this field to indicate the platform used to launch the tokens on. For example, some popular platforms are “uniswapv2”, “uniswapv3”, “balancerv2”.

Example

curl https://mev.api.blxrbdn.com \
    -X POST \
    -H "Content-Type: application/json" \
    -H "Authorization: <YOUR-AUTHORIZATION-HEADER>" \
    -d '{
          "id": "1",
          "method": "blxr_snipe_me",
          "params": {
            "transaction": [
              "ab..ab",
              "cd..cd"
            ],
            "mev_builders": {
              "bloxroute": "",
              "flashbots": "<signature>",
              "beaverbuild": "",
              "all": ""
             },
            "number_of_blocks": 5,
            "recipient_address": "0x000...111",
            "platform": "uniswapv2"
           }
        }'

RESPONSE

Example

{
    "jsonrpc": "2.0",
    "id": "1",
    "result": {
        "bundleHash": "0x19..d0"
    }
}

Notes:

  • Without the SnipeMe program, the MEV(or sniper’s bribe, sniper’s tx fee) generated by such a “start trading” bundle would all go to ETH validator (or builder). WIth SnipeMe program, the profit will be shared between the DeFi project, builder and bloXroute, such that the DeFi project can receive the majority of the profit instantly, as opposed to receiving none.

  • The “start trading” bundle must include the “trigger transaction” that allows the public to start buying/selling the token immediately. Depending on the DeFi project’s rules, the DeFi project can include other transactions in the same bundle. For example, including transactions to add liquidity and create pool before the “trigger transaction”, or transactions to purchase some tokens from the new pool for the team as team allocation after the “trigger transaction”.

  • bloXroute receives the sniper bids and bundle them together with the “start trading” orderflow. Snipers with the highest payout to the project will win the auction.

  • Using the SnipeMe method will not cause a delay to the bundle inclusion. bloXroute tries to get bids from users, and, more importantly, aims to land the bundle at the next block even if there are no bids.

Integration steps for Snipers

There are two steps involved for snipers: firstly using snipeMeStream to obtain information, and then using blxr_submit_snipe_me_bundle to submit a sniping bundle.

REQUEST

Name: snipeMeStream

snipeMeStream is a ws stream for snipers to subscribe to, and only whitelisted searchers can have access to this stream. In addition to the commonly seen transactions data (signature fields v/r/s are excluded), there are 6 important fields:

Result FieldDescription

blockNumber

Bundle’s block number.

bundleHash

Bundle’s bundle hash.

numberOfBlocks

Number of blocks for which the notification is valid (starting from blockNumber).

platform

Name of DeFi platform that token is swapped on. This field can be an empty string. It’s solely for logging purposes, and searchers should not rely on this field to determine the token pool involved in the bundle.

splitConfig

Profit sharing ratios between projectShare, bloxrouteShare, builderShare, and the total of three float numbers should be equal to 100.

projectWallet

DeFi proeject's wallet to receive bids.

Example

wscat -c wss://mev.api.blxrbdn.com/ws --no-check --header "Authorization: <YOUR-AUTHORIZATION-HEADER>"
> {"id": 1, "method": "subscribe", "params": ["snipeMeStream", {"include": [], "blockchain_network": "Mainnet"}]}
<< {
  "jsonrpc": "2.0",
  "id": null,
  "method": "subscribe",
  "params": {
    "subscription": "3c87cccd-0df5-4938-947e-b24f7602f147",
    "result": {
      "transactions": [
          {
          "txHash": "0x88b...296",
          "txContents": {
            "from": "0x6e9...f89",
            "gas": "0x299b6",
            "gasPrice": "0xf9982de00",
            "hash": "0x88b...296",
            "input": "0x18...cc2",
            "nonce": "0xf",
            "value": "0x0",
            "type": "0x0",
            "to": "0x7a2...88d"
          },
          "allowReverting": false
          },
          {
          "txHash": "0x88b...296",
          "txContents": {
            "from": "0x6e9...f89",
            "gas": "0x299b6",
            "gasPrice": "0xf9982de00",
            "hash": "0x88b...296",
            "input": "0x18...cc2",
            "nonce": "0xf",
            "value": "0x0",
            "type": "0x0",
            "to": "0x7a2...88d"
          },
          "allowReverting": false
        }
      ],
      "blockNumber": "0xba10d0",
      "bundleHash": "0x01...02"
      "numberOfBlocks": 5,
      "platform": "UniswapV2",
      "splitConfig": {
      	 "bloxrouteShare": 30,
      	 "projectShare": 60,
      	 "builderShare": 10
      },
      "projectWallet": "0x000...123"
    }
  }
}

Note that the searcher is expected to simulate transactions from the stream, to double check if the transactions can trigger a new token launch that the searcher is interested in, as well as to examine it to make sure the transactions and tokens involved are not a “trap” that could result into a loss of funds.

REQUEST

Method: blxr_submit_snipe_me_bundle

The sniper uses blxr_submit_snipe_me_bundle to submit the sniping bundle, which is expected to distribute profits to three wallets accordingly based on the splitConfig field from the snipeMeStream stream. The fields in this new request are mostly similar to those in regular blxr_submit_bundle request, but with 2 new fields:

ParameterDescription

target_bundle_hash

Bundle hash of the target "start trading" bundle that was provided in the stream output.

total_profit

Total profit in wei (with block base fee excluded) that is expected to be shared with the three wallets.

Example

curl https://mev.api.blxrbdn.com \
    -X POST \
    -H "Content-Type: application/json" \
    -H "Authorization: <YOUR-AUTHORIZATION-HEADER>" \
    -d '{
            "method": "blxr_submit_snipe_me_bundle",
            "id": "1",
            "params": {
               "transaction": [
                 "ab..ab",
                 "cd..cd"
                ],
                "block_number": "0xba10d0",
                "min_timestamp": 1616511391,
                "max_timestamp": 1617806320,
                "target_bundle_hash": "0x01...02",
                "total_profit": 1234
             }
          }'

Note that some parameters of blxr_submit_bundle, like uuid, are not supported in this new request. The mev builder list (mev_builders parameter) provided in this request, if any, would always be ignored, and this sniping bundle would potentially be sent to all block builders.

Last updated