Amphor protocol is a L1 DeFi protocol proposing ERC-4626 based strategies.
The first startegy to come out is a timelocked strategy that require the funds
to exit the vault during the product duration (which varies from 2 to
6 weeks).
This vault is the most basic strategy on the code side because the funds are
deposited by the users, then the vault is locked during the product period. Once
it has been locked, the funds go to a market maker wallet that is keeping the
assets in garantee.
At the end of the period (which varies from 1 to 5 weeks), Amphor
get back the funds into the vault and users can deposit and/or withdraw
again.
For the first iteration of the protocol, the only underlying supported will be
USDC from Circle.
In the future, we might support WBTC and WETH as underlying assets.
Since USDC token supports Permit operations but not WBTC and WETH, we
have separated this feature into another contract (AmphorSyntheticVaultWithPermit).
NOTE: Management of the vault is handled by a multisig wallet.
- The vault contract is deployed (
constructor) and some funds are directly deposited into it in order to bootstrap it and prevent as much as possible from inflation attacks (event if there are others protections from it). A performance fee of20.00%forAmphorprotocol is set. - The vault is open for
depositandwithdrawduring a little period (approx 2 days). - The vault is locked (
deposit/withdrawshouldn't be possible) with thestartfunction (callable only byowner/manager of the vault). During this transaction the funds are withdrawn from the contract. - After the product period end, the vault is unlocked (
deposit/withdraware now be possible) using theendfunction (callable only by theownerof the vault). In case of a positive performance, some fees are taken fees by the protocol (that cannot exceed30.00%and can only be changed byownerof the vault).
AmphorSyntheticVault.sol: VanillaAmphorSyntheticVault.AmphorSyntheticVaultWithPermit.sol:AmphorSyntheticVaultwithPermitfeature.
L1_USDC_DeployAmphorSyntheticVault.sol: Deployment script forAmphorSyntheticVaultWithPermitwithUSDCas underlying. Should bootstrap the vault with100 USDC(based on theenvfile). Should set the perf fees to20.00%.L1_WBTC_DeployAmphorSyntheticVault.sol: Deployment script forAmphorSyntheticVaultwithWBTCas underlying. Should bootstrap the vault with0.01 WBTC(based on theenvfile). Should set the perf fees to20.00%.L1_WETH_DeployAmphorSyntheticVault.sol: Deployment script forAmphorSyntheticVaultwithWETHas underlying. Should bootstrap the vault with0.1 WETH(based on theenvfile). Should set the perf fees to20.00%.
a16zCompliance.t.sol: Implements the tests ofa16z. Unfortunaly we didn't manage to make them work.cryticCompliance.t.sol: Implements the tests ofcrytic(from Trail of a bits). These one pass, you can launch them with the following command:
$ echidna . --contract CryticERC4626PropertyTestsSynth --config test/echidna.config.yaml
SyntheticBase.t.sol: Should define a part of the main state variables. Should define some functions that will be directly used into the actual tests.SyntheticBasic.t.sol: Should implement some basics tests that test the vault state variables and some basic properties of the vault.SyntheticDepositAndWithdraw.t.sol: Should implement some tests on the deposit and the withdraw function.SyntheticEndAndStart.t.sol: Should implement some tests on the start and the end function.SyntheticInflation.t.sol: Should implement some tests demonstrating vault resilience in the face of inflationary attacks.SyntheticPausable.t.sol: Should implement some tests demonstrating the good working of thePausablefeature.SyntheticPermit.t.sol: Should implement some tests demonstrating the good working of thePermitfeature.SigUtils.sol: Should implement utils functions used bySyntheticPermitcontract test (SyntheticPermit.t.sol).
The protocol is a Foundry project. Foundry a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
$ forge build$ forge test$ forge fmt$ forge coverage$ forge snapshot$ anvil$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>$ cast <subcommand>$ forge --help
$ anvil --help
$ cast --help