Comment on page
Integrating Savings Contracts
Integrate Angle Savings Contracts to earn from your assets
Angle Savings contracts enable depositing Angle stablecoins to earn a yield from it.
The flow is the following: if one user deposits 100 agEUR in the contract, and governance encodes a 2% yearly rate, then after a year when the user wants to withdraw its agEUR, the contract mints 2 agEUR (it has a minting right on the token), and the user can withdraw 2 agEUR.
As such, apart from the savings contract smart contract risk, there is no extra trust assumption between owning a stablecoin and owning a stablecoin in a staking contract to earn a yield from it.
To get the rate that a savings contract is paying, you can simply call the
rateparameter of the contract. It's the per second inflation rate given in base 27.
The contract also comes with a wrapper
estimatedAPRfunction which gives the estimated APY in base 18 for depositing in this contract (rewards in the savings contract are compounding and so what this function returns is an APY rather than an APR).
A 1% APY for this function would correspond to a value of 10000000000000000.
In the same vein, you can anticipate (assuming the inflation rate does not change) how much you'll earn for a period of time by depositing in the contract by calling the
function computeUpdatedAssets(uint256 _totalAssets, uint256 exp) external view returns (uint256);
_totalAssets: How much you're depositing in the contract
exp: Period in second for which you want to estimate your earnings
- Value of your assets after
expseconds in the contract should the inflation rate remain constant
Angle Savings contract implementation is a very simple extension of the baseline ERC4626 contract. As such, the logic to deposit or withdraw assets, as well as to mint or redeem shares is exactly the same as explained here.
The only thing that changes is that in case of unforeseen events, governance has the power to pause depositing and withdrawing from the contract. To check whether the contract is paused, you can check the
pausedvariable of the contract which is equal to 1 when contract is paused.
The contract also comes with the usual
maxRedeemfunctions which have no specifities.
convertToAssetscan be used to estimate the price of the share of the savings contract (=the staked token) in reference token.
Basically, the value of 1 share in reference asset is
Different implementations for Angle savings contracts may be deployed on different chains. It's important to note that while contract addresses may be the same, the prices of the corresponding shares may completely vary from one chain to another.
The inflation rate in an Angle Savings contract is encoded by governance. As such, it is non dilutive and does not vary as people deposit more capital or withdraw their assets.
Depending on the stablecoin and on the setup, governance may follow different update schedules. And the frequency of updates may vary from every week to every several months. Between two updates, depositors in Angle Savings contract are guaranteed to earn a fixed rate on their assets.