Optimizing Liquidity Allocation on SushiSwap's DEX

Summary

Prior Work:

Over the summer we built an optimization algorithm for liquidity allocation on Sushi Swap (https://twitter.com/eljhfx/status/1426389242096328705). It decides which liquidity pools should exist and how much liquidity to allocate into each pool. Our initial results eliminated approximately 100,000$ in slippage and gas fees for traders in a 24 hour period (relative to the current allocation method) while maintaining or increasing fees earned by liquidity providers.

Deliverables:

Our immediate action items for this grant are as follows:

  1. Improve the readability and runtime of the liquidity allocation optimization algorithm
  2. Scale up the algorithm to consider more tokens and pools (eventually the entire DEX)
  3. Use more data for training and separate training from testing data to prevent overfitting
  4. Design mechanisms for implementing the findings to tangibly improve SushiSwap by lowering gas fees and slippage
  5. Formalizing the results in an academic journal style article submitting it for publication

Long Term

We think that our backgrounds would be helpful for optimizing SushiSwap in other areas in the future. Specifically, we have already spoken at length about concentrated liquidity, impermanent loss and efficient routing algorithms. Although these are outside the primary scope of this initial grant, we would like to help SushiSwap on these items in the long term and will continue making progress on them throughout our time funded by the grant.

Grant Specifications

Requested amount
17.5k Sushi

Labor

  • Both of us are currently in school and working in blockchain so our additional available hours are limited. To supplement the hours that we will put into this, we plan to bring on a couple of talented researchers with similar backgrounds to help speed up the process.

Computing Costs

  • Building, training, and running Combinatorial optimization algorithms is expensive, both in terms of time and computational resources. The first iteration of our algorithm ran on a MacBook; however, as we scale up the size of the inputs, we will need far more computing power. We plan to use some of the grant funding to pay for cloud computing units and local computing resources.

Office Supplies and Office Space

  • Research, unlike development, lends itself more naturally to an office environment. Asynchronous and remote work in research often inhibits the types of helpful collaboration that are essential to excellent research. For that reason, we would like to rent a small office space to facilitate collaboration.

About Us:

Elijah Fox@eljhfx is a 4th year undergraduate at the University of Michigan studying Computation, Cognition, and Complex Systems. He plans to pursue a graduate degree in Systems Engineering or Computer Science.

Max Resnick@MaxResnick1 is a 4th year undergraduate studying Pure Math and Complex Systems at the University of Michigan, he will be pursuing a master’s degree at MIT in Economics next year.

7 Likes

What would the timeline be for completing the research?

How did you come to the figure of 17,500 $SUSHI as the grant amount?

A tentative timeline would be the algorithm improvement in 3-5 months, paper approx. 1 month and designing systems approx. 2-4 months. Afterwards we would also help with any implementation and consult on other ways to use the findings. Ideally the end product could be used for years after it is finished. We came up with 17,500 SUSHI for labor costs, computing resources and a working space. Most of it would go to labor (approx. 15,000 for 4-5 researchers) since we want to bring in a few more researchers with expertise in computational complexity, algorithmic game theory and stochastic processes and are actively looking for a university advisor. We have also been actively diving into other major problems with DEXs (IP, CL, routing), which we’ll be able to continue with some of the funding. Some would go into computing costs (approx. 1,250). Up to this point we’ve been running it locally on a MacBook, and want to buy both AWS credits and local computing resources. The runtime scales massively w/ the number of tokens, so if we want to add 20+ tokens, and run it on a weeks+ worth of data, we’ll need to use something much faster than a MacBook. Finally we are all based in Michigan and wanted to get a small working space to rent at a reasonable price to meet and work at (approx. 1,250). We strongly believe that research is done better in an in-person environment and also need a private, quiet, place to work and set up any computing resources (since we all have roommates). The grant could also be in USDC or some combination of USDC and $SUSHI that is convenient for the SushiSwap.

4 Likes

I don’t know if you have looked into it, but if you apply for AWS Activate, you can get up to $100k in AWS credits. The registration process is fairly easy, from what I remember. Love that you’re taking such an initiative. Have you given more thought to better re-allocation mechanisms, meanwhile?

3 Likes

Thanks for the answers, Elijah. I mean, I have no say other than to vote if the proposal goes up, but from a business standpoint, I thought it was worth digging in a little deeper on proposed spending and costs.

Also, as @pegbit mentions, there are options for free AWS credits. Here’s the Activate program that Pegbit mentions: AWS Activate for Startups, Founders, & Entrepreneurs.

2 Likes

We have a few ideas but definitely need to spend more time brainstorming and working out the details. The major limitation for these algorithms is Gas fees, since constantly reallocating liquidity according to some variant of this algorithm can get expensive quickly. Of course this is less of a problem on Polygon. One idea is a quick reallocate option for LPs with a deposit bonus. With a single click LPs would be able to change their position for a bonus. Another would be to redesign the fee structure for LPs to better match the optimal solution.

1 Like

Okay, here is a little more information provided by @Elijah in the AMA channel: https://twitter.com/eljhfx/status/1426389242096328705. It was added to his initial post but I guess I missed it there.

I’m not sure I fully get the technical specs. Maybe we need to have one of our core devs take a look assuming we want to take a look at this in further depth?

Are there any technical specs I could help explain?

1 Like

Not for me, Elijah. It’s a good idea. I imagine the core team will have more questions. But I appreciate your willingness to answer Q’s.

1 Like