How Guave Works: KyberSwap Routing + Flat Fees

Guave is a DEX aggregator on five EVM chains - Base, Arbitrum, Optimism, Ethereum and Polygon - with one unusual property: it charges a flat dollar fee instead of a percentage. Understanding how it works takes three pieces: routing, the fee layer, and the security model.

What a DEX aggregator does

No single liquidity pool has the best price for every trade. DEX aggregators query many pools - Uniswap v3, Aerodrome, Curve, Balancer and others - and split or route your trade across whichever path yields the most output tokens. The aggregator's job is price discovery and execution; it never holds your funds longer than a single transaction.

KyberSwap routing, OpenOcean fallback

Guave does not reinvent routing. Every quote and swap is powered by KyberSwap, one of the most established aggregator APIs in DeFi. When you type an amount on guave.trade, the frontend calls our Cloudflare Worker, which fetches the optimal route and calldata from KyberSwap and displays the expected output.

If KyberSwap is rate-limiting or a route goes stale between quote and build, the worker transparently falls back to OpenOcean - a second aggregator API that also charges zero protocol fee. Both routers are whitelisted on-chain, so the fallback changes nothing about what you sign: same GuaveRouter contract, same atomic swap, same flat fee.

The flat fee layer

The GuaveRouter contract enforces the fee on-chain, not in the UI. Fees are denominated in USD but paid in the chain's native token as msg.value with the swap transaction, across nine tiers:

Trade size (USD)Fee
Under $1,000$0.01
$1,000 - $10,000$0.99
$10,000 - $100,000$2.99
$100,000 - $1,000,000$9.99
$1,000,000 - $5,000,000$29.99
$5,000,000 - $10,000,000$99.99
$10,000,000 - $50,000,000$199.99
$50,000,000 - $100,000,000$499.99
Over $100,000,000$999.99

The frontend computes your trade's USD value from the live quote, selects the tier, converts it to ETH (or POL on Polygon) at the current price, and attaches it to the transaction. The contract verifies msg.value >= tierFees[tier] - so the fee cannot be skipped or inflated by either side.

Collected fees sit in a separate FeeCollector contract. An autoSweep function lets anyone trigger a payout to the operator once the balance exceeds a threshold - it can only ever send to the owner address, so it is safe to leave permissionless.

Approvals and Permit2

To swap, your token needs an allowance. Guave supports the standard ERC-20 approve flow plus Permit2 (0x000000000022D473030F116dDEE9F6B43aC78BA3) for gasless signature approvals where the wallet supports it. Approvals go to the GuaveRouter contract itself; the router then pulls exactly the swap amount via transferFrom and forwards it to the aggregator router for execution.

Security model

What Guave is not

Guave has no token, no points program, and no custody of user funds. It is a thin, auditable fee layer over the best routing available on five chains - nothing more.

The transaction lifecycle, step by step

Concretely, one swap works like this:

If any step fails the entire transaction reverts - there is no partial state where your tokens are stuck in the contract. That is the advantage of doing everything in a single atomic call.

Make a swap