Skip to main content
RivrDEX is built on Gear smart contracts — WASM-based programs running on Vara Network. The architecture is inspired by Uniswap v2: a Factory that deploys pools, and self-contained Pair contracts that hold reserves and execute swaps directly.

Official contract addresses

The canonical program IDs for the current Vara Network mainnet deployment. This page is the single official source — bookmark it. Inspect any of them live in Gear IDEA — paste the program ID into the search on Vara Mainnet. For example, the Factory or the wVARA/wUSDT Pair.
Always verify contract addresses against this page before interacting. Do not trust addresses shared in community channels, social media, DMs, or unofficial sites.

Contract architecture

Factory

Deploys new pair contracts and maintains the registry of all trading pairs.

Pair

Each trading pair is its own contract: it holds the reserves, mints LP tokens, and executes swaps directly.

Wrapped tokens

wVARA and wUSDT are VFT (Vara Fungible Token) programs — the assets the pool trades.

Factory contract

The Factory is the root of the protocol. Its responsibilities:
  • Deploy a new Pair contract when a new trading pair is created
  • Maintain a registry mapping token pairs to their Pair contract addresses
  • Ensure each token pair has exactly one canonical pool
Anyone can call the Factory to create a new pair for any two tokens — no permission required. You can read the live registry yourself with the Factory’s Pairs query.

Pair contracts

Each trading pair (e.g., wVARA/wUSDT) is managed by its own isolated Pair contract. Each Pair:
  • Holds the reserves of both tokens
  • Is itself the LP token (a VFT service) — it mints and burns LP balances for liquidity providers
  • Executes the constant product formula and performs swaps directly — there is no separate router contract; swap, add-liquidity, and remove-liquidity messages go straight to the Pair
  • Collects swap fees into its reserves (LP share) and accrues the protocol share for treasury withdrawal
Because each pair is a separate contract, adding a new token to the ecosystem never affects existing pools. The RivrDEX web interface constructs and sends all these messages for you.

Custody and administration

User funds live in the Pair’s reserves and can only be withdrawn by redeeming LP tokens from the address that holds them — the team cannot spend or redirect your balance in normal operation. Like most production AMMs, the contracts do include a small set of admin functions (pause/resume and an emergency liquidity-migration mechanism) intended for incident recovery and protocol upgrades. These are held by the core team and their use would be visible on-chain.

Open-source

The contract source code is public: gear-foundation/vara-amm — the repository the current deployment is built from. You can audit the logic, verify behavior, and build against the same IDL files the app uses.

WASM, not EVM

Vara Network uses Gear’s actor model and compiles contracts to WebAssembly (WASM) — not Ethereum’s EVM bytecode. This means:
  • You cannot interact with RivrDEX contracts using MetaMask, ethers.js, or other EVM tooling
  • You need Vara-compatible tooling such as Gear.js with Sails, or the Polkadot.js API
  • The RivrDEX web interface handles all contract interactions for you — no manual tooling required for standard use
Building an integration or a bot? Use Gear.js/Sails with the IDL files from the source repository and the program IDs from the table above.