WOWswap
  • 👋Introduction
  • ❓FAQ
  • About
    • 🤓Functioning of WOW protocol
    • 📉Leveraged short-swap
    • 💸Lending (Earn)
    • 🚨Liquidation
    • 💹Portfolio Page
    • 💲Hourly Interest Rate
    • 💰Insurance Fund
    • 💱Fees
  • How-to-Guide
    • 📊Trading overview on WOWswap
    • 👍Opening a trade
    • 😮How to stake WOW in Governance
    • ⛓Depositing Assets to Polygon and Connect to WOWswap
    • 🤖Set Stop Loss and Take Profit Orders
    • 🔔Receive Notifications for Profits, Liquidations and High APY
    • 🩺Running WOWswap liquidation bot
    • 🕶️Trading on WOWswap Pro
  • Governance
    • 🏛WOW Governance Model
    • 😮WOW token & contracts
    • 🔵xWOW token
  • Useful Links
    • 📱WOW App
    • 🥞Buy WOW on Pancakeswap
    • 🐲Buy WOW on Quickswap
    • 🔥Buy WOW on Pangolin (Avalanche)
    • 🎭Buy WOW on Mimo (IoTeX)
    • 🍣Buy WOW on Sushi (Ethereum)
    • 🧙‍♂️Buy WOW on MDEX (HECO)
    • 🐥Twitter
    • 🦜Discord
    • 👨‍👨‍👧‍👦Telegram Community
    • 📃Whitepaper
    • 🔒Audit
  • For devs
    • WOW Architecture
    • Smart contracts
    • Trading ABI and Documentation
Powered by GitBook
On this page

Was this helpful?

  1. For devs

WOW Architecture

Previous🔵xWOW tokenNextSmart contracts

Last updated 2 years ago

Was this helpful?

The following diagram describes the high-level architecture and workflow of WOWswap protocol.

Reserve is a smart-contract for liquidity pools. Liquidity Providers (LP) can deposit liquidity to Reserve in lendable tokens (BNB or BUSD). Reserve contract has ERC20 token interface – LP receive these tokens according to their share of the pool.

Pair is a smart-contract responsible for opening, closing and liquidating trading positions. Pair contracts are created for each tradable/lendable token pair, for example, CAKE-BNB. Pair contracts temporary hold all tradable tokens bought by traders, and mint proxy-tokens, which are sent to traders instead of real tokens. Proxy-tokens are necessary to make sure that traders pay back their debts to the liquidity pools. Proxy-tokens are pegged 1:1 to real tokens held by Pair contracts on behalf of traders.

Factory is a smart-contract factory: it creates Reserve contracts for new liquidity pools and Position contracts for new tradable/lendable token pairs. For security reasons only Factory is authorized to call some methods, for example, borrow, which borrows liquidity from the Reserve smart-contract.

Router – is an entry point for users, who interact with WOWswap though this smart-contract. Router allows adding and withdrawing liquidity, as well as opening, closing, and liquidating trading positions. PancakeSwap Router and Uniswap Router are entry points of decentralized exchanges, where actual swaps of tradable tokens take place.

Chainlink Price Guard - WOWswap checks if the price on AMM does is not less than 102% of the Oracle’s price. If the price is lower or higher, transaction is not allowed.