Skip to Content
How It Works

How It Works

Glarex is a full Uniswap deployment with a routing layer on top. This page explains what happens between clicking Swap and the tokens landing in your wallet.

The stack

Glarex deploys and owns its entire exchange stack on Robinhood Chain:

  • Uniswap V3 core — the factory and pool contracts that hold liquidity
  • Uniswap V3 periphery — position management and quoting
  • GlarexRouter — the contract every swap goes through, which applies the commission and pays cashback

Hub-and-spoke liquidity

With many tokens, a fully connected market would need hundreds of pools, each with thin liquidity. Glarex uses a hub-and-spoke layout instead.

WETH is the primary hub. Most tokens have a pool paired against WETH rather than against each other. A second hub provides depth for stable-denominated pairs.

The result:

  • Liquidity concentrates in fewer, deeper pools instead of spreading thin
  • Any token can reach any other token in at most two hops
  • Adding a new token means adding one pool, not twenty

Routing

When you request a quote, the router looks for the best path between your input and output token:

  1. Direct — if a pool exists for the exact pair, it’s quoted first
  2. Via hub — otherwise the route goes input → WETH → output as two hops in a single transaction

You never execute the hops yourself. The router does both legs atomically: either the whole swap succeeds or the whole thing reverts and you keep your tokens.

Concentrated liquidity

Uniswap pools hold liquidity in price ranges rather than spread across the entire curve. Two consequences for traders:

  • Prices near the active range are tight, with less slippage than a constant-product pool of the same size
  • Large trades can push price out of the active range, where the next range may be thinner and the price impact steeper

The quote you see already accounts for this. If the price impact is large, it will show in the quoted output before you confirm.

Commission

Glarex charges a flat 10 basis points (0.1%) per swap, on top of the pool’s own fee tier.

That commission is what funds the GLRX cashback paid back to you on the same transaction. There is no separate protocol fee, no fee on withdrawals, and no fee on faucet claims.

Quoting and staleness

Robinhood Chain produces blocks about every 100ms. Prices move between the moment you’re quoted and the moment your transaction lands.

Glarex handles this with a stale quote guard: if the quote your transaction was built on is no longer current, the swap is not submitted. You re-quote instead of getting filled at a price you didn’t agree to.

Gas buffer

Every swap submission adds a 30% buffer over the estimated gas.

A swap that crosses a tick boundary touches more storage than one that doesn’t, and the estimator can’t know in advance which side of a boundary the trade will land on. Without the buffer, boundary-crossing swaps fail out of gas. Unused gas is refunded as normal, so the buffer costs you nothing when it isn’t needed.

Indexing

Trades are read from the chain by an indexer that writes to the leaderboard and points tables.

It processes blocks in chunks with a 100-block reorg buffer, so a reorganized block never leaves phantom activity in your history. At 100ms blocks this usually means your swap shows up within a few seconds of confirming.

The indexer is a reporting layer only. Your tokens and your cashback are settled on-chain by the router, whether the indexer is running or not.

Looking ahead: Uniswap V4 at mainnet

The testnet deployment runs on Uniswap V3. The mainnet deployment is planned on Uniswap V4, which changes the architecture underneath Glarex in three ways:

  • Singleton PoolManager — all pools live in one contract instead of one contract per pair, which makes multi-hop routes meaningfully cheaper in gas
  • Flash accounting — intermediate balances net out within a transaction rather than moving tokens at every hop, so hub routing costs closer to what a direct swap costs today
  • Hooks — pool logic becomes extensible, which is where cashback can move from the router into the pool itself

Nothing on this page changes for traders when that happens: same hub routing, same commission, same cashback. The mechanics behind it get cheaper. Details will be documented before mainnet.

Next

Cashback & GLRX — how the cashback amount is determined Points — what the indexer tracks and how points accrue Contracts & Addresses — every deployed address

Last updated on