🏠Standalone DEX

This all-in-one contract, managed by admin. Each deployed DEX is stored inside the current contract and has its own FA2 token. Access to a specific DEX, implemented by pool ID. This ID is an also LP token ID. Every token metadata is managed by any of the manager's addresses.

Storage

Contract storage has a complicated structure all info about storage is collected on the page below.

📄Storage and types overview

Core methods

Main methods of DEX, that are able to use by anyone. These methods include investing, swapping, and divesting. Also, there are additional methods for staking QUIPU tokens for earning additional rewards and claiming referral rewards.

🔵DEX methods

Developer-only methods

The developer section contains Developer module entrypoints and additional methods for claiming developer rewards.

These entrypoints should be called only by developer address.

🛠️Developer methods

Admin methods

These entrypoints should be called only by admin address.

The next section is about entrypoints for managing fees, "A" constant change, editing manager list, and changing an admin address.

🛑Admin methods

Initial setup of contract

These methods should be used before global usage of contract. Entrypoints set lambda-functions to its corresponding indexes inside related big maps.

🟡Initialization

Create a new DEX pool

Creating a new DEX pool in the standalone variant is an admin function. So only the admin can create a new pool. Admin should approve the needed amount of tokens before calling this method because call includes transfer selected tokens to contract.

🟠Add new dex

Examples hint

All examples use LP token with decimals of 1818precision constant as 101810^{18} and 3 "abstract" tokens TBC, TXZ, TEH that have ratios 4:2:14:2:1 respectively.

Last updated