Inspiration

one of the hot topics these days of cryptos is trading. you can see that people are using crypto as an investment tool for making more money, many exchanges are making a profit from the trading transaction(fee) and people are trying to figure out the future of the price for each pair of crypto and use this exchanges to buy and sell them. so many traders are analysing different crypto and make strategies to find the best price for buy and sell. other people who cant analyze the market, prefer to ask from the trader as a signal and make money. many centralized services are providing something which helps people and trader to contact each other and make trading automated and profitable. in these services, a trader can provide signals and other people can invest in his strategy of trading, which call this service Copy Trading. you simply let someone else develop the trading strategy for you by directly copying the exact same deals they make. but the big problem of these centralised services is that people have to pay a fee or pay a subscription fee or have to share amounts of their money with that service provider. so in this situation trader and investors have to pay money to the service provider .in this project, we want to use DAPP to solve this problem.

What it does

so this project is a DAPP based on Ethereum (Kovan for the test) which everybody such as traders can make an order on ETH/DAI pair, which means that the trader has to choose the target price for selling his Eth and other people can follow this person, whenever the price of that pair reach the target, smart contract sell all of the Eth of the trader and all investors who follow him before automatically.

Challenges we ran into

developing copy trader is not as easy as other DAPP because we have so many barriers to developing something which is real-time. as you know in copy trading our challenges are:

  • how get the price of each crypto in realtime? (thanks chainlink price feed)
  • how trigger a smart contract when the price has changed automatically? (thanks chainlink Keeper Network)
  • how to sell Eth in a smart contract?(thanks uniswap SDK)
  • How can guaranty that no one can disclose signal?(this requirement is so important) working with many different tools is quite difficult specially Keeper, because this tool introduced recently

How we built it

in the first step, I tried to be friendly with uniswap SDK to make a transaction on ETH/DAI pair after that our main problem had shown up. one of the main features of other centralised copy trading system is that no one except the service provider can't see the signals of other traders and I had to make this feature in a public smart contract which everybody could see all transaction and so on. so first I tried to using zero-knowledge (ZKSNARK) proof to make computation anonymously so I tried to using Zokrates tool to make it happen. after a while, I figured out that I can use just the hash function to hide the orders. after that my next problem was that how can I make a smart contract real-time price feed, which means that trigger every second with a fresh price feed. so I used chainlink feed price and chainlink keeper to have eth price and keep smart contract always fresh

Accomplishments that we're proud of

Getting most of what I wanted done

What's next for ZK Trader

Getting most of what I wanted done

Built With

  • chainlink
  • keepernetwork
  • pricefeed
  • semantic-ui
  • solidity
  • uniswap
  • vuejs
Share this project:

Updates