zkLend X ZKX AMA Recap 22/09/2022
To inaugurate ZEND&FRIENDS ‘StarkNet Native DeFi’ Series 4 we had none-other than Eduard, Co-Founder and CEO of permissionless derivatives protocol on StarkNet, ZKX. Perpetual swaps, funding rate, and counter-party risk where among the topics of the call.
Listen to the full recording on our Spotify now.
The ‘Why’ of ZKX [01:40]
The journey started when we were working at SOSV a 1.3 billion dollar venture capital fund headquartered initially in the U.S. but with a very strong presence across emerging markets. We had offices across India, China, Singapore, Taiwan and many other countries. We were overlooking a portfolio of over 200 startups in Asia. As part of the work that we were doing with founders across the region, we had one stand-alone startup which was BitMEX which was our major crypto investment and that gave us a lot of visibility on how perpetual swaps had a massive product market feed within the region. This was also an instrument that was very easy to understand for users and could drive many interesting trading opportunities.
In parallel, we realised that there was an opportunity in DeFi as well as the rise of Robinhood, wall street bets, and the entire GameStop saga, that gave us an indication that there was an opportunity in the market to provide opportunities to millennials, gen-z and traders across this different emerging economies with more opportunities to trade, take the risk and grow their savings over time. In general, the background in both venture capital as well as operating startups in crypto and traditional Web2.0 across Asia and Europe trying to make a change in the derivatives space.
The Problem With Current Decentralised Perps [04:13]
We saw there was a few problems once we started building ZKX. Probably that is why it’s taking us a bit longer to complete the product because we aim to create a new architecture. The first problem we saw is a high dependency on oracles, while it’s great to have these centralised oracles that provide secure data feeds on-chain, we saw that you had a lot of dependency on Chainlink being up and running all the time and having the ability to offer the price feed that you require at any given point in time. What’s especially important here is to note that the refresh rate of these price feeds is usually not as speedy as one would require for a high-frequency order book that you find in the traditional finance markets. That is a problem of the on-chain gas fees structure that makes it quite pricey to be refreshing prices every second for example.
The second problem that we saw is that you have models like the virtual AMM that create quite a bit of slippage and maybe not the best trading experience for professional traders, firms, or bot traders, it’s okay for retail in most cases but there are limitations and some risks on how the insurance fund is used and how it’s connected with the fees. The design has its inherent flaws, then you have models like GMX you’re trading against a single pool of liquidity which makes it quite risky for the liquidity providers they’re going to take the fall any time there is a problem with the exchange of the system. Whether it’s an exploit or a potential hack that is quite a risky situation. Even though the stakers get to share the revenue they are also sharing quite a bit of counterparty risk.
And then you have the centralised order book which is what you find with dYdX for example where they keep their servers off-chain that run most of the operations for the exchange and then the transactions are settled on-chain. This is more efficient in terms of costs and speeds but it still has its inherent limitations, one, of course, is that it is off-chain so you cannot verify that whatever is happening is happening correctly, you cannot trace your data, and you also have certain limitations in terms of scalability as well as exposure to regulatory risks or arbitrage risks as well anyone within your team could go rogue.
So in that sense, we thought that the current architecture needs a revamp, something that can bring the best of both worlds. An order book that is highly scalable but truly decentralised and that’s been the challenge that we’ve been tackling for the last year. That’s why we are getting ready to launch. These were some of the issues that we are aiming to solve.
Perpetual Swaps [09:16]
Perpetual Swaps are a contract that lets you buy exposure in an underlying asset. Let’s say you want to buy $1,000 on Bitcoin you can go and do that without actually having to hold Bitcoin in itself. This is something that comes from the world of futures and derivatives with the difference that you don’t have an expiry date or delivery of the actual underlying assets and you don’t have to worry about strike prices, which is something you have to worry about with options. So in that sense is much more simple you just buy as much exposure as you want in the asset and then you can choose to lever up. This leverage is virtual you are not borrowing money from anyone but you do have a risk of liquidation which comes from the fact if you go long or short and the price moves a lot there might be some liabilities or additional money required to cover the losses of the position and that money might be greater than the money that you posted. So liquidation helps protect the entire exchange and manage these liabilities created by the leveraged positions.
So in short, it’s a very elegant way to buy exposure on any underlying asset. It can be any data feed, Bitcoin, or real-world assets, it can be anything as long as you can trade on it and have a reliable price reference. This is an instrument that came to be with BitMEX which was the OG exchange based out of Hong Kong started by Arthur Hayes that rose to fame because people were taking 50x leveraged positions and there will be massive liquidation cascades and that would drive the price of Bitcoin up and down like crazy. Some of these crashes that you have seen throughout the last five years were created by these liquidations cascades on derivatives exchanges like BitMEX. Nowadays perpetual swaps are available among all major exchanges, Binance being the one with the most volume and then you have the likes of OKX and Huobi who also have a lot of volume with these instruments. The inherent advantage is that if you hold a spot it’s very hard for you to protect if the price goes down and be able to profit if there’s an actual bear market. With perpetual swaps, you do have the ability to go short or long. This flexibility is more efficient because it gives you a better option to protect yourself in any market situation, so you always have an opportunity to make a profit regardless of the market conditions.
Funding Rate [14:09]
Since these positions are perpetual there’s no expiration or rollover, what happens is that people pile on either side of the order book, whether it’s long or short. This creates imbalances which create risk within the order book because all of a sudden you have a lot of liabilities on one side versus the other side. What the funding rate does is it adds a base interest rate that is paid by either side of the book to the other side to help balance and incentivise taking positions on the opposite side that has fewer liabilities.
It works slightly differently in different exchanges. You have some exchanges that will only pay funding rates in one direction towards the longs from the shorts. There are always different variations within the fuding rate, in basic terms it is an interest rate that you pay or you received based on the state of the order book.
There is what we call delta-neutral strategies which let you reduce your exposure to price movement and protect your main capital by actually being both long and short in different ratio and these strategies help you arbitrage the funding rate. You are helping provide liquidity and depth of market within the order book and also profiting from these interest payments that are happening sometimes every 4 or 8 hours, sometimes in real time depending on the cycle of each exchange for the funding rate. It is one of the ways to incentivise market makers to provide liquidity on either side of the order book whenever it’s required.
Perps Pros & Cons [18:32]
It’s a very controversial topic, everyone talks about being liquidated within a perpetual trade. It is one of those memes in crypto Twitter. We’ve done quite a bit of user interviews in the last few months, and it’s been quite interesting to see that people are both at the same time less risk-prone than we thought, you have plenty of traders that don’t use too much leverage they are more conservative because they know the risks of liquidation. And some traders decide to go YOLO and go all in with leverage and they feel like liquidation happens is because they took the wrong position according to the market conditions, therefore, the liquidation is justified. So you have both sides on the way to view these and the reason why I’m talking about this is that is usually seen as a con in perp trading that fact that you can get liquidated and you lose all your collateral. And this can happen if you go overboard with leverage or there is a sudden market swinging that goes in the opposite direction of your trade which is something very usual within crypto. Counterparty risk is always there, the fact that everything is on-chain helps, but you always have a system like virtual AMMs that have blown up a few times by the design. So we should not forget that DeFi is still very much beta and testing face, even though a lot of these platforms have been working well for a while everything is still in an experimental phase.
On the pros side, the simplicity of it is that you don’t have to think of strikes, expiration dates and any of the complexities of other derivatives. The fact that you can get exposure on either side of the trade, whether the price is going down or up and sometimes it gives you more options to protect yourself when you’re doing liquidity provision on an AMM you can protect yourself from impermanent loss you can do a perp position to balance that impermanent loss when the price moves, so it has a lot of utility as well within the ecosystem across the board for these use cases.
Target Audience [20:39]
What you see in traditional markets is that there are limitations on how much leverage or margin you can have, especially for retail traders to protect them from losing their collateral. You see that with Binance limiting how much leverage they allow because they see that it makes it less risky for the order book since it’s less prone to blow-up and it’s also better for the traders because it provides a safer environment. In that sense, yes, there is a clear target of people who have already been trading with different instruments and have some experience in day trading.
But from our perspective this is something that should be open to everyone, we do think there is a space with a certain amount of leverage with the right education everyday users can benefit from taking a small short position and benefit from the downside too. We don’t see that users should be restrained to just trade spot and can only go long. Having perps can be a very practical instrument for everyone and specifically in areas where you have small ticket sizes.
Where you have countries where someone wants to trade with $20 or $50 that’s where we think of having the option to add a little bit of leverage becomes way more relevant because at that point you give that asymmetrical upside to the user which is very attractive. Making 5% or 10% on $50 is not that attractive, but having the ability to take a small bet and having a $200 gain for a $50 position is something that can make a difference, especially in emerging markets. Generally, we see that it can also function as an equal playing ground, where people with smaller bets can enjoy the upside as much as the big players do.
Counterparty Risk [26:49]
You can provide some additional incentives for liquidity to come in and help market make. In our case, we have a funding rate that has a premium and that premium on the interest is added or subtracted according to the volatility of the underlying asset. Whenever there is a high implied volatility of the underlying there is an additional premium rate on top of this interest rate. We do have some additional incentives along with specific reward algorithms that value and track different aspects of your trading activity, whether it is volume, P&L, or consistency of trading. So we have implemented several mechanisms to make sure there are more incentives for that liquidity to stay and help traders go in and out of those assets and those order books but you always have that risk that liquidity may dry up.
What we have seen within the market is that there is a high seasonality for certain perpetual swaps you’ll see how some of the large centralised exchanges like Binance would launch certain perpetual swaps for newly listed assets that are very hot. So the new hot tokens that everyone wants to trade would launch as a swap and would go on for a few months with high volume and they will die out as the interest from the community fades away and moves on to something. This seasonality is a challenge and something that needs to be optimised within a perspective as a decentralised protocol on how we can offer these traders the option to hedge, short an asset when it’s hot and then let it fizzle out without any risk to the other participants in the market.
Then there’s other features that are being implemented which is the leveraging which let’s de-lever a position before it’s liquidation and provides a softer landing pad for the user as well as for the exchange. You can actually reduce your leverage as you’re getting closer to liquidation in a way that you reduce for the order book and the exchange and you allow the user to go out of the position with maybe some remaining collateral and not have to lose it all. It might not be the best solution from the perspective of centralised exchanges it may also reduce the amount of revenue they can make it, but from our perspective it’s important because it help both the user and the exchange reduce risk.
CEX vs DEX [35:29]
I think there are a few reasons why users stick with Centralised Exchanges. One is you’ve got a relatively easy fiat on-ramp and despite having KYC it means still on-board and off-board easily from your real-world account with fiat currency. You also have some kind of perception that it’s more trustworthy and less risky because you have Binance, for example, that has been functioning properly for many years and it’s a brand that people recognise. You also have the ability for these users to usually trade with their mobile phones as well as with their desktop app, don’t have to worry about using a wallet, installing MetaMask and all of those complexities. So there are still quite a few inherent advantages that they have. I wouldn’t say it’s necessarily the speed of execution or the technical infrastructure behind it, but more towards the entire user experience that they can offer.
It’s up to us with account abstraction on ZKRollups and integrations with the right fiat on-ramps, to recreate an experience that feels familiar for these users, and that feels easy for them to move towards us. — Eduard [36:45]
Going back to your question on scalability, this is indeed a problem mostly for professional traders and firms who do almost high-frequency trading and they cannot do that necessarily within the rounds of DeFi as much as they would on a centralised exchange some perpetual swap exchanges in DeFi don’t even have an API so you can’t really plugin with an API and run your strategy directly through there. So that brings a lot of limitations in terms of bringing additional debt to the order book and more and more trading activity. Which in the end would benefit everyone including retail traders, day traders and all of us. In that sense, we were aware that there are limitations in the scalability of these decentralised exchanges, now if you at something like dYdX they do about 300 TPS which is not a lot if you compare it with Binance does 1.5M TPS. For us, the solution was to create our network for nodes/validators who have a consensus algorithm that is optimised for speed of execution within the partial state of the order book. This means that the validators only know a portion of the order book and whenever a request comes in they have to look at their little book, look at their portion of the order book and check that whatever is being requested matches what they have in their little book they are going to run towards the gates to match it with a request and be the first ones to do it and that’s how they get rewarded.
This simple mechanism helps us optimise for higher frequency order book matching while maintaining its consensus and trust because you still have a consensus algorithm that validates that everything is done correctly and according to what the user is requesting. We think this new solution will be very interesting, which means that in the future everyone will be able to participate in the order book by running a node and profiting from these trade fees, liquidations and servicing the exchange, as well as users being able to enjoy greater scalability within a decentralised environment. That is some of the innovation we have created for ZKX, there is a theoretical world where we can implement ZK proofing for these node networks and we can validate even further with this additional layer that the computation is done correctly. Effectively, what we are talking about here is a problem of computation which is how we scale decentralised computation within crypto. We are still hosting our front end on AWS or Google Cloud, and we are still using centralised servers to run a lot of the operations within our applications and that’s why for us it was important to think about how we can not only decentralise the order book to achieve greater scalability but we could offload a lot of these operations whether it’s frontend, liquidations and so on to these decentralised node networks. Throughout October — December you are going to see a lot of technical papers coming from us talking about this and we are quite excited to share more.
Other Derivatives on ZKX? [43:32]
Here’s an interesting data point, about 30% of Robinhood’s revenue comes from options trading. Initially, we had the thesis that perpetual swaps are easy to understand therefore will have higher adoption therefore will be easier to bring onboard everyday users to this instrument, but then we started digging into the data and realised that options are one of the biggest revenue drivers and one of the most traded instruments on Robinhood. It was a realisation for us to understand that people do like to trade these other derivatives and they’re interested in learning more about them. Word on the street is that there are centralised exchanges in some smaller countries around the world that only offer spot trading and are losing market share to the bigger exchanges that offer other derivatives that smaller exchanges can’t offer yet.
We think there is space for that, there is an opportunity for options or some other instrument we don’t know, we have our proposal which is going to be announced very soon, the T-swaps or Tactical swaps. In very simple terms, wrap up complex options strategies and delta-neutral strategies into perpetual swaps. Our assumption here is that people love to trade, going to the trading terminal, open and closing positions, looking at the price chart, and options sometimes aren’t as dynamic as a perpetual swap can be. If you have to explain to a retail trader what a straddle, butterfly or condors are, all these different options strategies they might get lost, they might understand it but having to manage that position and understand what’s the best decision to take at any given point in time might be difficult for them as it is difficult for us because you’re managing puts and calls with different ratios and strikes. So our thesis here is to take these strategies, automate them and wrap them up into a perpetual swap in a way that within your trading terminal you can still see a trading chart, open and close positions with different kinds of perpetual swaps, not only long and short you can actually have a long or short straddle, butterfly all these different strategies available for you but you just simply put the collateral, pick the strategy and enter at any point you want and equally close it.
We think it will be a very interesting instrument for traders because it’s not a vault where you deposit liquidity and you forget about it which is not exciting, it’s not a full fledge option platform which may be too complex to manage daily. It’s still perpetual swaps, it’s still the same trading experience just with different ways of getting payouts. T-swaps are a different concept and we think will be an interesting new instrument which hasn’t been done before.
Whether you’re new to perps, looking to deepen your trading knowledge, or simply want to get in on some from the ZKX team, this is the perfect space for you!
Perps, short for “Perpetual Futures”, were first developed by BitMEX in 2016. A user can gain leveraged exposure to a position through perps by putting up a fraction of the funds required. For example, a user can put down $1 on a 50x ETH perp and the investment will behave like $50 of Ethereum.
What so special about perps? Unlike traditional futures where there is a fixed settlement date with delivery, perp positions stay open until the user closes them or gets liquidated by the exchange.
OK, but how does a contract keep going without maturity you might ask? Central to perps is the a continous exchange of payment between buyers and sellers every so often; this amount is also known as the “funding rate” and the frequency depends on the exchange.
Funding rate is calculated based on 2 components.
1. difference between the mark and index price (current future — spot of underlying) and,
2. a fixed interest rate (if applicable)
For example, an ETH/USDC pair where long ETH is in demand, the funding rate will be positive when the mark price is higher than index, reflecting a bullish sentiment on ETH.
The funding rate, alongside other incentives and fees are central to balance demand on both sides.
Trading perps gives you the ability to bet on either side of the market (long/short) and amplify gains and losses through leverage. They are often used for speculation and risk management, helping traders gain instant exposure and liquidity without holding the underlying.
This new class of asset has rapidly become a retail favorite in crypto, currently dominated by centralised exchanges such as Binance, ByBit but challenged by up and coming decentralised exchanges with the likes of dYdX, Perpetual Protocol, and now ZKX on the horizon.
Together, they contribute over $170bn in volume every 24h, more than double of spot volume across both DeFi and CeDeFi.
Excited to learn more about perps? Check out this useful guide
This section was adapted from our original thread, here.
zkLend is an L2 money-market protocol built on StarkNet, combining zk-rollup scalability, superior transaction speed, and cost-savings with Ethereum’s security. The protocol offers a dual solution: a permissioned and compliance-focused solution for institutional clients, and a permissionless service for DeFi users — all without sacrificing decentralisation.