Inspiration
It seems like every week there's some new story about how the people behind a centralized cryptocurrency exchange have absconded with funds, been hacked, or mismanaged the money in some other way. There's no reason to think that these cases will become any less frequent going forward, either. It is becoming more obvious than ever that a decentralized trading platform is both possible and desirable where—rather than trusting a company to hold your funds and execute trades on your behalf, users can retain control of their own private keys. We can even do it so as to minimize fees and remove centralized points of potential failure. Furthermore, we want our platform to be owned by its users: the platform should operate in a manner that is aligned with its users' interests. The most important feature of this system is that we make it trustless: no one can act maliciously without being revealed or otherwise punished for it.
But despite the advantages of DEXes over centralization—namely that they're open source, transparent and trustless—there are still some pain points that prevent them from gaining mass adoption. They currently lack UI/UX niceties that make navigating centralized exchanges like Coinbase or Gemini feel effortless, and they have limited functionality; most decentralized exchanges only offer basic market orders instead of advanced options like limit orders, stop-loss, leverage trading and much more, that are essential for traders.
Using Zexe, traders can exchange assets via smart contracts instead of central exchanges and other intermediaries—a revolutionary approach to a $15 trillion industry.
What it does
zexe is a decentralized platform where traders can access spot trading, futures, perpetual contracts and options all under one roof. We've developed three key features that all work seamlessly together. They are:
- Off-chain orderbook
Zexe uses off-chain order books to minimize gas costs and other transaction fees. Traders create their orders by sending them to the network, and those orders are then stored in an off-chain order book. Once the order is matched with another trader, it's executed on-chain between the two counterparties. This allows traders to make their trades quickly and efficiently, while keeping their funds secure from potential hackers and other malicious actors.
- Limit and Market Orders
zexe offers both limit and market orders—the former will let you set the exact price you want to pay or receive, while the latter will fill your order as quickly as possible at whatever price is available immediately. The stop loss feature lets you set a minimum/maximum price for your position, so if it goes below that minimum or above that maximum, you'll automatically sell your position and take a loss instead of letting it continue to go downhill
Users can also update and cancel their order along with setting and expiration time.
- Deposit/Withdraw
Traders can deposit/withdraw their tokens to the Vault. It enables users to earn trading rewards as well as making the system more gas efficient.
- Leverage Trading
On zexe, you can trade tokens by pledging your collateral assets as margin or collateral to leverage your trades. With upto 10x leverage on margin and futures trades, you can make your trades more aggressive than ever before. Perpetuals trading gives users the ability to buy or sell an asset at a specified price for a specified amount of time. It also allows them to hedge against unexpected price changes if they're holding an asset they want to sell in a few months' time or if they want guaranteed access to cash in the short term while still making money if prices rise.
How we built it
The zexe platform itself is made up of three layers: an off-chain order book, an on-chain settlement layer, and an on-chain management layer that manages the governance of its contract. The overall system consists of smart contracts which are deployed on Aurora Testnet, backend for indexing, and frontend to intereact with the app.
Contracts
Solidity, Jest, Hardhat
Vault.sol: Users can Deposit/Withdraw tokens. Using a vault is more gas efficient than transferring tokens from their wallet
Exchange.sol: Users can create, update and execute orders from this contract

Backend
Ethers, Express, MongoDB
Frontend
TypeScript, React, NextJS, ChakraUI, Ethers
Challenges we ran into
Indexing historical data from blockchain, and building analytics (24h_volume, 24h_change, historical price changes)
Accomplishments that we're proud of
Our team was able to complete the development of the application within the hackathon period with our solid code base and scalable architecture
What's next for zexe
Perpetual trading
Launch on Testnet by EOY
Mainnet launch by Q1 23
Built With
- ethers
- react
- solidity
- typescript



Log in or sign up for Devpost to join the conversation.