Solver Call Data
What is solverOpData?
solverOpData?The solverOpData parameter is a crucial component that contains the transaction data required by your solver contract. This data ensures that your MEV strategy executes precisely and securely within the Atlas ecosystem.
Why is solverOpData Important?
solverOpData Important?Executes your MEV strategy on the solver contract
Atlas constructs the call to
atlasSolverCalland passes thesolverOpDataalong.
The simplest way to obtain the correct solverOpData is to create a transaction directly to your solver contract (as if Atlas didn't exist) and extract that transaction's data field.
There are two primary approaches to using solverOpData, and the choice depends on your specific implementation:
There are many approaches on how you want to use the solverOpData and they're ultimately up to you.
Potential Approaches:
Approach 1: Direct MEV Logic Implementation in Solver Contract
MEV logic alongside the solver contract which implements the ISolverContract
atlasSolverCallshould be calling an internal function In this method, your solver contract contains all the MEV logic within its functions. ThesolverOpDatais an encoding of a function call within your solver contract, such assolve()
We provide a helper SolverBase which redirects the callData. Your solverOpData should encode your function here solve()
Example Contract AtlasDirectSolver
How It Works:
The
solve()function contains the MEV logic.The
atlasSolverCall()function (inherited fromSolverBase) callssolve()by forwarding the callData.solverOpDatais simply the ABI-encoded call tosolve().
Generating solverOpData:
Approach 2: Proxying Calls to an External Contract
This approach allows for modularity, enabling the use of a dedicated external contract for various MEV strategies.
The solverOpData includes both the function call to your solver contract and the data intended for the external contract.
Example: AtlasProxySolver
How It Works:
The
solve(bytes calldata solverOpData)function receives the callData intended for the external contract.It forwards this callData to the
searcherContractusing a low-levelcall.solverOpDataincludes the encoded function call for the external contract.
Generating solverOpData:
Suppose your external searcher contract has a function:
Step 1: Encode the External Contract Call
Step 2: Encode the Solver Contract Call
Last updated