gooberxyz / goobervault

An ERC-4626 style vault with Uni-V2 NFT<>ERC-20 bonding and VRGDA balancing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Goober dot xyz

Goober Vault

ci codecov

A special flavor of Uniswap V2 meets ERC-4626 to form a yield optimized vault for Art Gobblers.

Abstract

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 is a yield-optimized farm and liquidity engine for Goo and Gobblers. Goober allows a user to effectively pool their Goo and/or Gobblers with other users, such that they all receive more Goo emissions together than they would on their own, allowing market forces to maintain the optimal ratio of Goo/Gobblers in the pool. A unique combination of of Uniswap V2 and EIP-4626 forms a special purpose AMM with vault-like characteristics and internal maintenance mechanics. Aside from bonding an ERC20 with an ERC721, Goober diverges from Uni-V2 via its VRGDA implementation. The vault can mint new Gobblers when it’s profitable to do so under calculated contraints from the constant product formula and pool reserves, increasing the rate of future Goo emissions whilst continuing to keeping the pool balanced.

Through Goober users can 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.

Motivation

The Gobblers economy in its current form inherently converges towards a monopolization of resources. Since early, well funded 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.

Mechanism

Utilizing an amalgamation of Uniswap V2's constant function market math, an ERC4626 yield-bearing vault (with GBR as the vault token), and automated VRGDA minting (using probabilistic computation compared to internal pricing) Goober aligns incentives to create an optimal balance of Goo and Gobbler multiplier for increased liquidity and Goo production across market conditions.

Since Art Gobblers NFTs produce Goo according to the formula:

$$\sqrt{Goo * Mult} = GooProduction$$

The rate of growth of Goo happens to be maximized when Goo = Mult. There is an evident comparison with Uniswap v2's $x * y = k$ constant product market maker design, where the point of maximization is also the point at which $X = Y$.

Thus, Goober optimizes $+Δk$ for $x+y$ using an $x*y=k$ constant function market maker, where $$x=Goo$$ $$y=Mult$$ $$k={Goo * Mult}$$ $$\sqrt{k}=GooProduction$$

Resources

Documentation can be found here.

Deployments

Contract Mainnet
Goober 0x2275d4937b6bFd3c75823744d3EfBf6c3a8dE473

Developer Guide

Running Tests

Install Foundry

In order to run unit tests, run:

forge install
forge test

For longer fuzz campaigns, run:

FOUNDRY_PROFILE="intense" forge test

Running Slither

After installing Poetry and Slither run: Slither on Apple Silicon

poetry install
poetry shell
slither src/Goober.sol --config-file slither.config.json

Updating Gas Snapshots

To update the gas snapshots, run:

forge snapshot

Generating Coverage Report

To see project coverage, run:

forge coverage

License

MIT © 2022 Goober

About

An ERC-4626 style vault with Uni-V2 NFT<>ERC-20 bonding and VRGDA balancing

License:MIT License


Languages

Language:Solidity 98.7%Language:Shell 1.3%