Skip to content

Qoq

Qoq is an AMM (automated market maker) that runs inside Intear DEX. Its pools hold two assets each and trade them on a StableSwap curve around a price. The price is either fixed, for assets worth the same like two dollar stablecoins, or the median of the prices that an oracle reads from several exchanges. While a pool is balanced, it trades close to that price, so large swaps move the price little.

Qoq is a DEX on the engine, so there’s no Qoq contract to call. Every call goes to the engine, dex.intear.near, with Qoq’s DEX ID:

slimedragon.near/amp
  • Swaps use the engine’s swap_simple or operations, with Qoq routes in message. A swap through a pool that an oracle prices starts with an oracle request.
  • Everything else, like adding liquidity, is a dex_call, and reads are dex_view.
  • Arguments and results are Borsh, in base64. Types has the layout of each.

The examples use near CLI, like the Intear DEX docs.

Each pool has an ID, counted from 0 in the order pools were created. Pool 0 is NEAR/USDC, priced by an oracle, and pool 1 is USDt/USDC, at a fixed price of 1. Pools can hold NEAR, NEP-141 and NEP-245 assets.

Only Qoq’s owner, slimedragon.near, creates pools, and it can change a pool’s amplification, fee and oracle. Anyone can add liquidity to any pool and get shares of it. See Pools.

Each pool has one fee, out of the input of every swap. Qoq takes 20% of it as its protocol fee, and the rest goes to the pool’s liquidity providers, in the asset each one chooses. Swaps on a pool that an oracle prices also pay the oracle’s fee, for each request. Apps charge their own fee on the swaps they bring with Intear DEX’s referral fees.

Swap

Through one pool, a chain of pools, or split across several routes, in one swap.

Quote

Simulate swaps on pools that an oracle prices, with the prices you pass.

Provide liquidity

Add both assets of a pool and earn its fees, in either asset.

Earn referral fees

Charge up to 5% on the swaps your app sends, with Intear DEX’s referral fees.