Drake Exchange
Advanced Perpetuals Made Easy: Drake Exchange offers gas-free trading, delivering CEX-quality isolated and cross-margin trading with 100% on-chain transparency, simplifying funding rate investments.
Created on 22nd June 2024
•
Drake Exchange
Advanced Perpetuals Made Easy: Drake Exchange offers gas-free trading, delivering CEX-quality isolated and cross-margin trading with 100% on-chain transparency, simplifying funding rate investments.
The problem Drake Exchange solves
During the Buildathon, Drake introduced several features designed to make trading easy, accessible, and enjoyable for all levels of traders.
- Tokenized Funding Rate Vault
Conventionally, collecting funding rate payments while maintaining a delta-neutral position required extensive knowledge of perp dexes and constant position management. Drake has streamlined this process, enabling users to deposit USDC into the vault while the protocol handles all operations in the background.
Upon a user's deposit, the vault will partially swap their USDC for spot ETH, purchased from an AMM such as Aerodrome. Simultaneously, it will open a 1x short position. This keeps the position delta-neutral and collects payments from long positions.
The vault is designed to be active only under favorable conditions and will automatically close positions if the funding rate turns negative. When users want to leave the vault, they submit a withdrawal request and get back their initial USDC deposit plus any interest earned from funding rate payments. - Paper Trading Competition with Farcaster Frames Integration via Onchainkit
Infusing trading with fun and social elements can significantly enhance the user experience, especially for newer traders. On June 28th, Drake launched a paper trading competition with real USDC rewards. Users can now effortlessly share their PNL and trading statistics on Farcaster using a Frames integration. This integration also allows users to refer friends, earning a bonus to their final PNL. - Coinbase Smart Wallet & Paymaster
To ensure a seamless user experience, we have implemented Coinbase Smart Wallet and Paymaster. Paired with our ZeroDev integration, this makes signing in and creating wallets easier than ever. Both integrations also allow for sponsored gas fees, resulting in zero cost to the user and further simplifying their trading experience.
Challenges we ran into
Cross Margin Support
Cross margin mode is highly popular in perpetual trading, supporting advanced trading strategies and flexible collateral usage. However, implementing this feature presented significant challenges due to the complexity of account equity calculation and liquidation control.
Solution
To balance the risk model with on-chain efficiency, we experimented with various mathematical models and developed an innovative approach to implement this feature in our decentralized exchange (DEX). Additionally, we optimized the code architecture extensively to ensure that the gas costs remained manageable.
Risk Control
Risk control is crucial in a perpetual DEX due to the numerous uncertainties inherent in an on-chain environment, such as oracle price delays, network outages, malicious liquidity attacks, and price manipulation of illiquid tokens.
Solution
We integrated with Chainlink's low-latency oracle to block malicious arbitrage by using an on-chain settlement delay. We conducted extensive simulations and stress tests, including comprehensive unit tests, key component stateful random tests, and testnet stress tests. By simulating all conceivable scenarios, we ensured robustness and established emergency operation procedures to swift
User Feedback Loop
Gathering sufficient feedback from early users is vital for a new DEX. Initially, we collected feedback from close friends and are now looking to expand our user base through a Paper Trading Competition.
Solution
We launched a Paper Trading Competition where users can improve their rankings by trading more, referring friends, and providing valuable feedback. Users can easily share their performance and referral links through an implementation using Farcaster Frame, thus fostering a wider feedback loop and enhancing user engagement.
By addressing these challenges through innovative solutions and comprehensive testing, we aim to provide a robust and user-friendly trading platform.
Tracks Applied (4)
Coinbase Smart Wallet
Paymaster and Bundler
OnchainKit
Trading Track
TRADING with Aerodrome and Synthetix
Cheer Project
Cheering for a project means supporting a project you like with as little as 0.0025 ETH. Right now, you can Cheer using ETH on Arbitrum, Optimism and Base.