Solver Development for Intent-Based Protocols

We design and develop full-cycle blockchain solutions: from smart contract architecture to launching DeFi protocols, NFT marketplaces and crypto exchanges. Security audits, tokenomics, integration with existing infrastructure.
Showing 1 of 1All 1305 services
Solver Development for Intent-Based Protocols
Complex
~1-2 weeks
Frequently Asked Questions

Blockchain Development Services

Blockchain Development Stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1358
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1250
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    956
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1188
  • image_logo-advance_0.webp
    B2B Advance company logo design
    646
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    929

Solver Development for Intent-Based Protocols

A user of an intent-based protocol does not specify the exact swap route but signs a goal: "get at least 3000 USDC for 1 ETH by tomorrow morning." Execution falls on the solver — an off-chain agent that finds the best path through dozens of DEXes in seconds, considering liquidity, fees, and competitive bids from other solvers. An error in routing or a 200 ms delay, and the order goes to a competitor.

We develop custom solvers for protocols such as CoW Protocol, UniswapX, 1inch Fusion, and ERC-7683 (cross-chain intents) — a standard described in EIP-7683. For example, for one project on UniswapX, we implemented a private RFQ channel with market makers, boosting win rate from 5% to 18% and increasing average surplus by 30%. This allowed the client to take second place by volume among 45 solvers on the protocol.

Solver development includes architecture design, writing the core in Rust with parallel requests to 15+ liquidity sources, testing on forked mainnet, and deploying settlement contracts. Average order processing latency is 250 ms, and win rate after the first week of optimization reaches 10-15%. We guarantee transparent metrics and 99.9% uptime SLA.

How a solver works and what makes it complex

The solver receives a signed EIP-712 order, queries liquidity pools in parallel (Uniswap V3, Curve, Balancer), aggregators (1inch, 0x), and private RFQ channels. Then, within 10–15 seconds (for CoW Protocol batch auction) or without a strict deadline (for UniswapX), it forms a settlement transaction. Competition forces optimization at every step: we use Rust with tokio for parallel RPC (latency ~150 ms per source), cache pool state via WebSocket, and use the in-process EVM simulator revm to check routes without extra on-chain calls.

Why batch auction demands high performance

In CoW Protocol, the auction window is 30 seconds, of which 10–15 seconds remain for computation. During this time, dozens of DEXes must be polled, split routing calculated, transactions simulated, and a settlement formed. We use Rust with tokio async runtime — this enables parallel RPC to sources within 100–200 ms. Cache of pool state (reserves/sqrtPrice) via WebSocket subscriptions yields microsecond latency instead of milliseconds. The in-process EVM simulator (revm) checks routes without on-chain calls.

UniswapX: architecture and execution mechanism

UniswapX uses a Dutch auction: the filler/solver can execute the order at any time before expiry. The initial price is favorable to the user and gradually shifts in favor of the solver. The first solver to execute the order at an acceptable price wins.

UniswapX order structure (ExclusiveFillerOrder):

interface ExclusiveFillerOrder {
  info: {
    reactor: Address
    swapper: Address
    nonce: bigint
    deadline: bigint
    additionalValidationContract: Address
    additionalValidationData: Hex
  }
  exclusiveFiller: Address
  exclusivityOverrideBps: number
  input: {
    token: Address
    amount: bigint
  }
  outputs: Array<{
    token: Address
    startAmount: bigint
    endAmount: bigint
    recipient: Address
  }>
}

The solver receives input.amount from the user and must return at least currentOutput (value between startAmount and endAmount depending on timestamp).

Reactor contract and settlement

The UniswapX Reactor is an on-chain contract that verifies the user's signature, checks currentOutput over time, and manages transfers. The solver calls execute(order, signature, fillData). The key point: the solver receives input tokens at the beginning of execution and must return output tokens by the end of the same transaction. Between receiving and returning, the solver can use any on-chain protocols — this is the space for optimization.

Finding the optimal execution path

The solver's goal is to maximize surplus for given input/output. Surplus = actualOutput - minRequiredOutput. Better surplus → higher chance of winning the auction in batch systems.

Routing through multiple DEXes

The basic approach is to find the best price via an aggregator. Parallel requests to 10+ DEXes with a 500 ms timeout per source. The best responding route is selected. In production, we poll more than 15 sources, including Uniswap V3, Curve, Aerodrome, Balancer, and aggregators 1inch, 0x.

Split routing

If one DEX is insufficient, we split the order into parts. For orders >500 ETH, split routing into 2-3 parts reduces price impact from 3-5% to 1-2%.

Private liquidity (RFQ)

In addition to on-chain DEXes, the solver can access private market makers via RFQ. The market maker responds with a signed quote — if it beats the on-chain route, the solver uses it. CoW Protocol supports this via GPv2 interaction: the solver includes the signed quote from the market maker as part of the settlement. In one case, the RFQ channel increased surplus by 35% on orders >100 ETH.

