Integration Guide
Step 1: Design Your Bundle
Step 2: Construct and Submit the Bundle
import requests
from eth_account import Account
EUREKA_RPC = "https://rpc.eurekabuilder.xyz"
def send_loan_bundle(signed_txs: list[str], block_number: int, private_key: str):
"""
signed_txs should contain, in order:
1. borrow() call
2. your strategy transactions
3. approve() calls for repayment
4. repay() call
"""
body = {
"jsonrpc": "2.0",
"method": "eth_sendBundle",
"params": [{
"txs": signed_txs,
"blockNumber": hex(block_number),
}],
"id": 1,
}
message = json.dumps(body)
account = Account.from_key(private_key)
signature = account.sign_message(encode_defunct(text=message))
header_value = f"{account.address}:{signature.signature.hex()}"
response = requests.post(
EUREKA_RPC,
json=body,
headers={"X-Flashbots-Signature": header_value},
)
return response.json()
send_loan_bundle(
signed_txs=[
"0x<signed borrow() call>",
"0x<signed strategy txs>",
"0x<signed approve txs>",
"0x<signed repay() call>",
],
block_number=20_400_000,
private_key=private_key,
)Step 3: Verify Inclusion
Common Rejection Reasons
Reason
Cause
Fix
Tips
Examples
Last updated
