Overview
As a solver, you’ll need to:- Implement the required API endpoints that Eco Routes will call
- Register your solver with Eco
- Respond to quote requests
- Fulfill intents onchain
Implement your solver API
Your solver must expose specific endpoints that Eco Routes will call to get quotes and execute intents. The exact endpoints depend on which intent execution types you want to support.Routes V2 Endpoints (Required)
You need to implement these endpoints based on the Solver API specification:- POST
/api/v2/quote- Returns pricing for executing cross-chain swaps (exact input) - POST
/api/v2/quote/reverse- Returns pricing for reverse quotes (exact output) - POST
/api/v2/intentInitiation/initiateGaslessIntent- Executes gasless intents (only if supporting GASLESS execution)
Intent Execution Types
SELF_PUBLISH- Users publish intents on-chain themselves
- You monitor the blockchain and fulfill published intents
- Only requires the two quote endpoints
- You execute intents using permit3 signatures without requiring users to pay gas
- Requires all three endpoints including the initiation endpoint
If you only support
SELF_PUBLISH, you don’t need to implement the gasless intent initiation endpoint.Register Your Solver
Once your endpoints are live and tested, register with Eco Routes to start receiving quote requests.Registration Process
Use the Register Solver endpoint to submit your solver configuration: Key Configuration Parameters:- intentExecutionTypes: Array of execution types you support (
["SELF_PUBLISH"]or["SELF_PUBLISH", "GASLESS"]) - crossChainRoutes: Defines which token swaps you support across chains
- quotesV2Url: Your quote endpoint URL
- reverseQuotesV2Url: Your reverse quote endpoint URL
- receiveSignedIntentV2Url: Your gasless initiation endpoint (only if supporting GASLESS)
- useSolverDataFormat: Always set to
true
Important Notes
Integrate Portal Contract Event Monitoring
For SELF_PUBLISH intents, you must monitor Portal contract events on source chains to detect when users publish intents using your quotes.Portal Contract Overview
The Portal contract is where users publish their cross-chain intents. Each source chain you support has a Portal contract that emits events when intents are created. More information about the Portal contract can be found here.Key Events to Monitor
IntentCreated Event Emitted when a user publishes a new intent on-chain. This is the primary event you’ll monitor to find intents to fulfill.Handle Incoming Requests
Once registered, Eco Routes will start sending requests to your endpoints when users request quotes.Quote Request Flow
- User requests quotes through Eco Routes
- Eco Routes queries all registered solvers in parallel (including you)
- Your solver calculates pricing and returns a quote
- User sees all quotes and selects the best one
Execution Flow
For SELF_PUBLISH Intents
- User publishes the intent on-chain using your quote
- You monitor Eco portal contract events for new published and funded intents
- You fulfill the intent on destination portal contract
- Portal contract on destination will verify fulfillment and release funds on source chain
For GASLESS Intents
- User signs a permit3 signature using your quote
- Eco Routes calls your gasless initiation endpoint with the signature
- You execute the intent and pull tokens using the permit3 signature
- You return the transaction hash in the response
