Goober is a yield-optimized farm and liquidity engine for Art Gobblers, the experimental, decentralized art factory by Paradigm. Art Gobblers was constructed using two new innovations, GOO (an emission mechanism) and VRGDA (a Dutch auction mechanism). Gobblers continuously produce Goo, an ERC20 token, proportional to their multiplier and how much Goo is already in their "tank", a balance held per Ethereum address.
Goober allows users to permissionlessly swap Gobblers and Goo, as well as deposit Goo and fractionalize their Gobblers in order to maximize their Goo accrual without the need for active management. By depositing Gobblers and/or Goo into the vault, users receive GBR in return, an ERC20 token that gives depositors claim to the assets in the vault.
Several months prior to the release of Art Gobblers, the Paradigm team reached out to Grug, now a member of the Goober team, with the goal of gathering a group of MEV searchers to battle test the Art Gobbler issuance mechanism. The Art Gobblers contracts were deployed on the Goerli testnet with parameters sped up 30x in order to simulate 2 years in 2 weeks.
The test imparted a great degree of knowledge about the VRGDA and GOO mechanisms underpinning Art Gobblers onto all the participants. Notably, that participants who did not hit the ground running early would stand little to no chance of keeping up their Goo accrual with those that did.
This has also been true in production the existing Goo and Gobbler distribution heavily favors those with deep pockets or who colluded early on. Since these actors possess the most Gobblers, they produce the most Goo, in turn continuously driving the price of the auction beyond any new entrants' reach - at a quadratically increasing rate. Thus, a user with one or two Gobblers who has just gotten involved will likely never be able to mint another Gobbler with their Goo holdings.
Compounded by the fact that there is also low liquidity for Goo across decentralized exchanges, this dynamic makes it even more difficult for the average user to get the Goo flywheel turning without owning a Gobbler themselves. It has also caused large holders to mint from auction at an irrationally high Goo cost compared to the outstanding Goo supply. Since Gobbler prices on secondary markets inherently trade at a premium to the auction price, the average user has been effectively boxed out of the game.
Both liquidity and the ability to effectively pool capital with other users are necessary to compete with the quadratic inflation of Goo in the Art Gobblers system. Additionally, determining an optimal minting strategy (given a game-theoretical and probabilistic approach to VRGDA) to automate liquidty management and passive rebalancing.
It is very difficult to account for illiquidity and market fluctuations. In trying to solve for this, it became apparent that a constant function market maker optimizes for Goo production, it matches the shape of the function for optimal Goo production, and in fact, the unit of Goo and Gobbler production is the native unit of liquidity for a Uniswap V2 like automated market maker.
Thus, we set out to buid a special purpose AMM with yield bearing vault-like characteristics and managed minting mechanics. Where Goober diverges from Uniswap V2, aside from bonding an ERC20 with an ERC721, is the fact that the vault can mint new Gobblers when it's profitable to do so, returning them to the pool (shifting the curve) and increasing the rate of Goo emissions.
Utilizing an amalgamation of Uniswap V2's constant function bonding, an ERC-4626 yield-bearing vault (with GBR as the vault token), and automated VRGDA minting under certain market conditions, Goober aligns incentives to create an optimal balance of Goo and Gobbler multiplier for increased liquidity and Goo production across market conditions.
The rate of growth of Goo happens to be maximized when . Thus, there is a clear comparison with Uniswap V2's constant product market maker design, where the point of maximization is also the point at which .
Art Gobblers NFTs produce according to the formula:
Where is the multiplier of Art Gobbler NFTs in a wallet and is the Goo balance of a wallet.
Goober implements a Uniswap V2 style automated market maker where the total amount of in the vault, is the vault's total Gobbler , is the constant product of the reserves, is the instantaneous at some time , and GBR is the LP token.
Aligning the proportion of Goo and Gobblers in the vault with market forces using a bonding curve, optimizes for both Goo production and liquidity.
GBR is the ERC4626-like ERC20 vault token herein referred to as , representing fractions of the pool. The issuance and redemption rates of are determined by the change in , or , outlined in detail below.
The protocol charges a management in from what is minted during
deposit() and on the growth of in dilution. For example, if grows by , the protocol mints another of the total outstanding supply for itself.
The pool charges a 30 basis point swap fee, which accrues to GBR holders.
Since we want to optimize Goo emission, we create an incentive for increasing upon
The total rate of emission of the vault is tracked by a constant , where
When a deposit is made to the pool, a new value of reserves is calculated based on the amount of each asset added by depositor ,
Now that we have some increase in our emission,
the depositor should be rewarded accordingly. Thus, the vault mints some amount of , GBR to transfer to the depositor, where
subsituting for , we get
which can be simplified to
our issuance formula.
Since represents a fixed fraction of the pool. As the pool grows, so to will the assets redeemable by the fraction.
On withdraw, a user exchanges some for and/or , burning the respective amount of in the process.
Since, a withdrawal decreases the reserves, then post withdraw:
Since the pool's rate of emission has decreased, then so too must its supply of outstanding fractions by a proportionate amount.
We can derive the amount of reserves allotted to an amount of from the inverse of the issuance calculation:
which can be rearranged to
where and represent the respective amounts (each can be solved for interchangeably) that can be withdrawn simultaneously for some amount of fractions upon
Creating a liquid, balanced pool of Goo and Gobblers also enables users to swap efficiently between either asset, and for the vault to accrue fees and increase the growth of (Goo production).
swap() with initial reserves and , the new balances and are determined by:
we can rewrite the net changes () in Goo and Mult as and respectively.
Since we know the constant product must remain greater than or equal to the original after , and because is not unitarily interchangable, if the inequality does not hold, there is some amount of
erroneousGoo , that must be added to as additional or withdrawn from as additional for to make the inequality hold such that:
subsituting we get
or at point of equality:
which we can rearrange to
therefore, the erroneous goo can be expressed as,
which can be used to balance a swap that doesn't have the correct parameters.
As with all constant function market makers, there will always be some price impact inherent to swaps, as a function of the size of the order in relation to the size of the pool. In the case of Goober, this is best expressed as a percentage change in the ratio between and .
To solve for some price impact for
swap() , we must first calculate the change between the ratio of and , the price impact for the swap expressed as an absolute change in the ratio of the reserves for is:
which in the expanded form yields
and since we know that , and , then
then we can subsitute
which gives us the price impact in terms of values for and that maintain the exact constant product.
Goober also allows for flash swaps which allow a user to receive and use some Goo or Gobblers before paying for them, as long as they make the repayment within the same atomic transaction.
swap() function makes a call to an optional user-specified callback contract in between transferring out the tokens requested by the user and enforcing the invariant . Once the callback is complete, the contract checks the new balances and confirms that the invariant is satisfied, after adjusting for fees on the amounts paid in. If the contract does not have sufficient funds, it reverts the entire transaction. A user can also repay the Goober pool using the same token, rather than completing the
swap(). This is effectively the same as letting anyone flash-borrow any of assets stored in a Goober pool, for the same dynamic fees as Goober charges for regular swaps.
Since Goo growth of a given tank grows quadratically per added , it is optimal for the growth of to increase as often as possible. On-chain conditions determine when it is preferable for the pool, or an Externally Owned Account, to mint a new Gobbler from the VRGDA auction rather than buying a Gobbler at the pool's market rate.
The weighted average multiplier of a newly minted Gobbler can be derived from the mint probabilities specified in the Art Gobblers smart contract, which yield an average per mint of
Also we define,
Where follows the logistic VRGDA formula in based on the state-of-the-Art Gobblers smart contract at time .
At any time the Goober pool is willing to buy revealed Gobblers for a price , which can be calculated as the absolute value of
gooErroneous required to balance a one-sided swap of for 0 .
Given that price at which the pool is willing to buy a revealed Gobbler, there exists some price at which it is statistically profitable for the pool to buy an unrevealed Gobbler at some time away from reveal.
also happens to be the price it makes sense for the pool to pay for minting a new Gobbler from the VRGDA, which is functionally the same as buying an unrevealed Gobbler. Because of the Art Gobblers implementation, the value of can be found using modulo division on the present unix timestamp as follows
Emitted over some time is determined by the integral of the instantaneous rate of goo growth
by calculating the pool's new reserves after buying an revealed Gobbler
and the new after reveal, or if the pool had bought a similar revealed Gobbler
since an unrevealed Gobbler has until , there will be a difference in emission between the reserves of the pool had it bought a revealed Gobbler for and had it bought an unrevealed Gobbler for at time over the time interval - , which can be expressed as:
Therefore, we can express some discounted value of an unrevealed Gobbler in Goo at time as the extra reserves that must be present to satisfy
subsituting, rearranging and simplifying, we get
We can then subtract the discount from the known revealed Gobbler price to arrive at the price we can pay for an unrevealed Gobbler
therefore, an unrevealed Gobbler should be purchased from the VRGDA at time when
A experimental and permissively licensed (MIT) implementation of Goober can be found at gooberxyz/goobervault. Pull requests with improvements are welcome.
We believe Goober will democratize access to the Art Gobblers game, and make the GOO and VRGDA mechanics of the game function more smoothly over time.
If you are interested in integrating Goober into your project, we’d love to hear from you.
You can reach us on Twitter at @mevbandit, @0xAlcibiades, and @CapitalGrug.