Skip to main content
This guide will walk you through integrating as a solver for Eco Routes, enabling you to provide quotes and execute cross-chain intent transactions.

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
GASLESS
  • 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.
See the complete Solver API Reference for detailed request/response schemas.

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

Routes V2 Only: As a new solver, only provide V2 endpoint URLs. Do NOT include:
  • quotesUrl (V1 only)
  • reverseQuotesUrl (V1 only)
  • receiveSignedIntentUrl (V1 only)
These are only for legacy solvers supporting Routes V1.

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.
event IntentCreated(
        bytes32 indexed intentHash,
        address indexed creator,
        bytes routeData,
        bytes rewardData
    );

Handle Incoming Requests

Once registered, Eco Routes will start sending requests to your endpoints when users request quotes.

Quote Request Flow

  1. User requests quotes through Eco Routes
  2. Eco Routes queries all registered solvers in parallel (including you)
  3. Your solver calculates pricing and returns a quote
  4. User sees all quotes and selects the best one

Execution Flow

For SELF_PUBLISH Intents

  1. User publishes the intent on-chain using your quote
  2. You monitor Eco portal contract events for new published and funded intents
  3. You fulfill the intent on destination portal contract
  4. Portal contract on destination will verify fulfillment and release funds on source chain

For GASLESS Intents

  1. User signs a permit3 signature using your quote
  2. Eco Routes calls your gasless initiation endpoint with the signature
  3. You execute the intent and pull tokens using the permit3 signature
  4. You return the transaction hash in the response