Example code for RFQ integration
async function requestRFQ(order: Intent): Promise<SignedQuote> {
  const quote = await marketMaker.requestQuote({
    tokenIn: order.input.token,
    tokenOut: order.output.token,
    amount: order.input.amount,
    deadline: order.deadline
  })
  if (quote.amountOut > bestOnChainRoute.amountOut) {
    return quote // use RFQ
  }
  return null
}

CoW Protocol solver: batch auction mechanics

In CoW Protocol, a batch auction proceeds as follows:

  1. Orderbook: users sign orders (via CoW Swap UI or directly), orders enter the public orderbook API
  2. Auction call: every ~30 seconds, CoW Protocol calls /solve on registered solvers
  3. Solver computation: the solver receives the list of orders in the batch, finds the optimal set of executions (including CoW — matching opposing orders without DEX)
  4. Submission: the solver submits a solution with calldata for on-chain settlement
  5. Winner selection: the solver with the highest total surplus for the batch is selected
  6. On-chain settlement: the winning solver executes the transaction via the GPv2Settlement contract

CoW (Coincidence of Wants) is a feature: if the batch contains an order to sell ETH for USDC and an order to sell USDC for ETH — the solver can match them directly. No DEX fees, no price impact. Both parties get a better price.

Registering a solver in CoW Protocol

The solver must be authorized by CoW DAO. To participate in production auctions, a bond is required (DAO governance vote). For testing, a staging environment without bond is available. We facilitate the registration process, including preparation of technical documentation and passing contract audit. Details in the official CoW Protocol documentation.

Comparison of UniswapX and CoW Protocol for solvers

Parameter UniswapX (Dutch auction) CoW Protocol (batch auction)
Competition mechanism First to fill at acceptable price Batch solution every ~30 sec, best surplus wins
Computation time No strict deadline, but earlier is better Strict 30 sec, effective time 10-15 sec
CoW matching Not supported Supported, reduces need for DEX
RFQ Via exclusive filler Via signed quotes in settlement
Development complexity Medium High (batch optimization)
Typical win rate after optimization 15-25% 10-20%
Average gas savings (vs. regular swap) 5-10% 10-20%

What is included in the work

  • Competitive environment analysis — assessment of current solvers, their win rates, typical routes
  • Solver development for intent-based protocols — code in Rust/Go, integration with the chosen protocol, routing engine
  • Settlement contracts — custom if needed (Solidity 0.8.24, Foundry tests)
  • Monitoring and alerts — Prometheus metrics (win rate, avg surplus, latency), Grafana dashboard, Telegram notifications when win rate drops below 5%
  • Mainnet registration — documentation preparation, governance passage (for CoW), deployment
  • Post-launch support — strategy optimization, adding new DEXes, updates during hard forks

Timeline and savings estimates

A basic UniswapX filler with simple routing — 1 week. A full CoW Protocol solver with CoW matching, split routing and RFQ — 3–4 weeks. Cost is calculated individually, but average transaction savings due to optimization reach 15-20% vs. standard routes. We have 5+ years of experience and have implemented over 50 projects in smart contracts and DeFi infrastructure.

Why order a custom solver?

A ready-made solver does not account for the specifics of your tokens, liquidity, and strategy. A custom solver allows you to configure priority routes, private RFQ channels, optimize latency for your DEX aggregator, and increase win rates in auctions. Get a consultation — we will evaluate your project and offer a turnkey solution. Contact us to discuss the details.

DeFi Protocol Development

We design modular DeFi protocols where the math of stablecoins, liquidity, and oracles works flawlessly. Mango Markets is a stress test: the attacker manipulated the spot price through a single account, took a loan against inflated collateral, and withdrew $114 million. The oracle took the price from a single source without TWAP. Not a code bug—it was an architectural decision that became a vulnerability. Our experience shows: any DeFi protocol is a system of bets that all components, from calculations to economic incentives, are correctly aligned simultaneously.

We don't write code under the 'if it works, don't touch it' mindset. We model stress scenarios: cascading liquidations, depegs, flash loans. Only then do we build events that won't break the protocol.

Why are oracles a critical component of DeFi?

Most major DeFi hacks started with oracle manipulation. Let's break down the three layers we use in every project.

Spot price as oracle—not an option. Uniswap v2 spot price can be shifted by a flash loan in one transaction. The price at the end of the block is the only one that enters the state, and the oracle reads it. Attack scheme: borrow via flash loan → buy asset into the pool → price rises → take a loan against inflated collateral → sell asset → repay flash loan. One transaction.

TWAP as protection. Uniswap v3 observe() averages the price over a period (30 minutes). Manipulation requires maintaining the price for several blocks—this is expensive. But TWAP reacts slowly to legitimate changes, opening a window for arbitrage on liquidation during sharp movements.

Chainlink Price Feeds are an aggregation from multiple data providers with a median. Standard for lending. Problem: heartbeat 1–24 hours and deviation threshold 0.5%. If the price doesn't move, the feed may not update for a day. In volatile markets—lag.

Oracle Mechanism Manipulation Protection Latency
Chainlink Median from independent providers High (decentralization) Up to 24h at 0% movement
Uniswap v3 TWAP Average price over N blocks High (hard to maintain) 30 min – 1 h
Pyth Network Cross-chain low-latency Medium (dependent on publisher) Seconds

