BI 001 Perpetual Trading with AA
Problem Statement
- The goal of this idea is to give a CEX like trading experience, using Account Abstraction, in an onchain dApp.
- Many Perps & Options projects are already using AA in some way or another to simplify the UX
- dydx gives gasless onboarding, Polynomial is giving users smart contract wallets, but no one is using the 4337 stack yet.
- With ERC4337, you can give a gasless, one click experience, to truly allow non-web3 native traders to use decentralized alternatives to Binance & crew.
Potential solution
- Create a Trading Account for users that’s a Smart Contract Wallet, allowing you to plug in custom modules within the wallet wherever required
- example would be to have a module in the contract wallet itself that allows the user to use funds there as collateral against leverage.
- Session keys can be used to avoid requiring signatures in a session where time is of the essence. You can give a gasless experience in dApp, or allow users to pay gas in stablecoins.
- Multiple transactions can be batched, removing needs for approvals & multiple clicks, and save on some gas in the process.
Challenges you may have to overcome
- Building a perpetual trading platform involves dealing with complex technical aspects such as smart contract development, blockchain integration, order book management, and real-time trading engine implementation.
- Building mechanisms to incentivize liquidity providers, integrating with external liquidity sources, and implementing efficient market-making strategies are essential components.
- Managing risks associated with perpetual trading, such as price volatility and liquidation events, requires implementing robust risk management mechanisms.
Business model
The business model for this idea would involve a fee-based model, where you make money off the fees on each trade, with separate Maker & Taker fees.
Market Opportunity
Trading is a massive market - dydx did $790m of trades in the last 24 hours, because it’s able to deliver Account Abstraction using Starware, and has simplified onboarding from Ethereum, making it the market leader amongst decentralized perpetuals platform. GMX is 2nd, with a daily trading volume of ~$500m
- Building a perps platform on an EVM chain with AA will allow the project to capture the market on that chain by delivering a superior UX
- Developer’s guide to Account Abstraction
- Dydx business model
FAQs
Polygon zkEVM is the leading zero knowledge scaling solution that’s equivalent with the Ethereum Virtual Machine, this means that most of the existing smart contracts, developer tools, and wallets work seamlessly.
Polygon zkEVM harnesses the power of ZK proofs to reduce transaction cost and increase throughput, all while inheriting the security of Ethereum L1.
1- Ethereum-equivalence: Most Ethereum smart contracts, wallets, tools, etc. work on Polygon zkEVM seamlessly.
2- Inherits Ethereum security
3- Lower cost compared to L1 and better finality than other L2 solutions like Optimistic Rollups
4- ZKP-powered scalability, and aiming at similar throughput to PoS
Many people in crypto believed that a zkEVM was years away, and might never be practical or competitive with other ZK L2s. This was framed as an unavoidable tradeoff: we could have either full EVM equivalence or high performance, but not both. However, with the proving system breakthroughs pioneered by Polygon Labs, we belieive we can achieve full EVM equivalence while offering better performance (higher throughput, lower latency, and lower cost) than alt-L1s, optimistic rollups and other ZK rollups.
EVM-equivalent: Ethereum isn’t just a blockchain. It’s a rich ecosystem of smart contracts, developer tools, infrastructure, and wallets. It’s a vibrant community of developers, auditors, and users. The best way to scale Ethereum is to strive to maintain equivalence with this ecosystem, and the Polygon zkEVM will give users and developers an almost identical experience to Ethereum L1 -- just with a significant scalability improvement.
The ultimate goal is not compatibility. The ultimate goal is equivalence. Solutions that are compatible enable most of existing apps to work, but sometimes with code changes. Additionally, compatibility may lead to the breaking of developer tooling. Polygon zkEVM strives for EVM Equivalence, because it means that most applications, tools and infrastructure built on Ethereum can immediately port over to Polygon zkEVM with limited to no changes needed. Things are designed to work 100% on day one. This is important, because ideally:
1. Development teams don't have to make changes to their code, which could introduce a security vulnerability
2. Since no code changes are needed, you dont need additional audits, which saves teams money
3. The experience for a developer is much better. Since he/she is not rewriting the application, valuable time is saved.
4. The solution ultimately benefits from the security and decentralization of Ethereum, since transactions are still finalising on Ethereum
5. Allows Polygon zkEVM to benefit from the already vibrant and active Ethereum community
6. Allows for significant and quick dApp adoption, since apps built on Ethereum today are designed to be compatible.
SELFDESTRUCT: removed by SENDALL
EXTCODEHASH: returns hash contract bytecode from Polygon zkEVM state tree (do not check if the account is empty)
DIFFICULTY: returns 0
BLOCKCHASH: returns all previous block hashes (not just the last 256 blocks)
BLOCKCHASH is the state root at the end of a processable transaction and it is stored on the system smart contract
NUMBER: number of processable transactions
zkEVM supports all opcodes but SHA256, BLAKE and PAIRINGS.
ecRecover and identity are presently supported. Others return a revert.
At the moment, the answer is No. Aspirationally, the goal in the future is to build one of many chains that allow for users' assets to move from layer 2 (L2) to layer 2. With that being said, users will not be able to utilize this functionality at launch, but L2 to L2 movement is something road mapped for the future.