Latest updates from DefiPlaza
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...
Engineering better DEXs – Jazzer’s appearance on the DefiDownload Podcast
April 2, 2022
In this episode of the DeFi Download podcast, Piers Ridyard, CEO of Radix interviews Jazzer, the founder of DeFiPlaza. Jazzer discusses his path to developing DeFiPlaza, his engagement with...
Another 35k DFP2 burnt
March 20, 2022
To celebrate the start of serious StablePlaza development, the team collected the profits from the community run arbitrage bot and used these to buy back and burn DFP2 tokens. As a result, 35846...
Nearly 40k DFP2 burnt
February 20, 2022
To celebrate the release of the new website design, the team collected the profits from the community run arbitrage bot and used these to buy back and burn DFP2 tokens. As a result, 39831 DFP2...
New design launched
February 19, 2022
Based on requests from the community and with the help of a professional designer, we just launched a new design for both the website and the trading app. A clean mix of modern DeFi design...
Implemented a new voting strategy to allow voting with unclaimed rewards
February 8, 2022
DefiPlaza is governed by the DFP2 token holders. They can make proposals at governance portal, powered by Snapshot.org, and when they are approved the team will implement the outcome. To vote on...
Latest blog posts
-
Everything we know so far about StablePlaza
Timan Rebel - March 23, 2022
On January 26, 2022, a governance vote was created by a community member asking us to build a second DEX next to DefiPlaza focussed 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 tokens stable token 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 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 on 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. -
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.