Skip to main content

Execute

Once you have the signed message, include it in your transaction request.
For Odos v3, this is typically sent to the /sor/swap/v3 endpoint as permit2Signature or orderSignature.

Example Request Body

{
"chainId": 8453,
"userAddr": "0x123...",
"pathId": "abcd1234...",
"permit2Signature": "0xabc...",
"simulate": false
}

Executing via Web3.js

import Web3 from 'web3';
import 'dotenv/config';

const web3 = new Web3('https://base.llamarpc.com');
const tx = swapData.transaction;

const signed = await web3.eth.accounts.signTransaction(tx, process.env.PRIVATE_KEY);
const receipt = await web3.eth.sendSignedTransaction(signed.rawTransaction);

console.log('Transaction Hash:', receipt.transactionHash);

Executing via Python (Web3.py)

from web3 import Web3
import os

w3 = Web3(Web3.HTTPProvider("https://base.llamarpc.com"))
tx = swap_data["transaction"]

signed_tx = w3.eth.account.sign_transaction(tx, os.getenv("PRIVATE_KEY"))
tx_hash = w3.eth.send_raw_transaction(signed_tx.rawTransaction)
print("Transaction hash:", w3.to_hex(tx_hash))