In production, we use a two-tier check: Chainlink aggregator + Uniswap v3 TWAP as a verifier. If the discrepancy exceeds N%, the transaction is rejected and the system is paused.

How to protect a DeFi protocol from flash loan attacks?

Flash loans turn any user into an owner of unlimited capital for one transaction. Therefore, when designing contracts, we assume: everyone has access to unlimited capital. This completely changes the threat model.

Legitimate uses of flash loans are arbitrage, liquidation, and self-liquidation. But the protocol must verify that the loan is not used for manipulation: the oracle must not read the price from a pool that can be shifted in one transaction. We add checks on block.timestamp and minimum liquidity depth.

Key Components of DeFi Architecture

Protocol Type Core Mechanism Main Risk
DEX (AMM) x*y=k or concentrated liquidity impermanent loss, oracle manipulation
Lending collateral ratio, liquidation bad debt during cascading liquidations
Yield aggregator auto-compounding strategies rug via strategy upgrade
Derivatives / Perps funding rate, mark price liquidation cascades, socialized losses
Liquid staking stETH-style rebasing depegging on mass unstake

AMM: From x*y=k to Concentrated Liquidity

Uniswap v2 uses x * y = k. LP tokens are ERC-20—each pool issues its own token proportional to the share. Problem: liquidity is spread across the entire curve, most of it unused.

Uniswap v3 and ERC-721 positions: concentrated liquidity—LPs provide liquidity in a range [priceLow, priceHigh]. Capital efficiency up to 4000x for stable pairs. But ERC-721 breaks vault strategies built for ERC-20. Range management is a separate engineering challenge: a position falls out of range when the price moves, stops earning fees, and becomes single-asset. Protocols like Arrakis Finance automatically rebalance. If you build a vault on top of v3, you need your own range manager or integration with an existing one.

Slippage in v3 is calculated via sqrtPriceX96—96-bit fixed-point math. Errors on the frontend lead to discrepancies between visible and actual slippage.

Curve for pairs with close prices (stablecoin/stablecoin, stETH/ETH) uses an invariant combining constant product and constant sum. Lower slippage within the peg range. Contracts are in Vyper, code is mathematically dense, auditing is difficult.

Lending Protocols: Collateral, Liquidation, Bad Debt

LTV defines the maximum loan against collateral. Liquidation threshold is the level for liquidation. The difference is the buffer for the liquidator. Typical example: LTV 75%, liquidation threshold 80%, bonus 5%. If the price drops 20%+, the position is open for liquidation.

Cascading liquidations: many positions are liquidated simultaneously → liquidators sell collateral → price drops → next wave. LUNA/UST 2022 is a classic cascade.

If collateral devalues faster than liquidation, the protocol incurs bad debt. Aave uses a Safety Module (staked AAVE), Compound uses reserves. Without a backstop, bad debt is socialized via dilution of the supply token or netting.

Designing a liquidation system requires modeling stress scenarios: a single liquidation bot failure, high gas, collateral delisting.

Yield Farming and Incentive Mechanics

Liquidity mining distributes governance tokens to LP providers. Problem: mercenary capital—farmers come, sell tokens, leave. TVL is illusory.

Sustainable mechanics: protocol-owned liquidity (Olympus bonding), veToken (CRV locked → boost + governance), locked staking with penalty. The ve-model, if implemented incorrectly, creates governance concentration. A timelock on gauge weight changes and limits on voting power are needed.

What Our DeFi Protocol Development Includes

  • Architectural documentation: contract interaction diagrams, liquidation stress tests, oracle calculations.
  • Implementation in Solidity 0.8.x with OpenZeppelin 5.x (AccessControl, ReentrancyGuard, Pausable, TimelockController) and Solmate for gas-optimized base contracts.
  • Foundry fork tests on real mainnet (Uniswap, Chainlink, Aave) — pre-deployment tests cover all scenarios.
  • Audit: at least two independent auditors for TVL over $1M. Code4rena or Sherlock for bug bounty.
  • Deployment with Gnosis Safe 3/5 multisig + timelock 48–72 hours.
  • Monitoring via Tenderly (alerts, simulations), OpenZeppelin Defender (automation), Forta (on-chain threat detection).
  • Post-launch support: updates, patches, upgrades via proxy.

Our Expertise and Experience

We have been developing DeFi protocols since 2020, delivering 30+ projects with a combined TVL of over $150 million. Our clients include protocols in the top 20 by TVL on Ethereum, Arbitrum, and Base. The team consists of certified Solidity developers who have completed ConsenSys Diligence audit tracks.

DeFi basic principles that we apply in practice.

Timelines

  • DEX with AMM (Uniswap v2 fork): 6–10 weeks
  • Lending protocol (Aave-style, single collateral): 3–5 months
  • Yield aggregator with multiple strategies: 2–4 months
  • Full-fledged DeFi protocol with governance: 5–8 months including audit

Cost is calculated individually—contact us for a project estimate.

Get a consultation on DeFi protocol architecture—we will analyze the risks and propose an optimal solution.