1

Is a decentralized exchange basically a smart contract that includes all the exchange functionality? Where is the engine?

1

There are a few layers to a dececentralized exchange (DEX) to be aware of.

The application layer is the front end interface that most users interact with. Examples of this include the Forkdelta front end and Paradex. On this layer, users can visually see orders in an orderbook and inspect the state of the exchange via graphs and other tools. Users can use this layer to trade and place orders. The actions and data on this page are (usually) all performed and read from the smart contract layer.

The smart contract layer refers to the smart contracts that run the exchanges. Examples of these contracts are the Forkdelta smart contract, or a Uniswap exchange contract. These smart contracts hold all of the state of the exchange (current and past orders and trades) and process all of the logic passed to it from the front end. When a user makes a trade on the front end, it will trigger this smart contract, that proceeds to perform calculations and checks required to execute the trade. When all of the processing is complete, the trade will have executed and the smart contract will upgrade, which will subsequently upgrade the front end.

The EVM is the underlaying layer that runs all smart contracts on Ethereum. All smart contracts are simply a wrapper over EVM executions. This layer is the most fundamental layer on Ethereum.

  • So there's no engine? this is all done by smart contracts. – NowsyMe Apr 13 at 19:14
  • Correct. All of the logic and trades are done on the smart contracts. – shane Apr 13 at 23:45
1

Yes, a decentralized Exchange performs all the functionality of a centralized exchange, using smart contracts. the smart contracts handle all the functionalities. these type of exchanges as more reliable as they follow the code and there is no human error (except if someone writes a contract with an error).

  • 1
    The last part is not true. There can always be human errors, even when writing smart contracts. – Paul Berg Apr 13 at 18:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.