zkLend
Published in

zkLend

zkLend X SithSwap AMA Recap 20/10/2022

Continuing with ZEND&FRIENDS ‘StarkNet Native DeFi’ AMA series 4, zkLend Co-Founder Brian hosted SithSwap Contributor, Stark Neet and talked about building an AMM on StarkNet, their tokenomics (SITH and veSITH tokens) and roadmap ahead.

Full Recording

Listen to the full recording on our Spotify now.

AMA TLDR

The ‘Why’ of SithSwap [00:41]

My journey goes a long way back, I started getting involved with Web3 in the very early days of Ethereum way back in January 2015. I started picking up Solidity around there and decided I would be an Ethereum developer which I’ve been and still am. I experienced the growth of not only Ethereum but the evolution of the entire space day by day for the last 10+ years now. Then we got to see the birth of StarkNet and then as soon as it was feasible, I co-founded SithSwap and went on full mode as a developer and founder on StarkWare. On StarkNet with SithSwap we are building an advanced stableswap.

AMM Basics [2:46]

An AMM is the most primitive and bedrock form of decentralised exchange (DEX) protocol that you can come up with which relies simply on a mathematical formula (x*y = k). First of all, you pool together digital assets that form the tradable markets. After that, it simply depends on the mathematical formula to price these digital assets which are usually fungible tokens.

Re-using the same definition, a stableswap is simply a specialised type of AMM that comes with some extra assumption which specifically relates to the price correlation of the assets in a given pool and a more adequate mathematical formula to capitalise on the extra assumption. What this means is that you will have a pricing formula for the stableswaps that is tailored for the price action, behaviour or dynamics that the typical assets you will see on a stableswap are supposed to exhibit.

Slippage [04:51]

There’s not only slippage that traders or swappers should be wary of, there are two concepts which usually work against them in an AMM which are slippage and price impact. They’re very similar concepts, but there’s a subtle difference. Slippage is the difference between the amount out that you expect when you sign your trade or your swap transaction and the amount out that you will get once the transaction is executed. What causes the slippage here are all of the exogenous events that take place in the same pool that you’re swapping into. That’s why there is a setting picking a percentage of the slippage you’re comfortable with because you never know when you sign the transaction and when the transaction is fully executed, you cannot predict or be sure if you’re going to get out as many tokens so you give a parameter limit to the protocol and if that limit is not respected the transaction will revert so you don’t get fewer tokens than you would had hoped for.

A very similar concept is the notion of price impact. Price impact is the same thing but it is caused by your trade. The conditions that aggravate price impact are low liquidity on the pool or AMM you’re dealing with. If you have thin liquidity you are bound to be trading very small amounts of a token at a time. It’s better if you’re dealing with correlated tokens in a stableswap where price impact in its nature is going to be greatly reduced but if you still don’t have a lot of liquidity in a stableswap price impact is going to be a pain for sure. Price impact is caused by whatever price movement is caused in the reserves of a given pool or more than one pool based on your trade.

What differentiates SithSwap? [08:55]

We indeed borrow some of the best elements from some other AMMs but SithSwap as a system is essentially split into two parts. On the one end, you have the fee-generating product which is the AMM and on the other end, you have an elaborate reward system. It is made up of these two ecosystems, the AMM itself you can think of as an evolution of the good old Uniswap V2 general design and contract architecture that most DeFi developers will already know how to build and integrate with. It has all the features and extremely similar APIs on purpose, plus all the features that you found in Uniswap V2 but with a stableswap also. We don’t have metapools, we have a system of binary pairs when you create a new pair/pool you can choose whether you’re creating a standard pair that is going to use the same cost and product formula, or if you’re creating a stable pair then it’s going to leverage a more advanced pricing formula which is like a modified version of Curve.

And you also have a powerful oracle system that is built right into every one of our pairs. The pairs also have variable fees, which can be set on the fly to stay on top of trading conditions, even daily trading conditions on lower time frames and down to just-in-time liquidity. It’s a small feature making the fees variable but it’s a powerful one. You also get built into each pair made freely available to any other contract on StarkNet’s highly secure 30-minute time-weighted average price oracle which essentially tracks each pair reserves over time and effectively provides reliable price feeds to any other contract on StarkNet. It comes with the same caveats as any other on-chain oracle which depending on the trading volume, liquidity and reserve requirements, pending those it is a bulletproof type of oracle for other protocols on StarkNet like zkLend to use as price feeds.

