How I built the best NEAR-USDC pool

Two months ago, I set a new goal for Intear: become the #1 DEX. The first step is to become #1 for memecoins, since Intear already leads in everything shitcoin-related, except the DEX and the launchpad.

Intear DEX already had more features for memecoins: scheduled fees, burned LP that still earns fees, more fees, fees fees, etc., virtual liquidity, and a fast UI. What was missing is liquidity. Some people swap stablecoins into memecoins, and Intear DEX had very shallow stablecoin liquidity. The lack of infra integrations (CoinGecko, DEX Screener) doesn't help either. Those are still at least weeks away, since integrating a DEX that isn't an average Uniswap fork on an average EVM fork takes some work and special care. What I could do right now is make better liquidity pools.

Designing the new pool

I needed a pool that gives good prices on large swaps without millions in liquidity, because raising funds sounds boring and comes with investors' expectations to meet. Rhea already added pools like this 1–2 years ago: degen pools, now called ALMM. They work like Curve's stableswap pools, but scaled by prices from an oracle. Instead of wasting liquidity on prices like "NEAR at $0.08" or "NEAR at $8.88", which will sit there for years without a single swap, this kind of pool concentrates liquidity near the real price.

$0.01 to $100

Zoomed in

  • Constant-product pool of the same value
  • The NEAR-USDC Qoq pool, amplification 888

Oracle price … · Pool price …

Live: the depth at each price, the dollars a swap takes to move the price by 1%, from the pool's balances and the oracle's prices every 200 ms.

But Rhea's experience shows a big problem: their oracle is really bad. It updates every 20 to 120 seconds, so their pools often trade at stale prices, while arbitrage bots use real-time prices from CEXes and take money from the pools at the expense of liquidity providers.

I had three options:

  • Go down the same path and risk losing money. Oracle-priced stable pools lose to arbitrage, but they also earn much more in fees from the arbitrage bots, which softens and often outweighs the loss, and they make protocol revenue no matter how much liquidity providers win or lose. But I knew I'd start with my own money, so that didn't sound that good.
  • Build a standard concentrated liquidity pool. It unlocks limit orders, which is huge for trading, but it needs manual rebalancing, and without mature rebalancing tools it's much less efficient than Rhea's ALMM.
  • Make my own oracle, better than the one Rhea uses.

I chose the third one.

The perfect oracle

I needed an oracle that:

  • returns prices as fresh as possible,
  • is cheap enough to call, ideally on every single swap,
  • is fast enough that traders don't notice it.

Intear Oracle already existed: in late 2024, it was one of the winners of a NEAR hackathon, but nobody used it, since not many new apps were being built on NEAR, so it was shut down in mid-2026. The tech remained, though, and got better. NEAR's yield-resume lets a transaction pause for a moment, wait for someone (the oracle) to provide extra data, and resume. That's essentially how it works:

  1. Swap requestedYou send a swap to the Qoq pool. The transaction yields: it pauses and waits for a price.
  2. Oracle reads the marketIntear DEX Engine sees the request and gets fresh NEAR and USDC prices from CEXes.
  3. Price sentA gas key on the DEX account calls oracle_respond with the prices, with no hop between shards.
  4. Swap resumesThe pool centers its curve on the fresh price and fills the swap, about 1.8 s after the request.
A swap on a Qoq pool, from request to tokens.

But oracles have a problem on NEAR: the runtime is asynchronous, and each call usually takes 1 block to travel between shards, even when the oracle is on the same shard. To skip that block, the oracle's keys are added to the DEX account itself. A recent NEAR upgrade brought gas keys: keys that can be limited to calling one function, in this case oracle_respond, and topped up at any time. That makes them much easier to work with than old access keys, which have to be rotated every time they run out of their NEAR allowance. Another new feature is multiple parallel nonces, which let one oracle key submit several responses at the same time. That's very useful too. There are still about 3 blocks of latency because the indexer waits for finality, and 2 of them can easily be removed in the future if I want to, but 17 days into testing, nobody seems to have noticed the delay.

So I built an oracle system into Intear DEX Engine with all this tech and measured it: it costs around 0.00038 NEAR per call, which is now charged on every swap in this pool. Then I built the pool itself and called it Qoq. For no reason, I just wanted something that starts with Q, since it comes after P (Plach), so now they're alphabetical. I'm bad at names anyway. Since the oracle only responds for tokens I wire into it, creating Qoq pools is not permissionless.

Results

It was time to test it on real mainnet swaps. Right after deployment, it was already decent, much better than Plach pools for $100–$1,000 swaps. Then I built a dashboard just to compare it with other DEXes, and it turned out to be better than Rhea on almost 10% of mainnet swaps! I didn't expect it to be that good, but I guess we're competing now.

Live: which DEX gives the best NEAR-USDC price, by swap size and time. Open it full screen

I originally built a different dashboard, which also let me preview what that chart would look like if I added $5k of liquidity, cut 5 TGas, raised the concentration level, and so on. I played with that over the next 2 weeks, and now the pool:

  • sits at amplification 888, with $17k of liquidity,
  • uses less than half the gas it used to,
  • gives a dynamic trading fee discount to provide the best quote,
  • gets aggregated with Plach pools in the same transaction.

Now almost the entire chart is green: Intear DEX is winning NEAR-USDC across the board. The pool made over 30% APY over the last week, often reaching the top of the Intear DeFi Map.

Running total of $100 deposited 7 days ago · APY …

    Live from the Intear DeFi Map, without NEAR's own price change.

    As expected, since the oracle returns prices it found ~1.8 seconds after a swap was already requested, the oracle causes no arbitrage loss, so LPs are relatively safe, besides the oracle being fully centralized, and impermanent loss.

    An interesting finding is that this pool is more resistant to impermanent loss than traditional constant-product (not concentrated) pools. I still don't fully understand why, but my guess is that a traditional curve gets stale when the price moves and opens arbitrage opportunities, while an oracle-priced pool is rarely stale, because its curve is re-centered on CEX prices before every swap.

    Another finding is that there's not much benefit to having millions in this pool, so I'd say $50k TVL is the sweet spot. No liquidity in it is wasted, so a $17k pool can already route $6k+ trades with very little price impact.

    It was a fun and successful experiment, and the pool is now live on Intear DEX. If you understand the tech and the risks behind it, I invite you to add liquidity to it, because I need to pull mine out to add more pools: USDC-USDt (already on mainnet), maybe BTC, ETH, SOL and XAUT, and the planned SLMM pools.

    Building a trading app? Check out How to add token swaps to your app on NEAR.