Ham is a financial MMORPG building upon some of the least dumb ideas in programmable money and governance. Built by a couple degenerates who prefer meat to sweet potatoes, it seeks to answer
- how strong is a meme?
- how quickly can a community bootstrap itself?
- wen moon?
Read the manifesto.
At its core, HAM is an elastic supply cryptocurrency, which expands and contracts its supply in response to market conditions, initially targeting 1.00 DAI per HAM. This stability mechanism includes one key addition to existing elastic supply models such as Ampleforth: a portion of each supply expansion is used to buy assets and add them to the Ham treasury, which is controlled via Ham community governance, as well as incentivizing certain user behavior.
At launch there will be zero value in the HAM token. After deployment and initial distribution, it is entirely dependent upon HAM holders to determine its value and future development. We have employed a fork of the Compound governance module, which will ensure all updates to the Ham protocol happen entirely on-chain through community voting.
None. Seriously, look at the commit history, it's just find and replace. You probably shouldn't use this, but not everyone likes sweet potatoes and ham is delicious.
The original devs and the forking degenerates all encourage governance to fund a bug bounty/security audit. If there's no audit or bounty program, remember, any funds you deposit are basically a bug bounty.
Perhaps Sam Sun will audit this thing. Apparently that's how you get an audit these days, you just mention auditors and YOLO.
The core HAM token maintains a reserve. During each supply expansion (referred to as an inflating rebase), a portion of tokens is minted and used to build up the treasury. This treasury is then in complete ownership of HAM holders via governance.
Rather than allocating a portion of the supply to the founding team, HAM is being distributed in the spirit of Satoshi, and applied by YFI: no premine, no founder shares, no VC interests — simply equal-opportunity staking distribution to attract a broad and vision-aligned community of meat eaters.
The initial distribution of HAM will be oddly distributed across as many as 20 different staking pools. These pools have been chosen intentionally to reach a broad swath of the overall degenerate community, many of which don't like sweet potatoes.
These pools will be deployed over a 4 to 8 week period.
Following the launch of the initial distribution pools, a second distribution wave will be incentivized through multiple HAM Uniswap pools as well as other mechanisms. These pools will allow Uniswap's TWAP-based oracle to provide necessary input as the basis for rebase calculations, as well as provide liquidity for the rebase to purchase assets for the treasury.
After the launch of all pools, the initial rebase will be activated and governance will be turned over to token holders.
Rebases are controlled by an external contract called the Rebaser. This is comparable to Ampleforth's monetaryPolicy contract. It dictates how large the rebase is and what happens on the rebase. The HAM token just changes the supply based on what this contract provides it.
There are a few requirements before rebases are active:
- Liquid HAM market
init_twap()activate_rebasing()
Following the launch of the second pool, the deployer can call init_twap() on the rebaser contract, and rebasing can begin its activation phase.
The oracle is designed to be 12 hours between checkpoints. Given that, 12 hours after init_twap() is called, anyone can call activate_rebasing(). This turns rebasing on, permanently. Now anyone can call rebase() when inRebaseWindow() == true;.
In a rebase, the order of operations are:
- ensure in rebase window
- calculate how far off price is from the peg
- dampen the rebase by the rebaseLag
- if positive calculate protocol mint amount
- change scaling factor, (in/de)flating the supply
- sync uniswap, mint, sell to uniswap, transfer excess HAM and bought yCRV to reserves
- call any extra functions governance adds in the future (i.e. Balancer gulps)
Governance is entirely dictated by HAM holders from the start. Upon deployment, ownership of all HAM protocol contracts was reliquished to the timelocked Governance contract or removed entirely. At the very least, this can be seen as a reference implementation for a truly decentralized meat-farming protocol.
This repo uses Buidler, Typechain, and Waffle.
To build the contracts run
npm run buildRun tests with
npm run testMuch of this code base is modified from existing works, including:
Tornado -🌪️🐷
YAM - Basically s/YAM/HAM/g
Compound - Jumping off point for YAM token code and governance
Ampleforth - Initial YAM rebasing mechanism, modified to better suit the YAM protocol
Synthetix - Rewards staking contract