Latest updates from DefiPlaza
DefiPlaza and Astrolescent Team Up to bring next-level DeFi solutions to Radix
February 23, 2023
We are thrilled to announce that DefiPlaza has established a strategic partnership with Astrolescent, a fellow build00r of cutting-edge DeFi products on Radix! 🤝 Our partnership will involve...
DefiPlaza Launches Radix-Ethereum Bridge
January 5, 2023
With the deployment of the DFP2 token to Radix, we launched the first-ever community-owned Ethereum → Radix bridge, allowing you to move your tokens from the Ethereum chain to the Radix...
DefiPlaza Launches cDEX on Radix
January 4, 2023
During the last few months of 2022, we have worked diligently to lay the foundation for DefiPlaza to branch out to the Radix chain. We are very enthusiastic about the potential of the Radix public...
The StablePlaza pool is now live on DefiPlaza!
July 14, 2022
With a lot of pride, we present the new StablePlaza pool on DefiPlaza! DefiPlaza now has two multi-token pools that are optimized to give the lowest trade cost and the highest capital efficiency...
White Paper StablePlaza released
July 12, 2022
As part of the launch of the upcoming StablePlaza pool, a white paper was created to explain the core principles in more detail. The StablePlaza pool will launch this Thursday, July...
DefiPlaza listed as exchange on CoinGecko
June 27, 2022
8 months after Coingecko was the first to list DFP2, CoinGecko now added us as an official listed Exchange! With help from CoinGecko, we created a set of custom API endpoints, to make it possible...
New Liquidity Dashboard
May 5, 2022
Upon launch most DEXes ship with a dashboard where you can get some more insight into the liquidity you provided. Ours did not, however, as we wanted to get DefiPlaza out and in your hands as quickly...
Launched WalletConnect support
April 19, 2022
Today, DefiPlaza released the much-requested support for WalletConnect! When DefiPlaza launched, its User Interface (UI – i.e. the actual website for the app) was built directly on top of...
DeFi Download DFP2 burn
April 3, 2022
To celebrate the release of the DeFi Download podcast featuring DefiPlaza (go listen to it if you haven’t yet!) the team has allocated another 0.5 ETH from the arbitrage bot to buy back DFP2...
Latest blog posts
-
Our Plans for Babylon
Jazzer - January 4, 2023
It won’t be surprising to most that we have long thought about expanding to the up-and-coming Radix L1 chain. The move to become a multi-chain platform is not to be taken lightly, but in reality, we have planned for this since we went live with our DEX on Ethereum. And with the community unanimously voting in favor of this expansion, the time has come to unveil our plans for our Radix DEX! Building a Decentralized Exchange on Radix We are committed to deploying a decentralized exchange on the Radix public network as soon as the Babylon upgrade (which allows the implementation of smart contracts) goes live. The Radix team has announced Babylon is on track for a release in Q2 2023. That gives us a few months to design, build and test top-notch DEX infrastructure. Designing a DEX on Radix is a bit like building a flying car. The Radix Engine allows developers to think outside the box and easily build complex smart contracts that are inherently safe from many vulnerabilities that Ethereum suffers from, such as access control mishaps and reentrancy challenges. Moreover, the transaction cost is expected to play a much smaller role on Radix than it does currently on Ethereum. On Ethereum, the DefiPlaza USP is pretty clear: we are the most efficient DEX on the entire network. On Radix, everyone starts from scratch, and we don’t have many details about the exact fee model yet. It should be cheap for everyone forever is the commitment by RDX Works, but I’m sure that’s what they also thought when they deployed Ethereum.. 🙂 Sustainable DeFi On Radix, the design focus for DefiPlaza will be on sustainable DeFi. That is to say, DefiPlaza aims to provide the service of swapping tokens in a way that can be sustained over the long term by the income it generates. There is much the industry needs to improve in this regard. A recent analysis of the current market leader UniswapV3 has shown performance regarding LP gains is abysmal. For just the WETH/USDC pool alone, the combined losses by LPs have totaled 115M$ to date (end of 2022) as compared to them just holding the same WETH/USDC tokens. Yes, that’s after including LP income from fees! Total net LP losses in UniswapV3 WETH/USDC pool Even more recently, another study showed that the situation for WETH/WBTC is much more hopeful. Roughly 80% of LPs made a profit compared to just holding the same WETH & WBTC as long as they would provide liquidity for at least 6 months. The much better performance here is due to the price movement over time between ETH and BTC having positively correlated historically, which was one of the motivators for DefiPlaza to use a multi-token pool on Ethereum in the first place. Key Features For the design of DefiPlaza on Radix, we will use the insights from our exchange on Ethereum, combined with the insights from the recent studies on LP provision in general. Without going into specifics, we’ll be building on the shoulders of giants, borrowing concepts from Bancor, Dodo, and Curve combined with some new ideas of our own. The below represents an overview of features we are working to include in the exchange. Still, as development is an ongoing process, there may be changes between now and the final Babylon deployment. Multi-Token Trading In our Ethereum DEX, we have 16 tokens listed, which means you can trade between 120 unique token pairs without requiring hops from pool to pool as you would need on Uniswap, where liquidity is held in pairs. The DefiPlaza DEX offers direct trading between 124 pairs on Ethereum. The Radix Babylon exchange will offer even more direct trading pairs. On Radix, DefiPlaza will preserve the ability for users to swap between any two tokens and only pay trading fees once. Adding tokens to DefiPlaza may be done trustlessly by any user once the smart contract implementation is deployed. Users may swap between all the popular Radix tokens directly, paying the same single transaction fee. Single-Sided Liquidity On our Ethereum DEX, you can already supply and withdraw liquidity single-sided. Effectively you trade against LP tokens when you add/withdraw liquidity. However, while providing liquidity, you own the LP token, which represents a basket of tokens and thus is exposed to price movement for all tokens in that basket. For DefiPlaza on Radix, we’ll isolate the liquidity token by token. Internally, each token will be paired against DFP2. Thus, the liquidity providers will only be exposed to the price movements of the token provided and the price movement of DFP2. This means that DFP2 gains utility as it is used as the internal grease that keeps the exchange running. Demand for DFP2 will be directly coupled with the success of the exchange. Concentrated Liquidity Achieving high capital efficiency is the key to running an efficient exchange. The UniswapV2 algorithm was sustainably profitable originally but couldn’t compete against the high volumes drawn to UniswapV3 and others offering concentrated liquidity. However, getting the degree of liquidity concentration correct is very difficult, as discussed above with the LP performance for the UniswapV3 WETH/USDC pool. Concentrated liquidity, as popularized by Uniswap V3 Concentrated liquidity improves capital efficiency but equally increases the risk of Impermanent Loss. DefiPlaza on Radix will automate liquidity concentration and apply it to the degree deemed optimal based on available data and market conditions. Dynamic Fees The question of what fee to charge to swapping customers is critical to ensuring long-term sustainability. Set it too low, and fees may not outweigh Impermanent Loss. LP income consists of fee times volume. Maximizing this product means using a low fee when the markets are tranquil and a high fee when there is significant volatility. This is exactly what the DefiPlaza smart contracts will implement. Token Launch Platform Finally, a key feature of the Radix DEX will be an integrated token launch platform. This will allow third-party projects to raise funds by launching a new token through an auction mechanism. Successful completion of the auction will result in an immediate listing of the token on DefiPlaza.As mentioned above, under-the-hood listings are represented as pairs with DFP2. This means that a certain amount of DFP2 needs to be supplied when a token is listed to facilitate bidirectional trading. Experiment & Validate The above summarizes what we plan to implement once the Babylon upgrade becomes available. In the interim, we want to use the time for development, testing, and data gathering. Thus, the DefiPlaza team will deploy a centralized version of the DEX prior to launching the real deal! -
Introducing DFP2 on Radix
Jazzer - October 28, 2022
DefiPlaza is an Ethereum Decentralized Exchange that launched in 2021 to make DeFi affordable again. Since then, we’ve proven our technology and demonstrated consistently to be able to provide the lowest gas cost transactions on our two exchanges: DefiPlaza & StablePlaza. DefiPlaze is a multi-token exchange for 16 of the most-traded tokens on Ethereum and StablePlaza with a special form of concentrated liquidity specifically designed for stable tokens. As Jazzer (our founder) is a long-term Radix community member, the DefiPlaza community contains many Radix fans. With the completion of our staking program in October 2022 and the rapidly maturing Radix ecosystem, we found the time is right to introduce our DFP2 governance token on the Radix platform. The DFP2 Token Bridge The DFP2 token was largely distributed to the community through rewards for providing liquidity on the DefiPlaza exchange. That reward program has finished, which means that all 67,941,915 tokens that will ever exist are now in circulation (minus 251,412 tokens that were burnt by the team in several burn events). The circulating tokens represent voting and staking rights on DefiPlaza community governance proposals. The concept of the Ethereum → Radix bridge is that the community can move their tokens to Radix if they want to. This process doesn’t increase the circulating supply, as for every token released on Radix, one token is locked on Ethereum. DFP2 tokens and their associated governance voting power can now be transferred from Ethereum to Radix. Moving tokens from Ethereum to Radix is as easy as going to the bridge website, stating how many tokens you want to bridge and what Radix address. Then you’ll need to approve the bridge contract and execute the transaction on the Ethereum network. Once the transaction is completed, you’ll see the DFP2 tokens appear in your wallet on the Radix network within 24 hours (due to a manual check). The reverse path, moving DFP2 from Radix to Ethereum, is already technically possible but not yet integrated into the UI. This part will be implemented shortly to allow arbitrage both ways and ensure the Radix and Ethereum tokens truly reflect the same asset. Voting with DFP2 on Radix The DFP2 token is the governance token for the DefiPlaza project and, as such, holds voting power. On the Ethereum network, gasless voting is implemented through the snapshot.org service. DefiPlaza now has to count voting power on the Radix and the Ethereum networks with the bridge live. Presently, the Snapshot service doesn’t support the Radix network. Radix tokens can be counted, even though the network isn’t supported yet, by linking a Radix wallet to an Ethereum wallet which is then granted voting power equal to the number of tokens the Radix wallet holds at the time a governance vote is created. Linking a Radix wallet to an Ethereum wallet for governance voting Linking a Radix wallet to an Ethereum wallet can be done through the UI on the DefiPlaza website. The website connects with the Z3us wallet, which is used to prove ownership of the Radix wallet. Trading DFP2 on Radix It is our vision that DFP2 should be widely available to users and traded freely in as many places as possible. That’s why we’re working with the teams at DogeCubeX, OciSwap, and CaviarSwap to have trading pools available for DFP2 almost immediately after the launch of the bridge. These services offer centralized automated market makers and will become DEXes on Radix through the deployment of smart contracts when Radix Babylon is released to support smart contracts. We’re working with our friends at Radix to offer trading pools for DFP2 We believe there is plenty of space for multiple DEXes on Radix, especially if they aren’t mere clones of one another and offer different functionalities. The DefiPlaza team looks forward to the release of Babylon and aims to deploy a distinguishing DEX on Radix. How the Bridge Works There are three parts to the bridge implementation: the Ethereum smart contract, the Radix wallet, and the bridge UI. Users can call the bridge function on the smart contract via the UI on the website. When a bridge transaction is executed, the bridge contract pulls in the correct amount of DFP2 tokens and emits an event that is monitored by the team. Software was written that picks up on these events and automatically creates transactions that send the corresponding amount of Radix DFP2 tokens to the requested Radix address. There is a manual verification step for safety. The entire supply of DFP2 has already been emitted, and no more can be minted in the future. The total supply is 67,941,915 tokens. The same amount of DFP2 tokens were minted as a fixed supply token on Radix, held by the bridge wallet. Whenever someone bridges (i.e., locks) tokens on Ethereum, the corresponding amount of tokens is released from the bridge wallet on Radix. Note that the bridge contract and the Radix wallet are managed by the DefiPlaza team, i.e., the bridge implementation is currently not trustless as this isn’t technically possible yet without smart contracts on the Radix public network. -
The fee structure of the StablePlaza pool
Timan Rebel - July 9, 2022
If you like to learn more about the StablePlaza pool, we have a great Introduction to the StablePlaza pool. As a follow-up, we’ve written about the four stablecoins of the StablePlaza pool. The next part in our StablePlaza series dives deeper into the fee structure of the upcoming StablePlaza pool and how you could earn a part of those fees. This is not financial advice, but an objective explanation of the fee structure of StablePlaza. Swapping tokens To swap stablecoins on StablePlaza the user has to pay a fee. This fee is one part the network fee to execute transactions on the Ethereum network and is paid to the miners, and the other part is a transaction fee that StablePlaza charges for the use of the pool. Our goal with DefiPlaza, and thus with the new StablePlaza pool, is to offer a highly competitive trade cost to the end-user. Thanks to our greatly optimized smart contract, we are able to significantly lower the network fee a user has to pay when executing a transaction. Next to the network fee, we charge a transaction fee of only 0.03% of the value traded. If you would swap 10,000 USDC for BUSD, the transaction fee would only be $3. Providing Liquidity The StablePlaza pool can only operate if enough liquidity is provided to make swapping tokens possible. In return for providing liquidity, these liquidity providers receive a cut of the transaction fee as a reward. Two-thirds of the transaction fees are rewarded to the liquidity providers and one-third to the DFP2 holders who stake their DFP2 on the StablePlaza pool. Let us explain how that works with an example. If the TVL (total value locked) of the StablePlaza pool would be 1,000,000 USD, roughly 1,000,000 XSP was minted and given to the accounts that provided this liquidity. At this point, 1 XSP is 1 USD. After a while, a total of 100,000,000 USD is traded via the StablePlaza pool. With each swap, 0.03% of the input token is added to the liquidity pool, and 99.97% is converted into the output token. And one-third of the transaction fee is added to the total of unclaimed rewards for the staked DFP2. (More on that later). So, after 100 million USD of trade volume, 30,000 USD is added to the liquidity pool, increasing the TVL to 1,030,000 USD. To calculate the new price of XSP we have to take into account the staking rewards. The calculation would be: TVL / (total XSP including staking rewards) = 1,030,000 / (1,000,000 + 10,000) = 1.02 USD Which is a 2% reward with almost no risk of impermanent loss! Staking DFP2 Competing DeFi protocols regularly work with an ‘admin fee’ for each trade. In DefiPlaza, there is no admin fee, but some of the fees will be shared directly with the community. Anyone who wants to can stake their DFP2 governance tokens in return for a part of the generated StablePlaza fees, which makes this the first utility added to DFP2. It won’t be the last! As an extra feature holders can voluntarily lock their DFP2 for a period of up to 180 days to increase their cut of the fees. Without locking the cut is 1x for each DFP2, with voluntary locking that cut can go up to 3x. With the voluntary locking, DFP2 holders are rewarded for removing their liquidity from the market for a certain amount of time, decreasing the price volatility of DFP2 in the process. At any given time, with or without locking the DFP2, holders can claim their rewards. Rewards are minted in XSP, the liquidity token of the StablePlaza pool, and can be converted into any of the four stablecoins in the StablePlaza pool. Let us explain that with an extension of the example above. Of the generated 30,000 USD in fees, one-third is reserved for the staked DFP2. Say 100,000 DFP2 is staked by DFP2 holders. The 10,000 USD of generated fees will be divided over the 100k DFP2. If you staked 10,000 DFP2, you would receive 10% of those fees, which is 1,000 USD. That is if nobody locked their DFP2. The calculation becomes a bit more complex with the locking. Say one holder added 10,000 DFP2, which would be 10% of the total staked DFP2, and locked their DFP2 for the full 180 days, receiving the 200% bonus. If nobody else locked their DFP2, this holder would receive (DFP2 + bonus) / (total DFP2 + bonus) = (10,000 + 20,000) / (100,000 + 20,000) = 25% of the generated fees, which is 2,500 USD. What’s next? The upcoming WhitePaper will do a tech deep dive into the inner workings of the new StablePlaza pool, explaining in more detail the fee structure and how we anchor liquidity around 1 USD. It also reveals some unannounced features of the StablePlaza pool. The WhitePaper will go live on Monday, July 11, with the StablePlaza following closely on Thursday, July 14. LFG -
The 4 stable tokens in the StablePlaza pool
Timan Rebel - July 1, 2022
Curious to learn what the new StablePlaza pool is? Read our introduction to the upcoming StablePlaza pool. Because of the turbulence in the stable token market in the past few months, we had to think twice, even thrice about which tokens to include in our multi-token pool. The initial community proposal included UST and we are for sure happy we didn’t launch with that. The depegging of UST opened everyone’s eyes about the potential dangers of unstable stable tokens. That is the main reason we chose to only go with fully collateralized stables and not to include any form of algorithmic stable tokens for now. However, things might evolve over time, so we included a similar mechanism as we already have on the DefiPlaza pool to swap out tokens and swap in alternatives. For the upcoming StablePlaza pool, we selected USDC, USDT, DAI, and BUSD. The first three were a given, and BUSD was selected by our community after a governance proposal was created to choose between FRAX, MIM, and BUSD. But first, we’d like to explain why having stable stablecoins are so important and what happens when a stable token depegs. What happens at a depeg? Even in stable tokens, there is a certain price activity. The price is almost never perfectly in sync with 1 USD. There is a certain margin in which the price of each stable token fluctuates. The mechanism of arbitrage will synchronize the price between markets and the StablePlaza pool ends up with a bit less or a bit more of one token than the others. Arbitrage is an investment strategy in which an investor simultaneously buys and sells an asset in different markets to take advantage of a price difference and generate a profit.HBS These arbitrage transactions generate fees for the liquidity providers, while at the same time the arbitrageurs keep the pool perfectly balanced and earn a profit. When the price difference becomes bigger, the difference in the number of tokens in the pool will also enlarge. Especially when a stable token depegs, we could end up with only the depegged stable token in our pool, since arbitrageurs made a profit by buying all other stablecoins in the pool. Pegging is the practice of fixing the exchange rate of a currency to the value of another currency.A depeg is losing that peg to the value of the other currency. When the stable token restores its peg, arbitrageurs will see a new opportunity and will start buying the recovered token, supplying the depleted tokens in the process, to make a profit again. As long as stable tokens restore their peg we end up with a balanced StablePlaza pool again and an increase in the generated fees. That is why we selected the stablest stable tokens. A short-term depeg is fine, as long as the token recovers. Why USDC USD Coin ($USDC) is a fiat-collateralized stablecoin, which means it is backed by real assets. USDC is backed by cash and short-term U.S. government bonds. USDC is considered one of the safer stable tokens due to its transparency. Center, a consortium created by Circle and Coinbase to launch USDC, publishes monthly attestation reports, providing third-party assurance as to the size and composition of the USDC reserves. Circle is also a licensed money transmitter under U.S. state law. Why USDT Tether, as $USDT is officially called, is the world’s largest stablecoin. It is backed by cash, short-term corporate debt, and even some foreign government debt. Tether presents some more risks than USDC, because of its lack of transparency. There is no public auditing to check whether the reserves can fully back the USDT in circulation. Tether does however publishes an overview of its reserves daily on its own website. Tether also said it will undertake a full audit with a top 12 accounting firm to improve the transparency of its USDT reserves. Why DAI Unlike USDC and USDT, $Dai is not backed by traditional financial instruments like cash and bonds. DAI, created by The Maker Protocol, is backed by any Ethereum-based asset that has been approved by MKR holders. This makes DAI a true decentralized stable token since the collateral is not kept by a centralized entity. The Maker Protocol makes it possible to lock ETH and other crypto assets in order to generate new DAI tokens in the form of loans., with the ETH and other crypto-assets as the collateral for these loans. To counter the volatility of ETH and other crypto assets, DAI is over-collateralized. At the time of writing, the minimum collateralization ratio for ETH is set at 150%. DAI is not hard-pegged to the USD dollar due to its backing by crypto assets but is kept in sync by the ecosystem including internal economic incentives, policy tools controlled by MKR token holders, and arbitrageurs. DAI has proven itself to be robust across multiple boom and bust cycles in crypto token valuations, so we felt comfortable including it in the StablePlaza pool. Why BUSD Binance USD ($BUSD) is launched in collaboration between Binance and Paxos, a New York-regulated financial institution, and is a fiat-collateralized stable coin just like USDC. It is fully backed by cash held in Paxos-owned US bank accounts. BUSD is also approved by Wall Street regulators. Just like with USDC, monthly attestation reports are available, providing third-party assurance as to the size and composition of the BUSD reserves. -
Introducing the upcoming StablePlaza pool
Timan Rebel - June 29, 2022
Are we really introducing a new pool focused on stable coins in this turbulent stable token market? Yes! There is a lot of stable token volume going on and we believe we can take a cut of that. And let’s start with that elephant in the room. In the past few months, several major stable tokens have depegged, creating massive turbulence in the market. The biggest shockwave was of course caused by UST. But other stables have depegged as well but were luckily able to get back to their peg of 1 USD. That’s why we didn’t select the four stable tokens with the largest daily volume, but we selected the four stablest stable tokens available. For the four stable tokens in our pool, we looked at fully collateralized stable tokens and stayed away from any form of algorithmic stables. The four-token pool will consist of USDC, USDT, DAI, and BUSD. We explain more about why we selected these four in The 4 stable tokens in the StablePlaza pool. The upcoming StablePlaza pool When we launch the StablePlaza pool, DefiPlaza will have two multi-token pools. One is focused on blue-chip tokens, the other on stable tokens. And for each trade, we automatically select the pool that would result in the lowest trade fee for the end-user. As you might know, DefiPlaza is special thanks to its single-contract, multi-token, highly optimized DEX, designed to offer the lowest possible trade cost to the end-user. Gas costs per trade are the lowest in the industry, and thanks to the multi-token set up very capital efficient, while Impermanent Loss is minimized. The (current) DefiPlaza pool is a 16-token pool of blue-chip tokens and is 15 times more capital efficient than traditional pair-based DEXs, offering up to 15 times more fees per unit of liquidity at the same trading volume. Plus, all fees coming from the 120 trading pairs are collected in one pool. The StablePlaza pool will take the same highly optimized approach as the DefiPlaza pool to provide cheaper trades, with an even lower transaction fee of 0.03% of the value traded. While the DefiPlaza pool is up to 65% cheaper than Uniswap, the StablePlaza pool will be up to 25% cheaper than Curve, which isn’t as expensive as some of the pair-based DEXs to start with. It’s enough to say we are really proud of this! When we acquire enough liquidity and get integrated with 1inch, we can create significant volume with minimal, or no, impermanent loss since all four tokens in the pool are stables. To make even better use of the provided liquidity, we created our own type of concentrated liquidity. Concentrated liquidity refers to the ability for liquidity providers (LPs) to select a particular range along the price curve to provide liquidity.CoinMarketCap Instead of providing liquidity for a price going from 0 to infinity, concentrated liquidity makes it possible for liquidity providers to select a range which they want to provide liquidity for. For example from 500 to 1500 dollars for Ethereum. (At the moment of writing, the price of Ethereum is 1208 dollars). This way, the liquidity is used in a much more effective way, offering more fees per unit of liquidity provided. Since stable tokens tend to be stable, you could create a more extreme form of concentrated liquidity, anchored around 1 USD, plus and minus a margin. This is what we did for the StablePlaza pool, to make the pool highly capital efficient and create even more fees per unit of liquidity. But providing liquidity is not the only way to earn fees. DFP2 holders will be able to stake their DFP2 in the StablePlaza pool to earn 1/3rd of the generated fees. Two-thirds of the fees will go to the liquidity providers and one-third is divided between all staked DFP2 on the StablePlaza pool. If the holder decides to lock their DFP2 for up to 180 days, that stake will even receive up to two times their share of the fees. This new staking mechanism will give DFP2 a real first use case and the voluntary lockup period should reduce price volatility. We’re readying the launch of the StablePlaza pool and are dotting the i’s and crossing the t’s. In the next few days, we will release several more blog posts and then the StablePlaza white paper. So stay tuned! -
Everything we know so far about StablePlaza
Timan Rebel - March 23, 2022
An updated version of this article is available: Introducing the upcoming StablePlaza pool. On January 26, 2022, a governance vote was created by a community member asking us to build a second DEX next to DefiPlaza focused purely on stable tokens. The governance vote was accepted by our community, and Jazzer started the research into StablePlaza with the following requested features: – A smart contract with support for (at least) 4 stable tokens (USDc, USDT, DAI, MIM)– Zero slippage– A 0.03% fee– Return 0.02% to the pool and return 0.01% to DFP2 holders who choose to stake their tokens– Staked tokens should keep their voting rights for any proposals– If it is possible, keep the smart contract variable for number of coins in it. Over time other stables like TUSD may gain sufficient traction and we can add them into the pool easily. At the moment of writing, the research and math are nearly done, implementation is underway and the code audit is scheduled for April 25. Because we already get a lot of questions about what StablePlaza will look like, we’d like to explain as much as possible in this blog post. Some details might change during implementation and I’ll update this post if they do. Table of Contents Fee StructureConcentrated LiquidityStaking DFP2Variable Token AmountUniswap V2 compatibleCapital EfficiencySeparate AppTimeline Fee Structure As requested in the governance vote, we are proposing to launch StablePlaza with a 0.03% fee, sending 0.02% to the liquidity providers and 0.01% to the total amount of DFP2 staked (more on that below). This very low exchange fee combined with the efficient multi-token setup of DefiPlaza should make StablePlaza the DEX with the lowest possible cost and when 1inch and other aggregators implement StablePlaza it should be the de-facto place to swap stable tokens. Concentrated Liquidity The proposed Zero Slippage does not seem fully possible, due to the minor variances in price between the major stable tokens. Especially DAI does deviate up to 0.015 USD (1.5%) from the USD value compared to other stable tokens. That would mean that arbitrage would regularly cause the pool of DAI to be completely emptied as they can be sold elsewhere for more if DAI would indeed rise above 1.01 USD. As an alternative, we are looking at a concentrated liquidity setup similar to Uniswap V3 where the liquidity would be concentrated between 0.99 USD and 1.01 USD. If the price of one of the stable tokens would rise above a 1 percent difference with respect to the others it would run out of liquidity and no longer be available to buy. It can still be sold back into the pool bringing the prices back into balance. Staking DFP2 As said, 0.02% of every swap would go to the liquidity providers and 0.01% to the total pool of staked DFP2. That means that users will be able to lock their DFP2 in the smart contract and earn a reward. When a user unstakes they receive the same amount of DFP2 back, so there is no risk of impermanent loss as there is when providing liquidity against other tokens. What makes StablePlaza special is that it is paying out the rewards to both the liquidity providers and stakers in a stable token of their choice, and not in our own token that would become inflationary. Staked DFP2 will also retain its voting rights, in a similar way as unclaimed DFP2 rewards from DefiPlaza are available as voting power. Variable token amount After doing the math it turns out that having a variable amount of tokens versus a fixed amount of 4 or 8 stable tokens would have a negative impact on the gas fees as well as the complexity of the contract. Our current belief is therefore that we should stick to 4, maybe 8, stable tokens. We will, just like with DefiPlaza, add the ability to exchange tokens that are underperforming for new more promising stable tokens. Uniswap v2 compatible To make integrations with aggregators easier, we are working on making StablePlaza “Uniswap V2 compatible”, which means that the calls to swap on StablePlaza would be similar to how a contract would call the swap function on Uniswap V2 and receive a similar result. A 1inch would therefore not need to write any custom code and “only” add the StablePlaza contract address to add StablePlaza as a swapping destination. This makes integrating with aggregators easier and should thus increase the trade volume on StablePlaza significantly. Capital Efficiency Just like DefiPlaza, StablePlaza will be very capital efficient thanks to its multi-token pool setup. With 4 stable tokens, it would only need 4 pieces of liquidity to power 6 stable token pairs. Offering a 3x higher fee reward per provided liquidity as compared to traditional pair-based DEXes. Since a traditional pair-based DEX like Uniswap would need 12 pieces of liquidity to power 6 pairs. With 8 stable tokens, it would need 8 units of liquidity to provide 28 trading pairs. This potentially offers a 7x higher fee income when compared to pair-based DEXes, since a pair-based DEX would need 56 units of liquidity to provide the same 28 pairs. Separate app Since StablePlaza would feature its own swapping, liquidity, and staking functionality, we will launch StablePlaza as a separate app under the DefiPlaza brand. This will be done by deploying the new app to stable.defiplaza.net and making it clear to the user by using a different logo and background color that the user is now using StablePlaza and not DefiPlaza. That way we use the advantage of operating everything under one domain while separating the UI and making interacting with the two DEXes as easy as possible while at the same time reusing as much as possible of the existing UI. How we will market the new StablePlaza DEX on our website is still up for discussion and any tips are welcome. Timeline We scheduled the audit by Pessimistic.io for April 25, 2022. That gives us about five weeks to finish the smart contracts and adapt the DefiPlaza App to StablePlaza. We do believe this is possible and want to keep moving fast because StablePlaza is a huge opportunity for us and our community. The audit will probably take a week or two and we might need to update the smart contracts based on their feedback, but we are targeting a launch in mid-May. Since the math and engineering of StablePlaza are much more complex than DefiPlaza we are also planning to release a WhitePaper next to our usual extended Medium article upon launch, explaining all the details behind our decisions. -
The economics of providing liquidity on DefiPlaza
Jazzer - November 3, 2021
In the previous article we looked at why DefiPlaza makes for an attractive value proposition to end-users. If you haven’t read that, check it out! In this instalment we’ll take a closer look at the liquidity provider side of things. The economics for liquidity providers consist of two parts: revenue and costs. Providing liquidity is easy and can be done single sided. You will receive the index token XDP2 in return. The economics of providing liquidity The interaction that liquidity providers have with DefiPlaza is providing liquidity to the exchange, which is then used to allow customers to swap tokens against. At any point in the future, the liquidity provider may decide to withdraw their liquidity back into their own wallets. The question at hand is how much will they get back when they do. To understand what drives profit or loss in a multi-token AMM, let’s look at all components that factor into the value difference when depositing versus when withdrawing. Income from fees. The primary reason to provide liquidity to an AMM is that end-users can trade agains the liquidity in the pool for a fee. The fee on each trade (or liquidity add) on DefiPlaza is 0.1% of the input tokens. These fees accumulate in the DEX and result in a steady appreciation of the XDP2 index token over time.Price change of the underlying tokens. The DEX lists 16 tokens and for each of these tokens it holds a reserve. If the underlying tokens appreciate in value, so does the index token. If the underlying tokens depreciate in value, so does the index token.Impermanent loss. When the exchange is in balance, the dollar value of each token reserve in the DEX is equal. Suppose that one token suddenly doubles in value. In that the spot price on the DEX is no longer in balance with the external price, creating an arbitrage opportunity. After a while and a number of trades the exchange will once again be in balance and all 16 token reserves will be somewhat increased. However, the total value increase in XDP2 that this represents is not quite equal to the initial value increase of the single token which doubled in price. This difference is called impermanent loss and will be discussed in detail in the next section. When the liquidity provider withdraws his liquidity, the amount they will get back is the original amount they put in, plus the fees accumulated over time, plus the price change of the underlying tokens, minus the impermanent loss. Thus, to make a profit on the trade as compared to simply keeping the same portfolio of 16 tokens it is required that the fee income outweighs the impermanent loss in the long run. Let’s look at these two components in more detail. Fee income in a multi-token AMM Trading fees are generated by trades taking place against the liquidity held by the AMM. The fee is currently set to 0.1% of the value for every trade on the exchange. If there are more trading volume, there is more fee income. Arguably the most important performance metric for any AMM is the amount of fees generated per amount of liquidity in the AMM. As we saw in the previous article, more liquidity generates less slippage per trade, but at the same time more liquidity means less income per trade for the liquidity providers. How much liquidity does an AMM actually need to be optimally competitive? Let’s consider the largest UniSwap v2 pool with a USD component (USDC/ETH) as an example. As of July 2021 (when I did this analysis) that had around 320 M$ in liquidity. With the same total liquidity, DefiPlaza would have about 20 M$ per token spread evenly over the 16 tokens. UniSwap uses a 0.3% trading fee. DefiPlaza uses a 0.1% trading fee, so break even in trading fee cost to the consumer happens when DefiPlaza has 0.2% more slippage than UniSwap on any given trade. With 20 M$ liquidity per token, DefiPlaza reaches a slippage of 0.2% for a trade value of 40 k$. This means that for all trades with with values below 40 k$, DefiPlaza could provide a more competitive offering to the consumer than UniSwap regardless of how much liquidity UniSwap has for that pair. The lower the trade value, the less significant the slippage and the more attractive DefiPlaza will be versus UniSwap. So how many of those lower value trades are being done? Consider the trades for 100,000 consecutive blocks in July 2021 on the USDC/ETH pair, a dataset of ±108k trades. The data for these trades is plotted below: Impermanent loss generalised for N pooled tokens with beta price change per token The plot shows that >90% of the trades are below 40k USDC. Thus, DefiPlaza with the same 320M liquidity could outcompete UniSwap for 90% of the trades for the USDC/ETH pair, while also outcompeting UniSwap on 119 additional pairs for all trades <40k$ in size! That is the capital efficiency gain from pooling many assets together at work. The fraction of trades where DefiPlaza outcompetes UniSwap would be very large at 90%, but what does that mean for fee income? In the graph below we see the cumulative fraction of fee income plotted against the trade size in the same period as discussed above. What we can see in this graph is that roughly 30% of the fees of this pool are generated by the 90% of trades that are smaller than 40 k$ in size. At the lower fee percentage, those trades represent an equivalent income for DefiPlaza LPs of roughly 10% of the USDC/ETH UniSwap pool fee revenue. This means that in a transparent market DefiPlaza should be able to take 10% of the UniSwap v2 USDC/ETH trading fees at the same liquidity. If we then take into account the other 119 trading pairs that DefiPlaza offers with the same liquidity, the combined fee income should easily reach more than 100% of the UniSwap USDC/ETH liquidity provider income. The above comparison is only against the UniSwap v2 liquidity & volume, DefiPlaza should be able to take market share from other DEXes as well further increasing fee revenue. All this makes that we believe DefiPlaza can offer liquidity providers a competitive revenue even at a 0.1% fee level once it gains traction. Calculating impermanent loss At the cost side we have impermanent loss (IL) to consider. IL is something many people are aware exists but don’t quite fully understand. Put simply, as the market value of the liquidity reserves held by the DEX changes, arbitrage swaps occur along the x*y=k bonding curve to keep the spot prices on the exchange in balance with prices on the external market. As this happens the tokens held in reserve by the exchange slightly loose value as compared to the same portfolio held outside of the exchange. The loss is called impermanent because if the relative price between the tokens listed at the AMM returns to the same ratio as it was initially, these losses vanish completely. After one supplies liquidity to an AMM, the impermanent loss for that liquidity position moves up and down over time as the relative token prices change. When the liquidity is withdrawn the impermanent loss is realised into an actual loss. What we need to understand is how IL is likely to develop over time for our liquidity providers. Mathematically, it is possible to compute exactly how much the impermanent loss is as a function of the relative prices. If we take beta to be the price change for each token as compared to when the liquidity position was opened, one can work out the formula for generalised impermanent loss when N tokens are paired together (UniSwap N=2, DefiPlaza N=16) to the below: Impermanent loss generalised for N pooled tokens with beta price change per token Suppose we add $1000 in liquidity to DefiPlaza today. Then we will receive a certain amount of liquidity tokens XDP2 which represent our share in the reserves of all tokens held by the exchange. If we check back a month later, we might find that 2 tokens fell by 20% (beta=0.8), 4 tokens stayed the same price (beta=1), 8 tokens went +20% (beta=1.2) and 2 tokens went +50% (beta=1.5) in price. Then if we withdraw the liquidity tokens we initially received for our $1000 investment from DefiPlaza, we now would receive tokens worth ±$1120.70 on the external market. However, someone who held the same $1000 split over the same 16 tokens without providing them as liquidity would now have $1137.50 worth of tokens. The Impermanent Loss is the relative difference between these two amounts. It can be calculated with the formula above for arbitrary pool sizes and token price changes. For the example numbers above the resulting impermanent loss is ±1.48%. Impermanent loss example calculation The impermanent loss is zero if all betas are the same. Thus, if all tokens move up and down at the same rate, no impermanent loss will occur at all. If part of the tokens increase significantly in price while others fall in price the impermanent loss will be large. The more correlation there is in price movement between the listed tokens, the smaller will be the impermanent loss. Crypto markets have historically shown a high degree of correlation between token prices. With a larger basket of tokens, the risk of IL is effectively spread over the whole basket. If one token multiplies by 10x on price relative to the others, the IL will be less in a pool with 16 tokens than a pool with 2 tokens. If most of the tokens have similar price action, impermanent loss remains relatively small. Liquidity mining To be a compelling value proposition, the sum of fee revenue minus impermanent loss needs to be competitive as compared to other DEXes where people could provide liquidity. In the early stages after launch it is likely that trading volume will be relatively low. Thus, the revenue side of the equation is uncertain. To incentivise people to provide liquidity in this ramp-up period, DefiPlaza has a liquidity mining program. Over the period of 1 year, 50M governance tokens are released on quadratic curve (with more tokens releasing in the early stages). In the first 3 weeks this program has been very successful, with liquidity growing steadily and rewards fluctuating from 300% to 1400% over this period. It is expected that the income of the liquidity providers will initially be largely made up of liquidity rewards, ramping down gradually over the year such that at the end of the year the income will consist purely of trading fees. Conclusion DefiPlaza offers a competitive value proposition to liquidity providers by making it a fundamentally cheaper place to trade which should attract high volumes over time. The impermanent loss side of the equation is a bit more difficult to understand than in a pair-based exchange, but since it lists many tokens which may reasonably be expected to have correlated price action, the expected value for IL is actually less in DefiPlaza than for many trading pairs in pair based exchanges. The liquidity rewards are the cherry on the cake. -
Introducing DefiPlaza: Making DeFi on Ethereum affordable again
Jazzer - October 12, 2021
Since the publication of the original article on DefiPlaza, a lot has happened. Among other things, EIP-1559 has finally been implemented which many people had hoped would help reducing gas prices. Unfortunately, prices haven’t come down at all, and Ethereum transactions are more expensive than ever. Thus, the DefiPlaza value proposition is as relevant now as it ever was. Last week the new and improved DefiPlaza v2 has launched and now is a good time to remind ourselves what DefiPlaza is all about: DefiPlaza aims to bring DEX services to our customers at the lowest fees and gas costs on Ethereum. This includes swaps, adding/removing liquidity as well as staking transactions. The way that DefiPlaza can achieve significantly lower costs is by using a different economic model. Rather than having trading pairs like in UniSwap (2 tokens per pair), DefiPlaza uses a multi-token pool with 16 of the highest volume tokens in the DeFi space. By doing all this in a single smart contract and highly optimizing for gas consumption, the costs of a swap transaction to the end-user can be significantly reduced. Effectively, we’re trying to do for DeFi what the low cost brokers did for the stock market: tremendously bring down the barrier for entry and the costs to the end-user. The idea is to leverage a superior economic model to the pair based exchanges that currently dominate the DeFi space. In this post we’ll dive a little deeper into DEX transaction economics when viewed from the end-user side. In the next article we’ll explore the economics from the liquidity provider side of things. Total end-user cost of a DEX transaction If we look closely at any DEX transaction, we find that the total cost of a swap to the consumer can be broken down into three components: Gas fees. This is the most visible cost, as it is explicitly shown for each transaction. A swap between two ERC20 tokens which are directly pooled together in UniSwap usually costs in the order of 100.000–150.000 gas. This amount is independent of the amount swapped, and is thus disproportionally effecting users who are swapping relatively small amounts. Since the Ethereum network is congested this issue is not expected to go away anytime soon. Ethereum 2.0 will not solve it either, since that breaks composability and thus is not suitable for DeFi.Exchange fees. Every exchange uses their own fee model. The benchmark fee as set by UniSwap is 0.3% of the amount exchanged for pairs of dissimilar tokens. This fee directly goes into the pool and thus into the pockets of the liquidity providers. To make a swapping pair between two tokens economically attractive for the LPs, a 0.3% is roughly what’s required to get an appropriately balanced risk/reward ratio for dissimilar tokens.Bonding curve slippage. The spot price on a UniSwap pair is given by the ratio of the tokens held in reserve. When a trade is executed, the pair moves along the invariant curve x*y=k. Therefore, the price is changing as trades happen and the actual price paid for tokens in a swap will always be slightly worse than the spot price, which results in an additional cost to the user. Slippage is small for small trades but increases rapidly when the size of the trade grows relative to the liquidity in the pool. As an example cost breakdown, let’s consider the UniSwap V2 pool for USDC/ETH, which contains roughly $240m in total liquidity as I’m writing this. Since DefiPlaza only launched last week, it doesn’t have the same liquidity yet. For an apples-to-apples comparison, let’s consider what would happen if DefiPlaza would contain the same $240m in total liquidity ($15m for each of the 16 tokens). For a swap of $10k in USDC to ETH, we would get the following cost breakdown (assuming gas at 100 GWei and ETH at $3500 as we have today). We can observe that the total cost to the user for a DefiPlaza transaction is lower than just the gas costs for a UniSwap transaction. That means that DefiPlaza will be cheaper, regardless of what fees/slippage are used on UniSwap! For the $240m total liquidity example, a trade of 10k$ USDC to ETH would be ~45% cheaper than the same trade on UniSwapV2 is today. The above cost breakdown is just for the USDC/ETH pair on DefiPlaza, but with in DefiPlaza the same $240m liquidity is split over 16 tokens, allowing 119 other pairs to trade on top of the USDC/ETH pair, all at the similar low total transaction costs. The multi-token pool model is vastly more economical than the pair-based model, especially in congested networks like Ethereum. Reference transactions for gas costs: DefiPlaza USDC to ETH, spending all USDC (59,844 gas)UniSwapV2 USDC to ETH, spending all USDC (118,150 gas) What about UniSwap v3? The comparison above was done against the UniSwap v2 pool because it’s difficult to have an apples-to-apples comparison with v3 due to the concentrated liquidity mechanism. The upcoming post on liquidity provision economics will discuss concentrated liquidity in more detail, but for now let’s make the following general observations. Gas costs of swaps have increased going from v2 to v3.Fees for dissimilar tokens are still at 0.3% for most tokens.After nearly 5 months the liquidity on v2 is still significantly larger than the liquidity on v3. UniSwap v2 liquidity (left) is still significantly larger than UniSwap v3 liquidity (right). Not on the same scale. Put very bluntly, when the same fees are used the end-user UniSwap v2 simply gives a better deal than UniSwap v3. The high gas price combined with increased gas cost for v3 hinders adoption of the new version of UniSwap. In my opinion UniSwap has implemented very impressive new features from a technical point of view, but somewhat neglected improving the end-user value proposition. Some pairs on v3 are now using the fee level intended for similar tokens (0.05%) for dissimilar tokens to attract more volume, but even against that lower fee DefiPlaza remains the better offering due to the gas costs factor. Non-direct pairing swaps The comparison for USDC to ETH transaction above focused on a type of transaction that UniSwap specialises in: swaps between two tokens that are directly paired together in a liquidity pool. As shown above, even under those conditions Defi Plaza comfortably offers the better value proposition at the same level of liquidity. However, if a transaction involves two tokens which are not paired directly, the UniSwap router will automatically create a transaction which makes multiple hops. These additional hops introduce additional trading fees and additional gas costs. A 2-hop transaction will cost around 170k gas (±60$) on UniSwap v2 and around 250k gas (±87.5$) on UniSwap v3 in pure gas consumption. In contrast, DefiPlaza doesn’t need hops for any of the 120 trading pairs, so it will result in the same low gas costs for all pairs. Swapping two ERC20 tokens costs around 77k gas (±26.5$) for most tokens, with swaps against ETH costing even less! DefiPlaza liquidity program In summary, we believe that DefiPlaza offers great value to both the end users (discussed in this article) and the liquidity providers (next article). The product is already out there and is working well. The code has been audited. What is still needed now is to grow the liquidity and the volume, through marketing, brand awareness, listings and integrations with aggregators. We believe that the best way to gain traction is by increasing the liquidity, which is an enabler for low slippage trades. With sufficient liquidity DefiPlaza will become the lowest cost option for the vast majority of all DeFi token trades on Ethereum. To gain momentum, DefiPlaza is running a liquidity rewards program for 1 year (until Oct 6th 2022). DefiPlaza.net/stake interface snapshot. Actual APR fluctuates over time. As this article is published it is 490%. Over this one year, a total of 50M governance tokens are released to the liquidity holders on the exchange. A further 5M tokens are reserved for the team and the community fund, and another 12.7 M tokens are carried over from DefiPlaza version 1. The governance token will be used to vote on critical matters in the DefiPlaza ecosystem, such as which tokens are listed on the exchange and on the fees on the platform. Check out our website at defiplaza.netCheck out our telegram channel at t.me/defiplaza -
DefiPlaza — A low cost DEX for Ethereum
Jazzer - June 24, 2021
Since the meteoric rise of DeFi last year we have many options to exchange tokens using several decentralised exchanges built straight onto the block chain. They work great and have been a massive boon to the fledgling DeFi industry. UniSwap could even be called the spider in the DeFi web. All is not well however, and the issue I wish to address here is that DeFi is basically becoming too expensive to use for the general public. The native Ethereum token ETH has risen tremendously in price and on top of that the gas price on the network has risen due to congestion. Moreover, the fees that most DEXs charge is in the order of 0.3% of the trade value which is just quite expensive. These high trading costs have become such a problem it’s starting to damage the growth of the DeFi ecosystem. Thus, I believe there is space in the market for an Ethereum based exchange that competes on cost. That is to say, an exchange which allows users to swap tokens at lower gas fees and lower exchange fees. To put it simply: I believe the DeFi community wants and deserves a lean, mean swapping machine. The value proposition of a low cost exchange So why don’t we just build a DEX that has low fees? Sure, the customers who do swaps and the arbitrageurs would welcome such an exchange, but how can we convince the liquidity providers (LPs) to commit their capital to provide liquidity if the fees (which provide their revenue) are drastically reduced? There is only one answer that makes sense: by having the exchange turn over significantly higher volume per unit of liquidity. This is the objective of DeFi Plaza; To provide an exchange which offers such favourable conditions to its user base that it will generate more than enough volume to compensate the LPs for the lower level of fees. Although there are many different fee levels being charged for DeFi trades, the benchmark level is set by UniSwap at 0.3% for dissimilar tokens. Off-chain centralized exchange fees are typically in the order of 0.1% of the trade value for everyday customers. The DeFi Plaza will go live with a fee level of 0.1% for 120 trading pairs between 16 of the largest and most liquid tokens on the Ethereum DeFi ecosystem. Consider below the fee for a trade from ETH to LINK on one of the various Ethereum main net exchanges: A note on capital efficiency So how could we get away with charging so much lower fees than the competition? The answer is by drastically increasing the efficiency of the deployed capital. To understand how this works, consider the history of UniSwap. In UniSwap v1, the capital would be allocated in pairs with ETH. In other words each token would be tradable against ETH. If we want to go from LINK to say DAI, internally UniSwap would trade your LINK with ETH and then that ETH with DAI incurring extra high gas costs and higher fees. With UniSwap v2 came the ability to create pools between two arbitrary tokens directly, such that for popular trading pairs the hop to ETH can be avoided. This increases capital efficiency with respect to UniSwap v1. For UniSwap v3 the main improvement is ‘concentrated liquidity’, which is a high-tech engineering marvel that aims to further dramatically increase capital efficiency. Concentrated liquidity allows you to earn N times the fees in exchange for suffering N times the impermanent loss. Also, when the price ratio moves outside of your configured bounds you completely stop earning fees but still rack up more impermanent loss. To prevent that from happening you need to rebase the ranges, which requires realising the impermanent loss. This makes liquidity providing a bit like options trading. If you guess the trading range correctly you can make good money. If not, you’re in for some losses instead. I’ve not been able to get data on the actual performance distribution of individual LPs, but I doubt that for dissimilar tokens they’re doing significantly better than with v2. And at least as important, for dissimilar tokens the default pair fee is still 0.3% and the high complexity means that the gas costs have only gone up. For end-users v2 is simply the superior product as for them it achieves the same thing at lower cost. What would really fundamentally improve capital efficiency is to extrapolate the line that was set from UniSwap v1 to UniSwap v2. Where v2 would allow arbitrary pairs of tokens, I would have expected v3 to allow arbitrary pools of tokens. With multi-token pools, each token can be used to trade against all the other tokens in the pool. Balancer has done pioneering work in this domain, focussing on the imbalanced pairings and pools. DeFi Plaza is a multi-token exchange, which lists 16 tokens. Since each token can be traded against every other token, this creates 120 unique trading pairs. The tokens that have been selected to be listed include the highest volume and most liquid tokens in DeFi. Thus, for 16 units of liquidity we enable 120 trading pairs, where pair based exchanges require 2 units of liquidity to enable 1 trading pair. This creates a fundamental improvement of a factor 15 in capital efficiency with no real downside. If the market validates my hypothesis, pair based exchanges are now essentially obsolete for established, high volume tokens. What about L2 solutions? An argument is made that by moving volume to L2 implementations like Polygon, we can unload the main chain and lower transaction costs. However, L2 solutions suffer from several disadvantages that make me consider them work arounds rather than actual solutions: L2 breaks composability. DeFi is about an ecosystem of assets and dApps which can interact without friction in a single transaction. By moving to L2 this feature is broken and thus in the long run it simply won’t work.L2 introduces new security risks. For Bitcoin and Ethereum we have ample experience with the proven PoW security mechanism. The robustness of the security protocols and features of L2s still need to be proven.L2 introduces serious friction in the form of time and/or money to move assets back and forth.L2 breaks auditability. Things become much harder to keep track of when it is moved between chains. While some users may not have any issues with waiting for 7 days to move funds on/off an L2 network, I don’t consider this an acceptable solution. In the long run, something is needed that solves the scalability and composability problem in the L1 (check out Radix), but in the short run I think the Ethereum ecosystem needs something that allows us to do swaps on Ethereum L1 at a lower cost point for both network costs and swapping fees. Improving gas efficiency During periods of network congestion the gas costs are a major factor in overall DeFi transaction costs. With the DeFi Plaza implementation an effort was made to save as much gas as reasonably possible in the actual execution of individual transactions. The primary focus for these savings are the end-user facing functions for swapping, liquidity add/remove as well as (un)staking transactions. Savings were mainly achieved in the following places: Everything in a single contract. Without a router there are fewer external contract calls, saving gas. And because all liquidity is in one big pot direct swaps between any two listed token become possible saving gas as well as fees.ETH not WETH: Using WETH makes the code cleaner and more generic, but it comes at the expense of additional gas costs. So I chose to make some ugly code to avoid the wrapping token to save some gas.Mappings over Arrays. It may not be pretty or convenient, but if it’s gas efficient I’m still doing it.No flash loan functionality. Flash loans are great, but enabling them requires additional complexity. For DeFi Plaza v1 I’ve decided they’re not core to the mission. Future versions may see flash loans enabled.Use variable packing where possible to minimise reads and especially writes to/from the blockchain.Minimising the amount of function calls to the bare minimum. Especially external calls. It’s difficult to do a fair comparison of gas costs by simply looking at historic transactions as there is significant variation depending on whether there are new variables stored or gas rebates due to variables being reset to zero. Thus, I’ve run an experiment in a controlled environment (a forked main net) to enable a like for like comparison for a token swap for one of the most popular tokens in DeFi. See below the gas used in a swap transaction from to ETH→LINK, with no extra gas charges/rebates for storage changes. DeFi Plaza is significantly leaner on gas than the competition, and the ETH to LINK example is actually quite favourable to the competition as they all have direct ETH-LINK pools (save for Bancor which has to go via BNT). If a swap needs to touch multiple pairs to complete the gas fees increase rapidly as can be seen from the Bancor example. For example, should we want to exchange LINK for MATIC, then the gas costs for DeFi Plaza remains low while in pair based exchanges it would increase dramatically as they don’t typically have LINK to MATIC pairs available. For liquidity add/remove, as well as for staking transaction similar gas savings have been achieved. I’ll present comparison graphs in a separate Medium post as this one is plenty long already. Managing a high volume, high liquidity exchange To generate most value for all its users, the exchange should attract as much liquidity and trade volume as possible. Thus, the tokens initially listed include those projects that are likely to generate the highest DEX liquidity and trading volumes. For technical reasons the contract is hard coded to have 16 listed tokens, including ETH itself. If DeFi Plaza is successful, simply being listed here would drive up demand and trading volumes for any token similar to how S&P 500 inclusion drives demand for stocks on the NYSE. DeFi Plaza will start with a single DEX, listing the most liquid and high volume tokens ERC20 tokens. If the market shows an appetite for this type of DEX, I anticipate that there will be a MidCap and SmallCap (MoonShot) exchange as well. These need separate exchanges as within an index the liquidity per token balances out to the same dollar value through arbitrage. If smaller projects were to be included into the primary exchange they would cause a drag on liquidity for the whole exchange. Optimum fee levels may be different since liquidity and volume will be lower there. Fees on the exchange will start at 0.1% but can be configured anywhere between 0–100%. It’s unlikely that 0.1% is the optimal fee for the exchange, and I intend to explore the impact of changing the fee on the performance of the DEX. Balancer has already implemented variable fees based which are largely based on volatility. I’d propose dynamic fees based on market share of trading volume. This requires targeted experimentation with the level of fees. Once the exchange has been up and running for a while without code issues and the community has organised, the process of fee optimisation will be started. Governance Which gives us a nice segue into governance. Yes, DeFi Plaza will introduce a governance token called DFP (sorry Andre). This is a real product, which should be supplying real revenue. Once it has gained sufficient momentum in the marketplace it should be able to sustain itself without demand driven by a liquidity program. However, a governance token is a proven method to gather momentum, as well as helping achieve some secondary goals: To recover cost of development and deployment to the team.To provide an ongoing incentive for the team to further improve the product.To allow a lively community to form around the project with decision making power over the direction. It is fully intended to phase over from dev control to community control as soon as the project has a community powerful and trusted enough to carry the project forward. There is a real need to make collective decisions, since choices around which tokens to list and which fee structure to use are real knobs to steer both LP revenue and risk profile.To reward early adopters for their trust in the platform and their help with making it grow. I deeply believe that the project needs to be designed such that it can stand on its own and be an attractive product even when there are no liquidity incentives in the future. However, as the platform still needs to be proven there is a need to bootstrap liquidity and supplying a governance token liquidity reward is a proven method to achieve that even in a high risk (we test in production) environment. The governance token will be used as means for the community to vote on the direction of the project. Which tokens to (un)list, which exchanges to launch, fee structures, collaborations, etcetera. Tokenomics The governance token is a fixed supply token which can be mined by staking the exchange index liquidity token XDP1. Over a period of one year all 100MM will be released. At launch, there will be 1MM (1%) loaded onto the exchange as bootstrapping liquidity. A further 4MM (4%) is unlocked to recover development and deployment costs. 5MM (5%) are granted as a founder reward which is locked for 1 year to incentivise continued commitment to the project. 5MM (5%) of the tokens are reserved for a community multisig wallet to be spent in whichever way the community believes furthers the interests of the project. The other 85MM (85%) of the tokens are available for the community members as liquidity rewards. The 90% of tokens that are allocated to the community are released over a period of 1 year, following a quadratic curve that is designed to taper off smoothly towards zero release rate at the end of the program. The total governance token amount in circulation including all allocations and their release is shown below. The roll-out of DeFi Plaza DeFi Plaza is live. You can find it at https://www.DeFiPlaza.netWhen you visit the website, you’ll find a different experience from most DeFi projects. No goofy food name, no shiny sparkles or hype language. Simply an exchange, ready to do business. The same lean and mean philosophy that has been applied to the smart contracts has also been applied to the website. No React or other heavy libraries. It’s pure JavaScript designed to be fast, lean and snappy even if you’re on a low bandwidth connection. The exchange is completely live. Liquidity can be added and LP index tokens can already be staked. Governance token distribution starts on Saturday June 26th at 16:00 UTC. Initial APR is ±1000%, which may change as it depends on the price of the DFP token on the DEX. This is a grassroots project. No marketing, no influencers, no ads, no nothing. DeFi Plaza depends on word of mouth to draw attention to the project. As I think it should be. The exchange is here: https://www.defiplaza.netThe smart contract for the exchange is here.The smart contract for the governance token staking is here.There’s a telegram group at https://t.me/defiplazaThere’s a Twitter account at https://twitter.com/defiplaza A word of caution & disclaimer This project is an AMM experiment by a random guy from the internet. Nothing more, nothing less. Though I did my absolute best to make a secure and efficient exchange, there could be scenarios that I missed in testing. Thus, the real test of the concept is in production. The code is unaudited. It’s just me testing on my machine. And I’m not a professional coder, I’m an engineer. But I guess if you don’t constantly experience a sense of dread and impending doom while working on a project, you’re not using Solidity right. Anyway, the message I want to convey is that this project should be considered very high risk. It’s not unlikely we’ll have to migrate the whole thing over to a new version down the line. Maybe even multiple times. It could cost transaction fees. It may even be worse because despite my best efforts it’s entirely possible that there are exploits lurking in the code. Stripping to the core helps reduce the attack vectors, but it’s still Solidity so who’s to say for sure, really? Please review the code carefully and let me know if you find anything and/or forward it to people who can review it for us. I’ve seeded the DEX with a good chunk of my own net worth to show my personal confidence & commitment. And I’ve set up the liquidity rewards release curve to reflect the increased risk to early liquidity providers. Still, I take no responsibility whatsoever for any losses that you may incur when engaging with the DEX.