# Flashbots

MEV Protection focuses on protecting users from vulnerabilities such as front-running in Ethereum transactions. This is achieved through integration with Flashbots' solutions.

### **/getflashbotblocks**

## Get details of the flashbot blocks.

<mark style="color:blue;">`GET`</mark> `https://api.expand.network/chain/getflashbotblocks`

#### Query Parameters

| Name        | Type   | Description                                                           |
| ----------- | ------ | --------------------------------------------------------------------- |
| chainId     | String | Refer to the [Chain ID ](../important-ids/chain-id)page for details.  |
| chainSymbol | String | Refer to the [Chain ID ](../important-ids/chain-id)page for details.  |

{% tabs %}
{% tab title="Sample Request" %}
```url
https://api.expand.network/chain/getflashbotblocks?chainId=1
```
{% endtab %}

{% tab title="Sample Response" %}
```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "paris": 1,
        "blocks": [
            {
                "block_number": 18974792,
                "miner_reward": "17726971662419410",
                "fee_recipient_eth_diff": "17726971662419410",
                "miner": "0xDAFEA492D9c6733ae3d56b7Ed1ADB60692c98Bc5",
                "fee_recipient": "0xDAFEA492D9c6733ae3d56b7Ed1ADB60692c98Bc5",
                "coinbase_transfers": "0",
                "eth_sent_to_fee_recipient": "0",
                "gas_used": 8039689,
                "gas_price": "2204932511",
                "effective_priority_fee": "2204932511",
                "transactions": [
                    {
                        "transaction_hash": "0xa34125f19982fdcd8f8ac012b7924ecf145d9f1c5a5aae060b68e7d0b403c491",
                        "tx_index": 0,
                        "bundle_type": "flashbots",
                        "bundle_index": 0,
                        "block_number": 18974792,
                        "eoa_address": "0x5DB4b98e3deF62f0fce1267Db1d77639C43C3B14",
                        "to_address": "0x77E06c9eCCf2E797fd462A92B6D7642EF85b0A44",
                        "gas_used": 106331,
                        "gas_price": "31119562123",
                        "coinbase_transfer": "0",
                        "eth_sent_to_fee_recipient": "0",
                        "total_miner_reward": "3308974160100713",
                        "fee_recipient_eth_diff": "3308974160100713"
                    },
                    {
                        "transaction_hash": "0x5719b3ee2891cd3d4bdbcf3d5d3b41fb2f68f3e027ee825b84ca4b6b51ddef8d",
                        "tx_index": 0,
                        "bundle_type": "mempool",
                        "bundle_index": 1,
                        "block_number": 18974792,
                        "eoa_address": "0xFB12622b729599db9c30469bD36787cA2e9413c3",
                        "to_address": "0x04d44A44E0be0a692938baeC467F22c4dBDF719b",
                        "gas_used": 21000,
                        "gas_price": "17607123388",
                        "coinbase_transfer": "0",
                        "eth_sent_to_fee_recipient": "0",
                        "total_miner_reward": "369749591148000",
                        "fee_recipient_eth_diff": "369749591148000"
                    }
                ]
            },
            {
                "block_number": 18974736,
                "miner_reward": "24107460683890845",
                "fee_recipient_eth_diff": "24107460683890845",
                "miner": "0xDAFEA492D9c6733ae3d56b7Ed1ADB60692c98Bc5",
                "fee_recipient": "0xDAFEA492D9c6733ae3d56b7Ed1ADB60692c98Bc5",
                "coinbase_transfers": "0",
                "eth_sent_to_fee_recipient": "0",
                "gas_used": 17311402,
                "gas_price": "1392577024",
                "effective_priority_fee": "1392577024",
                "transactions": [
                    {
                        "transaction_hash": "0xa049c8a8ce354fca67277d7218fd4b70c798d6c92d7e2ab5779d644187dfa0bb",
                        "tx_index": 0,
                        "bundle_type": "flashbots",
                        "bundle_index": 0,
                        "block_number": 18974736,
                        "eoa_address": "0x000812de2241aB594aE154060028F70F39DAE000",
                        "to_address": "0x00fa0B420C3119F473c2463104FB9d4E91E445af",
                        "gas_used": 21000,
                        "gas_price": "26962839990",
                        "coinbase_transfer": "0",
                        "eth_sent_to_fee_recipient": "0",
                        "total_miner_reward": "566219639790000",
                        "fee_recipient_eth_diff": "566219639790000"
                    },
                    {
                        "transaction_hash": "0x09486a4e90887c631f3dbb2f33a4c0d700f7079e48eba48580f4d74ade51f5fc",
                        "tx_index": 1,
                        "bundle_type": "flashbots",
                        "bundle_index": 0,
                        "block_number": 18974736,
                        "eoa_address": "0x00fa0B420C3119F473c2463104FB9d4E91E445af",
                        "to_address": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
                        "gas_used": 47018,
                        "gas_price": "26962839990",
                        "coinbase_transfer": "0",
                        "eth_sent_to_fee_recipient": "0",
                        "total_miner_reward": "1267738810649820",
                        "fee_recipient_eth_diff": "1267738810649820"
                    }
                ]
            }
        ],
        "latest_block_number": 18974792
    }
}
```
{% endtab %}
{% endtabs %}

