# WOW Architecture

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

![](https://3431135529-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MYhYcw9WN6xTQqOD_-A%2F-MafW0UJQipPiiI0yfeE%2F-MafXt3dKnDZkfrViEOx%2Fimage.png?alt=media\&token=8fbd3ea7-6b9a-4a3f-9b03-3c992f86e9fe)

**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.&#x20;

**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.&#x20;

**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 Route**r 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.&#x20;
