DEX Contract Code

The contract code has been written in C++ and available by the link https://github.com/AgoraDex/ultra-dex-contract and has been audited successfully : the certificate is downloadable here.

The DEX contract inherits and extends the eosio.token contract structure with backward compatibility.

There are list of actions which is represents DEX interface:

create.pair - creates a token pair and defines initial (minimal) liquidity amounts for both pools. There is no possibility to create a duplicate token pair. This method might be called only with the DEX contract and creator signatures.

remove.pair - delete a token pair and remove initial liquidity. This method might be called only with the DEX contract and last liquidity owner. The remove is available only if all liquidity is owned by the one account.

addliquidity - add liquidity to the specified token's pair. As a result of this method, LP tokens of the given pair are transferred to the user's wallet. The number of tokens is proportional to the volume of liquidity added relative to what was already in the pools.

remliquidity - withdraw previously added liquidity. LP tokens should be transferred upfront to withdraw corresponding liquidity amount.

swap - do the tokens exchange.

Last updated