Skip to content

Commit 55593c9

Browse files
dimrioudev-dist
andauthored
Add svr bundles instructions (#3580)
* Add svr bundles instructions * Fix format * empty commit: trigger automation --------- Co-authored-by: devin distefano <devin.distefano@smartcontract.com>
1 parent f797f1a commit 55593c9

File tree

5 files changed

+121
-0
lines changed

5 files changed

+121
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"jsonrpc": "2.0",
3+
"method": "mev_sendBundle",
4+
"params": [
5+
{
6+
"version": "v0.1",
7+
"inclusion": {
8+
"block": "0x01",
9+
"maxBlock": "0x04"
10+
},
11+
"body": [
12+
{
13+
"hash": "0x_bundle_event_hash"
14+
},
15+
{
16+
"tx": "0x0213a...",
17+
"canRevert": false
18+
}
19+
]
20+
}
21+
]
22+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"hash": "0x_bundle_event_hash",
3+
"txs": [
4+
{
5+
"to": "0x45ab36b69e02e59d3c49b863b31f530c991dd554",
6+
"functionSelector": "0x6fadcf72",
7+
"callData": "0x80640b.....................a2354d"
8+
},
9+
{
10+
"to": "0x45ab36b69e02e59d3c49b863b31f530c991dd554",
11+
"functionSelector": "0x6fadcf72",
12+
"callData": "0x12340b.....................a2354d"
13+
}
14+
]
15+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"hash": "0x_single_transaction_event_hash",
3+
"txs": [
4+
{
5+
"to": "0x45ab36b69e02e59d3c49b863b31f530c991dd554",
6+
"functionSelector": "0x6fadcf72",
7+
"callData": "0x80640b.....................a2354d"
8+
}
9+
]
10+
}

src/content/data-feeds/llms-full.txt

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6343,8 +6343,43 @@ Chainlink SVR uses forwarder contracts to route feed updates. You typically see
63436343

63446344
3. **callData**: The `callData` includes the parameters for `transmitSecondary()` on the aggregator contract. You can decode this if you need to extract the updated price when the onchain event is not emitted (details in the section below).
63456345

6346+
Here's an example of a single transaction event:
6347+
6348+
```json
6349+
{
6350+
"hash": "0x_single_transaction_event_hash",
6351+
"txs": [
6352+
{
6353+
"to": "0x45ab36b69e02e59d3c49b863b31f530c991dd554",
6354+
"functionSelector": "0x6fadcf72",
6355+
"callData": "0x80640b.....................a2354d"
6356+
}
6357+
]
6358+
}
6359+
```
6360+
63466361
Below are code examples for setting up a listener that monitors the MEV-Share event stream for SVR feed updates. These examples show how to connect to the stream, filter for relevant transactions with the `6fadcf72` function selector, and process incoming events:
63476362

6363+
The event stream is also expected to occasionally transmit transaction bundles. The bundle event has a similar format to the single transaction event, but with more than one transactions. Transactions will be bundled in nonce ascending order, meaning txs[0] has the lowest nonce and txs[len(txs)] has the highest. Below is an example of a bundle:
6364+
6365+
```json
6366+
{
6367+
"hash": "0x_bundle_event_hash",
6368+
"txs": [
6369+
{
6370+
"to": "0x45ab36b69e02e59d3c49b863b31f530c991dd554",
6371+
"functionSelector": "0x6fadcf72",
6372+
"callData": "0x80640b.....................a2354d"
6373+
},
6374+
{
6375+
"to": "0x45ab36b69e02e59d3c49b863b31f530c991dd554",
6376+
"functionSelector": "0x6fadcf72",
6377+
"callData": "0x12340b.....................a2354d"
6378+
}
6379+
]
6380+
}
6381+
```
6382+
63486383
#### 3. Decode `callData` for `forward` and `transmitSecondary`
63496384

63506385
Once you've identified a potential SVR feed update transaction, you'll need to decode its payload. This step allows you to extract:
@@ -6470,6 +6505,33 @@ Below are code examples demonstrating how to construct and submit bundles to the
64706505

64716506
For gas management, simulations, and other advanced usage, see the official [Flashbots documentation](https://docs.flashbots.net/).
64726507

6508+
Bidding for bundle events is very similar to single transaction events. As a searcher, you can append your transaction at the end of the bundle by using the bundle event hash just like you would with the single transaction event hash. Below is an example:
6509+
6510+
```json
6511+
{
6512+
"jsonrpc": "2.0",
6513+
"method": "mev_sendBundle",
6514+
"params": [
6515+
{
6516+
"version": "v0.1",
6517+
"inclusion": {
6518+
"block": "0x01",
6519+
"maxBlock": "0x04"
6520+
},
6521+
"body": [
6522+
{
6523+
"hash": "0x_bundle_event_hash"
6524+
},
6525+
{
6526+
"tx": "0x0213a...",
6527+
"canRevert": false
6528+
}
6529+
]
6530+
}
6531+
]
6532+
}
6533+
```
6534+
64736535
#### 7. Considerations
64746536

64756537
- **Competition**: Multiple searchers might detect the same liquidation. The best bid typically wins.

src/content/data-feeds/svr-feeds/searcher-onboarding-ethereum.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ Chainlink SVR uses forwarder contracts to route feed updates. You typically see
112112

113113
1. **callData**: The `callData` includes the parameters for `transmitSecondary()` on the aggregator contract. You can decode this if you need to extract the updated price when the onchain event is not emitted (details in the section below).
114114

115+
Here's an example of a single transaction event:
116+
117+
<CodeSample src="samples/DataFeeds/SVR/single-transaction-event.json" />
118+
115119
Below are code examples for setting up a listener that monitors the MEV-Share event stream for SVR feed updates. These examples show how to connect to the stream, filter for relevant transactions with the `6fadcf72` function selector, and process incoming events:
116120

117121
<Tabs client:visible>
@@ -125,6 +129,10 @@ Below are code examples for setting up a listener that monitors the MEV-Share ev
125129
</Fragment>
126130
</Tabs>
127131

132+
The event stream is also expected to occasionally transmit transaction bundles. The bundle event has a similar format to the single transaction event, but with more than one transactions. Transactions will be bundled in nonce ascending order, meaning txs[0] has the lowest nonce and txs[len(txs)] has the highest. Below is an example of a bundle:
133+
134+
<CodeSample src="samples/DataFeeds/SVR/bundle-transaction-event.json" />
135+
128136
#### 3. Decode `callData` for `forward` and `transmitSecondary`
129137

130138
Once you've identified a potential SVR feed update transaction, you'll need to decode its payload. This step allows you to extract:
@@ -284,6 +292,10 @@ Below are code examples demonstrating how to construct and submit bundles to the
284292

285293
For gas management, simulations, and other advanced usage, see the official [Flashbots documentation](https://docs.flashbots.net/).
286294

295+
Bidding for bundle events is very similar to single transaction events. As a searcher, you can append your transaction at the end of the bundle by using the bundle event hash just like you would with the single transaction event hash. Below is an example:
296+
297+
<CodeSample src="samples/DataFeeds/SVR/bundle-bid.json" />
298+
287299
#### 7. Considerations
288300

289301
- **Competition**: Multiple searchers might detect the same liquidation. The best bid typically wins.

0 commit comments

Comments
 (0)