Skip to main content

Documentation Index

Fetch the complete documentation index at: https://eco.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

A solver fulfills intents on destination chains in exchange for the source-chain reward. This recipe walks through registration and the steady-state operating loop.

What you need to provide

EndpointRequired forPurpose
POST /api/v2/quoteAll solversReturn pricing for a candidate intent (exact-input)
POST /api/v2/quote/reverseAll solversReturn pricing for an exact-output intent
See the API Reference for full request/response schemas.

1. Implement the V2 endpoints

Your /api/v2/quote handler:
  1. Parses the candidate intent (source chain, destination chain, route tokens, requested output)
  2. Calculates your cost (destination gas, capital cost, slippage)
  3. Returns reward tokens you’d accept on the source chain (covering cost + margin) — or rejects if unprofitable
/api/v2/quote/reverse is the same idea for exact-output intents.

2. Register your solver

curl -X POST https://quotes.eco.com/api/v1/solverRegistry/registerSolver \
  -H "Content-Type: application/json" \
  -d '{
    "solverName": "your-solver",
    "intentExecutionTypes": ["SELF_PUBLISH"],
    "crossChainRoutes": [ ... ],
    "quotesV2Url": "https://your-solver.com/api/v2/quote",
    "reverseQuotesV2Url": "https://your-solver.com/api/v2/quote/reverse",
    "useSolverDataFormat": true
  }'
Routes V2 only — do not include quotesUrl, reverseQuotesUrl, or receiveSignedIntentUrl. Those are V1 legacy fields.

3. Monitor Portal events for SELF_PUBLISH intents

Watch the source-chain Portal for IntentPublished events. Match on intents that used your quote (your reward tokens will be present in the event).
event IntentPublished(
    bytes32 indexed hash,
    uint64 destination,
    bytes route,
    address indexed creator,
    address indexed prover,
    uint256 deadline,
    uint256 nativeAmount,
    TokenAmount[] tokens
);

4. Fulfill on the destination

portal.fulfillAndProve{value: route.nativeAmount + bridgeFee}(
    intentHash,
    route,
    rewardHash,
    claimant,
    proverAddress,
    sourceChainDomainID,
    proverData
);
The Portal transfers your reward tokens to the Executor, runs route.calls atomically, and emits IntentFulfilled.

5. Wait for proof, then withdraw

The chosen prover dispatches the fulfillment proof to the source chain. Once the source-chain Portal verifies it:
portal.withdraw(destination, routeHash, reward);
You receive the reward tokens.

Capital efficiency

Two patterns reduce your inventory needs:
  • Crowd Liquidity — flash-borrow stablecoin liquidity for fulfillment, repay from the destination outcome. See Crowd Liquidity.
  • Issuer-direct integration — if you have native mint/burn for a stablecoin, use it instead of pre-positioned inventory.

Best practices

  • Pre-simulate route.calls before fulfilling to avoid wasted gas on calls that would revert
  • Use batchWithdraw to amortize tx costs across multiple proven intents
  • Set deadline margins that allow for proof verification time on your chosen prover
  • Treat Fulfillment event detection as the success signal, not the tx receipt
You’re now operating as a solver.