Inspiration
I read the following paper a few weeks ago, and had the idea to extend it and implement the concept: cool white paper
What it does
I wrote solidity contracts to model an adaptive market maker -- whose trading curves can be tunable by a parameter q. For certain q-values, we approach a more linear regime like Curve Finance for stable coins. For other q-values, we can replicate the constant product market maker (i.e. uniswap), and for still other q-values, we can add even more curvature, which would be appropriate for extremely volatile or leveraged assets.
How we built it
I used solidity and the hardhat framework to deploy the smart contract. I borrowed a square-root solidity function from uniswap's github. I did feasibility studies using python to model the exchange, trading process, and q-update process. I used next.js and moralis to build a front end to interact with the smart contract.
Challenges we ran into
I ran out of time towards the end, so didn't get to implement everything I wanted to. One challenge was implementing fractional exponents in integer-based math solidity. To simplify, I only used q values of -1,-0.5,0,0.5,and 1. This allowed me to use integer powers and square roots, which were easier to implement in a short time.
Also, I in trying to get a front-end stood up, it took a bit longer to implement all the web development pieces. I had hoped to get a simple Chainlink Keeper implemented to show the adaptive update process for q, but in the end did not have time.
Accomplishments that we're proud of
Deployed my first solidity contracts. Did troubleshooting with the smart contract code, as well as its interface to the front-end. Prototyped a dApp in less than 2 weeks.
What we learned
Learned how to deploy solidity contracts both on localhost and on Rinkeby using hardhat. Learned how to deploy a web front-end using vercel.
What's next for AdMM: Adaptive Market Maker
Adding Chainlink Keepers to periodically check the price volatility and determine better values for q for a given token pair. Implement the full ERC-20 transfer functions. Do security checks on the code base.
Log in or sign up for Devpost to join the conversation.