Mariia Charikova [email protected]
Igor Krasheninnikov [email protected]
Roman Solovev [email protected]
API is a Web3 Python app, which will be a proxy between user and DEX smart contracts. User will call functions within this app and the app will send the orders and ethereum to DEX.
OrderBook is a smart contract which stores current DOM (Depth of Market) and when new order arrives (sell/buy) it will send the associated ethereum and tokens to DEX Wallet, then it will call the Matching engine smart contract to check if new order applies to perform a buy/sell operation.
Matching engine is a smart contract which recieves a OrderBook state and tries to match current buy/sell bids and if it succeedes, it will send a task to DEX wallet to send ethereum/tokens to associated users and a task for OrderBook to delete matched entries.
DEX Wallet is a smart contract which stores the etherium/tokens of current bids and sends them to users, when Matching engine finds a match.
An ERC20 token contract, that would be thadable for ETH on our DEX
- Install Ganache app for local network, install flask, web3 python packakges
- Add some accounts from Ganache to
accounts.json
(example provided) - Add service account (to deploy Wallet and OrderBook contracts) to
service_account
(also from Ganache) - Launch
python3 deploy_contracts.py
to deploy Wallet, OrderBook and sample token contracts, their addresses will be stored indatabase.json
- Launch the web interface:
python3 -m flask run
in the repository root directory - Go to 127.0.0.1:5000, there will be a starting page with account selection: