Alongside Crypto Market Index (AMKT) is a fully backed market index, providing exposure to a market-cap weighted basket of assets, to be rebalanced quarterly.
The next iteration of AMKT moves custody on-chain, relying on Vault
to custody underlying assets, and on governance to submit accurate Bounty
for the next set of underlying assets to rebalance.
This diagram provides a high-level overview of the system and its core functions. While it aims to capture the key components and interactions, it does not encompass the full breadth and depth of the system's functionality.
AMKT is an Upgradeable, Votable, ERC20 token on Ethereum Mainnet. It can be issued by bringing a basket of underlying assets, and it can be redeemed to receive a basket of underlying assets, as defined by Issuance and Vault.
The core system aims to be modular and minimal for maximal safety and extensibility.
-
Vault: Source of truth for the index and custodian of assets.
virtualUnits()
defines the amount of each asset required in the index.- Issuance is authorized to call
invokeERC20s()
,invokeMint()
, andinvokeBurn()
. - InvokeableBounty is authorized to call
invokeERC20s()
, andinvokeSetNominals()
. - Fee Recipient is authorized to call
tryInflation()
, which will mint accrued fees to them and adjustvirtualUnits
to account for minted tokens. - Emergency Multisig is authorized to call
setEmergency
, which will pause token issuance and rebalance, but cannot not pause redemptions. - Governance owns Vault via TimelockController. It's able to change the configurations of the vault, including fee rate, as well as roles.
-
Issuance: Entry point for issuing and redeeming AMKT.
issue()
andredeem()
are permisionless functions allowing conversion of underlying assets and AMKT.
-
InvokeableBounty: Entry point for rebalancing the index.
fulfillBounty()
is a permissioned function only callable byfulfiller
of theBounty
. It calculates amount of tokens to exchange based on theBounty
and facilitates the exchange. It also modifiesvirtualUnits
to reflect the rebalance.- ActiveBounty maintains the currently active bounty. Governance is authorized to call
setHash()
, which will make aBounty
active.
Governance is responsible for facilitating rebalances, configuring the Vault, and upgrading AMKT. Users can participate in governance with AMKT via Tally. Every governance action besides rebalances is subject to a minimum delay of 4 days, enforced by the TimelockController
.
To prevent against a malicious token Governance takeover, the Governance Multisig is the only entity authorized to cancel and execute transactions scheduled in TimelockController
.
This repo primarily uses Foundry for testing.
cd contracts && forge test
Additionally, Halmos is used for symbolic testing.
cd contracts && halmos
sdk/rebalance
contains an example Rust program to assist users with preparing a rebalance proposal to Governance.