For V2 I can share that we are already building. We are not doing anything too drastic, so we are taking everything that we built and we are adding concentrated liquidity. Every feature I just talked about, but we will make all that work along with concentrated liquidity. Ambient liquidity is our current liquidity and then we are going to have concentrated liquidity on the ticks which are very specific price ranges. So you are going to have essentially Uniswap V2 and V3 merged into one system, that’s going to be our V2. We would like to have it out by the summer of next year.

SITH & veSITH [17:23]

Technically the two systems, AMM and reward system are completely independent, they are perfectly capable of not needing the other, but they are designed to work together. What this means that the way that both systems will be rolled out, we can afford to roll out the AMM on its own and leave it on mainnet for any number of months or at least until the liquidity conditions make sense for us to launch phase 2 and the AMM will hold on by itself just fine as a standalone product and do so in a sustainable way. The reward system is there simply to be turbocharged through incentives, which the AMM users deserve. The reward system is also done in a way that it is product agnostic, open to whoever decides to purchase SITH or become a veSITH holder. Further down the line when more versions of the AMM are available the whole system is designed in a way that it can outlive all of these old product versions.

A great way to start unpacking the reward system is with the two tokens which sit at the centre of it. The SITH is a reward and utility token whereas the veSITH is a Non-Fungible Token (NFT) governance token, it’s not only used as a governance token but also to capture all of the good stuff which is 100% of the trading fees generated by the AMM every week as well some re-basis which are anti-diluted on purpose.

Starting with the SITH token let me just briefly sum up how the launch for phase 2 is going to look which involves the reward system. We are going to launch the AMM on mainnet and leave it there and polish everything around it, whether it is the interface, analytics, and so forth. When we see liquidity on StarkNet start kicking up then we are going to get ready to roll out phase 2 which involves the reward system with the tokens. Before that, we might conduct a public sale always contingent on how much liquidity and how ready StarkNet is going to look in a few months, for now, we’ll be taking a serious look at that. So there might be a public sale between these two phases. By the time phase 2 is ready to roll out we are going to put out a redeemer contract for those who participated in the public sale to redeem their tokens. We are going to put out vesting wallets which have the responsibility to lock up and vest over time linearly the allocation for the seed investors and the team. And more importantly, we are going to deploy liquidity mining programs that ensure that the process of phases 1 and 2 can meet and start spinning from very early on. Those are the first three steps building up to phase 2.

At the end of the liquidity mining program you will see a pre-whitelisted list of gages where you can vote, you can lock up your SITH token in our voting escrow which gives you back veSITH NFT tokens to vote for whatever is going to be on the list that kicks everything into motion. What that does to your veSITH is that whenever you vote for one or more gages elect those gages to receive a proportional allocation to voting power received of weekly SITH rewards, which are the protocol emissions that we have earmarked over 70% of the total supply. So every week there are new gages that can be any token but most likely it’s going to be our LP pairs token. What it does is it kicks into motion the rest of the phase 2 features that we have to LP holders who have provided liquidity to SithSwap and staked into relevant gages if they were already whitelisted from the very next epoch they will start accruing a proportional share of weekly SITH rewards. And the veSITH holders who voted for these gages will get a 100%, proportionally, that those pairs accrued over the same epoch. At the end of the epoch, the veSITH holders are going to get an anti-dilutive to rebase which is a very tiny component, a tiny share of the newly minted SITH each week, and is there to better align and motivate people to continue to lock up their SITH as it’s minted every week otherwise it wouldn’t be fair if as you are max-lock your SITH for four years and meanwhile over there will be a lot of SITH minted during four years, the anti-dilutive re-basis is there to help with that. At the same time, LP holders are constantly incentivised to keep liquidity in our pairs and to continue to do it if they want to receive more weekly SITH rewards.

Building an AMM on StarkNet [30:56]

