Skip to content

HickupHH3/goostew

 
 

Repository files navigation

GooStew

Note pronounced gusto with an Italian accent - gù·sto

GooStew optimizes goo production for its users. Users deposit gobblers and/or goo and receive more goo than they would have received from goo inflation. The simplest example is pairing a gobbler without goo with a user who does not own a gobbler but has lots of goo; or a gobbler with a high emission multiple but a low goo tank with another gobbler with a low emission multiple but a high goo tank. Combined, the goo production will be higher than the sum of their individual goo productions.

It turns out that providing your gobblers and goo to the protocol is always superior to producing goo on your own, no matter your gobbler / goo ratio. Intuitively, this is because putting all goo into a single pot and optimally distributing this goo over all gobblers (according to their different emission multiples) leads to a higher total goo production than the sum of several smaller non-optimized gobbler & goo pots.

GooStew is therefore a no-loss goo production protocol. In the worst case, users receive as much goo as they would have produced on their own, in the average case they vastly improve their goo production. The additional goo produced by the protocol is distributed to users according to their individual contributions. See the technical paper for more info on how contributions are measured.

Features

  • increased goo production for everyone
  • allows goo-only contributions of users that do not own any gobblers. This group is set back especially hard by ArtGobbler's goo production mechanism and GooStew helps this group earn part of the goo inflation.
  • ibGoo: When depositing any goo, the protocol issues inflation-bearing goo tokens which are a claim on the ever-increasing total goo pot. Market making goo is tough because the total goo supply inflates quadratically and goo LP positions don't earn any of the goo inflation. We see ibGoo as a better choice for providing goo liquidity.

Development

forge install
forge build
# copy example.env and fill in the required env vars
cp example.env .env
forge test

Run Tests

source .env
forge test -vvv

Gas Benchmarks

forge snapshot --match-contract BenchmarksTest --diff

Web app testing

source .env

# start local anvil node forking from mainnet
anvil --accounts 1 --fork-url $ETHEREUM_RPC_URL --fork-block-number 15854780 --port 8546

# deploy contracts to local node
forge script script/DeploymentLocal.s.sol:Deployment --rpc-url local --broadcast -vv

# let web app know the ABI & deployment addresses
cp out/GooStew.sol/GooStew.json ../goostew-app/abis/GooStew.json
cp broadcast/DeploymentLocal.s.sol/1/run-latest.json ../goostew-app/abis/deployment.json

Deployment

source .env

# mainnet
forge script script/DeploymentEthereum.s.sol:Deployment --rpc-url mainnet --private-key $PRIVATE_KEY --broadcast --verify --etherscan-api-key $ETHERSCAN_KEY -vvvv
# if verification fails with "Etherscan could not detect the deployment.". Resume script
forge script script/DeploymentEthereum.s.sol:Deployment --rpc-url mainnet --private-key $PRIVATE_KEY --resume --verify --etherscan-api-key $ETHERSCAN_KEY -vvvv

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Solidity 99.9%
  • Shell 0.1%