### **/getflashbottransactions**

## Get details of the flashbot transactions.

<mark style="color:blue;">`GET`</mark> `https://api.expand.network/chain/getflashbottransactions`

#### Query Parameters

| Name        | Type   | Description                                                           |
| ----------- | ------ | --------------------------------------------------------------------- |
| chainId     | String | Refer to the [Chain ID ](../important-ids/chain-id)page for details.  |
| chainSymbol | String | Refer to the [Chain ID ](../important-ids/chain-id)page for details.  |

{% tabs %}
{% tab title="Sample Request" %}
```url
https://api.expand.network/chain/getflashbottransactions?chainId=1
```
{% endtab %}

{% tab title="Sample Response" %}
```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "transactions": [
            {
                "transaction_hash": "0xbcf55b7e9488135c12f3e70bd2a191cc19913475de6937f54cb9843865416391",
                "tx_index": 0,
                "bundle_index": 21,
                "block_number": 18975317,
                "eao_address": "0x2aC74Bd02EE017fa05629432Dd3728720c455032",
                "to_address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
                "gas_used": 30428,
                "gas_price": "10000002",
                "coinbase_transfer": "0",
                "eth_sent_to_fee_recipient": "0",
                "total_miner_reward": "304280060856",
                "fee_recipient_eth_diff": "304280060856"
            },
            {
                "transaction_hash": "0xd441a44e2adf57f0d53e027d4441cdfee8653cd7f259ec0c90b60ea144b31d32",
                "tx_index": 0,
                "bundle_index": 20,
                "block_number": 18975317,
                "eao_address": "0x758aC3DC8FB6F939adf42bB83e717f94619052f5",
                "to_address": "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
                "gas_used": 118712,
                "gas_price": "11300000",
                "coinbase_transfer": "0",
                "eth_sent_to_fee_recipient": "0",
                "total_miner_reward": "1341445600000",
                "fee_recipient_eth_diff": "1341445600000"
            },
            {
                "transaction_hash": "0x02cbeb153f91225abcdad3cd4d39d457b5e13f3fb1191f26c73c328c50f54071",
                "tx_index": 0,
                "bundle_index": 19,
                "block_number": 18975317,
                "eao_address": "0x4a25D28d10B02BCF13a16068F56d167D8F96d093",
                "to_address": "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
                "gas_used": 181502,
                "gas_price": "12500000",
                "coinbase_transfer": "0",
                "eth_sent_to_fee_recipient": "0",
                "total_miner_reward": "2268775000000",
                "fee_recipient_eth_diff": "2268775000000"
            },
            {
                "transaction_hash": "0x2b89ed3dbfe8946229468f33e31ed447631c192906344b7c62b6e927a7a5a512",
                "tx_index": 12,
                "bundle_index": 18,
                "block_number": 18975317,
                "eao_address": "0x4960DC043DDc244A02192898B3e2F1730194F0ac",
                "to_address": "0xf2B2420CEff184EEc76B3de15bd90C5734e45449",
                "gas_used": 21000,
                "gas_price": "10000001",
                "coinbase_transfer": "0",
                "eth_sent_to_fee_recipient": "0",
                "total_miner_reward": "210000021000",
                "fee_recipient_eth_diff": "210000021000"
            }
        ],
        "latest_block_number": 18975317
    }
}
```
{% endtab %}
{% endtabs %}