My background as an Ethereum builder coming to StarkNet involved very specific decisions for its technological stack. For any Ethereum developer taking on development on StarkNet is a challenge in many ways the language of the smart contract is completely new. In terms of the network, if you have tested any of the dApps on testnet or mainnet you will see that there is still a lot of work to bring performance on par with other chains. The developer experience is very reminiscent of the very early days of Ethereum when Solidity was in its infancy, most of the tools barely worked, and they had a lot of rough edges. I see a lot of similarities and parallels, having gone through all of that in 2015 and 2016, we need to keep our eyes on the prize and look beyond the obstacles and once all these issues are dealt with and StarkNet is fully live we are going to see the true potential of what StarkWare has been building.

Today we have essentially three big validity rollup competitors which are StarkNet, zkSync and Polygon’s zkEVM. I still feel that the right place to be, the one with the longest horizon possible is StarkNet. I think just like Ethereum among L1s, StarkNet among L2s has the most forward-looking roadmap and vision and obviously, the talent to execute that. — Stark Neet [33:38]

I listed what my grievances are as a builder, but I still think it’s the right place to be and I think it’s the first platform to achieve truly global scale within the next couple of years. But probably are not going to get as much attention as the merge did but there are crucial to reposition Ethereum as a much more rollup-friendly chain in the first place and then StarkNet is going to do the rest.

One pain point for many projects can be the lack of a general-purpose indexer because there is a lot that goes into delivering a polished project on any chain and a big part of it is indexing and extracting data from each point, processing that data and presenting to the user may be in the form of analytics. It is a very common need and unfortunately currently on StarkNet you need to find your solutions. One of the things that I’m most looking forward to besides the core infrastructure, StarkNet is going to bring about the first iterations of the parallelised sequencer. The thing I want to see the most is for the all-space, all-builder ecosystem to very precisely follow suit with the first Cairo releases and move to Rust as aggressively as possible. It’s probably the lowest hanging fruit because it is relatively easy to do, just need to have the will to do it as builders as a whole but it’s going to have a big payoff if we do it because the move to Rust alone will unlock an order of magnitude of performance on its own without any further infrastructure improvements or optimisations to StarkNet. To be fair there’s been very promising and encouraging developments there; the biggest is probably the first Rust-Cairo VM. I just wish more tools and libraries would follow through as quickly as possible.

What the Future Holds for SithSwap [40:06]

What users can look forward to the soonest is a redesign of the SithSwap interface which will look pretty good and also the first release of the analytics. Then in Q1, we need to be very careful with the mandatory upgrade to the first release of Cairo 1.0. Whenever that’s out, as soon as we have enough information on that we can give an estimate as to when we plan to launch the AMM on mainnet, I’m sure it’s going to be before the end of Q1 no matter what so they can also look forward to our mainnet. And based on how the liquidity situation is and just how ready StarkNet is, ready as a blockchain, how that starts looking after the AMM release we are going to pin down and release phase 2.

About SithSwap

SithSwap is a next-gen #AMM built on StarkNet that offers instant volatile (variable) and stable swaps, leveraging on #StarkNet to achieve ultra-low slippage and near-zero fee transactions. It offers innovative AMM engine coupled with a token design that put users and liquidity providers at the heart of its design

SithSwap is designed to have two sets of tokens:

(i) $SITH — ERC-20 utility tokens for rewards emission and distribution

(ii) $veSITH — ERC-721 governance tokens for voting right

It utilises ve(3,3) mechanism to reward actions that support protocol’s growth and stability, while Gauge Voting gamifies trading fees reward system and encourage active user engagement

$SITH holders lock tokens to receive $veSITH, which enjoy rewards such as:

  1. receive weekly $SITH emissions
  2. vote on liquidity pair gauge to receive claim of trading fees and bribes
  3. create and vote on whitelisting new tokens

SithSwap passed Cairo Lang audit early this month, and a refreshed Alpha Goerli testnet will be deployed soon. Also look out for their Alpha Mainnet deployment just around the corner!

This section was adapted from our original thread, here.

About zkLend

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.

Website | Twitter | Telegram | Discord | Spotify

--

--

zkLend is an L2 money-market protocol built on StarkNet, combining zk-rollup scalability, superior transaction speed, and cost-savings with Ethereum’s security.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
zkLend

zkLend is an L2 money-market protocol built on StarkNet, combining zk-rollup scalability, superior transaction speed, and cost-savings with Ethereum’s security.