### **/getflashbotbundle**

## Get details of the specified flashbot bundle.

<mark style="color:blue;">`GET`</mark> `https://api.expand.network/chain/getflashbottransactions`

#### Query Parameters

| Name                                         | Type   | Description                                                           |
| -------------------------------------------- | ------ | --------------------------------------------------------------------- |
| chainId                                      | String | Refer to the [Chain ID ](../important-ids/chain-id)page for details.  |
| chainSymbol                                  | String | Refer to the [Chain ID ](../important-ids/chain-id)page for details.  |
| bundleHash<mark style="color:red;">\*</mark> | String | The bundle hash.                                                      |

{% tabs %}
{% tab title="Sample Request" %}
```url
https://api.expand.network/chain/getflashbotbundle?bundleHash=0x2228f5d8954ce31dc1601a8ba264dbd401bf1428388ce88238932815c5d6f23f
```
{% endtab %}

{% tab title="Sample Response" %}
```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "transactions": [
            {
                "transaction_hash": "0xd9cdf1483a85aa206625c66fea49059b96ffae1c086f76664cfa3f91a495d73a",
                "tx_index": 0,
                "bundle_index": 3,
                "block_number": 9091437,
                "eao_address": "0x8D460B72eaF3d63830E16C22d1Fc6908D0834Abe",
                "to_address": "0x8D460B72eaF3d63830E16C22d1Fc6908D0834Abe",
                "gas_used": 21000,
                "gas_price": "1000000000",
                "coinbase_transfer": "0",
                "eth_sent_to_fee_recipient": "0",
                "total_miner_reward": "21000000000000",
                "fee_recipient_eth_diff": "21000000000000"
            }
        ]
    }
}
```
{% endtab %}
{% endtabs %}

### /sendtransaction

## Send transaction on the chain.

<mark style="color:green;">`POST`</mark> `https://api.expand.network/chain/sendtransaction`

#### Request Body

| Name                                             | Type    | Description                                                                                                            |
| ------------------------------------------------ | ------- | ---------------------------------------------------------------------------------------------------------------------- |
| rpc                                              | String  | Remote procedural call URL.                                                                                            |
| chainId                                          | String  | Refer to the [Chain ID ](../important-ids/chain-id)page for details.                                                   |
| chainSymbol                                      | String  | Refer to the [Chain ID ](../important-ids/chain-id)page for details.                                                   |
| rawTransaction<mark style="color:red;">\*</mark> | String  | The encoded transaction, obtained from the signed transaction.                                                         |
| bdnTransaction                                   | Boolean | <p>If true, then txn goes through the bdn route, which speeds up the transaction process.</p><p>By default, false.</p> |
| mevProtection                                    | Boolean | If true, then txn goes through flashbots.                                                                              |

{% tabs %}
{% tab title="Sample Request" %}
**With mevProtection: true**&#x20;

```json
{
    "chainId":"1",
    "rawTransaction": "0xf8a68205180f82753e94dc31ee1784292379fbb2964b3b9c4124d8f89c6080b844a9059cbb000000000000000000000000a67e9b68c41b0f26184d64c26e0b2b81466e5994000000000000000000000000000000000000000000000000000000174876e8002ea0952b0468aff066f3e00a1d476b8894d84bfc47a1a3cdab9d6809a3461cc713e5a018219ee382aa3c7edf73a87bd8a75e2c40a97efbdf56a6cfd353af06fb74101d",
    "mevProtection": true
}
```
{% endtab %}

{% tab title="Sample Response" %}
**With mevProtection: true** &#x20;

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "txHash": "0xd9cdf1483a85aa206625c66fea49059b96ffae1c086f76664cfa3f91a495d73a"
    }
}
```
{% endtab %}
{% endtabs %}
