diff --git a/docs/contributing/documentation/writing-style-guide.md b/docs/contributing/documentation/writing-style-guide.md index 6cc38f235d..5a1fa7c3ce 100644 --- a/docs/contributing/documentation/writing-style-guide.md +++ b/docs/contributing/documentation/writing-style-guide.md @@ -114,7 +114,7 @@ The examples below use dollars, but the same rules apply to all global currencie - When directly referring to the creation, destruction, or manipulation of a token (particularly as it relates to tooling) or when referencing the token as a currency, in an instructional or conversational setting, or as a conceptual product of the Foundation or its systems: - Use the proper prefix if necessary and capitalized TLA version: `wETH` - - **Example:** “wETH is a token that represents Ether 1:1 and conforms to the ERC20 token standard.” + - **Example:** “wETH is a token that represents Ether 1:1 and conforms to the ERC-20 token standard.” - Similarly, when referring to exchange pairs: - Use: `wETH/DAI` diff --git a/docs/contributing/governance/governance-and-operations.md b/docs/contributing/governance/governance-and-operations.md index c9924ffeb8..8a2b96eeda 100644 --- a/docs/contributing/governance/governance-and-operations.md +++ b/docs/contributing/governance/governance-and-operations.md @@ -8,7 +8,7 @@ Multi-DAO refers to the fluid number of decentralized autonomous organizations ( - **YFI holders** vote for changes to the protocol or the governance structure - **yTeams** focus on specific aspects of the protocol or relevant operations -- **Multisig** members execute or veto any on-chain decisions +- **Multisig** members execute or veto any onchain decisions Token holders have an ultimate say over what yTeams exist, who is part of the Multisig, and the limitations of each group's operational control. The term 'constrained delegation' originates from token holders delegating specific powers to various groups building and managing yearn. @@ -81,11 +81,11 @@ Each yTeam is assigned specific decision-making powers, defined by YIP-61: ### Multisig -Decisions issued by yTeams will be executed on-chain by the Multisig until a more decentralized system is approved for implementation. In the meantime, the [Multisig](/developers/security/multisig#members) controls the following: +Decisions issued by yTeams will be executed onchain by the Multisig until a more decentralized system is approved for implementation. In the meantime, the [Multisig](/developers/security/multisig#members) controls the following: | Power | Description | | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | -| Execution Power | The power to execute decisions made by YFI holders and yTeams on-chain | +| Execution Power | The power to execute decisions made by YFI holders and yTeams onchain | | Veto Power | This power allows the Multisig to veto any decision and ideally should not be needed | | Transitionary Power | A temporary power enabling the Multisig to operate under the mandate of YIP-41 until the set of decision-making powers covers all needed transactions | @@ -94,7 +94,7 @@ Decisions issued by yTeams will be executed on-chain by the Multisig until a mor Yearn continuously paves the way towards an ideal balance of DAO decentralization and productivity. The current phase of efforts implements changes mainly on the social layer. In the future, we will be moving towards software implementations such as: - Multisig consensus mechanisms that allow each yTeam to have execution power -- Move from proxy voting to on-chain voting +- Move from proxy voting to onchain voting - tokenize decision-making powers as NFTs - Utilize [Coordinape](https://coordinape.com/) for things like budget allocation and compensation diff --git a/docs/contributing/governance/proposal-process.md b/docs/contributing/governance/proposal-process.md index a4bb9e4a09..c45374d367 100644 --- a/docs/contributing/governance/proposal-process.md +++ b/docs/contributing/governance/proposal-process.md @@ -1,6 +1,6 @@ # Proposal Process -[veYFI](/contributing/governance/veyfi) token holders control the Yearn ecosystem through off-chain proposals and votes via [Snapshot](https://snapshot.org/#/s:veyfi.eth). Proposals that generate majority support (>50% of the vote) are implemented by a 9-member multi-signature wallet, and 6 out of 9 wallet signers must sign for a change to be implemented. The [members of the multi-signature wallet](/developers/security/multisig#members) were voted in by YFI holders and are subject to change from future governance votes. +[veYFI](/contributing/governance/veyfi) token holders control the Yearn ecosystem through offchain proposals and votes via [Snapshot](https://snapshot.org/#/s:veyfi.eth). Proposals that generate majority support (>50% of the vote) are implemented by a 9-member multi-signature wallet, and 6 out of 9 wallet signers must sign for a change to be implemented. The [members of the multi-signature wallet](/developers/security/multisig#members) were voted in by YFI holders and are subject to change from future governance votes. ## Discussion @@ -34,7 +34,7 @@ Getting as much feedback as possible from the various communication channels is ### Making a proposal -Anyone can post a proposal on the forum for discussion within the community. If it's promoted to off-chain votation (via [Snapshot](https://snapshot.org/#/ybaby.eth)), only someone holding 1 veYFI can submit it to Snapshot. If your proposal made it to off-chain votation and you don't have enough veYFI, mods will help you through this stage. +Anyone can post a proposal on the forum for discussion within the community. If it's promoted to offchain votation (via [Snapshot](https://snapshot.org/#/ybaby.eth)), only someone holding 1 veYFI can submit it to Snapshot. If your proposal made it to offchain votation and you don't have enough veYFI, mods will help you through this stage. The default template for proposals can be found on [GitHub](https://github.com/yearn/YIPS/blob/master/yip-X.md) + on the [forum](https://gov.yearn.fi), if you post under "proposals" or "discussion" it will auto-fill in the template as well. @@ -51,9 +51,9 @@ The default template for proposals can be found on [GitHub](https://github.com/y - Holding [veYFI](/contributing/governance/veyfi) enables you to vote on Yearn's [Snapshot](https://snapshot.org/#/ybaby.eth) page -#### What’s the difference between voting for a poll on the forum and an off-chain vote? +#### What’s the difference between voting for a poll on the forum and an offchain vote? -- A poll gauges the sentiment of what the community is feeling on the proposal while an off-chain vote (via [Snapshot](https://snapshot.org/#/ybaby.eth)) will be binding and will take effect if it passes. +- A poll gauges the sentiment of what the community is feeling on the proposal while an offchain vote (via [Snapshot](https://snapshot.org/#/ybaby.eth)) will be binding and will take effect if it passes. ## Implementation diff --git a/docs/contributing/governance/veYFI-comp-summary.md b/docs/contributing/governance/veYFI-comp-summary.md index 0d0d9dbca5..e6423ed0aa 100644 --- a/docs/contributing/governance/veYFI-comp-summary.md +++ b/docs/contributing/governance/veYFI-comp-summary.md @@ -1,10 +1,10 @@ --- -rpcCalls: +rpcCalls: - name: 'dYFI Redemption' chain: '1' address: '0x7dC3A74F0684fc026f9163C6D5c3C99fda2cf60a' abiName: 'dyfiRedemptionABI' - methods: + methods: - 'discount' - 'get_latest_price' - name: 'eth_required' diff --git a/docs/contributing/governance/veyfi.md b/docs/contributing/governance/veyfi.md index e6295a601c..b80193a745 100644 --- a/docs/contributing/governance/veyfi.md +++ b/docs/contributing/governance/veyfi.md @@ -1,10 +1,10 @@ --- -rpcCalls: +rpcCalls: - name: 'dYFI Redemption' chain: '1' address: '0x7dC3A74F0684fc026f9163C6D5c3C99fda2cf60a' abi: 'dyfiRedemptionABI' - methods: + methods: - 'discount' - 'get_latest_price' - name: 'eth_required' @@ -59,7 +59,7 @@ veYFI incorporates [YIP-56: Buyback and Build](https://gov.yearn.fi/t/yip-56-buy - **x** = `veYFI_supply / YFI_supply`
- :::yearn[Current On-Chain Values] + :::yearn[Current Onchain Values] - The current redemption discount is: - Current Spot Price of YFI/ETH: diff --git a/docs/contributing/introduction.md b/docs/contributing/introduction.md index ba9bec32f5..1aba193d3e 100644 --- a/docs/contributing/introduction.md +++ b/docs/contributing/introduction.md @@ -2,8 +2,8 @@ ![image](/img/dao-pages/here-we-are-cropped.jpg) -Yearn is a collective of developers, users, thinkers, and doers all working toward making the best suite of on-chain, decentralized, yield products. There are no bosses or interns, no board of directors or HR department, only those who contribute to, participate in, and explore Yearn. Yearn started as an experiment with a week long release of YFI and continues as an experiment today. +Yearn is a collective of developers, users, thinkers, and doers all working toward making the best suite of onchain, decentralized, yield products. There are no bosses or interns, no board of directors or HR department, only those who contribute to, participate in, and explore Yearn. Yearn started as an experiment with a week long release of YFI and continues as an experiment today. ## Governance -The Yearn ecosystem is controlled by YFI token holders who submit and vote on off-chain proposals that govern the ecosystem. Proposals that generate majority support \(>50% of the vote\) are implemented by a 9-member multi-signature wallet. Changes must be signed by 6 out of the 9 wallet signers to be implemented. The members of the multi-signature wallet were voted in by YFI holders and are subject to change from future governance votes. Please refer to the [multisig documentation](/developers/security/multisig) for the list of multisig signers. For more info about the governance process, please consult the [multisig members list](/developers/security/multisig) and [YIP-61: Governance 2.0](https://gov.yearn.fi/t/yip-61-governance-2-0/10460). +The Yearn ecosystem is controlled by YFI token holders who submit and vote on offchain proposals that govern the ecosystem. Proposals that generate majority support \(>50% of the vote\) are implemented by a 9-member multi-signature wallet. Changes must be signed by 6 out of the 9 wallet signers to be implemented. The members of the multi-signature wallet were voted in by YFI holders and are subject to change from future governance votes. Please refer to the [multisig documentation](/developers/security/multisig) for the list of multisig signers. For more info about the governance process, please consult the [multisig members list](/developers/security/multisig) and [YIP-61: Governance 2.0](https://gov.yearn.fi/t/yip-61-governance-2-0/10460). diff --git a/docs/contributing/operations/decision-making.md b/docs/contributing/operations/decision-making.md index a22c9cf181..fcbbf6b5fa 100644 --- a/docs/contributing/operations/decision-making.md +++ b/docs/contributing/operations/decision-making.md @@ -3,16 +3,16 @@ ## Types of Decisions -There are two key dimensions of decision-making at yearn: on- or off-chain; gated or un-gated. +There are two key dimensions of decision-making at yearn: on- or offchain; gated or un-gated. -- On-chain decisions are executed via transactions on the blockchain. -- Off-chain decisions are executed in various ways off of the blockchain. +- Onchain decisions are executed via transactions on the blockchain. +- Offchain decisions are executed in various ways off of the blockchain. - Gated decisions require specific permissions. - Un-gated decisions can be made by anyone, they are permissionless. Here are some examples for the four categories of decisions that emerge from this space: -| |on-chain|off-chain| +| |onchain|offchain| |----|--------|---------| |gated|add a strategy to a vault|merge a pr| ||transfer money from the treasury|decide on a logo| @@ -21,17 +21,17 @@ Here are some examples for the four categories of decisions that emerge from thi ||execute a signed multisig tx|write a new docs page| ||create a new vault|propose a YIP| -[Gov 2.0](https://gov.yearn.fi/t/yip-61-governance-2-0) clarifies who holds decision-making power for our most critical kinds of decisions: on-chain gated decisions. But what about the other kinds? Who decides how off-chain gated decisions are made? Are there any guidelines for un-gated decisions or are they totally open? The rest of this document aims to clarify these questions. +[Gov 2.0](https://gov.yearn.fi/t/yip-61-governance-2-0) clarifies who holds decision-making power for our most critical kinds of decisions: onchain gated decisions. But what about the other kinds? Who decides how offchain gated decisions are made? Are there any guidelines for un-gated decisions or are they totally open? The rest of this document aims to clarify these questions. ## Gated Decisions -### On-Chain +### Onchain -All possible gated on-chain decisions are organized by Gov 2.0 into discrete and transferable objects called 'Decision-Making Powers' or just 'powers' for short. These powers are objects --- abstractions just above the specific transactions that embody the actual decisions. As we use this new system, we can decide to make these objects more or less granular. Currently YFI holders have the 'Manage Powers' decision-making power, so changes to each power is decided via YFI vote. But, YFI holders could vote to delegate the 'Manage Powers' power, or a subset of it, to a yTeam in the future. +All possible gated onchain decisions are organized by Gov 2.0 into discrete and transferable objects called 'Decision-Making Powers' or just 'powers' for short. These powers are objects --- abstractions just above the specific transactions that embody the actual decisions. As we use this new system, we can decide to make these objects more or less granular. Currently YFI holders have the 'Manage Powers' decision-making power, so changes to each power is decided via YFI vote. But, YFI holders could vote to delegate the 'Manage Powers' power, or a subset of it, to a yTeam in the future. -### Off-Chain +### Offchain -Currently gated off-chain decision-making powers are held by various members of the yearn core team and there is no overarching process defined to organize them. Here is an incomplete list of domains with off-chain gates to be organized in the future: +Currently gated offchain decision-making powers are held by various members of the yearn core team and there is no overarching process defined to organize them. Here is an incomplete list of domains with offchain gates to be organized in the future: - yearn twitter account admin - various yearn frontend admin @@ -124,9 +124,9 @@ He makes the site and shares internally, and now it's yearn-official. 5) Conflict Resolution (optional) -Daniel's decision causes some conflict inside yearn. There has been no process to decide what is yearn-official in the off-chain space, so Daniel had the power to use the advice process and make a decision on it. No one is questioning that, but Philbert is strongly against the new site being yearn-official so he decides to start the conflict resolution process with Daniel about this decision. +Daniel's decision causes some conflict inside yearn. There has been no process to decide what is yearn-official in the offchain space, so Daniel had the power to use the advice process and make a decision on it. No one is questioning that, but Philbert is strongly against the new site being yearn-official so he decides to start the conflict resolution process with Daniel about this decision. -During the process (described below), Daniel and Philbert talk it through and together decide to update the site to add yWaifu content, which was the main cause of Philbert's tension. And through talking, they came up with a proposal for a new gate on deciding what's yearn-official off-chain. They do the advice process on it and then implement it. +During the process (described below), Daniel and Philbert talk it through and together decide to update the site to add yWaifu content, which was the main cause of Philbert's tension. And through talking, they came up with a proposal for a new gate on deciding what's yearn-official offchain. They do the advice process on it and then implement it. ## The Conflict Resolution Process diff --git a/docs/developers/addresses/v3-contracts.md b/docs/developers/addresses/v3-contracts.md index b86af99328..924626ba40 100644 --- a/docs/developers/addresses/v3-contracts.md +++ b/docs/developers/addresses/v3-contracts.md @@ -54,7 +54,7 @@ Core contracts are the base generic contracts that can be used by anyone who wan ### Periphery Contracts -All generic periphery contracts and factories can be retrieved on chain from the `AddressProvider` Contract: +All generic periphery contracts and factories can be retrieved onchain from the `AddressProvider` Contract: | Name / ENS | Periphery Contract Address | | ---------------------- | ---------------------- | @@ -74,7 +74,7 @@ For a more complete list of all available periphery contracts visit the [Periphe ## Yearn Specific Addresses -Yearn Specific contracts and roles, as well as the most up to date V3 registry can be retrieved on chain from the Role Manager. +Yearn Specific contracts and roles, as well as the most up to date V3 registry can be retrieved onchain from the Role Manager. To find individual vaults, use the V3 Registry below or refer to https://yearn.fi/v3 diff --git a/docs/developers/building-on-yearn.md b/docs/developers/building-on-yearn.md index 9ef5d5a29c..903b89b258 100644 --- a/docs/developers/building-on-yearn.md +++ b/docs/developers/building-on-yearn.md @@ -53,7 +53,7 @@ Check out the [Frontend Integrations](front-end-development) section of this doc ## Data Analysis -Yearn aims to provide more insights into our products to our customers and partners through analyzing the on-chain and off-chain data. Given that all Yearn protocol data is publicly stored on-chain, there are lots of insights to be gained from analyzing these transactions. +Yearn aims to provide more insights into our products to our customers and partners through analyzing the onchain and offchain data. Given that all Yearn protocol data is publicly stored onchain, there are lots of insights to be gained from analyzing these transactions. **Dune Analytics**- Query contract data and generate dashboards with SQL diff --git a/docs/developers/data-services/kong.md b/docs/developers/data-services/kong.md index d64c0b0241..9e32b08b21 100644 --- a/docs/developers/data-services/kong.md +++ b/docs/developers/data-services/kong.md @@ -54,7 +54,7 @@ query MainnetVaults { REST: https://kong.yearn.fi/api/rest/list/vaults/:chainId REST Example: https://kong.yearn.fi/api/rest/list/vaults/1 -#### List Yearn v2 vaults on all chains +#### List Yearn V2 vaults on all chains ```graphql query GetV2VaultAddresses { diff --git a/docs/developers/data-services/ydaemon.md b/docs/developers/data-services/ydaemon.md index cc49f0b321..3d9ed9e2a4 100644 --- a/docs/developers/data-services/ydaemon.md +++ b/docs/developers/data-services/ydaemon.md @@ -148,15 +148,18 @@ migrable (string) chainIDs (string) - Default: All supported chains -- Valid values: Comma-separated chain IDs: 1, 10, 137, 250, 8453, 42161 +- Valid values: Comma-separated chain IDs: 1, 10, 100, 137, 146, 250, 8453, 42161, 747474 - Example: "1,137,42161" - Supported chains: - 1 = Ethereum - 10 = Optimism + - 100 = Gnosis - 137 = Polygon + - 146 = Sonic - 250 = Fantom - 8453 = Base - 42161 = Arbitrum + - 747474 = Katana humanized (boolean) @@ -182,7 +185,7 @@ GET /{chainID}/reports/{address} # Harvest reports for strategy ``` GET /{chainID}/vaults/harvests/{addresses} # Harvest history for vaults GET /{chainID}/earned/{address}/{vaults} # Earnings per vault per user -GET /{chainID}/earned/{address} # All earnings for user on chain +GET /{chainID}/earned/{address} # All earnings for user onchain GET /earned/{address} # All earnings for user (all chains) ``` @@ -270,7 +273,7 @@ yDaemon aggregates data from multiple sources: 1. **Yearn Subgraph**: Base data source for vault and strategy information 2. **Yearn Meta**: Configuration and metadata (risk scores, descriptions, icons) -3. **Yearn Lens Oracle**: On-chain price data for tokens and vaults +3. **Yearn Lens Oracle**: Onchain price data for tokens and vaults 4. **Blockchain RPC**: Direct chain queries via Tenderly and other providers 5. **Curve API**: Pool and gauge information for Curve vaults 6. **External Price Feeds**: Gamma, Pendle, and other protocol-specific data diff --git a/docs/developers/data-services/yearn-data.md b/docs/developers/data-services/yearn-data.md index b642ec68ed..95f3fe6a1b 100644 --- a/docs/developers/data-services/yearn-data.md +++ b/docs/developers/data-services/yearn-data.md @@ -11,7 +11,7 @@ Kong's Yearn index covers the v3 and v2 vault ecosystems: - Regular contract snapshots of each registry, vault, strategy, trade handler, accountant, and debt allocator. - Full event history for each of the above (*with limited history on transfers, deposits, withdraws, and approves). - Snapshot hooks for computing vault-strategies relationships, debts, fees, and rewards. -- Snapshot hooks for integrating off-chain risk and meta data. +- Snapshot hooks for integrating offchain risk and meta data. - Event hooks for tracking new vaults and strategies, computing spot harvest APRs, and pricing transfers. - Timeseries hooks for computing APY and TVL. diff --git a/docs/developers/data-services/yearn-lens.md b/docs/developers/data-services/yearn-lens.md index 26ad4aac43..5922942d5f 100644 --- a/docs/developers/data-services/yearn-lens.md +++ b/docs/developers/data-services/yearn-lens.md @@ -1,6 +1,6 @@ # Yearn Lens -Yearn Lens is a series of smart contracts that aggregate and format Yearn v2 Vault data into standardized interfaces. +Yearn Lens is a series of smart contracts that aggregate and format Yearn V2 Vault data into standardized interfaces. ## Architecture @@ -26,7 +26,7 @@ Yearn Lens is a series of smart contracts that aggregate and format Yearn v2 Vau - Registry adapters have the ability to return metadata specific to an asset type (for example for vaults: `pricePerShare`, `controller`, etc.) - Oracle - The oracle contract is responsible for fetching price information from various sources - - The oracle is intended for non-critical off-chain calculations + - The oracle is intended for non-critical offchain calculations - TVL calculations - Token and asset balance normalizations - Not intended to be used with strategies or other contracts diff --git a/docs/developers/data-services/yearn-stack.md b/docs/developers/data-services/yearn-stack.md index 78e5f275d9..04a0be3503 100644 --- a/docs/developers/data-services/yearn-stack.md +++ b/docs/developers/data-services/yearn-stack.md @@ -1,6 +1,6 @@ # Yearn Stack + FE Features -Yearn SDK integrates several components, both on-chain and off-chain. +Yearn SDK integrates several components, both onchain and offchain. ## Backend stack @@ -8,7 +8,7 @@ Yearn SDK integrates several components, both on-chain and off-chain. Backend Chart

-### On Chain +### Onchain - 🔍 Yearn Lens - Oracle @@ -31,22 +31,22 @@ Yearn SDK integrates several components, both on-chain and off-chain. - disabling asset interactions - Yearn Frontend -### Off Chain +### Offchain - yDaemon and Kong: stores historical data for vaults ## Backend features -### Resilience powered by on-chain data and IPFS storage +### Resilience powered by onchain data and IPFS storage - Critical data (assets, positions, vault deprecations) will be fetched exclusively from the chain / IPFS - maximizing uptime - reducing reliance on other services -- Historical TVL, historical APY and other non critical data will be stored off chain and fetched dinamically. +- Historical TVL, historical APY and other non critical data will be stored offchain and fetched dinamically. -#### On-chain assets and positions +#### Onchain assets and positions -- Lens does what the old off-chain API does, but directly on-chain. This will speed up the fetching time and greatly reduce our reliance on scheduled jobs in servers. +- Lens does what the old offchain API does, but directly onchain. This will speed up the fetching time and greatly reduce our reliance on scheduled jobs in servers. #### IPFS CI/CD for frontend and metadata @@ -61,7 +61,7 @@ Yearn SDK integrates several components, both on-chain and off-chain. - SDK will provide a simple interface for all integrators, including ourselves. - Read methods will seamlessly integrate with all data sources, while keeping coherent data structures. -- Write methods talk directly to assets on chain. Execution of write transactions will trigger refresh events so data freshness of frontend (or other integration platforms) will still be preserved. +- Write methods talk directly to assets onchain. Execution of write transactions will trigger refresh events so data freshness of frontend (or other integration platforms) will still be preserved. ### Historical User Earnings diff --git a/docs/developers/deprecated-products/delegated-funding-dao-vaults.md b/docs/developers/deprecated-products/delegated-funding-dao-vaults.md index e79d99ee3b..b02b2550aa 100644 --- a/docs/developers/deprecated-products/delegated-funding-dao-vaults.md +++ b/docs/developers/deprecated-products/delegated-funding-dao-vaults.md @@ -4,7 +4,7 @@ status: On Hold (No Active Development or R&D) # Delegated Funding DAO Vaults -YFI holders can provide capital to DAOs approved to accept funding in the DAO vault ecosystem. DAOs wishing to receive funding are required to setup [Gitcoin Grants](https://gitcoin.co/grants/) page and apply for funding via the [Yearn governance forum](https://gov.yearn.fi/). If there is sufficient interest to approve the DAO for funding an off-chain vote will be conducted \([https://vote.yearn.fi](https://yearn.snapshot.page/#/)\). If voting is successful the DAO will be added to the DAO vault ecosystem. +YFI holders can provide capital to DAOs approved to accept funding in the DAO vault ecosystem. DAOs wishing to receive funding are required to setup [Gitcoin Grants](https://gitcoin.co/grants/) page and apply for funding via the [Yearn governance forum](https://gov.yearn.fi/). If there is sufficient interest to approve the DAO for funding an offchain vote will be conducted \([https://vote.yearn.fi](https://yearn.snapshot.page/#/)\). If voting is successful the DAO will be added to the DAO vault ecosystem. Governance determines weekly, monthly, and yearly credit limits that the DAO can access via the [DAO vault](https://yborrow.finance/). The DAO is free to repay the credit line on their own terms, and in tokens or other collateral options accepted in the yearn ecosystem. Any profits are shared between vault LPs. diff --git a/docs/developers/deprecated-products/yPools/yETH/adding-assets.md b/docs/developers/deprecated-products/yPools/yETH/adding-assets.md index a55bc7c5b6..12caba4f95 100644 --- a/docs/developers/deprecated-products/yPools/yETH/adding-assets.md +++ b/docs/developers/deprecated-products/yPools/yETH/adding-assets.md @@ -1,10 +1,10 @@ --- -rpcCalls: +rpcCalls: - name: 'yPools Governance' chain: '1' address: '0xB7a528CF6D36F736Fa678A629b98A427d43E5ba5' abiName: 'yPoolsGenericGovernorABI' - methods: + methods: - 'epoch' - 'propose_open' - 'vote_open' diff --git a/docs/developers/deprecated-products/yPools/yETH/overview.md b/docs/developers/deprecated-products/yPools/yETH/overview.md index 880ce254a0..60313e80b8 100644 --- a/docs/developers/deprecated-products/yPools/yETH/overview.md +++ b/docs/developers/deprecated-products/yPools/yETH/overview.md @@ -4,7 +4,7 @@ yETH is a user-governed liquidity pool token consisting of various Ethereum Liquid Staking Derivatives (LSTs). -The yETH protocol is an Automated Market Maker (AMM) for LSTs. Each LST in the yETH pool is priced according to the amount of [beacon chain](https://ethereum.org/en/upgrades/beacon-chain/) ETH it represents. This lets users deposit their LSTs into the pool and receive yETH tokens pegged 1:1 with beacon chain ETH. Users can also stake their yETH tokens to mint st-yETH, accrue yield, and participate in yETH governance. +The yETH protocol is an Automated Market Maker (AMM) for LSTs. Each LST in the yETH pool is priced according to the amount of [beacon chain](https://ethereum.org/en/upgrades/beaconchain/) ETH it represents. This lets users deposit their LSTs into the pool and receive yETH tokens pegged 1:1 with beacon chain ETH. Users can also stake their yETH tokens to mint st-yETH, accrue yield, and participate in yETH governance. This AMM model, combined with the governance and incentive mechanisms of the yETH protocol, aims to provide an optimal risk-adjusted yield for ETH staking by dynamically adjusting the weights of the LSTs in the pool. It also offers users flexibility with single-sided deposits and withdrawals, and maintains the pool's balance and diversification through a weight management system. diff --git a/docs/developers/deprecated-products/yPools/yETH/yeth-faq.md b/docs/developers/deprecated-products/yPools/yETH/yeth-faq.md index 2037bc894f..f7ea7b6255 100644 --- a/docs/developers/deprecated-products/yPools/yETH/yeth-faq.md +++ b/docs/developers/deprecated-products/yPools/yETH/yeth-faq.md @@ -20,7 +20,7 @@ yETH provides diversification by holding a basket of LSDs, which helps to spread ### How is yield passed onto stakers? -LSD Protocols generate yield and update their on-chain rates. This results in yETH being minted and sent to st-yETH. +LSD Protocols generate yield and update their onchain rates. This results in yETH being minted and sent to st-yETH. ### Can I withdraw multiple LSDs? diff --git a/docs/developers/deprecated-products/yPools/yETH/yeth-overview.md b/docs/developers/deprecated-products/yPools/yETH/yeth-overview.md index d3aee1512d..495b239166 100644 --- a/docs/developers/deprecated-products/yPools/yETH/yeth-overview.md +++ b/docs/developers/deprecated-products/yPools/yETH/yeth-overview.md @@ -6,7 +6,7 @@ sidebar_label: Overview yETH is a user-governed yPool consisting of various Ethereum Liquid Staking Derivatives (LSTs). -The yETH protocol is an Automated Market Maker (AMM) for LSTs. Each LST in the yETH pool is priced according to the amount of [beacon chain](https://ethereum.org/en/upgrades/beacon-chain/) ETH it represents. This lets users deposit their LSTs into the pool and receive yETH tokens pegged 1:1 with beacon chain ETH. Users can also stake their yETH tokens to mint st-yETH, accrue yield, and participate in yETH governance. +The yETH protocol is an Automated Market Maker (AMM) for LSTs. Each LST in the yETH pool is priced according to the amount of [beacon chain](https://ethereum.org/en/upgrades/beaconchain/) ETH it represents. This lets users deposit their LSTs into the pool and receive yETH tokens pegged 1:1 with beacon chain ETH. Users can also stake their yETH tokens to mint st-yETH, accrue yield, and participate in yETH governance. This AMM model, combined with the governance and incentive mechanisms of the yETH protocol, aims to provide an optimal risk-adjusted yield for ETH staking by dynamically adjusting the weights of the LSTs in the pool. It also offers users flexibility with single-sided deposits and withdrawals, and maintains the pool's balance and diversification through a weight management system. diff --git a/docs/developers/deprecated-products/yPools/ypools-overview.md b/docs/developers/deprecated-products/yPools/ypools-overview.md index a6c0cb53e6..c6eb6a9699 100644 --- a/docs/developers/deprecated-products/yPools/ypools-overview.md +++ b/docs/developers/deprecated-products/yPools/ypools-overview.md @@ -1,11 +1,11 @@ --- -rpcCalls: +rpcCalls: - name: 'yPools Governance' chain: '1' address: '0xB7a528CF6D36F736Fa678A629b98A427d43E5ba5' abiName: 'yPoolsGenericGovernorABI' - methods: + methods: - 'epoch' - 'propose_open' - 'vote_open' diff --git a/docs/developers/deprecated-products/yPrisma/yprisma-faq.md b/docs/developers/deprecated-products/yPrisma/yprisma-faq.md index c0739b3734..8f28193aab 100644 --- a/docs/developers/deprecated-products/yPrisma/yprisma-faq.md +++ b/docs/developers/deprecated-products/yPrisma/yprisma-faq.md @@ -68,7 +68,7 @@ There are several key reasons to claim your emissions as yPRISMA instead of lock 1. When minting yPRISMA, you get to utilize Yearn's boost, which is among the highest of total Prisma accounts. 1. yPRISMA is minted 1:1 against your max locked claim amount. -1. yPRISMA is fully transferrable and can be swaped on DEXes like Curve, or staked for benefits in the ecosystem. +1. yPRISMA is fully transferrable and can be swapped on DEXes like Curve, or staked for benefits in the ecosystem. ### How can I claim my Prisma protocol emissions as yPRISMA? diff --git a/docs/developers/deprecated-products/yPrisma/yprisma-guide.md b/docs/developers/deprecated-products/yPrisma/yprisma-guide.md index ea9d31f828..6a3506a37f 100644 --- a/docs/developers/deprecated-products/yPrisma/yprisma-guide.md +++ b/docs/developers/deprecated-products/yPrisma/yprisma-guide.md @@ -61,7 +61,7 @@ You can view the $ value of your claimable rewards in this tab, as well as the a As the vault earns yield, the price of your vault tokens will increase as there is more underlying mkUSD in the vault for you to redeem upon withdrawal. For example, 100 yvmkUSD-A could represent 150 mkUSD (~$150.00), dependent on the total cumulative earnings of the vault. -Your mkUSD rewards accrue week over week and are never lost if unclaimed. To claim them to your wallet, all you need to do is click "Claim All" and confirm the transaction . +Your mkUSD rewards accrue week over week and are never lost if unclaimed. To claim them to your wallet, all you need to do is click "Claim All" and confirm the transaction. ### 4. Get yPRISMA diff --git a/docs/developers/deprecated-products/ybribe/ybribe.md b/docs/developers/deprecated-products/ybribe/ybribe.md index 9e45433411..8f35f4e089 100644 --- a/docs/developers/deprecated-products/ybribe/ybribe.md +++ b/docs/developers/deprecated-products/ybribe/ybribe.md @@ -18,5 +18,5 @@ veCRV holders can sell their gauge votes to the highest bidder each week by voti * A new UI makes it easy for veCRV holders to identify the best opportunities. * Convex votes are excluded from the system to make bribes more efficient. -* Fully trustless design and 100% on-chain design. +* Fully trustless design and 100% onchain design. * The codebase is fully audited. diff --git a/docs/developers/front-end-development.md b/docs/developers/front-end-development.md index d38cc76692..77622c2e93 100644 --- a/docs/developers/front-end-development.md +++ b/docs/developers/front-end-development.md @@ -1,5 +1,5 @@ # Frontend Integrations -Yearn uses a JavaScript SDK for formatting protocol data and generating transactions for reading/writing protocol data. Yearn SDK integrates several components, both on-chain and off-chain. +Yearn uses a JavaScript SDK for formatting protocol data and generating transactions for reading/writing protocol data. Yearn SDK integrates several components, both onchain and offchain. [The repository here](https://github.com/turtlemoji/yearn-sdk-examples) contains a live preview and example usage of the Yearn SDK. Explore this codebase to learn how to start interacting with the Yearn protocol in your own app. diff --git a/docs/developers/security/risks/risk-score.md b/docs/developers/security/risks/risk-score.md index a2532fe123..40249c6930 100644 --- a/docs/developers/security/risks/risk-score.md +++ b/docs/developers/security/risks/risk-score.md @@ -81,8 +81,8 @@ This score aims to find out how much and how often a strategy can be subject to The centralization score of the strategy that is being evaluated. Measures the strategy's reliance on privileged roles that are defined in strategy. -- 5 -> Strategy heavily relies on off-chain management, potentially exposing user funds to rug possibilities by admins. -- 4 -> Strategy frequently depends on off-chain management but has safeguards against rug possibilities by admins. +- 5 -> Strategy heavily relies on offchain management, potentially exposing user funds to rug possibilities by admins. +- 4 -> Strategy frequently depends on offchain management but has safeguards against rug possibilities by admins. - 3 -> Strategy involves privileged roles but less frequently and with less risk of rug possibilities. - 2 -> Strategy has privileged roles but they are not vital for operations and pose minimal risk of rug possibilities. - 1 -> Strategy operates without dependency on any privileged roles, ensuring full permissionlessness. @@ -149,7 +149,7 @@ How long the external protocol contracts in scope have been deployed alive What does the external protocol do? Note that this is a rough estimate of evaluating a protocol's purpose. In some cases, the Yearn security team can score regardless of the criteria; in such cases, the reasoning will be provided in the text box as usual with all scores. -- 5 -> The main expertise of the protocol lies in off-chain operations, such as RWA protocols. +- 5 -> The main expertise of the protocol lies in offchain operations, such as RWA protocols. - 4 -> Cross-chain applications, like cross-chain bridges, cross-chain yield aggregators, and cross-chain lending/borrowing protocols - 3 -> AMM lending/borrowing protocols that are not forks of blue-chip protocols, leveraged farming protocols, as well as newly conceptualized protocols - 2 -> Slightly modified forked blue-chip protocols. diff --git a/docs/developers/smart-contracts/V2/BaseStrategy.md b/docs/developers/smart-contracts/V2/BaseStrategy.md index c574cd7b5e..f290a360b6 100644 --- a/docs/developers/smart-contracts/V2/BaseStrategy.md +++ b/docs/developers/smart-contracts/V2/BaseStrategy.md @@ -18,7 +18,7 @@ The Strategy's version must match the Vault's `API_VERSION`. | Name | Type | Description | | :----------------------------- | :------------ | :--------------------------------------------------------------------------- | -|`A`| | string which holds the current API version of this contract. +|`_apiVersion`| string | The current API version of this contract. ### name @@ -38,7 +38,7 @@ This Strategy's name. | Name | Type | Description | | :----------------------------- | :------------ | :--------------------------------------------------------------------------- | -|`This`| | Strategy's name. +|`_name`| string | Strategy's name. ### delegatedAssets @@ -138,12 +138,10 @@ Initializes the Strategy, this is called only once, when the | Name | Type | Description | | :--- | :--- | :------------------------------------------------------------------- | -|`_vault` | address | The address of the Vault responsible for this Strategy. -|`_strategist` | address | The address to assign as `strategist`. -The strategist is able to change the reward address -|`_rewards` | address | The address to use for pulling rewards. -|`_keeper` | address | The address of the _keeper._keeper -can harvest and tend a strategy. +|`_vault` | address | The address of the Vault responsible for this Strategy.| +|`_strategist` | address | The address to assign as `strategist`. The strategist is able to change the reward address.| +|`_rewards` | address | The address to use for pulling rewards.| +|`_keeper` | address | The address of the keeper. Keeper can harvest and tend a strategy.| ### setHealthCheck @@ -283,8 +281,7 @@ Used to ensure that any significant credit a strategy has from the | Name | Type | Description | | :--- | :--- | :------------------------------------------------------------------- | -|`_creditThreshold` | uint256 | The number of want tokens that will - automatically trigger a harvest. +|`_creditThreshold` | uint256 | The number of want tokens that will automatically trigger a harvest.| ### setForceHarvestTriggerOnce @@ -304,8 +301,7 @@ Used to automatically trigger a harvest by our keepers. Can be | Name | Type | Description | | :--- | :--- | :------------------------------------------------------------------- | -|`_forceHarvestTriggerOnce` | bool | Value of true tells keepers to harvest - our strategy +|`_forceHarvestTriggerOnce` | bool | Value of true tells keepers to harvest our strategy.| ### setBaseFeeOracle @@ -383,7 +379,7 @@ Provide an accurate conversion from `_amtInWei` (denominated in wei) | Name | Type | Description | | :----------------------------- | :------------ | :--------------------------------------------------------------------------- | -|`The`| uint256 | amount in `want` of `_amtInEth` converted to `want` +|`_amountInWant`| uint256 | amount in `want` of `_amtInEth` converted to `want`| ### estimatedTotalAssets @@ -398,12 +394,12 @@ Provide an accurate estimate for the total amount of assets This total should be "realizable" e.g. the total value that could *actually* be obtained from this Strategy if it were to divest its - entire position based on current on-chain conditions. + entire position based on current onchain conditions. @dev Care must be taken in using this function, since it relies on external systems, which could be manipulated by the attacker to give an inflated - (or reduced) value produced by this function, based on current on-chain + (or reduced) value produced by this function, based on current onchain conditions (e.g. this function is possible to influence through flashloan attacks, oracle manipulations, or other DeFi attack mechanisms). @@ -418,7 +414,7 @@ Provide an accurate estimate for the total amount of assets | Name | Type | Description | | :----------------------------- | :------------ | :--------------------------------------------------------------------------- | -|`The`| | estimated total assets in this Strategy. +|`_totalAssets`| uint256 | Estimated total assets in this Strategy.| ### isActive @@ -532,7 +528,7 @@ Provide a signal to the keeper that `tend()` should be called. The | Name | Type | Description | | :----------------------------- | :------------ | :--------------------------------------------------------------------------- | -|`if`| uint256 | `tend()` should be called, `false` otherwise. +|`_shouldTend`| bool | `true` if `tend()` should be called, `false` otherwise.| ### tend @@ -599,7 +595,7 @@ Provide a signal to the keeper that `harvest()` should be called. The | Name | Type | Description | | :----------------------------- | :------------ | :--------------------------------------------------------------------------- | -|`if`| uint256 | `harvest()` should be called, `false` otherwise. +|`_shouldHarvest`| bool | `true` if `harvest()` should be called, `false` otherwise. ### isBaseFeeAcceptable @@ -615,7 +611,7 @@ Check if the current network base fee is below our external target. If | Name | Type | Description | | :----------------------------- | :------------ | :--------------------------------------------------------------------------- | -|`if`| | `harvest()` should be allowed, `false` otherwise. +|`_isAcceptable`| bool | `true` if `harvest()` should be allowed, `false` otherwise.| ### harvest @@ -708,7 +704,7 @@ interacted with the vault before. Activates emergency exit. Once activated, the Strategy will exit its position upon the next harvest, depositing all funds into the Vault as - quickly as is reasonable given on-chain conditions. + quickly as is reasonable given onchain conditions. This may only be called by governance or the strategist. diff --git a/docs/developers/smart-contracts/V2/vault.md b/docs/developers/smart-contracts/V2/vault.md index 1a3cf8c952..82e87419b3 100644 --- a/docs/developers/smart-contracts/V2/vault.md +++ b/docs/developers/smart-contracts/V2/vault.md @@ -6,7 +6,7 @@ **Yearn Token Vault** -*Yearn Token Vault. Holds an underlying token, and allows users to interact with the Yearn ecosystem through Strategies connected to the Vault. Vaults are not limited to a single Strategy, they can have as many Strategies as can be designed (however the withdrawal queue is capped at 20.) Deposited funds are moved into the most impactful strategy that has not already reached its limit for assets under management, regardless of which Strategy a user's funds end up in, they receive their portion of yields generated across all Strategies. When a user withdraws, if there are no funds sitting undeployed in the Vault, the Vault withdraws funds from Strategies in the order of least impact. (Funds are taken from the Strategy that will disturb everyone's gains the least, then the next least, etc.) In order to achieve this, the withdrawal queue's order must be properly set and managed by the community (through governance). Vault Strategies are parameterized to pursue the highest risk-adjusted yield. There is an "Emergency Shutdown" mode. When the Vault is put into emergency shutdown, assets will be recalled from the Strategies as quickly as is practical (given on-chain conditions), minimizing loss. Deposits are halted, new Strategies may not be added, and each Strategy exits with the minimum possible damage to position, while opening up deposits to be withdrawn by users. There are no restrictions on withdrawals above what is expected under Normal Operation. For further details, please refer to the specification: https://github.com/iearn-finance/yearn-vaults/blob/main/SPECIFICATION.md* +*Yearn Token Vault. Holds an underlying token, and allows users to interact with the Yearn ecosystem through Strategies connected to the Vault. Vaults are not limited to a single Strategy, they can have as many Strategies as can be designed (however the withdrawal queue is capped at 20.) Deposited funds are moved into the most impactful strategy that has not already reached its limit for assets under management, regardless of which Strategy a user's funds end up in, they receive their portion of yields generated across all Strategies. When a user withdraws, if there are no funds sitting undeployed in the Vault, the Vault withdraws funds from Strategies in the order of least impact. (Funds are taken from the Strategy that will disturb everyone's gains the least, then the next least, etc.) In order to achieve this, the withdrawal queue's order must be properly set and managed by the community (through governance). Vault Strategies are parameterized to pursue the highest risk-adjusted yield. There is an "Emergency Shutdown" mode. When the Vault is put into emergency shutdown, assets will be recalled from the Strategies as quickly as is practical (given onchain conditions), minimizing loss. Deposits are halted, new Strategies may not be added, and each Strategy exits with the minimum possible damage to position, while opening up deposits to be withdrawn by users. There are no restrictions on withdrawals above what is expected under Normal Operation. For further details, please refer to the specification: https://github.com/iearn-finance/yearn-vaults/blob/main/SPECIFICATION.md* ## Events @@ -498,7 +498,7 @@ Returns: Deposits `_amount` `token`, issuing shares to `recipient`. If the Vault is in Emergency Shutdown, deposits will not be accepted and this call will fail. -*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both off-chain and on-chain) to determine if depositing into the Vault is a "good idea".* +*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both offchain and onchain) to determine if depositing into the Vault is a "good idea".* Arguments: @@ -515,7 +515,7 @@ Returns: > type: `nonpayable function` > -*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both off-chain and on-chain) to determine if depositing into the Vault is a "good idea".* +*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both offchain and onchain) to determine if depositing into the Vault is a "good idea".* Arguments: @@ -532,7 +532,7 @@ Returns: > type: `nonpayable function` > -*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both off-chain and on-chain) to determine if depositing into the Vault is a "good idea".* +*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both offchain and onchain) to determine if depositing into the Vault is a "good idea".* Arguments: diff --git a/docs/developers/smart-contracts/V3/Periphery/Registry.md b/docs/developers/smart-contracts/V3/Periphery/Registry.md index c33368d544..c34be0d24f 100644 --- a/docs/developers/smart-contracts/V3/Periphery/Registry.md +++ b/docs/developers/smart-contracts/V3/Periphery/Registry.md @@ -8,7 +8,7 @@ **Author:** yearn.finance -Serves as an on chain registry to track any Yearn V3 +Serves as an onchain registry to track any Yearn V3 vaults and strategies that a certain party wants to endorse. Can also be used to deploy new vaults of any specific @@ -198,8 +198,8 @@ Get all endorsed vaults deployed using the Registry. *This will return a nested array of all vaults deployed separated by their underlying asset. -This is only meant for off chain viewing and should not be used during any -on chain tx's.* +This is only meant for offchain viewing and should not be used during any +onchain tx's.* ```solidity function getAllEndorsedVaults() external view virtual returns (address[][] memory allEndorsedVaults); @@ -280,7 +280,7 @@ function newEndorsedVault( |Name|Type|Description| |----|----|-----------| |`_asset`|`address`|The asset that may be deposited into the new Vault.| -|`_name`|`string`|Specify a custom Vault name. .| +|`_name`|`string`|Specify a custom Vault name.| |`_symbol`|`string`|Specify a custom Vault symbol name.| |`_roleManager`|`address`|The address authorized for guardian interactions in the new Vault.| |`_profitMaxUnlockTime`|`uint256`|The time strategy profits will unlock over.| @@ -318,7 +318,7 @@ function newEndorsedVault( |Name|Type|Description| |----|----|-----------| |`_asset`|`address`|The asset that may be deposited into the new Vault.| -|`_name`|`string`|Specify a custom Vault name. .| +|`_name`|`string`|Specify a custom Vault name.| |`_symbol`|`string`|Specify a custom Vault symbol name.| |`_roleManager`|`address`|The address authorized for guardian interactions in the new Vault.| |`_profitMaxUnlockTime`|`uint256`|The time strategy profits will unlock over.| @@ -413,7 +413,7 @@ function _registerVault( Tag a vault with a specific string. *This is available to governance to tag any vault or strategy -on chain if desired to arbitrarily classify any vaults. +onchain if desired to arbitrarily classify any vaults. i.e. Certain ratings ("A") / Vault status ("Shutdown") etc.* ```solidity diff --git a/docs/developers/smart-contracts/V3/Periphery/ReleaseRegistry.md b/docs/developers/smart-contracts/V3/Periphery/ReleaseRegistry.md index 96592d5499..b3daf4b313 100644 --- a/docs/developers/smart-contracts/V3/Periphery/ReleaseRegistry.md +++ b/docs/developers/smart-contracts/V3/Periphery/ReleaseRegistry.md @@ -8,7 +8,7 @@ **Author:** yearn.finance -Used by Yearn Governance to track on chain all +Used by Yearn Governance to track onchain all releases of the V3 vaults by API Version. ## State Variables diff --git a/docs/developers/smart-contracts/V3/TokenizedStrategy.md b/docs/developers/smart-contracts/V3/TokenizedStrategy.md index d0d06c9539..2e5dfe1b56 100644 --- a/docs/developers/smart-contracts/V3/TokenizedStrategy.md +++ b/docs/developers/smart-contracts/V3/TokenizedStrategy.md @@ -213,7 +213,7 @@ deployed and can only be called once for each strategy. This will set all the default storage that must be set for a strategy to function. Any changes can be made post deployment through external calls from `management`. -The function will also emit an event that off chain indexers can +The function will also emit an event that offchain indexers can look for to track any new deployments using this TokenizedStrategy.* ```solidity @@ -468,9 +468,9 @@ function convertToAssets(uint256 shares) external view returns (uint256); ### previewDeposit -Allows an on-chain or off-chain user to simulate +Allows an onchain or offchain user to simulate the effects of their deposit at the current block, given -current on-chain conditions. +current onchain conditions. *This will round down.* @@ -492,9 +492,9 @@ function previewDeposit(uint256 assets) external view returns (uint256); ### previewMint -Allows an on-chain or off-chain user to simulate +Allows an onchain or offchain user to simulate the effects of their mint at the current block, given -current on-chain conditions. +current onchain conditions. *This is used instead of convertToAssets so that it can round up for safer mints.* @@ -517,9 +517,9 @@ function previewMint(uint256 shares) external view returns (uint256); ### previewWithdraw -Allows an on-chain or off-chain user to simulate +Allows an onchain or offchain user to simulate the effects of their withdrawal at the current block, -given current on-chain conditions. +given current onchain conditions. *This is used instead of convertToShares so that it can round up for safer withdraws.* @@ -542,9 +542,9 @@ function previewWithdraw(uint256 assets) external view returns (uint256); ### previewRedeem -Allows an on-chain or off-chain user to simulate +Allows an onchain or offchain user to simulate the effects of their redemption at the current block, -given current on-chain conditions. +given current onchain conditions. *This will round down.* diff --git a/docs/developers/smart-contracts/V3/VaultFactory.md b/docs/developers/smart-contracts/V3/VaultFactory.md index 477d7048d6..684aec4a17 100644 --- a/docs/developers/smart-contracts/V3/VaultFactory.md +++ b/docs/developers/smart-contracts/V3/VaultFactory.md @@ -72,12 +72,6 @@ Called during vault and strategy reports to retrieve the protocol fee to charge function protocol_fee_config() ``` -#### Parameters - -| Name | Type | Description | -| :----------------------------- | :------------ | :--------------------------------------------- | -| vault | unknown | Address of the vault that would be reporting. | - #### Return Values | Name | Type | Description | diff --git a/docs/developers/smart-contracts/deprecated/V2/version-0.3.1/BaseStrategy.md b/docs/developers/smart-contracts/deprecated/V2/version-0.3.1/BaseStrategy.md index a9277afef3..41a9b2ae9c 100644 --- a/docs/developers/smart-contracts/deprecated/V2/version-0.3.1/BaseStrategy.md +++ b/docs/developers/smart-contracts/deprecated/V2/version-0.3.1/BaseStrategy.md @@ -51,7 +51,7 @@ This Strategy's name. `estimatedTotalAssets()` below, as the TVL calc will be total assets minus delegated assets. @return The amount of assets this strategy manages that should not be included in Yearn's Total Value - Locked (TVL) calculation across it's ecosystem. + Locked (TVL) calculation across its ecosystem. @@ -235,11 +235,11 @@ on protected functions in the Strategy. This total should be "realizable" e.g. the total value that could *actually* be obtained from this Strategy if it were to divest its - entire position based on current on-chain conditions. + entire position based on current onchain conditions. @dev Care must be taken in using this function, since it relies on external systems, which could be manipulated by the attacker to give an inflated - (or reduced) value produced by this function, based on current on-chain + (or reduced) value produced by this function, based on current onchain conditions (e.g. this function is possible to influence through flashloan attacks, oracle manipulations, or other DeFi attack mechanisms). @@ -499,7 +499,7 @@ value. Activates emergency exit. Once activated, the Strategy will exit its position upon the next harvest, depositing all funds into the Vault as - quickly as is reasonable given on-chain conditions. + quickly as is reasonable given onchain conditions. This may only be called by governance or the strategist. @dev diff --git a/docs/developers/smart-contracts/deprecated/V2/version-0.3.1/vault.md b/docs/developers/smart-contracts/deprecated/V2/version-0.3.1/vault.md index 67f987b531..e10b222132 100644 --- a/docs/developers/smart-contracts/deprecated/V2/version-0.3.1/vault.md +++ b/docs/developers/smart-contracts/deprecated/V2/version-0.3.1/vault.md @@ -7,7 +7,7 @@ -*Yearn Token Vault. Holds an underlying token, and allows users to interact with the Yearn ecosystem through Strategies connected to the Vault. Vaults are not limited to a single Strategy, they can have as many Strategies as can be designed (however the withdrawal queue is capped at 20.) Deposited funds are moved into the most impactful strategy that has not already reached its limit for assets under management, regardless of which Strategy a user's funds end up in, they receive their portion of yields generated across all Strategies. When a user withdraws, if there are no funds sitting undeployed in the Vault, the Vault withdraws funds from Strategies in the order of least impact. (Funds are taken from the Strategy that will disturb everyone's gains the least, then the next least, etc.) In order to achieve this, the withdrawal queue's order must be properly set and managed by the community (through governance). Vault Strategies are parameterized to pursue the highest risk-adjusted yield. There is an "Emergency Shutdown" mode. When the Vault is put into emergency shutdown, assets will be recalled from the Strategies as quickly as is practical (given on-chain conditions), minimizing loss. Deposits are halted, new Strategies may not be added, and each Strategy exits with the minimum possible damage to position, while opening up deposits to be withdrawn by users. There are no restrictions on withdrawals above what is expected under Normal Operation. For further details, please refer to the specification: https://github.com/iearn-finance/yearn-vaults/blob/master/SPECIFICATION.md* +*Yearn Token Vault. Holds an underlying token, and allows users to interact with the Yearn ecosystem through Strategies connected to the Vault. Vaults are not limited to a single Strategy, they can have as many Strategies as can be designed (however the withdrawal queue is capped at 20.) Deposited funds are moved into the most impactful strategy that has not already reached its limit for assets under management, regardless of which Strategy a user's funds end up in, they receive their portion of yields generated across all Strategies. When a user withdraws, if there are no funds sitting undeployed in the Vault, the Vault withdraws funds from Strategies in the order of least impact. (Funds are taken from the Strategy that will disturb everyone's gains the least, then the next least, etc.) In order to achieve this, the withdrawal queue's order must be properly set and managed by the community (through governance). Vault Strategies are parameterized to pursue the highest risk-adjusted yield. There is an "Emergency Shutdown" mode. When the Vault is put into emergency shutdown, assets will be recalled from the Strategies as quickly as is practical (given onchain conditions), minimizing loss. Deposits are halted, new Strategies may not be added, and each Strategy exits with the minimum possible damage to position, while opening up deposits to be withdrawn by users. There are no restrictions on withdrawals above what is expected under Normal Operation. For further details, please refer to the specification: https://github.com/iearn-finance/yearn-vaults/blob/master/SPECIFICATION.md* ## Functions @@ -20,7 +20,7 @@ function initialize(address,address,address,string,string) ``` -Initializes the Vault, this is called only once, when the contract is deployed. The performance fee is set to 10% of yield, per Strategy. The management fee is set to 2%, per year. The initial deposit limit is set to 0 (deposits disabled); it must be updated after initialization. +Initializes the Vault, this is called only once, when the contract is deployed. The performance fee is set to 10% of yield, per Strategy. The management fee is set to 2%, per year. The initial deposit limit is set to 0 (deposits disabled); it must be updated after initialization. *If `nameOverride` is not specified, the name will be 'yearn' combined with the name of `token`. If `symbolOverride` is not specified, the symbol will be 'y' combined with the symbol of `token`.* @@ -74,7 +74,7 @@ function apiVersion() ``` -Used to track the deployed version of this contract. In practice you can use this version number to compare with Yearn's GitHub and determine which version of the source matches this deployed contract. +Used to track the deployed version of this contract. In practice you can use this version number to compare with Yearn's GitHub and determine which version of the source matches this deployed contract. *All strategies must have an `apiVersion()` that matches the Vault's `API_VERSION`.* @@ -97,7 +97,7 @@ function setName(string) ``` -Used to change the value of `name`. This may only be called by governance. +Used to change the value of `name`. This may only be called by governance. @@ -118,7 +118,7 @@ function setSymbol(string) ``` -Used to change the value of `symbol`. This may only be called by governance. +Used to change the value of `symbol`. This may only be called by governance. @@ -139,7 +139,7 @@ function setGovernance(address) ``` -Nominate a new address to use as governance. The change does not go into effect immediately. This function sets a pending change, and the governance address is not updated until the proposed governance address has accepted the responsibility. This may only be called by the current governance address. +Nominate a new address to use as governance. The change does not go into effect immediately. This function sets a pending change, and the governance address is not updated until the proposed governance address has accepted the responsibility. This may only be called by the current governance address. @@ -160,7 +160,7 @@ function acceptGovernance() ``` -Once a new governance address has been proposed using setGovernance(), this function may be called by the proposed address to accept the responsibility of taking over governance for this contract. This may only be called by the proposed governance address. +Once a new governance address has been proposed using setGovernance(), this function may be called by the proposed address to accept the responsibility of taking over governance for this contract. This may only be called by the proposed governance address. *setGovernance() should be called by the existing governance address, prior to calling this function.* @@ -177,7 +177,7 @@ function setManagement(address) ``` -Changes the management address. Management is able to make some investment decisions adjusting parameters. This may only be called by governance. +Changes the management address. Management is able to make some investment decisions adjusting parameters. This may only be called by governance. @@ -198,7 +198,7 @@ function setGuestList(address) ``` -Used to set or change `guestList`. A guest list is another contract that dictates who is allowed to participate in a Vault (and transfer shares). This may only be called by governance. +Used to set or change `guestList`. A guest list is another contract that dictates who is allowed to participate in a Vault (and transfer shares). This may only be called by governance. @@ -219,7 +219,7 @@ function setRewards(address) ``` -Changes the rewards address. Any distributed rewards will cease flowing to the old address and begin flowing to this address once the change is in effect. This will not change any Strategy reports in progress, only new reports made after this change goes into effect. This may only be called by governance. +Changes the rewards address. Any distributed rewards will cease flowing to the old address and begin flowing to this address once the change is in effect. This will not change any Strategy reports in progress, only new reports made after this change goes into effect. This may only be called by governance. @@ -240,7 +240,7 @@ function setDepositLimit(uint256) ``` -Changes the maximum amount of tokens that can be deposited in this Vault. Note, this is not how much may be deposited by a single depositor, but the maximum amount that may be deposited across all depositors. This may only be called by governance. +Changes the maximum amount of tokens that can be deposited in this Vault. Note, this is not how much may be deposited by a single depositor, but the maximum amount that may be deposited across all depositors. This may only be called by governance. @@ -261,7 +261,7 @@ function setPerformanceFee(uint256) ``` -Used to change the value of `performanceFee`. Should set this value below the maximum strategist performance fee. This may only be called by governance. +Used to change the value of `performanceFee`. Should set this value below the maximum strategist performance fee. This may only be called by governance. @@ -282,7 +282,7 @@ function setManagementFee(uint256) ``` -Used to change the value of `managementFee`. This may only be called by governance. +Used to change the value of `managementFee`. This may only be called by governance. @@ -303,7 +303,7 @@ function setGuardian(address) ``` -Used to change the address of `guardian`. This may only be called by governance or the existing guardian. +Used to change the address of `guardian`. This may only be called by governance or the existing guardian. @@ -324,7 +324,7 @@ function setEmergencyShutdown(bool) ``` -Activates or deactivates Vault mode where all Strategies go into full withdrawal. During Emergency Shutdown: 1. No Users may deposit into the Vault (but may withdraw as usual.) 2. Governance may not add new Strategies. 3. Each Strategy must pay back their debt as quickly as reasonable to minimally affect their position. 4. Only Governance may undo Emergency Shutdown. See contract level note for further details. This may only be called by governance or the guardian. +Activates or deactivates Vault mode where all Strategies go into full withdrawal. During Emergency Shutdown: 1. No Users may deposit into the Vault (but may withdraw as usual.) 2. Governance may not add new Strategies. 3. Each Strategy must pay back their debt as quickly as reasonable to minimally affect their position. 4. Only Governance may undo Emergency Shutdown. See contract level note for further details. This may only be called by governance or the guardian. @@ -345,7 +345,7 @@ function setWithdrawalQueue(address[20]) ``` -Updates the withdrawalQueue to match the addresses and order specified by `queue`. There can be fewer strategies than the maximum, as well as fewer than the total number of strategies active in the vault. `withdrawalQueue` will be updated in a gas-efficient manner, assuming the input is well- ordered with 0x0 only at the end. This may only be called by governance or management. +Updates the withdrawalQueue to match the addresses and order specified by `queue`. There can be fewer strategies than the maximum, as well as fewer than the total number of strategies active in the vault. `withdrawalQueue` will be updated in a gas-efficient manner, assuming the input is well- ordered with 0x0 only at the end. This may only be called by governance or management. *This is order sensitive, specify the addresses in the order in which funds should be withdrawn (so `queue`[0] is the first Strategy withdrawn from, `queue`[1] is the second, etc.) This means that the least impactful Strategy (the Strategy that will have its core positions impacted the least by having funds removed) should be at `queue`[0], then the next least impactful at `queue`[1], and so on.* @@ -368,7 +368,7 @@ function transfer(address,uint256) ``` -Transfers shares from the caller's address to `receiver`. This function will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. +Transfers shares from the caller's address to `receiver`. This function will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. @@ -396,7 +396,7 @@ function transferFrom(address,address,uint256) ``` -Transfers `amount` shares from `sender` to `receiver`. This operation will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. Unless the caller has given this contract unlimited approval, transfering shares will decrement the caller's `allowance` by `amount`. +Transfers `amount` shares from `sender` to `receiver`. This operation will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. Unless the caller has given this contract unlimited approval, transfering shares will decrement the caller's `allowance` by `amount`. @@ -491,7 +491,7 @@ function permit(address,address,uint256,uint256,bytes) ``` -Approves spender by owner's signature to expend owner's tokens. See https://eips.ethereum.org/EIPS/eip-2612. +Approves spender by owner's signature to expend owner's tokens. See https://eips.ethereum.org/EIPS/eip-2612. @@ -522,7 +522,7 @@ function totalAssets() ``` -Returns the total quantity of all assets under control of this Vault, whether they're loaned out to a Strategy, or currently held in the Vault. +Returns the total quantity of all assets under control of this Vault, whether they're loaned out to a Strategy, or currently held in the Vault. @@ -543,10 +543,10 @@ function deposit() ``` -Deposits `_amount` `token`, issuing shares to `recipient`. If the Vault is in Emergency Shutdown, deposits will not be accepted and this call will fail. +Deposits `_amount` `token`, issuing shares to `recipient`. If the Vault is in Emergency Shutdown, deposits will not be accepted and this call will fail. -*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both off-chain and on-chain) to determine if depositing into the Vault is a "good idea".* +*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both offchain and onchain) to determine if depositing into the Vault is a "good idea".* #### Parameters: @@ -574,7 +574,7 @@ function deposit(uint256) -*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both off-chain and on-chain) to determine if depositing into the Vault is a "good idea".* +*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both offchain and onchain) to determine if depositing into the Vault is a "good idea".* #### Parameters: @@ -602,7 +602,7 @@ function deposit(uint256,address) -*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both off-chain and on-chain) to determine if depositing into the Vault is a "good idea".* +*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both offchain and onchain) to determine if depositing into the Vault is a "good idea".* #### Parameters: @@ -629,7 +629,7 @@ function maxAvailableShares() ``` -Determines the maximum quantity of shares this Vault can facilitate a withdrawal for, factoring in assets currently residing in the Vault, as well as those deployed to strategies on the Vault's balance sheet. +Determines the maximum quantity of shares this Vault can facilitate a withdrawal for, factoring in assets currently residing in the Vault, as well as those deployed to strategies on the Vault's balance sheet. *Regarding how shares are calculated, see dev note on `deposit`. If you want to calculated the maximum a user could withdraw up to, you want to use this function. Note that the amount provided by this function is the theoretical maximum possible from withdrawing, the real amount depends on the realized losses incurred during withdrawal.* @@ -652,7 +652,7 @@ function withdraw() ``` -Withdraws the calling account's tokens from this Vault, redeeming amount `_shares` for an appropriate amount of tokens. See note on `setWithdrawalQueue` for further details of withdrawal ordering and behavior. +Withdraws the calling account's tokens from this Vault, redeeming amount `_shares` for an appropriate amount of tokens. See note on `setWithdrawalQueue` for further details of withdrawal ordering and behavior. *Measuring the value of shares is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On withdrawal, this means that shares are redeemed against the total amount that the deposited capital had "realized" since the point it was deposited, up until the point it was withdrawn. If that number were to be higher than the "expected value" at some future point, withdrawing shares via this method could entitle the depositor to *more* than the expected value once the "realized value" is updated from further reports by the Strategies to the Vaults. Under exceptional scenarios, this could cause earlier withdrawals to earn "more" of the underlying assets than Users might otherwise be entitled to, if the Vault's estimated value were otherwise measured through external means, accounting for whatever exceptional scenarios exist for the Vault (that aren't covered by the Vault's own design.)* @@ -770,7 +770,7 @@ function pricePerShare() ``` -Gives the price for a single Vault share. +Gives the price for a single Vault share. *See dev note on `withdraw`.* @@ -793,7 +793,7 @@ function addStrategy(address,uint256,uint256,uint256) ``` -Add a Strategy to the Vault. This may only be called by governance. +Add a Strategy to the Vault. This may only be called by governance. *The Strategy will be appended to `withdrawalQueue`, call `setWithdrawalQueue` to change the order.* @@ -819,7 +819,7 @@ function updateStrategyDebtRatio(address,uint256) ``` -Change the quantity of assets `strategy` may manage. This may be called by governance or management. +Change the quantity of assets `strategy` may manage. This may be called by governance or management. @@ -841,7 +841,7 @@ function updateStrategyRateLimit(address,uint256) ``` -Change the quantity assets per block this Vault may deposit to or withdraw from `strategy`. This may only be called by governance or management. +Change the quantity assets per block this Vault may deposit to or withdraw from `strategy`. This may only be called by governance or management. @@ -863,7 +863,7 @@ function updateStrategyPerformanceFee(address,uint256) ``` -Change the fee the strategist will receive based on this Vault's performance. This may only be called by governance. +Change the fee the strategist will receive based on this Vault's performance. This may only be called by governance. @@ -885,7 +885,7 @@ function migrateStrategy(address,address) ``` -Migrates a Strategy, including all assets from `oldVersion` to `newVersion`. This may only be called by governance. +Migrates a Strategy, including all assets from `oldVersion` to `newVersion`. This may only be called by governance. *Strategy must successfully migrate all capital and positions to new Strategy, or else this will upset the balance of the Vault. The new Strategy should be "empty" e.g. have no prior commitments to this Vault, otherwise it could have issues.* @@ -909,7 +909,7 @@ function revokeStrategy() ``` -Revoke a Strategy, setting its debt limit to 0 and preventing any future deposits. This function should only be used in the scenario where the Strategy is being retired but no migration of the positions are possible, or in the extreme scenario that the Strategy needs to be put into "Emergency Exit" mode in order for it to exit as quickly as possible. The latter scenario could be for any reason that is considered "critical" that the Strategy exits its position as fast as possible, such as a sudden change in market conditions leading to losses, or an imminent failure in an external dependency. This may only be called by governance, the guardian, or the Strategy itself. Note that a Strategy will only revoke itself during emergency shutdown. +Revoke a Strategy, setting its debt limit to 0 and preventing any future deposits. This function should only be used in the scenario where the Strategy is being retired but no migration of the positions are possible, or in the extreme scenario that the Strategy needs to be put into "Emergency Exit" mode in order for it to exit as quickly as possible. The latter scenario could be for any reason that is considered "critical" that the Strategy exits its position as fast as possible, such as a sudden change in market conditions leading to losses, or an imminent failure in an external dependency. This may only be called by governance, the guardian, or the Strategy itself. Note that a Strategy will only revoke itself during emergency shutdown. @@ -949,7 +949,7 @@ function addStrategyToQueue(address) ``` -Adds `strategy` to `withdrawalQueue`. This may only be called by governance or management. +Adds `strategy` to `withdrawalQueue`. This may only be called by governance or management. *The Strategy will be appended to `withdrawalQueue`, call `setWithdrawalQueue` to change the order.* @@ -972,7 +972,7 @@ function removeStrategyFromQueue(address) ``` -Remove `strategy` from `withdrawalQueue`. This may only be called by governance or management. +Remove `strategy` from `withdrawalQueue`. This may only be called by governance or management. *We don't do this with revokeStrategy because it should still be possible to withdraw from the Strategy if it's unwinding.* @@ -995,7 +995,7 @@ function debtOutstanding() ``` -Determines if `strategy` is past its debt limit and if any tokens should be withdrawn to the Vault. +Determines if `strategy` is past its debt limit and if any tokens should be withdrawn to the Vault. @@ -1047,7 +1047,7 @@ function creditAvailable() ``` -Amount of tokens in Vault a Strategy has access to as a credit line. This will check the Strategy's debt limit, as well as the tokens available in the Vault, and determine the maximum amount of tokens (if any) the Strategy may draw on. In the rare case the Vault is in emergency shutdown this will return 0. +Amount of tokens in Vault a Strategy has access to as a credit line. This will check the Strategy's debt limit, as well as the tokens available in the Vault, and determine the maximum amount of tokens (if any) the Strategy may draw on. In the rare case the Vault is in emergency shutdown this will return 0. @@ -1099,7 +1099,7 @@ function expectedReturn() ``` -Provide an accurate expected value for the return this `strategy` would provide to the Vault the next time `report()` is called (since the last time it was called). +Provide an accurate expected value for the return this `strategy` would provide to the Vault the next time `report()` is called (since the last time it was called). @@ -1151,7 +1151,7 @@ function report(uint256,uint256,uint256) ``` -Reports the amount of assets the calling Strategy has free (usually in terms of ROI). The performance fee is determined here, off of the strategy's profits (if any), and sent to governance. The strategist's fee is also determined here (off of profits), to be handled according to the strategist on the next harvest. This may only be called by a Strategy managed by this Vault. +Reports the amount of assets the calling Strategy has free (usually in terms of ROI). The performance fee is determined here, off of the strategy's profits (if any), and sent to governance. The strategist's fee is also determined here (off of profits), to be handled according to the strategist on the next harvest. This may only be called by a Strategy managed by this Vault. *For approved strategies, this is the most efficient behavior. The Strategy reports back what it has free, then Vault "decides" whether to take some back or give it more. Note that the most it can take is `gain + _debtPayment`, and the most it can give is all of the remaining reserves. Anything outside of those bounds is abnormal behavior. All approved strategies must have increased diligence around calling this function, as abnormal behavior could become catastrophic.* @@ -1160,8 +1160,8 @@ Reports the amount of assets the calling Strategy has free (usually in terms of #### Parameters: | Name | Type | Description | | :----------------------------- | :------------ | :--------------------------------------------- | -| * gain * | * * | * Amount Strategy has realized as a gain on it's investment since its last report, and is free to be given back to Vault as earnings * | -| * loss * | * * | * Amount Strategy has realized as a loss on it's investment since its last report, and should be accounted for on the Vault's balance sheet * | +| * gain * | * * | * Amount Strategy has realized as a gain on its investment since its last report, and is free to be given back to Vault as earnings * | +| * loss * | * * | * Amount Strategy has realized as a loss on its investment since its last report, and should be accounted for on the Vault's balance sheet * | | * _debtPayment * | * * | * Amount Strategy has made available to cover outstanding debt * | @@ -1182,7 +1182,7 @@ function sweep(address) ``` -Removes tokens from this Vault that are not the type of token managed by this Vault. This may be used in case of accidentally sending the wrong kind of token to this Vault. Tokens will be sent to `governance`. This will fail if an attempt is made to sweep the tokens that this Vault manages. This may only be called by governance. +Removes tokens from this Vault that are not the type of token managed by this Vault. This may be used in case of accidentally sending the wrong kind of token to this Vault. Tokens will be sent to `governance`. This will fail if an attempt is made to sweep the tokens that this Vault manages. This may only be called by governance. diff --git a/docs/developers/smart-contracts/deprecated/V2/version-0.3.2/BaseStrategy.md b/docs/developers/smart-contracts/deprecated/V2/version-0.3.2/BaseStrategy.md index 7467c46de6..8c4d3eb562 100644 --- a/docs/developers/smart-contracts/deprecated/V2/version-0.3.2/BaseStrategy.md +++ b/docs/developers/smart-contracts/deprecated/V2/version-0.3.2/BaseStrategy.md @@ -266,11 +266,11 @@ on protected functions in the Strategy. This total should be "realizable" e.g. the total value that could *actually* be obtained from this Strategy if it were to divest its - entire position based on current on-chain conditions. + entire position based on current onchain conditions. @dev Care must be taken in using this function, since it relies on external systems, which could be manipulated by the attacker to give an inflated - (or reduced) value produced by this function, based on current on-chain + (or reduced) value produced by this function, based on current onchain conditions (e.g. this function is possible to influence through flashloan attacks, oracle manipulations, or other DeFi attack mechanisms). @@ -530,7 +530,7 @@ value. Activates emergency exit. Once activated, the Strategy will exit its position upon the next harvest, depositing all funds into the Vault as - quickly as is reasonable given on-chain conditions. + quickly as is reasonable given onchain conditions. This may only be called by governance or the strategist. @dev diff --git a/docs/developers/smart-contracts/deprecated/V2/version-0.3.2/vault.md b/docs/developers/smart-contracts/deprecated/V2/version-0.3.2/vault.md index b9bcbf9053..45d9718229 100644 --- a/docs/developers/smart-contracts/deprecated/V2/version-0.3.2/vault.md +++ b/docs/developers/smart-contracts/deprecated/V2/version-0.3.2/vault.md @@ -7,7 +7,7 @@ -*Yearn Token Vault. Holds an underlying token, and allows users to interact with the Yearn ecosystem through Strategies connected to the Vault. Vaults are not limited to a single Strategy, they can have as many Strategies as can be designed (however the withdrawal queue is capped at 20.) Deposited funds are moved into the most impactful strategy that has not already reached its limit for assets under management, regardless of which Strategy a user's funds end up in, they receive their portion of yields generated across all Strategies. When a user withdraws, if there are no funds sitting undeployed in the Vault, the Vault withdraws funds from Strategies in the order of least impact. (Funds are taken from the Strategy that will disturb everyone's gains the least, then the next least, etc.) In order to achieve this, the withdrawal queue's order must be properly set and managed by the community (through governance). Vault Strategies are parameterized to pursue the highest risk-adjusted yield. There is an "Emergency Shutdown" mode. When the Vault is put into emergency shutdown, assets will be recalled from the Strategies as quickly as is practical (given on-chain conditions), minimizing loss. Deposits are halted, new Strategies may not be added, and each Strategy exits with the minimum possible damage to position, while opening up deposits to be withdrawn by users. There are no restrictions on withdrawals above what is expected under Normal Operation. For further details, please refer to the specification: https://github.com/iearn-finance/yearn-vaults/blob/master/SPECIFICATION.md* +*Yearn Token Vault. Holds an underlying token, and allows users to interact with the Yearn ecosystem through Strategies connected to the Vault. Vaults are not limited to a single Strategy, they can have as many Strategies as can be designed (however the withdrawal queue is capped at 20.) Deposited funds are moved into the most impactful strategy that has not already reached its limit for assets under management, regardless of which Strategy a user's funds end up in, they receive their portion of yields generated across all Strategies. When a user withdraws, if there are no funds sitting undeployed in the Vault, the Vault withdraws funds from Strategies in the order of least impact. (Funds are taken from the Strategy that will disturb everyone's gains the least, then the next least, etc.) In order to achieve this, the withdrawal queue's order must be properly set and managed by the community (through governance). Vault Strategies are parameterized to pursue the highest risk-adjusted yield. There is an "Emergency Shutdown" mode. When the Vault is put into emergency shutdown, assets will be recalled from the Strategies as quickly as is practical (given onchain conditions), minimizing loss. Deposits are halted, new Strategies may not be added, and each Strategy exits with the minimum possible damage to position, while opening up deposits to be withdrawn by users. There are no restrictions on withdrawals above what is expected under Normal Operation. For further details, please refer to the specification: https://github.com/iearn-finance/yearn-vaults/blob/master/SPECIFICATION.md* ## Functions @@ -20,7 +20,7 @@ function initialize(address,address,address,string,string) ``` -Initializes the Vault, this is called only once, when the contract is deployed. The performance fee is set to 10% of yield, per Strategy. The management fee is set to 2%, per year. The initial deposit limit is set to 0 (deposits disabled); it must be updated after initialization. +Initializes the Vault, this is called only once, when the contract is deployed. The performance fee is set to 10% of yield, per Strategy. The management fee is set to 2%, per year. The initial deposit limit is set to 0 (deposits disabled); it must be updated after initialization. *If `nameOverride` is not specified, the name will be 'yearn' combined with the name of `token`. If `symbolOverride` is not specified, the symbol will be 'y' combined with the symbol of `token`.* @@ -74,7 +74,7 @@ function apiVersion() ``` -Used to track the deployed version of this contract. In practice you can use this version number to compare with Yearn's GitHub and determine which version of the source matches this deployed contract. +Used to track the deployed version of this contract. In practice you can use this version number to compare with Yearn's GitHub and determine which version of the source matches this deployed contract. *All strategies must have an `apiVersion()` that matches the Vault's `API_VERSION`.* @@ -97,7 +97,7 @@ function setName(string) ``` -Used to change the value of `name`. This may only be called by governance. +Used to change the value of `name`. This may only be called by governance. @@ -118,7 +118,7 @@ function setSymbol(string) ``` -Used to change the value of `symbol`. This may only be called by governance. +Used to change the value of `symbol`. This may only be called by governance. @@ -139,7 +139,7 @@ function setGovernance(address) ``` -Nominate a new address to use as governance. The change does not go into effect immediately. This function sets a pending change, and the governance address is not updated until the proposed governance address has accepted the responsibility. This may only be called by the current governance address. +Nominate a new address to use as governance. The change does not go into effect immediately. This function sets a pending change, and the governance address is not updated until the proposed governance address has accepted the responsibility. This may only be called by the current governance address. @@ -160,7 +160,7 @@ function acceptGovernance() ``` -Once a new governance address has been proposed using setGovernance(), this function may be called by the proposed address to accept the responsibility of taking over governance for this contract. This may only be called by the proposed governance address. +Once a new governance address has been proposed using setGovernance(), this function may be called by the proposed address to accept the responsibility of taking over governance for this contract. This may only be called by the proposed governance address. *setGovernance() should be called by the existing governance address, prior to calling this function.* @@ -177,7 +177,7 @@ function setManagement(address) ``` -Changes the management address. Management is able to make some investment decisions adjusting parameters. This may only be called by governance. +Changes the management address. Management is able to make some investment decisions adjusting parameters. This may only be called by governance. @@ -198,7 +198,7 @@ function setGuestList(address) ``` -Used to set or change `guestList`. A guest list is another contract that dictates who is allowed to participate in a Vault (and transfer shares). This may only be called by governance. +Used to set or change `guestList`. A guest list is another contract that dictates who is allowed to participate in a Vault (and transfer shares). This may only be called by governance. @@ -219,7 +219,7 @@ function setRewards(address) ``` -Changes the rewards address. Any distributed rewards will cease flowing to the old address and begin flowing to this address once the change is in effect. This will not change any Strategy reports in progress, only new reports made after this change goes into effect. This may only be called by governance. +Changes the rewards address. Any distributed rewards will cease flowing to the old address and begin flowing to this address once the change is in effect. This will not change any Strategy reports in progress, only new reports made after this change goes into effect. This may only be called by governance. @@ -240,7 +240,7 @@ function setLockedProfitDegration(uint256) ``` -Changes the locked profit degration. +Changes the locked profit degration. @@ -261,7 +261,7 @@ function setDepositLimit(uint256) ``` -Changes the maximum amount of tokens that can be deposited in this Vault. Note, this is not how much may be deposited by a single depositor, but the maximum amount that may be deposited across all depositors. This may only be called by governance. +Changes the maximum amount of tokens that can be deposited in this Vault. Note, this is not how much may be deposited by a single depositor, but the maximum amount that may be deposited across all depositors. This may only be called by governance. @@ -282,7 +282,7 @@ function setPerformanceFee(uint256) ``` -Used to change the value of `performanceFee`. Should set this value below the maximum strategist performance fee. This may only be called by governance. +Used to change the value of `performanceFee`. Should set this value below the maximum strategist performance fee. This may only be called by governance. @@ -303,7 +303,7 @@ function setManagementFee(uint256) ``` -Used to change the value of `managementFee`. This may only be called by governance. +Used to change the value of `managementFee`. This may only be called by governance. @@ -324,7 +324,7 @@ function setGuardian(address) ``` -Used to change the address of `guardian`. This may only be called by governance or the existing guardian. +Used to change the address of `guardian`. This may only be called by governance or the existing guardian. @@ -345,7 +345,7 @@ function setEmergencyShutdown(bool) ``` -Activates or deactivates Vault mode where all Strategies go into full withdrawal. During Emergency Shutdown: 1. No Users may deposit into the Vault (but may withdraw as usual.) 2. Governance may not add new Strategies. 3. Each Strategy must pay back their debt as quickly as reasonable to minimally affect their position. 4. Only Governance may undo Emergency Shutdown. See contract level note for further details. This may only be called by governance or the guardian. +Activates or deactivates Vault mode where all Strategies go into full withdrawal. During Emergency Shutdown: 1. No Users may deposit into the Vault (but may withdraw as usual.) 2. Governance may not add new Strategies. 3. Each Strategy must pay back their debt as quickly as reasonable to minimally affect their position. 4. Only Governance may undo Emergency Shutdown. See contract level note for further details. This may only be called by governance or the guardian. @@ -366,7 +366,7 @@ function setWithdrawalQueue(address[20]) ``` -Updates the withdrawalQueue to match the addresses and order specified by `queue`. There can be fewer strategies than the maximum, as well as fewer than the total number of strategies active in the vault. `withdrawalQueue` will be updated in a gas-efficient manner, assuming the input is well- ordered with 0x0 only at the end. This may only be called by governance or management. +Updates the withdrawalQueue to match the addresses and order specified by `queue`. There can be fewer strategies than the maximum, as well as fewer than the total number of strategies active in the vault. `withdrawalQueue` will be updated in a gas-efficient manner, assuming the input is well- ordered with 0x0 only at the end. This may only be called by governance or management. *This is order sensitive, specify the addresses in the order in which funds should be withdrawn (so `queue`[0] is the first Strategy withdrawn from, `queue`[1] is the second, etc.) This means that the least impactful Strategy (the Strategy that will have its core positions impacted the least by having funds removed) should be at `queue`[0], then the next least impactful at `queue`[1], and so on.* @@ -389,7 +389,7 @@ function transfer(address,uint256) ``` -Transfers shares from the caller's address to `receiver`. This function will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. +Transfers shares from the caller's address to `receiver`. This function will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. @@ -417,7 +417,7 @@ function transferFrom(address,address,uint256) ``` -Transfers `amount` shares from `sender` to `receiver`. This operation will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. Unless the caller has given this contract unlimited approval, transfering shares will decrement the caller's `allowance` by `amount`. +Transfers `amount` shares from `sender` to `receiver`. This operation will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. Unless the caller has given this contract unlimited approval, transfering shares will decrement the caller's `allowance` by `amount`. @@ -512,7 +512,7 @@ function permit(address,address,uint256,uint256,bytes) ``` -Approves spender by owner's signature to expend owner's tokens. See https://eips.ethereum.org/EIPS/eip-2612. +Approves spender by owner's signature to expend owner's tokens. See https://eips.ethereum.org/EIPS/eip-2612. @@ -543,7 +543,7 @@ function totalAssets() ``` -Returns the total quantity of all assets under control of this Vault, whether they're loaned out to a Strategy, or currently held in the Vault. +Returns the total quantity of all assets under control of this Vault, whether they're loaned out to a Strategy, or currently held in the Vault. @@ -564,10 +564,10 @@ function deposit() ``` -Deposits `_amount` `token`, issuing shares to `recipient`. If the Vault is in Emergency Shutdown, deposits will not be accepted and this call will fail. +Deposits `_amount` `token`, issuing shares to `recipient`. If the Vault is in Emergency Shutdown, deposits will not be accepted and this call will fail. -*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both off-chain and on-chain) to determine if depositing into the Vault is a "good idea".* +*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both offchain and onchain) to determine if depositing into the Vault is a "good idea".* #### Parameters: @@ -595,7 +595,7 @@ function deposit(uint256) -*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both off-chain and on-chain) to determine if depositing into the Vault is a "good idea".* +*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both offchain and onchain) to determine if depositing into the Vault is a "good idea".* #### Parameters: @@ -623,7 +623,7 @@ function deposit(uint256,address) -*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both off-chain and on-chain) to determine if depositing into the Vault is a "good idea".* +*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both offchain and onchain) to determine if depositing into the Vault is a "good idea".* #### Parameters: @@ -650,7 +650,7 @@ function maxAvailableShares() ``` -Determines the maximum quantity of shares this Vault can facilitate a withdrawal for, factoring in assets currently residing in the Vault, as well as those deployed to strategies on the Vault's balance sheet. +Determines the maximum quantity of shares this Vault can facilitate a withdrawal for, factoring in assets currently residing in the Vault, as well as those deployed to strategies on the Vault's balance sheet. *Regarding how shares are calculated, see dev note on `deposit`. If you want to calculated the maximum a user could withdraw up to, you want to use this function. Note that the amount provided by this function is the theoretical maximum possible from withdrawing, the real amount depends on the realized losses incurred during withdrawal.* @@ -673,7 +673,7 @@ function withdraw() ``` -Withdraws the calling account's tokens from this Vault, redeeming amount `_shares` for an appropriate amount of tokens. See note on `setWithdrawalQueue` for further details of withdrawal ordering and behavior. +Withdraws the calling account's tokens from this Vault, redeeming amount `_shares` for an appropriate amount of tokens. See note on `setWithdrawalQueue` for further details of withdrawal ordering and behavior. *Measuring the value of shares is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On withdrawal, this means that shares are redeemed against the total amount that the deposited capital had "realized" since the point it was deposited, up until the point it was withdrawn. If that number were to be higher than the "expected value" at some future point, withdrawing shares via this method could entitle the depositor to *more* than the expected value once the "realized value" is updated from further reports by the Strategies to the Vaults. Under exceptional scenarios, this could cause earlier withdrawals to earn "more" of the underlying assets than Users might otherwise be entitled to, if the Vault's estimated value were otherwise measured through external means, accounting for whatever exceptional scenarios exist for the Vault (that aren't covered by the Vault's own design.)* @@ -791,7 +791,7 @@ function pricePerShare() ``` -Gives the price for a single Vault share. +Gives the price for a single Vault share. *See dev note on `withdraw`.* @@ -814,7 +814,7 @@ function addStrategy(address,uint256,uint256,uint256,uint256) ``` -Add a Strategy to the Vault. This may only be called by governance. +Add a Strategy to the Vault. This may only be called by governance. *The Strategy will be appended to `withdrawalQueue`, call `setWithdrawalQueue` to change the order.* @@ -841,7 +841,7 @@ function updateStrategyDebtRatio(address,uint256) ``` -Change the quantity of assets `strategy` may manage. This may be called by governance or management. +Change the quantity of assets `strategy` may manage. This may be called by governance or management. @@ -863,7 +863,7 @@ function updateStrategyMinDebtPerHarvest(address,uint256) ``` -Change the quantity assets per block this Vault may deposit to or withdraw from `strategy`. This may only be called by governance or management. +Change the quantity assets per block this Vault may deposit to or withdraw from `strategy`. This may only be called by governance or management. @@ -885,7 +885,7 @@ function updateStrategyMaxDebtPerHarvest(address,uint256) ``` -Change the quantity assets per block this Vault may deposit to or withdraw from `strategy`. This may only be called by governance or management. +Change the quantity assets per block this Vault may deposit to or withdraw from `strategy`. This may only be called by governance or management. @@ -907,7 +907,7 @@ function updateStrategyPerformanceFee(address,uint256) ``` -Change the fee the strategist will receive based on this Vault's performance. This may only be called by governance. +Change the fee the strategist will receive based on this Vault's performance. This may only be called by governance. @@ -929,7 +929,7 @@ function migrateStrategy(address,address) ``` -Migrates a Strategy, including all assets from `oldVersion` to `newVersion`. This may only be called by governance. +Migrates a Strategy, including all assets from `oldVersion` to `newVersion`. This may only be called by governance. *Strategy must successfully migrate all capital and positions to new Strategy, or else this will upset the balance of the Vault. The new Strategy should be "empty" e.g. have no prior commitments to this Vault, otherwise it could have issues.* @@ -953,7 +953,7 @@ function revokeStrategy() ``` -Revoke a Strategy, setting its debt limit to 0 and preventing any future deposits. This function should only be used in the scenario where the Strategy is being retired but no migration of the positions are possible, or in the extreme scenario that the Strategy needs to be put into "Emergency Exit" mode in order for it to exit as quickly as possible. The latter scenario could be for any reason that is considered "critical" that the Strategy exits its position as fast as possible, such as a sudden change in market conditions leading to losses, or an imminent failure in an external dependency. This may only be called by governance, the guardian, or the Strategy itself. Note that a Strategy will only revoke itself during emergency shutdown. +Revoke a Strategy, setting its debt limit to 0 and preventing any future deposits. This function should only be used in the scenario where the Strategy is being retired but no migration of the positions are possible, or in the extreme scenario that the Strategy needs to be put into "Emergency Exit" mode in order for it to exit as quickly as possible. The latter scenario could be for any reason that is considered "critical" that the Strategy exits its position as fast as possible, such as a sudden change in market conditions leading to losses, or an imminent failure in an external dependency. This may only be called by governance, the guardian, or the Strategy itself. Note that a Strategy will only revoke itself during emergency shutdown. @@ -993,7 +993,7 @@ function addStrategyToQueue(address) ``` -Adds `strategy` to `withdrawalQueue`. This may only be called by governance or management. +Adds `strategy` to `withdrawalQueue`. This may only be called by governance or management. *The Strategy will be appended to `withdrawalQueue`, call `setWithdrawalQueue` to change the order.* @@ -1016,7 +1016,7 @@ function removeStrategyFromQueue(address) ``` -Remove `strategy` from `withdrawalQueue`. This may only be called by governance or management. +Remove `strategy` from `withdrawalQueue`. This may only be called by governance or management. *We don't do this with revokeStrategy because it should still be possible to withdraw from the Strategy if it's unwinding.* @@ -1039,7 +1039,7 @@ function debtOutstanding() ``` -Determines if `strategy` is past its debt limit and if any tokens should be withdrawn to the Vault. +Determines if `strategy` is past its debt limit and if any tokens should be withdrawn to the Vault. @@ -1091,7 +1091,7 @@ function creditAvailable() ``` -Amount of tokens in Vault a Strategy has access to as a credit line. This will check the Strategy's debt limit, as well as the tokens available in the Vault, and determine the maximum amount of tokens (if any) the Strategy may draw on. In the rare case the Vault is in emergency shutdown this will return 0. +Amount of tokens in Vault a Strategy has access to as a credit line. This will check the Strategy's debt limit, as well as the tokens available in the Vault, and determine the maximum amount of tokens (if any) the Strategy may draw on. In the rare case the Vault is in emergency shutdown this will return 0. @@ -1143,7 +1143,7 @@ function expectedReturn() ``` -Provide an accurate expected value for the return this `strategy` would provide to the Vault the next time `report()` is called (since the last time it was called). +Provide an accurate expected value for the return this `strategy` would provide to the Vault the next time `report()` is called (since the last time it was called). @@ -1195,7 +1195,7 @@ function report(uint256,uint256,uint256) ``` -Reports the amount of assets the calling Strategy has free (usually in terms of ROI). The performance fee is determined here, off of the strategy's profits (if any), and sent to governance. The strategist's fee is also determined here (off of profits), to be handled according to the strategist on the next harvest. This may only be called by a Strategy managed by this Vault. +Reports the amount of assets the calling Strategy has free (usually in terms of ROI). The performance fee is determined here, off of the strategy's profits (if any), and sent to governance. The strategist's fee is also determined here (off of profits), to be handled according to the strategist on the next harvest. This may only be called by a Strategy managed by this Vault. *For approved strategies, this is the most efficient behavior. The Strategy reports back what it has free, then Vault "decides" whether to take some back or give it more. Note that the most it can take is `gain + _debtPayment`, and the most it can give is all of the remaining reserves. Anything outside of those bounds is abnormal behavior. All approved strategies must have increased diligence around calling this function, as abnormal behavior could become catastrophic.* @@ -1204,8 +1204,8 @@ Reports the amount of assets the calling Strategy has free (usually in terms of #### Parameters: | Name | Type | Description | | :----------------------------- | :------------ | :--------------------------------------------- | -| * gain * | * * | * Amount Strategy has realized as a gain on it's investment since its last report, and is free to be given back to Vault as earnings * | -| * loss * | * * | * Amount Strategy has realized as a loss on it's investment since its last report, and should be accounted for on the Vault's balance sheet * | +| * gain * | * * | * Amount Strategy has realized as a gain on its investment since its last report, and is free to be given back to Vault as earnings * | +| * loss * | * * | * Amount Strategy has realized as a loss on its investment since its last report, and should be accounted for on the Vault's balance sheet * | | * _debtPayment * | * * | * Amount Strategy has made available to cover outstanding debt * | @@ -1226,7 +1226,7 @@ function sweep(address) ``` -Removes tokens from this Vault that are not the type of token managed by this Vault. This may be used in case of accidentally sending the wrong kind of token to this Vault. Tokens will be sent to `governance`. This will fail if an attempt is made to sweep the tokens that this Vault manages. This may only be called by governance. +Removes tokens from this Vault that are not the type of token managed by this Vault. This may be used in case of accidentally sending the wrong kind of token to this Vault. Tokens will be sent to `governance`. This will fail if an attempt is made to sweep the tokens that this Vault manages. This may only be called by governance. diff --git a/docs/developers/smart-contracts/deprecated/V2/version-0.3.3/BaseStrategy.md b/docs/developers/smart-contracts/deprecated/V2/version-0.3.3/BaseStrategy.md index 7467c46de6..f00c6c89dd 100644 --- a/docs/developers/smart-contracts/deprecated/V2/version-0.3.3/BaseStrategy.md +++ b/docs/developers/smart-contracts/deprecated/V2/version-0.3.3/BaseStrategy.md @@ -51,7 +51,7 @@ This Strategy's name. `estimatedTotalAssets()` below, as the TVL calc will be total assets minus delegated assets. @return The amount of assets this strategy manages that should not be included in Yearn's Total Value - Locked (TVL) calculation across it's ecosystem. + Locked (TVL) calculation across its ecosystem. @@ -266,11 +266,11 @@ on protected functions in the Strategy. This total should be "realizable" e.g. the total value that could *actually* be obtained from this Strategy if it were to divest its - entire position based on current on-chain conditions. + entire position based on current onchain conditions. @dev Care must be taken in using this function, since it relies on external systems, which could be manipulated by the attacker to give an inflated - (or reduced) value produced by this function, based on current on-chain + (or reduced) value produced by this function, based on current onchain conditions (e.g. this function is possible to influence through flashloan attacks, oracle manipulations, or other DeFi attack mechanisms). @@ -530,7 +530,7 @@ value. Activates emergency exit. Once activated, the Strategy will exit its position upon the next harvest, depositing all funds into the Vault as - quickly as is reasonable given on-chain conditions. + quickly as is reasonable given onchain conditions. This may only be called by governance or the strategist. @dev diff --git a/docs/developers/smart-contracts/deprecated/V2/version-0.3.3/vault.md b/docs/developers/smart-contracts/deprecated/V2/version-0.3.3/vault.md index b9bcbf9053..45d9718229 100644 --- a/docs/developers/smart-contracts/deprecated/V2/version-0.3.3/vault.md +++ b/docs/developers/smart-contracts/deprecated/V2/version-0.3.3/vault.md @@ -7,7 +7,7 @@ -*Yearn Token Vault. Holds an underlying token, and allows users to interact with the Yearn ecosystem through Strategies connected to the Vault. Vaults are not limited to a single Strategy, they can have as many Strategies as can be designed (however the withdrawal queue is capped at 20.) Deposited funds are moved into the most impactful strategy that has not already reached its limit for assets under management, regardless of which Strategy a user's funds end up in, they receive their portion of yields generated across all Strategies. When a user withdraws, if there are no funds sitting undeployed in the Vault, the Vault withdraws funds from Strategies in the order of least impact. (Funds are taken from the Strategy that will disturb everyone's gains the least, then the next least, etc.) In order to achieve this, the withdrawal queue's order must be properly set and managed by the community (through governance). Vault Strategies are parameterized to pursue the highest risk-adjusted yield. There is an "Emergency Shutdown" mode. When the Vault is put into emergency shutdown, assets will be recalled from the Strategies as quickly as is practical (given on-chain conditions), minimizing loss. Deposits are halted, new Strategies may not be added, and each Strategy exits with the minimum possible damage to position, while opening up deposits to be withdrawn by users. There are no restrictions on withdrawals above what is expected under Normal Operation. For further details, please refer to the specification: https://github.com/iearn-finance/yearn-vaults/blob/master/SPECIFICATION.md* +*Yearn Token Vault. Holds an underlying token, and allows users to interact with the Yearn ecosystem through Strategies connected to the Vault. Vaults are not limited to a single Strategy, they can have as many Strategies as can be designed (however the withdrawal queue is capped at 20.) Deposited funds are moved into the most impactful strategy that has not already reached its limit for assets under management, regardless of which Strategy a user's funds end up in, they receive their portion of yields generated across all Strategies. When a user withdraws, if there are no funds sitting undeployed in the Vault, the Vault withdraws funds from Strategies in the order of least impact. (Funds are taken from the Strategy that will disturb everyone's gains the least, then the next least, etc.) In order to achieve this, the withdrawal queue's order must be properly set and managed by the community (through governance). Vault Strategies are parameterized to pursue the highest risk-adjusted yield. There is an "Emergency Shutdown" mode. When the Vault is put into emergency shutdown, assets will be recalled from the Strategies as quickly as is practical (given onchain conditions), minimizing loss. Deposits are halted, new Strategies may not be added, and each Strategy exits with the minimum possible damage to position, while opening up deposits to be withdrawn by users. There are no restrictions on withdrawals above what is expected under Normal Operation. For further details, please refer to the specification: https://github.com/iearn-finance/yearn-vaults/blob/master/SPECIFICATION.md* ## Functions @@ -20,7 +20,7 @@ function initialize(address,address,address,string,string) ``` -Initializes the Vault, this is called only once, when the contract is deployed. The performance fee is set to 10% of yield, per Strategy. The management fee is set to 2%, per year. The initial deposit limit is set to 0 (deposits disabled); it must be updated after initialization. +Initializes the Vault, this is called only once, when the contract is deployed. The performance fee is set to 10% of yield, per Strategy. The management fee is set to 2%, per year. The initial deposit limit is set to 0 (deposits disabled); it must be updated after initialization. *If `nameOverride` is not specified, the name will be 'yearn' combined with the name of `token`. If `symbolOverride` is not specified, the symbol will be 'y' combined with the symbol of `token`.* @@ -74,7 +74,7 @@ function apiVersion() ``` -Used to track the deployed version of this contract. In practice you can use this version number to compare with Yearn's GitHub and determine which version of the source matches this deployed contract. +Used to track the deployed version of this contract. In practice you can use this version number to compare with Yearn's GitHub and determine which version of the source matches this deployed contract. *All strategies must have an `apiVersion()` that matches the Vault's `API_VERSION`.* @@ -97,7 +97,7 @@ function setName(string) ``` -Used to change the value of `name`. This may only be called by governance. +Used to change the value of `name`. This may only be called by governance. @@ -118,7 +118,7 @@ function setSymbol(string) ``` -Used to change the value of `symbol`. This may only be called by governance. +Used to change the value of `symbol`. This may only be called by governance. @@ -139,7 +139,7 @@ function setGovernance(address) ``` -Nominate a new address to use as governance. The change does not go into effect immediately. This function sets a pending change, and the governance address is not updated until the proposed governance address has accepted the responsibility. This may only be called by the current governance address. +Nominate a new address to use as governance. The change does not go into effect immediately. This function sets a pending change, and the governance address is not updated until the proposed governance address has accepted the responsibility. This may only be called by the current governance address. @@ -160,7 +160,7 @@ function acceptGovernance() ``` -Once a new governance address has been proposed using setGovernance(), this function may be called by the proposed address to accept the responsibility of taking over governance for this contract. This may only be called by the proposed governance address. +Once a new governance address has been proposed using setGovernance(), this function may be called by the proposed address to accept the responsibility of taking over governance for this contract. This may only be called by the proposed governance address. *setGovernance() should be called by the existing governance address, prior to calling this function.* @@ -177,7 +177,7 @@ function setManagement(address) ``` -Changes the management address. Management is able to make some investment decisions adjusting parameters. This may only be called by governance. +Changes the management address. Management is able to make some investment decisions adjusting parameters. This may only be called by governance. @@ -198,7 +198,7 @@ function setGuestList(address) ``` -Used to set or change `guestList`. A guest list is another contract that dictates who is allowed to participate in a Vault (and transfer shares). This may only be called by governance. +Used to set or change `guestList`. A guest list is another contract that dictates who is allowed to participate in a Vault (and transfer shares). This may only be called by governance. @@ -219,7 +219,7 @@ function setRewards(address) ``` -Changes the rewards address. Any distributed rewards will cease flowing to the old address and begin flowing to this address once the change is in effect. This will not change any Strategy reports in progress, only new reports made after this change goes into effect. This may only be called by governance. +Changes the rewards address. Any distributed rewards will cease flowing to the old address and begin flowing to this address once the change is in effect. This will not change any Strategy reports in progress, only new reports made after this change goes into effect. This may only be called by governance. @@ -240,7 +240,7 @@ function setLockedProfitDegration(uint256) ``` -Changes the locked profit degration. +Changes the locked profit degration. @@ -261,7 +261,7 @@ function setDepositLimit(uint256) ``` -Changes the maximum amount of tokens that can be deposited in this Vault. Note, this is not how much may be deposited by a single depositor, but the maximum amount that may be deposited across all depositors. This may only be called by governance. +Changes the maximum amount of tokens that can be deposited in this Vault. Note, this is not how much may be deposited by a single depositor, but the maximum amount that may be deposited across all depositors. This may only be called by governance. @@ -282,7 +282,7 @@ function setPerformanceFee(uint256) ``` -Used to change the value of `performanceFee`. Should set this value below the maximum strategist performance fee. This may only be called by governance. +Used to change the value of `performanceFee`. Should set this value below the maximum strategist performance fee. This may only be called by governance. @@ -303,7 +303,7 @@ function setManagementFee(uint256) ``` -Used to change the value of `managementFee`. This may only be called by governance. +Used to change the value of `managementFee`. This may only be called by governance. @@ -324,7 +324,7 @@ function setGuardian(address) ``` -Used to change the address of `guardian`. This may only be called by governance or the existing guardian. +Used to change the address of `guardian`. This may only be called by governance or the existing guardian. @@ -345,7 +345,7 @@ function setEmergencyShutdown(bool) ``` -Activates or deactivates Vault mode where all Strategies go into full withdrawal. During Emergency Shutdown: 1. No Users may deposit into the Vault (but may withdraw as usual.) 2. Governance may not add new Strategies. 3. Each Strategy must pay back their debt as quickly as reasonable to minimally affect their position. 4. Only Governance may undo Emergency Shutdown. See contract level note for further details. This may only be called by governance or the guardian. +Activates or deactivates Vault mode where all Strategies go into full withdrawal. During Emergency Shutdown: 1. No Users may deposit into the Vault (but may withdraw as usual.) 2. Governance may not add new Strategies. 3. Each Strategy must pay back their debt as quickly as reasonable to minimally affect their position. 4. Only Governance may undo Emergency Shutdown. See contract level note for further details. This may only be called by governance or the guardian. @@ -366,7 +366,7 @@ function setWithdrawalQueue(address[20]) ``` -Updates the withdrawalQueue to match the addresses and order specified by `queue`. There can be fewer strategies than the maximum, as well as fewer than the total number of strategies active in the vault. `withdrawalQueue` will be updated in a gas-efficient manner, assuming the input is well- ordered with 0x0 only at the end. This may only be called by governance or management. +Updates the withdrawalQueue to match the addresses and order specified by `queue`. There can be fewer strategies than the maximum, as well as fewer than the total number of strategies active in the vault. `withdrawalQueue` will be updated in a gas-efficient manner, assuming the input is well- ordered with 0x0 only at the end. This may only be called by governance or management. *This is order sensitive, specify the addresses in the order in which funds should be withdrawn (so `queue`[0] is the first Strategy withdrawn from, `queue`[1] is the second, etc.) This means that the least impactful Strategy (the Strategy that will have its core positions impacted the least by having funds removed) should be at `queue`[0], then the next least impactful at `queue`[1], and so on.* @@ -389,7 +389,7 @@ function transfer(address,uint256) ``` -Transfers shares from the caller's address to `receiver`. This function will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. +Transfers shares from the caller's address to `receiver`. This function will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. @@ -417,7 +417,7 @@ function transferFrom(address,address,uint256) ``` -Transfers `amount` shares from `sender` to `receiver`. This operation will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. Unless the caller has given this contract unlimited approval, transfering shares will decrement the caller's `allowance` by `amount`. +Transfers `amount` shares from `sender` to `receiver`. This operation will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. Unless the caller has given this contract unlimited approval, transfering shares will decrement the caller's `allowance` by `amount`. @@ -512,7 +512,7 @@ function permit(address,address,uint256,uint256,bytes) ``` -Approves spender by owner's signature to expend owner's tokens. See https://eips.ethereum.org/EIPS/eip-2612. +Approves spender by owner's signature to expend owner's tokens. See https://eips.ethereum.org/EIPS/eip-2612. @@ -543,7 +543,7 @@ function totalAssets() ``` -Returns the total quantity of all assets under control of this Vault, whether they're loaned out to a Strategy, or currently held in the Vault. +Returns the total quantity of all assets under control of this Vault, whether they're loaned out to a Strategy, or currently held in the Vault. @@ -564,10 +564,10 @@ function deposit() ``` -Deposits `_amount` `token`, issuing shares to `recipient`. If the Vault is in Emergency Shutdown, deposits will not be accepted and this call will fail. +Deposits `_amount` `token`, issuing shares to `recipient`. If the Vault is in Emergency Shutdown, deposits will not be accepted and this call will fail. -*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both off-chain and on-chain) to determine if depositing into the Vault is a "good idea".* +*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both offchain and onchain) to determine if depositing into the Vault is a "good idea".* #### Parameters: @@ -595,7 +595,7 @@ function deposit(uint256) -*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both off-chain and on-chain) to determine if depositing into the Vault is a "good idea".* +*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both offchain and onchain) to determine if depositing into the Vault is a "good idea".* #### Parameters: @@ -623,7 +623,7 @@ function deposit(uint256,address) -*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both off-chain and on-chain) to determine if depositing into the Vault is a "good idea".* +*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both offchain and onchain) to determine if depositing into the Vault is a "good idea".* #### Parameters: @@ -650,7 +650,7 @@ function maxAvailableShares() ``` -Determines the maximum quantity of shares this Vault can facilitate a withdrawal for, factoring in assets currently residing in the Vault, as well as those deployed to strategies on the Vault's balance sheet. +Determines the maximum quantity of shares this Vault can facilitate a withdrawal for, factoring in assets currently residing in the Vault, as well as those deployed to strategies on the Vault's balance sheet. *Regarding how shares are calculated, see dev note on `deposit`. If you want to calculated the maximum a user could withdraw up to, you want to use this function. Note that the amount provided by this function is the theoretical maximum possible from withdrawing, the real amount depends on the realized losses incurred during withdrawal.* @@ -673,7 +673,7 @@ function withdraw() ``` -Withdraws the calling account's tokens from this Vault, redeeming amount `_shares` for an appropriate amount of tokens. See note on `setWithdrawalQueue` for further details of withdrawal ordering and behavior. +Withdraws the calling account's tokens from this Vault, redeeming amount `_shares` for an appropriate amount of tokens. See note on `setWithdrawalQueue` for further details of withdrawal ordering and behavior. *Measuring the value of shares is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On withdrawal, this means that shares are redeemed against the total amount that the deposited capital had "realized" since the point it was deposited, up until the point it was withdrawn. If that number were to be higher than the "expected value" at some future point, withdrawing shares via this method could entitle the depositor to *more* than the expected value once the "realized value" is updated from further reports by the Strategies to the Vaults. Under exceptional scenarios, this could cause earlier withdrawals to earn "more" of the underlying assets than Users might otherwise be entitled to, if the Vault's estimated value were otherwise measured through external means, accounting for whatever exceptional scenarios exist for the Vault (that aren't covered by the Vault's own design.)* @@ -791,7 +791,7 @@ function pricePerShare() ``` -Gives the price for a single Vault share. +Gives the price for a single Vault share. *See dev note on `withdraw`.* @@ -814,7 +814,7 @@ function addStrategy(address,uint256,uint256,uint256,uint256) ``` -Add a Strategy to the Vault. This may only be called by governance. +Add a Strategy to the Vault. This may only be called by governance. *The Strategy will be appended to `withdrawalQueue`, call `setWithdrawalQueue` to change the order.* @@ -841,7 +841,7 @@ function updateStrategyDebtRatio(address,uint256) ``` -Change the quantity of assets `strategy` may manage. This may be called by governance or management. +Change the quantity of assets `strategy` may manage. This may be called by governance or management. @@ -863,7 +863,7 @@ function updateStrategyMinDebtPerHarvest(address,uint256) ``` -Change the quantity assets per block this Vault may deposit to or withdraw from `strategy`. This may only be called by governance or management. +Change the quantity assets per block this Vault may deposit to or withdraw from `strategy`. This may only be called by governance or management. @@ -885,7 +885,7 @@ function updateStrategyMaxDebtPerHarvest(address,uint256) ``` -Change the quantity assets per block this Vault may deposit to or withdraw from `strategy`. This may only be called by governance or management. +Change the quantity assets per block this Vault may deposit to or withdraw from `strategy`. This may only be called by governance or management. @@ -907,7 +907,7 @@ function updateStrategyPerformanceFee(address,uint256) ``` -Change the fee the strategist will receive based on this Vault's performance. This may only be called by governance. +Change the fee the strategist will receive based on this Vault's performance. This may only be called by governance. @@ -929,7 +929,7 @@ function migrateStrategy(address,address) ``` -Migrates a Strategy, including all assets from `oldVersion` to `newVersion`. This may only be called by governance. +Migrates a Strategy, including all assets from `oldVersion` to `newVersion`. This may only be called by governance. *Strategy must successfully migrate all capital and positions to new Strategy, or else this will upset the balance of the Vault. The new Strategy should be "empty" e.g. have no prior commitments to this Vault, otherwise it could have issues.* @@ -953,7 +953,7 @@ function revokeStrategy() ``` -Revoke a Strategy, setting its debt limit to 0 and preventing any future deposits. This function should only be used in the scenario where the Strategy is being retired but no migration of the positions are possible, or in the extreme scenario that the Strategy needs to be put into "Emergency Exit" mode in order for it to exit as quickly as possible. The latter scenario could be for any reason that is considered "critical" that the Strategy exits its position as fast as possible, such as a sudden change in market conditions leading to losses, or an imminent failure in an external dependency. This may only be called by governance, the guardian, or the Strategy itself. Note that a Strategy will only revoke itself during emergency shutdown. +Revoke a Strategy, setting its debt limit to 0 and preventing any future deposits. This function should only be used in the scenario where the Strategy is being retired but no migration of the positions are possible, or in the extreme scenario that the Strategy needs to be put into "Emergency Exit" mode in order for it to exit as quickly as possible. The latter scenario could be for any reason that is considered "critical" that the Strategy exits its position as fast as possible, such as a sudden change in market conditions leading to losses, or an imminent failure in an external dependency. This may only be called by governance, the guardian, or the Strategy itself. Note that a Strategy will only revoke itself during emergency shutdown. @@ -993,7 +993,7 @@ function addStrategyToQueue(address) ``` -Adds `strategy` to `withdrawalQueue`. This may only be called by governance or management. +Adds `strategy` to `withdrawalQueue`. This may only be called by governance or management. *The Strategy will be appended to `withdrawalQueue`, call `setWithdrawalQueue` to change the order.* @@ -1016,7 +1016,7 @@ function removeStrategyFromQueue(address) ``` -Remove `strategy` from `withdrawalQueue`. This may only be called by governance or management. +Remove `strategy` from `withdrawalQueue`. This may only be called by governance or management. *We don't do this with revokeStrategy because it should still be possible to withdraw from the Strategy if it's unwinding.* @@ -1039,7 +1039,7 @@ function debtOutstanding() ``` -Determines if `strategy` is past its debt limit and if any tokens should be withdrawn to the Vault. +Determines if `strategy` is past its debt limit and if any tokens should be withdrawn to the Vault. @@ -1091,7 +1091,7 @@ function creditAvailable() ``` -Amount of tokens in Vault a Strategy has access to as a credit line. This will check the Strategy's debt limit, as well as the tokens available in the Vault, and determine the maximum amount of tokens (if any) the Strategy may draw on. In the rare case the Vault is in emergency shutdown this will return 0. +Amount of tokens in Vault a Strategy has access to as a credit line. This will check the Strategy's debt limit, as well as the tokens available in the Vault, and determine the maximum amount of tokens (if any) the Strategy may draw on. In the rare case the Vault is in emergency shutdown this will return 0. @@ -1143,7 +1143,7 @@ function expectedReturn() ``` -Provide an accurate expected value for the return this `strategy` would provide to the Vault the next time `report()` is called (since the last time it was called). +Provide an accurate expected value for the return this `strategy` would provide to the Vault the next time `report()` is called (since the last time it was called). @@ -1195,7 +1195,7 @@ function report(uint256,uint256,uint256) ``` -Reports the amount of assets the calling Strategy has free (usually in terms of ROI). The performance fee is determined here, off of the strategy's profits (if any), and sent to governance. The strategist's fee is also determined here (off of profits), to be handled according to the strategist on the next harvest. This may only be called by a Strategy managed by this Vault. +Reports the amount of assets the calling Strategy has free (usually in terms of ROI). The performance fee is determined here, off of the strategy's profits (if any), and sent to governance. The strategist's fee is also determined here (off of profits), to be handled according to the strategist on the next harvest. This may only be called by a Strategy managed by this Vault. *For approved strategies, this is the most efficient behavior. The Strategy reports back what it has free, then Vault "decides" whether to take some back or give it more. Note that the most it can take is `gain + _debtPayment`, and the most it can give is all of the remaining reserves. Anything outside of those bounds is abnormal behavior. All approved strategies must have increased diligence around calling this function, as abnormal behavior could become catastrophic.* @@ -1204,8 +1204,8 @@ Reports the amount of assets the calling Strategy has free (usually in terms of #### Parameters: | Name | Type | Description | | :----------------------------- | :------------ | :--------------------------------------------- | -| * gain * | * * | * Amount Strategy has realized as a gain on it's investment since its last report, and is free to be given back to Vault as earnings * | -| * loss * | * * | * Amount Strategy has realized as a loss on it's investment since its last report, and should be accounted for on the Vault's balance sheet * | +| * gain * | * * | * Amount Strategy has realized as a gain on its investment since its last report, and is free to be given back to Vault as earnings * | +| * loss * | * * | * Amount Strategy has realized as a loss on its investment since its last report, and should be accounted for on the Vault's balance sheet * | | * _debtPayment * | * * | * Amount Strategy has made available to cover outstanding debt * | @@ -1226,7 +1226,7 @@ function sweep(address) ``` -Removes tokens from this Vault that are not the type of token managed by this Vault. This may be used in case of accidentally sending the wrong kind of token to this Vault. Tokens will be sent to `governance`. This will fail if an attempt is made to sweep the tokens that this Vault manages. This may only be called by governance. +Removes tokens from this Vault that are not the type of token managed by this Vault. This may be used in case of accidentally sending the wrong kind of token to this Vault. Tokens will be sent to `governance`. This will fail if an attempt is made to sweep the tokens that this Vault manages. This may only be called by governance. diff --git a/docs/developers/smart-contracts/deprecated/V2/version-0.3.4/BaseStrategy.md b/docs/developers/smart-contracts/deprecated/V2/version-0.3.4/BaseStrategy.md index 8f3975bc1f..8f02063a9e 100644 --- a/docs/developers/smart-contracts/deprecated/V2/version-0.3.4/BaseStrategy.md +++ b/docs/developers/smart-contracts/deprecated/V2/version-0.3.4/BaseStrategy.md @@ -268,11 +268,11 @@ on protected functions in the Strategy. This total should be "realizable" e.g. the total value that could *actually* be obtained from this Strategy if it were to divest its - entire position based on current on-chain conditions. + entire position based on current onchain conditions. @dev Care must be taken in using this function, since it relies on external systems, which could be manipulated by the attacker to give an inflated - (or reduced) value produced by this function, based on current on-chain + (or reduced) value produced by this function, based on current onchain conditions (e.g. this function is possible to influence through flashloan attacks, oracle manipulations, or other DeFi attack mechanisms). @@ -532,7 +532,7 @@ value. Activates emergency exit. Once activated, the Strategy will exit its position upon the next harvest, depositing all funds into the Vault as - quickly as is reasonable given on-chain conditions. + quickly as is reasonable given onchain conditions. This may only be called by governance or the strategist. @dev diff --git a/docs/developers/smart-contracts/deprecated/V2/version-0.3.4/vault.md b/docs/developers/smart-contracts/deprecated/V2/version-0.3.4/vault.md index b9bcbf9053..45d9718229 100644 --- a/docs/developers/smart-contracts/deprecated/V2/version-0.3.4/vault.md +++ b/docs/developers/smart-contracts/deprecated/V2/version-0.3.4/vault.md @@ -7,7 +7,7 @@ -*Yearn Token Vault. Holds an underlying token, and allows users to interact with the Yearn ecosystem through Strategies connected to the Vault. Vaults are not limited to a single Strategy, they can have as many Strategies as can be designed (however the withdrawal queue is capped at 20.) Deposited funds are moved into the most impactful strategy that has not already reached its limit for assets under management, regardless of which Strategy a user's funds end up in, they receive their portion of yields generated across all Strategies. When a user withdraws, if there are no funds sitting undeployed in the Vault, the Vault withdraws funds from Strategies in the order of least impact. (Funds are taken from the Strategy that will disturb everyone's gains the least, then the next least, etc.) In order to achieve this, the withdrawal queue's order must be properly set and managed by the community (through governance). Vault Strategies are parameterized to pursue the highest risk-adjusted yield. There is an "Emergency Shutdown" mode. When the Vault is put into emergency shutdown, assets will be recalled from the Strategies as quickly as is practical (given on-chain conditions), minimizing loss. Deposits are halted, new Strategies may not be added, and each Strategy exits with the minimum possible damage to position, while opening up deposits to be withdrawn by users. There are no restrictions on withdrawals above what is expected under Normal Operation. For further details, please refer to the specification: https://github.com/iearn-finance/yearn-vaults/blob/master/SPECIFICATION.md* +*Yearn Token Vault. Holds an underlying token, and allows users to interact with the Yearn ecosystem through Strategies connected to the Vault. Vaults are not limited to a single Strategy, they can have as many Strategies as can be designed (however the withdrawal queue is capped at 20.) Deposited funds are moved into the most impactful strategy that has not already reached its limit for assets under management, regardless of which Strategy a user's funds end up in, they receive their portion of yields generated across all Strategies. When a user withdraws, if there are no funds sitting undeployed in the Vault, the Vault withdraws funds from Strategies in the order of least impact. (Funds are taken from the Strategy that will disturb everyone's gains the least, then the next least, etc.) In order to achieve this, the withdrawal queue's order must be properly set and managed by the community (through governance). Vault Strategies are parameterized to pursue the highest risk-adjusted yield. There is an "Emergency Shutdown" mode. When the Vault is put into emergency shutdown, assets will be recalled from the Strategies as quickly as is practical (given onchain conditions), minimizing loss. Deposits are halted, new Strategies may not be added, and each Strategy exits with the minimum possible damage to position, while opening up deposits to be withdrawn by users. There are no restrictions on withdrawals above what is expected under Normal Operation. For further details, please refer to the specification: https://github.com/iearn-finance/yearn-vaults/blob/master/SPECIFICATION.md* ## Functions @@ -20,7 +20,7 @@ function initialize(address,address,address,string,string) ``` -Initializes the Vault, this is called only once, when the contract is deployed. The performance fee is set to 10% of yield, per Strategy. The management fee is set to 2%, per year. The initial deposit limit is set to 0 (deposits disabled); it must be updated after initialization. +Initializes the Vault, this is called only once, when the contract is deployed. The performance fee is set to 10% of yield, per Strategy. The management fee is set to 2%, per year. The initial deposit limit is set to 0 (deposits disabled); it must be updated after initialization. *If `nameOverride` is not specified, the name will be 'yearn' combined with the name of `token`. If `symbolOverride` is not specified, the symbol will be 'y' combined with the symbol of `token`.* @@ -74,7 +74,7 @@ function apiVersion() ``` -Used to track the deployed version of this contract. In practice you can use this version number to compare with Yearn's GitHub and determine which version of the source matches this deployed contract. +Used to track the deployed version of this contract. In practice you can use this version number to compare with Yearn's GitHub and determine which version of the source matches this deployed contract. *All strategies must have an `apiVersion()` that matches the Vault's `API_VERSION`.* @@ -97,7 +97,7 @@ function setName(string) ``` -Used to change the value of `name`. This may only be called by governance. +Used to change the value of `name`. This may only be called by governance. @@ -118,7 +118,7 @@ function setSymbol(string) ``` -Used to change the value of `symbol`. This may only be called by governance. +Used to change the value of `symbol`. This may only be called by governance. @@ -139,7 +139,7 @@ function setGovernance(address) ``` -Nominate a new address to use as governance. The change does not go into effect immediately. This function sets a pending change, and the governance address is not updated until the proposed governance address has accepted the responsibility. This may only be called by the current governance address. +Nominate a new address to use as governance. The change does not go into effect immediately. This function sets a pending change, and the governance address is not updated until the proposed governance address has accepted the responsibility. This may only be called by the current governance address. @@ -160,7 +160,7 @@ function acceptGovernance() ``` -Once a new governance address has been proposed using setGovernance(), this function may be called by the proposed address to accept the responsibility of taking over governance for this contract. This may only be called by the proposed governance address. +Once a new governance address has been proposed using setGovernance(), this function may be called by the proposed address to accept the responsibility of taking over governance for this contract. This may only be called by the proposed governance address. *setGovernance() should be called by the existing governance address, prior to calling this function.* @@ -177,7 +177,7 @@ function setManagement(address) ``` -Changes the management address. Management is able to make some investment decisions adjusting parameters. This may only be called by governance. +Changes the management address. Management is able to make some investment decisions adjusting parameters. This may only be called by governance. @@ -198,7 +198,7 @@ function setGuestList(address) ``` -Used to set or change `guestList`. A guest list is another contract that dictates who is allowed to participate in a Vault (and transfer shares). This may only be called by governance. +Used to set or change `guestList`. A guest list is another contract that dictates who is allowed to participate in a Vault (and transfer shares). This may only be called by governance. @@ -219,7 +219,7 @@ function setRewards(address) ``` -Changes the rewards address. Any distributed rewards will cease flowing to the old address and begin flowing to this address once the change is in effect. This will not change any Strategy reports in progress, only new reports made after this change goes into effect. This may only be called by governance. +Changes the rewards address. Any distributed rewards will cease flowing to the old address and begin flowing to this address once the change is in effect. This will not change any Strategy reports in progress, only new reports made after this change goes into effect. This may only be called by governance. @@ -240,7 +240,7 @@ function setLockedProfitDegration(uint256) ``` -Changes the locked profit degration. +Changes the locked profit degration. @@ -261,7 +261,7 @@ function setDepositLimit(uint256) ``` -Changes the maximum amount of tokens that can be deposited in this Vault. Note, this is not how much may be deposited by a single depositor, but the maximum amount that may be deposited across all depositors. This may only be called by governance. +Changes the maximum amount of tokens that can be deposited in this Vault. Note, this is not how much may be deposited by a single depositor, but the maximum amount that may be deposited across all depositors. This may only be called by governance. @@ -282,7 +282,7 @@ function setPerformanceFee(uint256) ``` -Used to change the value of `performanceFee`. Should set this value below the maximum strategist performance fee. This may only be called by governance. +Used to change the value of `performanceFee`. Should set this value below the maximum strategist performance fee. This may only be called by governance. @@ -303,7 +303,7 @@ function setManagementFee(uint256) ``` -Used to change the value of `managementFee`. This may only be called by governance. +Used to change the value of `managementFee`. This may only be called by governance. @@ -324,7 +324,7 @@ function setGuardian(address) ``` -Used to change the address of `guardian`. This may only be called by governance or the existing guardian. +Used to change the address of `guardian`. This may only be called by governance or the existing guardian. @@ -345,7 +345,7 @@ function setEmergencyShutdown(bool) ``` -Activates or deactivates Vault mode where all Strategies go into full withdrawal. During Emergency Shutdown: 1. No Users may deposit into the Vault (but may withdraw as usual.) 2. Governance may not add new Strategies. 3. Each Strategy must pay back their debt as quickly as reasonable to minimally affect their position. 4. Only Governance may undo Emergency Shutdown. See contract level note for further details. This may only be called by governance or the guardian. +Activates or deactivates Vault mode where all Strategies go into full withdrawal. During Emergency Shutdown: 1. No Users may deposit into the Vault (but may withdraw as usual.) 2. Governance may not add new Strategies. 3. Each Strategy must pay back their debt as quickly as reasonable to minimally affect their position. 4. Only Governance may undo Emergency Shutdown. See contract level note for further details. This may only be called by governance or the guardian. @@ -366,7 +366,7 @@ function setWithdrawalQueue(address[20]) ``` -Updates the withdrawalQueue to match the addresses and order specified by `queue`. There can be fewer strategies than the maximum, as well as fewer than the total number of strategies active in the vault. `withdrawalQueue` will be updated in a gas-efficient manner, assuming the input is well- ordered with 0x0 only at the end. This may only be called by governance or management. +Updates the withdrawalQueue to match the addresses and order specified by `queue`. There can be fewer strategies than the maximum, as well as fewer than the total number of strategies active in the vault. `withdrawalQueue` will be updated in a gas-efficient manner, assuming the input is well- ordered with 0x0 only at the end. This may only be called by governance or management. *This is order sensitive, specify the addresses in the order in which funds should be withdrawn (so `queue`[0] is the first Strategy withdrawn from, `queue`[1] is the second, etc.) This means that the least impactful Strategy (the Strategy that will have its core positions impacted the least by having funds removed) should be at `queue`[0], then the next least impactful at `queue`[1], and so on.* @@ -389,7 +389,7 @@ function transfer(address,uint256) ``` -Transfers shares from the caller's address to `receiver`. This function will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. +Transfers shares from the caller's address to `receiver`. This function will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. @@ -417,7 +417,7 @@ function transferFrom(address,address,uint256) ``` -Transfers `amount` shares from `sender` to `receiver`. This operation will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. Unless the caller has given this contract unlimited approval, transfering shares will decrement the caller's `allowance` by `amount`. +Transfers `amount` shares from `sender` to `receiver`. This operation will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. Unless the caller has given this contract unlimited approval, transfering shares will decrement the caller's `allowance` by `amount`. @@ -512,7 +512,7 @@ function permit(address,address,uint256,uint256,bytes) ``` -Approves spender by owner's signature to expend owner's tokens. See https://eips.ethereum.org/EIPS/eip-2612. +Approves spender by owner's signature to expend owner's tokens. See https://eips.ethereum.org/EIPS/eip-2612. @@ -543,7 +543,7 @@ function totalAssets() ``` -Returns the total quantity of all assets under control of this Vault, whether they're loaned out to a Strategy, or currently held in the Vault. +Returns the total quantity of all assets under control of this Vault, whether they're loaned out to a Strategy, or currently held in the Vault. @@ -564,10 +564,10 @@ function deposit() ``` -Deposits `_amount` `token`, issuing shares to `recipient`. If the Vault is in Emergency Shutdown, deposits will not be accepted and this call will fail. +Deposits `_amount` `token`, issuing shares to `recipient`. If the Vault is in Emergency Shutdown, deposits will not be accepted and this call will fail. -*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both off-chain and on-chain) to determine if depositing into the Vault is a "good idea".* +*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both offchain and onchain) to determine if depositing into the Vault is a "good idea".* #### Parameters: @@ -595,7 +595,7 @@ function deposit(uint256) -*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both off-chain and on-chain) to determine if depositing into the Vault is a "good idea".* +*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both offchain and onchain) to determine if depositing into the Vault is a "good idea".* #### Parameters: @@ -623,7 +623,7 @@ function deposit(uint256,address) -*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both off-chain and on-chain) to determine if depositing into the Vault is a "good idea".* +*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both offchain and onchain) to determine if depositing into the Vault is a "good idea".* #### Parameters: @@ -650,7 +650,7 @@ function maxAvailableShares() ``` -Determines the maximum quantity of shares this Vault can facilitate a withdrawal for, factoring in assets currently residing in the Vault, as well as those deployed to strategies on the Vault's balance sheet. +Determines the maximum quantity of shares this Vault can facilitate a withdrawal for, factoring in assets currently residing in the Vault, as well as those deployed to strategies on the Vault's balance sheet. *Regarding how shares are calculated, see dev note on `deposit`. If you want to calculated the maximum a user could withdraw up to, you want to use this function. Note that the amount provided by this function is the theoretical maximum possible from withdrawing, the real amount depends on the realized losses incurred during withdrawal.* @@ -673,7 +673,7 @@ function withdraw() ``` -Withdraws the calling account's tokens from this Vault, redeeming amount `_shares` for an appropriate amount of tokens. See note on `setWithdrawalQueue` for further details of withdrawal ordering and behavior. +Withdraws the calling account's tokens from this Vault, redeeming amount `_shares` for an appropriate amount of tokens. See note on `setWithdrawalQueue` for further details of withdrawal ordering and behavior. *Measuring the value of shares is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On withdrawal, this means that shares are redeemed against the total amount that the deposited capital had "realized" since the point it was deposited, up until the point it was withdrawn. If that number were to be higher than the "expected value" at some future point, withdrawing shares via this method could entitle the depositor to *more* than the expected value once the "realized value" is updated from further reports by the Strategies to the Vaults. Under exceptional scenarios, this could cause earlier withdrawals to earn "more" of the underlying assets than Users might otherwise be entitled to, if the Vault's estimated value were otherwise measured through external means, accounting for whatever exceptional scenarios exist for the Vault (that aren't covered by the Vault's own design.)* @@ -791,7 +791,7 @@ function pricePerShare() ``` -Gives the price for a single Vault share. +Gives the price for a single Vault share. *See dev note on `withdraw`.* @@ -814,7 +814,7 @@ function addStrategy(address,uint256,uint256,uint256,uint256) ``` -Add a Strategy to the Vault. This may only be called by governance. +Add a Strategy to the Vault. This may only be called by governance. *The Strategy will be appended to `withdrawalQueue`, call `setWithdrawalQueue` to change the order.* @@ -841,7 +841,7 @@ function updateStrategyDebtRatio(address,uint256) ``` -Change the quantity of assets `strategy` may manage. This may be called by governance or management. +Change the quantity of assets `strategy` may manage. This may be called by governance or management. @@ -863,7 +863,7 @@ function updateStrategyMinDebtPerHarvest(address,uint256) ``` -Change the quantity assets per block this Vault may deposit to or withdraw from `strategy`. This may only be called by governance or management. +Change the quantity assets per block this Vault may deposit to or withdraw from `strategy`. This may only be called by governance or management. @@ -885,7 +885,7 @@ function updateStrategyMaxDebtPerHarvest(address,uint256) ``` -Change the quantity assets per block this Vault may deposit to or withdraw from `strategy`. This may only be called by governance or management. +Change the quantity assets per block this Vault may deposit to or withdraw from `strategy`. This may only be called by governance or management. @@ -907,7 +907,7 @@ function updateStrategyPerformanceFee(address,uint256) ``` -Change the fee the strategist will receive based on this Vault's performance. This may only be called by governance. +Change the fee the strategist will receive based on this Vault's performance. This may only be called by governance. @@ -929,7 +929,7 @@ function migrateStrategy(address,address) ``` -Migrates a Strategy, including all assets from `oldVersion` to `newVersion`. This may only be called by governance. +Migrates a Strategy, including all assets from `oldVersion` to `newVersion`. This may only be called by governance. *Strategy must successfully migrate all capital and positions to new Strategy, or else this will upset the balance of the Vault. The new Strategy should be "empty" e.g. have no prior commitments to this Vault, otherwise it could have issues.* @@ -953,7 +953,7 @@ function revokeStrategy() ``` -Revoke a Strategy, setting its debt limit to 0 and preventing any future deposits. This function should only be used in the scenario where the Strategy is being retired but no migration of the positions are possible, or in the extreme scenario that the Strategy needs to be put into "Emergency Exit" mode in order for it to exit as quickly as possible. The latter scenario could be for any reason that is considered "critical" that the Strategy exits its position as fast as possible, such as a sudden change in market conditions leading to losses, or an imminent failure in an external dependency. This may only be called by governance, the guardian, or the Strategy itself. Note that a Strategy will only revoke itself during emergency shutdown. +Revoke a Strategy, setting its debt limit to 0 and preventing any future deposits. This function should only be used in the scenario where the Strategy is being retired but no migration of the positions are possible, or in the extreme scenario that the Strategy needs to be put into "Emergency Exit" mode in order for it to exit as quickly as possible. The latter scenario could be for any reason that is considered "critical" that the Strategy exits its position as fast as possible, such as a sudden change in market conditions leading to losses, or an imminent failure in an external dependency. This may only be called by governance, the guardian, or the Strategy itself. Note that a Strategy will only revoke itself during emergency shutdown. @@ -993,7 +993,7 @@ function addStrategyToQueue(address) ``` -Adds `strategy` to `withdrawalQueue`. This may only be called by governance or management. +Adds `strategy` to `withdrawalQueue`. This may only be called by governance or management. *The Strategy will be appended to `withdrawalQueue`, call `setWithdrawalQueue` to change the order.* @@ -1016,7 +1016,7 @@ function removeStrategyFromQueue(address) ``` -Remove `strategy` from `withdrawalQueue`. This may only be called by governance or management. +Remove `strategy` from `withdrawalQueue`. This may only be called by governance or management. *We don't do this with revokeStrategy because it should still be possible to withdraw from the Strategy if it's unwinding.* @@ -1039,7 +1039,7 @@ function debtOutstanding() ``` -Determines if `strategy` is past its debt limit and if any tokens should be withdrawn to the Vault. +Determines if `strategy` is past its debt limit and if any tokens should be withdrawn to the Vault. @@ -1091,7 +1091,7 @@ function creditAvailable() ``` -Amount of tokens in Vault a Strategy has access to as a credit line. This will check the Strategy's debt limit, as well as the tokens available in the Vault, and determine the maximum amount of tokens (if any) the Strategy may draw on. In the rare case the Vault is in emergency shutdown this will return 0. +Amount of tokens in Vault a Strategy has access to as a credit line. This will check the Strategy's debt limit, as well as the tokens available in the Vault, and determine the maximum amount of tokens (if any) the Strategy may draw on. In the rare case the Vault is in emergency shutdown this will return 0. @@ -1143,7 +1143,7 @@ function expectedReturn() ``` -Provide an accurate expected value for the return this `strategy` would provide to the Vault the next time `report()` is called (since the last time it was called). +Provide an accurate expected value for the return this `strategy` would provide to the Vault the next time `report()` is called (since the last time it was called). @@ -1195,7 +1195,7 @@ function report(uint256,uint256,uint256) ``` -Reports the amount of assets the calling Strategy has free (usually in terms of ROI). The performance fee is determined here, off of the strategy's profits (if any), and sent to governance. The strategist's fee is also determined here (off of profits), to be handled according to the strategist on the next harvest. This may only be called by a Strategy managed by this Vault. +Reports the amount of assets the calling Strategy has free (usually in terms of ROI). The performance fee is determined here, off of the strategy's profits (if any), and sent to governance. The strategist's fee is also determined here (off of profits), to be handled according to the strategist on the next harvest. This may only be called by a Strategy managed by this Vault. *For approved strategies, this is the most efficient behavior. The Strategy reports back what it has free, then Vault "decides" whether to take some back or give it more. Note that the most it can take is `gain + _debtPayment`, and the most it can give is all of the remaining reserves. Anything outside of those bounds is abnormal behavior. All approved strategies must have increased diligence around calling this function, as abnormal behavior could become catastrophic.* @@ -1204,8 +1204,8 @@ Reports the amount of assets the calling Strategy has free (usually in terms of #### Parameters: | Name | Type | Description | | :----------------------------- | :------------ | :--------------------------------------------- | -| * gain * | * * | * Amount Strategy has realized as a gain on it's investment since its last report, and is free to be given back to Vault as earnings * | -| * loss * | * * | * Amount Strategy has realized as a loss on it's investment since its last report, and should be accounted for on the Vault's balance sheet * | +| * gain * | * * | * Amount Strategy has realized as a gain on its investment since its last report, and is free to be given back to Vault as earnings * | +| * loss * | * * | * Amount Strategy has realized as a loss on its investment since its last report, and should be accounted for on the Vault's balance sheet * | | * _debtPayment * | * * | * Amount Strategy has made available to cover outstanding debt * | @@ -1226,7 +1226,7 @@ function sweep(address) ``` -Removes tokens from this Vault that are not the type of token managed by this Vault. This may be used in case of accidentally sending the wrong kind of token to this Vault. Tokens will be sent to `governance`. This will fail if an attempt is made to sweep the tokens that this Vault manages. This may only be called by governance. +Removes tokens from this Vault that are not the type of token managed by this Vault. This may be used in case of accidentally sending the wrong kind of token to this Vault. Tokens will be sent to `governance`. This will fail if an attempt is made to sweep the tokens that this Vault manages. This may only be called by governance. diff --git a/docs/developers/smart-contracts/deprecated/V2/version-0.3.5/BaseStrategy.md b/docs/developers/smart-contracts/deprecated/V2/version-0.3.5/BaseStrategy.md index 8f3975bc1f..df5f393cca 100644 --- a/docs/developers/smart-contracts/deprecated/V2/version-0.3.5/BaseStrategy.md +++ b/docs/developers/smart-contracts/deprecated/V2/version-0.3.5/BaseStrategy.md @@ -53,7 +53,7 @@ This Strategy's name. strategy, for the purposes of computing the management fee in `Vault` @return The amount of assets this strategy manages that should not be included in Yearn's Total Value - Locked (TVL) calculation across it's ecosystem. + Locked (TVL) calculation across its ecosystem. @@ -268,11 +268,11 @@ on protected functions in the Strategy. This total should be "realizable" e.g. the total value that could *actually* be obtained from this Strategy if it were to divest its - entire position based on current on-chain conditions. + entire position based on current onchain conditions. @dev Care must be taken in using this function, since it relies on external systems, which could be manipulated by the attacker to give an inflated - (or reduced) value produced by this function, based on current on-chain + (or reduced) value produced by this function, based on current onchain conditions (e.g. this function is possible to influence through flashloan attacks, oracle manipulations, or other DeFi attack mechanisms). @@ -532,7 +532,7 @@ value. Activates emergency exit. Once activated, the Strategy will exit its position upon the next harvest, depositing all funds into the Vault as - quickly as is reasonable given on-chain conditions. + quickly as is reasonable given onchain conditions. This may only be called by governance or the strategist. @dev diff --git a/docs/developers/smart-contracts/deprecated/V2/version-0.3.5/vault.md b/docs/developers/smart-contracts/deprecated/V2/version-0.3.5/vault.md index b9bcbf9053..45d9718229 100644 --- a/docs/developers/smart-contracts/deprecated/V2/version-0.3.5/vault.md +++ b/docs/developers/smart-contracts/deprecated/V2/version-0.3.5/vault.md @@ -7,7 +7,7 @@ -*Yearn Token Vault. Holds an underlying token, and allows users to interact with the Yearn ecosystem through Strategies connected to the Vault. Vaults are not limited to a single Strategy, they can have as many Strategies as can be designed (however the withdrawal queue is capped at 20.) Deposited funds are moved into the most impactful strategy that has not already reached its limit for assets under management, regardless of which Strategy a user's funds end up in, they receive their portion of yields generated across all Strategies. When a user withdraws, if there are no funds sitting undeployed in the Vault, the Vault withdraws funds from Strategies in the order of least impact. (Funds are taken from the Strategy that will disturb everyone's gains the least, then the next least, etc.) In order to achieve this, the withdrawal queue's order must be properly set and managed by the community (through governance). Vault Strategies are parameterized to pursue the highest risk-adjusted yield. There is an "Emergency Shutdown" mode. When the Vault is put into emergency shutdown, assets will be recalled from the Strategies as quickly as is practical (given on-chain conditions), minimizing loss. Deposits are halted, new Strategies may not be added, and each Strategy exits with the minimum possible damage to position, while opening up deposits to be withdrawn by users. There are no restrictions on withdrawals above what is expected under Normal Operation. For further details, please refer to the specification: https://github.com/iearn-finance/yearn-vaults/blob/master/SPECIFICATION.md* +*Yearn Token Vault. Holds an underlying token, and allows users to interact with the Yearn ecosystem through Strategies connected to the Vault. Vaults are not limited to a single Strategy, they can have as many Strategies as can be designed (however the withdrawal queue is capped at 20.) Deposited funds are moved into the most impactful strategy that has not already reached its limit for assets under management, regardless of which Strategy a user's funds end up in, they receive their portion of yields generated across all Strategies. When a user withdraws, if there are no funds sitting undeployed in the Vault, the Vault withdraws funds from Strategies in the order of least impact. (Funds are taken from the Strategy that will disturb everyone's gains the least, then the next least, etc.) In order to achieve this, the withdrawal queue's order must be properly set and managed by the community (through governance). Vault Strategies are parameterized to pursue the highest risk-adjusted yield. There is an "Emergency Shutdown" mode. When the Vault is put into emergency shutdown, assets will be recalled from the Strategies as quickly as is practical (given onchain conditions), minimizing loss. Deposits are halted, new Strategies may not be added, and each Strategy exits with the minimum possible damage to position, while opening up deposits to be withdrawn by users. There are no restrictions on withdrawals above what is expected under Normal Operation. For further details, please refer to the specification: https://github.com/iearn-finance/yearn-vaults/blob/master/SPECIFICATION.md* ## Functions @@ -20,7 +20,7 @@ function initialize(address,address,address,string,string) ``` -Initializes the Vault, this is called only once, when the contract is deployed. The performance fee is set to 10% of yield, per Strategy. The management fee is set to 2%, per year. The initial deposit limit is set to 0 (deposits disabled); it must be updated after initialization. +Initializes the Vault, this is called only once, when the contract is deployed. The performance fee is set to 10% of yield, per Strategy. The management fee is set to 2%, per year. The initial deposit limit is set to 0 (deposits disabled); it must be updated after initialization. *If `nameOverride` is not specified, the name will be 'yearn' combined with the name of `token`. If `symbolOverride` is not specified, the symbol will be 'y' combined with the symbol of `token`.* @@ -74,7 +74,7 @@ function apiVersion() ``` -Used to track the deployed version of this contract. In practice you can use this version number to compare with Yearn's GitHub and determine which version of the source matches this deployed contract. +Used to track the deployed version of this contract. In practice you can use this version number to compare with Yearn's GitHub and determine which version of the source matches this deployed contract. *All strategies must have an `apiVersion()` that matches the Vault's `API_VERSION`.* @@ -97,7 +97,7 @@ function setName(string) ``` -Used to change the value of `name`. This may only be called by governance. +Used to change the value of `name`. This may only be called by governance. @@ -118,7 +118,7 @@ function setSymbol(string) ``` -Used to change the value of `symbol`. This may only be called by governance. +Used to change the value of `symbol`. This may only be called by governance. @@ -139,7 +139,7 @@ function setGovernance(address) ``` -Nominate a new address to use as governance. The change does not go into effect immediately. This function sets a pending change, and the governance address is not updated until the proposed governance address has accepted the responsibility. This may only be called by the current governance address. +Nominate a new address to use as governance. The change does not go into effect immediately. This function sets a pending change, and the governance address is not updated until the proposed governance address has accepted the responsibility. This may only be called by the current governance address. @@ -160,7 +160,7 @@ function acceptGovernance() ``` -Once a new governance address has been proposed using setGovernance(), this function may be called by the proposed address to accept the responsibility of taking over governance for this contract. This may only be called by the proposed governance address. +Once a new governance address has been proposed using setGovernance(), this function may be called by the proposed address to accept the responsibility of taking over governance for this contract. This may only be called by the proposed governance address. *setGovernance() should be called by the existing governance address, prior to calling this function.* @@ -177,7 +177,7 @@ function setManagement(address) ``` -Changes the management address. Management is able to make some investment decisions adjusting parameters. This may only be called by governance. +Changes the management address. Management is able to make some investment decisions adjusting parameters. This may only be called by governance. @@ -198,7 +198,7 @@ function setGuestList(address) ``` -Used to set or change `guestList`. A guest list is another contract that dictates who is allowed to participate in a Vault (and transfer shares). This may only be called by governance. +Used to set or change `guestList`. A guest list is another contract that dictates who is allowed to participate in a Vault (and transfer shares). This may only be called by governance. @@ -219,7 +219,7 @@ function setRewards(address) ``` -Changes the rewards address. Any distributed rewards will cease flowing to the old address and begin flowing to this address once the change is in effect. This will not change any Strategy reports in progress, only new reports made after this change goes into effect. This may only be called by governance. +Changes the rewards address. Any distributed rewards will cease flowing to the old address and begin flowing to this address once the change is in effect. This will not change any Strategy reports in progress, only new reports made after this change goes into effect. This may only be called by governance. @@ -240,7 +240,7 @@ function setLockedProfitDegration(uint256) ``` -Changes the locked profit degration. +Changes the locked profit degration. @@ -261,7 +261,7 @@ function setDepositLimit(uint256) ``` -Changes the maximum amount of tokens that can be deposited in this Vault. Note, this is not how much may be deposited by a single depositor, but the maximum amount that may be deposited across all depositors. This may only be called by governance. +Changes the maximum amount of tokens that can be deposited in this Vault. Note, this is not how much may be deposited by a single depositor, but the maximum amount that may be deposited across all depositors. This may only be called by governance. @@ -282,7 +282,7 @@ function setPerformanceFee(uint256) ``` -Used to change the value of `performanceFee`. Should set this value below the maximum strategist performance fee. This may only be called by governance. +Used to change the value of `performanceFee`. Should set this value below the maximum strategist performance fee. This may only be called by governance. @@ -303,7 +303,7 @@ function setManagementFee(uint256) ``` -Used to change the value of `managementFee`. This may only be called by governance. +Used to change the value of `managementFee`. This may only be called by governance. @@ -324,7 +324,7 @@ function setGuardian(address) ``` -Used to change the address of `guardian`. This may only be called by governance or the existing guardian. +Used to change the address of `guardian`. This may only be called by governance or the existing guardian. @@ -345,7 +345,7 @@ function setEmergencyShutdown(bool) ``` -Activates or deactivates Vault mode where all Strategies go into full withdrawal. During Emergency Shutdown: 1. No Users may deposit into the Vault (but may withdraw as usual.) 2. Governance may not add new Strategies. 3. Each Strategy must pay back their debt as quickly as reasonable to minimally affect their position. 4. Only Governance may undo Emergency Shutdown. See contract level note for further details. This may only be called by governance or the guardian. +Activates or deactivates Vault mode where all Strategies go into full withdrawal. During Emergency Shutdown: 1. No Users may deposit into the Vault (but may withdraw as usual.) 2. Governance may not add new Strategies. 3. Each Strategy must pay back their debt as quickly as reasonable to minimally affect their position. 4. Only Governance may undo Emergency Shutdown. See contract level note for further details. This may only be called by governance or the guardian. @@ -366,7 +366,7 @@ function setWithdrawalQueue(address[20]) ``` -Updates the withdrawalQueue to match the addresses and order specified by `queue`. There can be fewer strategies than the maximum, as well as fewer than the total number of strategies active in the vault. `withdrawalQueue` will be updated in a gas-efficient manner, assuming the input is well- ordered with 0x0 only at the end. This may only be called by governance or management. +Updates the withdrawalQueue to match the addresses and order specified by `queue`. There can be fewer strategies than the maximum, as well as fewer than the total number of strategies active in the vault. `withdrawalQueue` will be updated in a gas-efficient manner, assuming the input is well- ordered with 0x0 only at the end. This may only be called by governance or management. *This is order sensitive, specify the addresses in the order in which funds should be withdrawn (so `queue`[0] is the first Strategy withdrawn from, `queue`[1] is the second, etc.) This means that the least impactful Strategy (the Strategy that will have its core positions impacted the least by having funds removed) should be at `queue`[0], then the next least impactful at `queue`[1], and so on.* @@ -389,7 +389,7 @@ function transfer(address,uint256) ``` -Transfers shares from the caller's address to `receiver`. This function will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. +Transfers shares from the caller's address to `receiver`. This function will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. @@ -417,7 +417,7 @@ function transferFrom(address,address,uint256) ``` -Transfers `amount` shares from `sender` to `receiver`. This operation will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. Unless the caller has given this contract unlimited approval, transfering shares will decrement the caller's `allowance` by `amount`. +Transfers `amount` shares from `sender` to `receiver`. This operation will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. Unless the caller has given this contract unlimited approval, transfering shares will decrement the caller's `allowance` by `amount`. @@ -512,7 +512,7 @@ function permit(address,address,uint256,uint256,bytes) ``` -Approves spender by owner's signature to expend owner's tokens. See https://eips.ethereum.org/EIPS/eip-2612. +Approves spender by owner's signature to expend owner's tokens. See https://eips.ethereum.org/EIPS/eip-2612. @@ -543,7 +543,7 @@ function totalAssets() ``` -Returns the total quantity of all assets under control of this Vault, whether they're loaned out to a Strategy, or currently held in the Vault. +Returns the total quantity of all assets under control of this Vault, whether they're loaned out to a Strategy, or currently held in the Vault. @@ -564,10 +564,10 @@ function deposit() ``` -Deposits `_amount` `token`, issuing shares to `recipient`. If the Vault is in Emergency Shutdown, deposits will not be accepted and this call will fail. +Deposits `_amount` `token`, issuing shares to `recipient`. If the Vault is in Emergency Shutdown, deposits will not be accepted and this call will fail. -*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both off-chain and on-chain) to determine if depositing into the Vault is a "good idea".* +*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both offchain and onchain) to determine if depositing into the Vault is a "good idea".* #### Parameters: @@ -595,7 +595,7 @@ function deposit(uint256) -*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both off-chain and on-chain) to determine if depositing into the Vault is a "good idea".* +*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both offchain and onchain) to determine if depositing into the Vault is a "good idea".* #### Parameters: @@ -623,7 +623,7 @@ function deposit(uint256,address) -*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both off-chain and on-chain) to determine if depositing into the Vault is a "good idea".* +*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both offchain and onchain) to determine if depositing into the Vault is a "good idea".* #### Parameters: @@ -650,7 +650,7 @@ function maxAvailableShares() ``` -Determines the maximum quantity of shares this Vault can facilitate a withdrawal for, factoring in assets currently residing in the Vault, as well as those deployed to strategies on the Vault's balance sheet. +Determines the maximum quantity of shares this Vault can facilitate a withdrawal for, factoring in assets currently residing in the Vault, as well as those deployed to strategies on the Vault's balance sheet. *Regarding how shares are calculated, see dev note on `deposit`. If you want to calculated the maximum a user could withdraw up to, you want to use this function. Note that the amount provided by this function is the theoretical maximum possible from withdrawing, the real amount depends on the realized losses incurred during withdrawal.* @@ -673,7 +673,7 @@ function withdraw() ``` -Withdraws the calling account's tokens from this Vault, redeeming amount `_shares` for an appropriate amount of tokens. See note on `setWithdrawalQueue` for further details of withdrawal ordering and behavior. +Withdraws the calling account's tokens from this Vault, redeeming amount `_shares` for an appropriate amount of tokens. See note on `setWithdrawalQueue` for further details of withdrawal ordering and behavior. *Measuring the value of shares is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On withdrawal, this means that shares are redeemed against the total amount that the deposited capital had "realized" since the point it was deposited, up until the point it was withdrawn. If that number were to be higher than the "expected value" at some future point, withdrawing shares via this method could entitle the depositor to *more* than the expected value once the "realized value" is updated from further reports by the Strategies to the Vaults. Under exceptional scenarios, this could cause earlier withdrawals to earn "more" of the underlying assets than Users might otherwise be entitled to, if the Vault's estimated value were otherwise measured through external means, accounting for whatever exceptional scenarios exist for the Vault (that aren't covered by the Vault's own design.)* @@ -791,7 +791,7 @@ function pricePerShare() ``` -Gives the price for a single Vault share. +Gives the price for a single Vault share. *See dev note on `withdraw`.* @@ -814,7 +814,7 @@ function addStrategy(address,uint256,uint256,uint256,uint256) ``` -Add a Strategy to the Vault. This may only be called by governance. +Add a Strategy to the Vault. This may only be called by governance. *The Strategy will be appended to `withdrawalQueue`, call `setWithdrawalQueue` to change the order.* @@ -841,7 +841,7 @@ function updateStrategyDebtRatio(address,uint256) ``` -Change the quantity of assets `strategy` may manage. This may be called by governance or management. +Change the quantity of assets `strategy` may manage. This may be called by governance or management. @@ -863,7 +863,7 @@ function updateStrategyMinDebtPerHarvest(address,uint256) ``` -Change the quantity assets per block this Vault may deposit to or withdraw from `strategy`. This may only be called by governance or management. +Change the quantity assets per block this Vault may deposit to or withdraw from `strategy`. This may only be called by governance or management. @@ -885,7 +885,7 @@ function updateStrategyMaxDebtPerHarvest(address,uint256) ``` -Change the quantity assets per block this Vault may deposit to or withdraw from `strategy`. This may only be called by governance or management. +Change the quantity assets per block this Vault may deposit to or withdraw from `strategy`. This may only be called by governance or management. @@ -907,7 +907,7 @@ function updateStrategyPerformanceFee(address,uint256) ``` -Change the fee the strategist will receive based on this Vault's performance. This may only be called by governance. +Change the fee the strategist will receive based on this Vault's performance. This may only be called by governance. @@ -929,7 +929,7 @@ function migrateStrategy(address,address) ``` -Migrates a Strategy, including all assets from `oldVersion` to `newVersion`. This may only be called by governance. +Migrates a Strategy, including all assets from `oldVersion` to `newVersion`. This may only be called by governance. *Strategy must successfully migrate all capital and positions to new Strategy, or else this will upset the balance of the Vault. The new Strategy should be "empty" e.g. have no prior commitments to this Vault, otherwise it could have issues.* @@ -953,7 +953,7 @@ function revokeStrategy() ``` -Revoke a Strategy, setting its debt limit to 0 and preventing any future deposits. This function should only be used in the scenario where the Strategy is being retired but no migration of the positions are possible, or in the extreme scenario that the Strategy needs to be put into "Emergency Exit" mode in order for it to exit as quickly as possible. The latter scenario could be for any reason that is considered "critical" that the Strategy exits its position as fast as possible, such as a sudden change in market conditions leading to losses, or an imminent failure in an external dependency. This may only be called by governance, the guardian, or the Strategy itself. Note that a Strategy will only revoke itself during emergency shutdown. +Revoke a Strategy, setting its debt limit to 0 and preventing any future deposits. This function should only be used in the scenario where the Strategy is being retired but no migration of the positions are possible, or in the extreme scenario that the Strategy needs to be put into "Emergency Exit" mode in order for it to exit as quickly as possible. The latter scenario could be for any reason that is considered "critical" that the Strategy exits its position as fast as possible, such as a sudden change in market conditions leading to losses, or an imminent failure in an external dependency. This may only be called by governance, the guardian, or the Strategy itself. Note that a Strategy will only revoke itself during emergency shutdown. @@ -993,7 +993,7 @@ function addStrategyToQueue(address) ``` -Adds `strategy` to `withdrawalQueue`. This may only be called by governance or management. +Adds `strategy` to `withdrawalQueue`. This may only be called by governance or management. *The Strategy will be appended to `withdrawalQueue`, call `setWithdrawalQueue` to change the order.* @@ -1016,7 +1016,7 @@ function removeStrategyFromQueue(address) ``` -Remove `strategy` from `withdrawalQueue`. This may only be called by governance or management. +Remove `strategy` from `withdrawalQueue`. This may only be called by governance or management. *We don't do this with revokeStrategy because it should still be possible to withdraw from the Strategy if it's unwinding.* @@ -1039,7 +1039,7 @@ function debtOutstanding() ``` -Determines if `strategy` is past its debt limit and if any tokens should be withdrawn to the Vault. +Determines if `strategy` is past its debt limit and if any tokens should be withdrawn to the Vault. @@ -1091,7 +1091,7 @@ function creditAvailable() ``` -Amount of tokens in Vault a Strategy has access to as a credit line. This will check the Strategy's debt limit, as well as the tokens available in the Vault, and determine the maximum amount of tokens (if any) the Strategy may draw on. In the rare case the Vault is in emergency shutdown this will return 0. +Amount of tokens in Vault a Strategy has access to as a credit line. This will check the Strategy's debt limit, as well as the tokens available in the Vault, and determine the maximum amount of tokens (if any) the Strategy may draw on. In the rare case the Vault is in emergency shutdown this will return 0. @@ -1143,7 +1143,7 @@ function expectedReturn() ``` -Provide an accurate expected value for the return this `strategy` would provide to the Vault the next time `report()` is called (since the last time it was called). +Provide an accurate expected value for the return this `strategy` would provide to the Vault the next time `report()` is called (since the last time it was called). @@ -1195,7 +1195,7 @@ function report(uint256,uint256,uint256) ``` -Reports the amount of assets the calling Strategy has free (usually in terms of ROI). The performance fee is determined here, off of the strategy's profits (if any), and sent to governance. The strategist's fee is also determined here (off of profits), to be handled according to the strategist on the next harvest. This may only be called by a Strategy managed by this Vault. +Reports the amount of assets the calling Strategy has free (usually in terms of ROI). The performance fee is determined here, off of the strategy's profits (if any), and sent to governance. The strategist's fee is also determined here (off of profits), to be handled according to the strategist on the next harvest. This may only be called by a Strategy managed by this Vault. *For approved strategies, this is the most efficient behavior. The Strategy reports back what it has free, then Vault "decides" whether to take some back or give it more. Note that the most it can take is `gain + _debtPayment`, and the most it can give is all of the remaining reserves. Anything outside of those bounds is abnormal behavior. All approved strategies must have increased diligence around calling this function, as abnormal behavior could become catastrophic.* @@ -1204,8 +1204,8 @@ Reports the amount of assets the calling Strategy has free (usually in terms of #### Parameters: | Name | Type | Description | | :----------------------------- | :------------ | :--------------------------------------------- | -| * gain * | * * | * Amount Strategy has realized as a gain on it's investment since its last report, and is free to be given back to Vault as earnings * | -| * loss * | * * | * Amount Strategy has realized as a loss on it's investment since its last report, and should be accounted for on the Vault's balance sheet * | +| * gain * | * * | * Amount Strategy has realized as a gain on its investment since its last report, and is free to be given back to Vault as earnings * | +| * loss * | * * | * Amount Strategy has realized as a loss on its investment since its last report, and should be accounted for on the Vault's balance sheet * | | * _debtPayment * | * * | * Amount Strategy has made available to cover outstanding debt * | @@ -1226,7 +1226,7 @@ function sweep(address) ``` -Removes tokens from this Vault that are not the type of token managed by this Vault. This may be used in case of accidentally sending the wrong kind of token to this Vault. Tokens will be sent to `governance`. This will fail if an attempt is made to sweep the tokens that this Vault manages. This may only be called by governance. +Removes tokens from this Vault that are not the type of token managed by this Vault. This may be used in case of accidentally sending the wrong kind of token to this Vault. Tokens will be sent to `governance`. This will fail if an attempt is made to sweep the tokens that this Vault manages. This may only be called by governance. diff --git a/docs/developers/smart-contracts/deprecated/V2/version-0.4.2/process-and-procedures/deployment.md b/docs/developers/smart-contracts/deprecated/V2/version-0.4.2/process-and-procedures/deployment.md index 708ba1ecdd..b7f0405e9f 100644 --- a/docs/developers/smart-contracts/deprecated/V2/version-0.4.2/process-and-procedures/deployment.md +++ b/docs/developers/smart-contracts/deprecated/V2/version-0.4.2/process-and-procedures/deployment.md @@ -21,7 +21,7 @@ The below instructions show some python commands that assume you are using the b - Set Treasury (`treasury.ychad.eth`) as the rewards address. - Set Core Dev multisig (`dev.ychad.eth`) as guardian. - Set Strategist multisig (`brain.ychad.eth`) as management. - - Set description and symbol for vault or use suggested as default (can be changed on chain later) + - Set description and symbol for vault or use suggested as default (can be changed onchain later) 1. Confirm the Parameters are set correctly and press `y`and ENTER to deploy vault. 1. Check new vault has ABI setup on Etherscan (Some vault versions from older releases may have verification issues with Vyper and proxy detection on Etherscan, consider using latest releases >0.3.5 to ensure verification works). @@ -136,7 +136,7 @@ In addition to the 2 strategists, a Core Developer has to review the strategy be - Set Treasury (`treasury.ychad.eth`) as the rewards address. - Set Core Dev multisig (`dev.ychad.eth`) as guardian. - Set Strategist multisig (`brain.ychad.eth`) as management. - - Set description and symbol for vault or use suggested as default (can be changed on chain later) + - Set description and symbol for vault or use suggested as default (can be changed onchain later) 1. Yearn governance now must accept governance and endorse the vault: diff --git a/docs/developers/smart-contracts/deprecated/V2/version-0.4.2/smart-contracts/BaseStrategy.md b/docs/developers/smart-contracts/deprecated/V2/version-0.4.2/smart-contracts/BaseStrategy.md index 5445799328..c196dafc57 100644 --- a/docs/developers/smart-contracts/deprecated/V2/version-0.4.2/smart-contracts/BaseStrategy.md +++ b/docs/developers/smart-contracts/deprecated/V2/version-0.4.2/smart-contracts/BaseStrategy.md @@ -53,7 +53,7 @@ This Strategy's name. strategy, for the purposes of computing the management fee in `Vault` @return The amount of assets this strategy manages that should not be included in Yearn's Total Value - Locked (TVL) calculation across it's ecosystem. + Locked (TVL) calculation across its ecosystem. @@ -304,11 +304,11 @@ on protected functions in the Strategy. This total should be "realizable" e.g. the total value that could *actually* be obtained from this Strategy if it were to divest its - entire position based on current on-chain conditions. + entire position based on current onchain conditions. @dev Care must be taken in using this function, since it relies on external systems, which could be manipulated by the attacker to give an inflated - (or reduced) value produced by this function, based on current on-chain + (or reduced) value produced by this function, based on current onchain conditions (e.g. this function is possible to influence through flashloan attacks, oracle manipulations, or other DeFi attack mechanisms). @@ -580,7 +580,7 @@ interacted with the vault before. Activates emergency exit. Once activated, the Strategy will exit its position upon the next harvest, depositing all funds into the Vault as - quickly as is reasonable given on-chain conditions. + quickly as is reasonable given onchain conditions. This may only be called by governance or the strategist. @dev diff --git a/docs/developers/smart-contracts/deprecated/V2/version-0.4.2/smart-contracts/vault.md b/docs/developers/smart-contracts/deprecated/V2/version-0.4.2/smart-contracts/vault.md index b03ae8d149..834653728b 100644 --- a/docs/developers/smart-contracts/deprecated/V2/version-0.4.2/smart-contracts/vault.md +++ b/docs/developers/smart-contracts/deprecated/V2/version-0.4.2/smart-contracts/vault.md @@ -7,7 +7,7 @@ -*Yearn Token Vault. Holds an underlying token, and allows users to interact with the Yearn ecosystem through Strategies connected to the Vault. Vaults are not limited to a single Strategy, they can have as many Strategies as can be designed (however the withdrawal queue is capped at 20.) Deposited funds are moved into the most impactful strategy that has not already reached its limit for assets under management, regardless of which Strategy a user's funds end up in, they receive their portion of yields generated across all Strategies. When a user withdraws, if there are no funds sitting undeployed in the Vault, the Vault withdraws funds from Strategies in the order of least impact. (Funds are taken from the Strategy that will disturb everyone's gains the least, then the next least, etc.) In order to achieve this, the withdrawal queue's order must be properly set and managed by the community (through governance). Vault Strategies are parameterized to pursue the highest risk-adjusted yield. There is an "Emergency Shutdown" mode. When the Vault is put into emergency shutdown, assets will be recalled from the Strategies as quickly as is practical (given on-chain conditions), minimizing loss. Deposits are halted, new Strategies may not be added, and each Strategy exits with the minimum possible damage to position, while opening up deposits to be withdrawn by users. There are no restrictions on withdrawals above what is expected under Normal Operation. For further details, please refer to the specification: https://github.com/iearn-finance/yearn-vaults/blob/master/SPECIFICATION.md* +*Yearn Token Vault. Holds an underlying token, and allows users to interact with the Yearn ecosystem through Strategies connected to the Vault. Vaults are not limited to a single Strategy, they can have as many Strategies as can be designed (however the withdrawal queue is capped at 20.) Deposited funds are moved into the most impactful strategy that has not already reached its limit for assets under management, regardless of which Strategy a user's funds end up in, they receive their portion of yields generated across all Strategies. When a user withdraws, if there are no funds sitting undeployed in the Vault, the Vault withdraws funds from Strategies in the order of least impact. (Funds are taken from the Strategy that will disturb everyone's gains the least, then the next least, etc.) In order to achieve this, the withdrawal queue's order must be properly set and managed by the community (through governance). Vault Strategies are parameterized to pursue the highest risk-adjusted yield. There is an "Emergency Shutdown" mode. When the Vault is put into emergency shutdown, assets will be recalled from the Strategies as quickly as is practical (given onchain conditions), minimizing loss. Deposits are halted, new Strategies may not be added, and each Strategy exits with the minimum possible damage to position, while opening up deposits to be withdrawn by users. There are no restrictions on withdrawals above what is expected under Normal Operation. For further details, please refer to the specification: https://github.com/iearn-finance/yearn-vaults/blob/master/SPECIFICATION.md* ## Functions @@ -20,7 +20,7 @@ function initialize(address,address,address,string,string) ``` -Initializes the Vault, this is called only once, when the contract is deployed. The performance fee is set to 10% of yield, per Strategy. The management fee is set to 2%, per year. The initial deposit limit is set to 0 (deposits disabled); it must be updated after initialization. +Initializes the Vault, this is called only once, when the contract is deployed. The performance fee is set to 10% of yield, per Strategy. The management fee is set to 2%, per year. The initial deposit limit is set to 0 (deposits disabled); it must be updated after initialization. *If `nameOverride` is not specified, the name will be 'yearn' combined with the name of `token`. If `symbolOverride` is not specified, the symbol will be 'yv' combined with the symbol of `token`. The token used by the vault should not change balances outside transfers and it must transfer the exact amount requested. Fee on transfer and rebasing are not supported.* @@ -103,7 +103,7 @@ function apiVersion() ``` -Used to track the deployed version of this contract. In practice you can use this version number to compare with Yearn's GitHub and determine which version of the source matches this deployed contract. +Used to track the deployed version of this contract. In practice you can use this version number to compare with Yearn's GitHub and determine which version of the source matches this deployed contract. *All strategies must have an `apiVersion()` that matches the Vault's `API_VERSION`.* @@ -126,7 +126,7 @@ function setName(string) ``` -Used to change the value of `name`. This may only be called by governance. +Used to change the value of `name`. This may only be called by governance. @@ -147,7 +147,7 @@ function setSymbol(string) ``` -Used to change the value of `symbol`. This may only be called by governance. +Used to change the value of `symbol`. This may only be called by governance. @@ -168,7 +168,7 @@ function setGovernance(address) ``` -Nominate a new address to use as governance. The change does not go into effect immediately. This function sets a pending change, and the governance address is not updated until the proposed governance address has accepted the responsibility. This may only be called by the current governance address. +Nominate a new address to use as governance. The change does not go into effect immediately. This function sets a pending change, and the governance address is not updated until the proposed governance address has accepted the responsibility. This may only be called by the current governance address. @@ -189,7 +189,7 @@ function acceptGovernance() ``` -Once a new governance address has been proposed using setGovernance(), this function may be called by the proposed address to accept the responsibility of taking over governance for this contract. This may only be called by the proposed governance address. +Once a new governance address has been proposed using setGovernance(), this function may be called by the proposed address to accept the responsibility of taking over governance for this contract. This may only be called by the proposed governance address. *setGovernance() should be called by the existing governance address, prior to calling this function.* @@ -206,7 +206,7 @@ function setManagement(address) ``` -Changes the management address. Management is able to make some investment decisions adjusting parameters. This may only be called by governance. +Changes the management address. Management is able to make some investment decisions adjusting parameters. This may only be called by governance. @@ -227,7 +227,7 @@ function setRewards(address) ``` -Changes the rewards address. Any distributed rewards will cease flowing to the old address and begin flowing to this address once the change is in effect. This will not change any Strategy reports in progress, only new reports made after this change goes into effect. This may only be called by governance. +Changes the rewards address. Any distributed rewards will cease flowing to the old address and begin flowing to this address once the change is in effect. This will not change any Strategy reports in progress, only new reports made after this change goes into effect. This may only be called by governance. @@ -248,7 +248,7 @@ function setLockedProfitDegradation(uint256) ``` -Changes the locked profit degradation. +Changes the locked profit degradation. @@ -269,7 +269,7 @@ function setDepositLimit(uint256) ``` -Changes the maximum amount of tokens that can be deposited in this Vault. Note, this is not how much may be deposited by a single depositor, but the maximum amount that may be deposited across all depositors. This may only be called by governance. +Changes the maximum amount of tokens that can be deposited in this Vault. Note, this is not how much may be deposited by a single depositor, but the maximum amount that may be deposited across all depositors. This may only be called by governance. @@ -290,7 +290,7 @@ function setPerformanceFee(uint256) ``` -Used to change the value of `performanceFee`. Should set this value below the maximum strategist performance fee. This may only be called by governance. +Used to change the value of `performanceFee`. Should set this value below the maximum strategist performance fee. This may only be called by governance. @@ -311,7 +311,7 @@ function setManagementFee(uint256) ``` -Used to change the value of `managementFee`. This may only be called by governance. +Used to change the value of `managementFee`. This may only be called by governance. @@ -332,7 +332,7 @@ function setGuardian(address) ``` -Used to change the address of `guardian`. This may only be called by governance or the existing guardian. +Used to change the address of `guardian`. This may only be called by governance or the existing guardian. @@ -353,7 +353,7 @@ function setEmergencyShutdown(bool) ``` -Activates or deactivates Vault mode where all Strategies go into full withdrawal. During Emergency Shutdown: 1. No Users may deposit into the Vault (but may withdraw as usual.) 2. Governance may not add new Strategies. 3. Each Strategy must pay back their debt as quickly as reasonable to minimally affect their position. 4. Only Governance may undo Emergency Shutdown. See contract level note for further details. This may only be called by governance or the guardian. +Activates or deactivates Vault mode where all Strategies go into full withdrawal. During Emergency Shutdown: 1. No Users may deposit into the Vault (but may withdraw as usual.) 2. Governance may not add new Strategies. 3. Each Strategy must pay back their debt as quickly as reasonable to minimally affect their position. 4. Only Governance may undo Emergency Shutdown. See contract level note for further details. This may only be called by governance or the guardian. @@ -374,7 +374,7 @@ function setWithdrawalQueue(address[20]) ``` -Updates the withdrawalQueue to match the addresses and order specified by `queue`. There can be fewer strategies than the maximum, as well as fewer than the total number of strategies active in the vault. `withdrawalQueue` will be updated in a gas-efficient manner, assuming the input is well- ordered with 0x0 only at the end. This may only be called by governance or management. +Updates the withdrawalQueue to match the addresses and order specified by `queue`. There can be fewer strategies than the maximum, as well as fewer than the total number of strategies active in the vault. `withdrawalQueue` will be updated in a gas-efficient manner, assuming the input is well- ordered with 0x0 only at the end. This may only be called by governance or management. *This is order sensitive, specify the addresses in the order in which funds should be withdrawn (so `queue`[0] is the first Strategy withdrawn from, `queue`[1] is the second, etc.) This means that the least impactful Strategy (the Strategy that will have its core positions impacted the least by having funds removed) should be at `queue`[0], then the next least impactful at `queue`[1], and so on.* @@ -397,7 +397,7 @@ function transfer(address,uint256) ``` -Transfers shares from the caller's address to `receiver`. This function will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. +Transfers shares from the caller's address to `receiver`. This function will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. @@ -425,7 +425,7 @@ function transferFrom(address,address,uint256) ``` -Transfers `amount` shares from `sender` to `receiver`. This operation will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. Unless the caller has given this contract unlimited approval, transfering shares will decrement the caller's `allowance` by `amount`. +Transfers `amount` shares from `sender` to `receiver`. This operation will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. Unless the caller has given this contract unlimited approval, transfering shares will decrement the caller's `allowance` by `amount`. @@ -520,7 +520,7 @@ function permit(address,address,uint256,uint256,bytes) ``` -Approves spender by owner's signature to expend owner's tokens. See https://eips.ethereum.org/EIPS/eip-2612. +Approves spender by owner's signature to expend owner's tokens. See https://eips.ethereum.org/EIPS/eip-2612. @@ -551,7 +551,7 @@ function totalAssets() ``` -Returns the total quantity of all assets under control of this Vault, whether they're loaned out to a Strategy, or currently held in the Vault. +Returns the total quantity of all assets under control of this Vault, whether they're loaned out to a Strategy, or currently held in the Vault. @@ -572,10 +572,10 @@ function deposit() ``` -Deposits `_amount` `token`, issuing shares to `recipient`. If the Vault is in Emergency Shutdown, deposits will not be accepted and this call will fail. +Deposits `_amount` `token`, issuing shares to `recipient`. If the Vault is in Emergency Shutdown, deposits will not be accepted and this call will fail. -*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both off-chain and on-chain) to determine if depositing into the Vault is a "good idea".* +*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both offchain and onchain) to determine if depositing into the Vault is a "good idea".* #### Parameters: @@ -603,7 +603,7 @@ function deposit(uint256) -*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both off-chain and on-chain) to determine if depositing into the Vault is a "good idea".* +*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both offchain and onchain) to determine if depositing into the Vault is a "good idea".* #### Parameters: @@ -631,7 +631,7 @@ function deposit(uint256,address) -*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both off-chain and on-chain) to determine if depositing into the Vault is a "good idea".* +*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both offchain and onchain) to determine if depositing into the Vault is a "good idea".* #### Parameters: @@ -658,7 +658,7 @@ function maxAvailableShares() ``` -Determines the maximum quantity of shares this Vault can facilitate a withdrawal for, factoring in assets currently residing in the Vault, as well as those deployed to strategies on the Vault's balance sheet. +Determines the maximum quantity of shares this Vault can facilitate a withdrawal for, factoring in assets currently residing in the Vault, as well as those deployed to strategies on the Vault's balance sheet. *Regarding how shares are calculated, see dev note on `deposit`. If you want to calculated the maximum a user could withdraw up to, you want to use this function. Note that the amount provided by this function is the theoretical maximum possible from withdrawing, the real amount depends on the realized losses incurred during withdrawal.* @@ -681,7 +681,7 @@ function withdraw() ``` -Withdraws the calling account's tokens from this Vault, redeeming amount `_shares` for an appropriate amount of tokens. See note on `setWithdrawalQueue` for further details of withdrawal ordering and behavior. +Withdraws the calling account's tokens from this Vault, redeeming amount `_shares` for an appropriate amount of tokens. See note on `setWithdrawalQueue` for further details of withdrawal ordering and behavior. *Measuring the value of shares is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On withdrawal, this means that shares are redeemed against the total amount that the deposited capital had "realized" since the point it was deposited, up until the point it was withdrawn. If that number were to be higher than the "expected value" at some future point, withdrawing shares via this method could entitle the depositor to *more* than the expected value once the "realized value" is updated from further reports by the Strategies to the Vaults. Under exceptional scenarios, this could cause earlier withdrawals to earn "more" of the underlying assets than Users might otherwise be entitled to, if the Vault's estimated value were otherwise measured through external means, accounting for whatever exceptional scenarios exist for the Vault (that aren't covered by the Vault's own design.) In the situation where a large withdrawal happens, it can empty the vault balance and the strategies in the withdrawal queue. Strategies not in the withdrawal queue will have to be harvested to rebalance the funds and make the funds available again to withdraw.* @@ -799,7 +799,7 @@ function pricePerShare() ``` -Gives the price for a single Vault share. +Gives the price for a single Vault share. *See dev note on `withdraw`.* @@ -822,7 +822,7 @@ function addStrategy(address,uint256,uint256,uint256,uint256) ``` -Add a Strategy to the Vault. This may only be called by governance. +Add a Strategy to the Vault. This may only be called by governance. *The Strategy will be appended to `withdrawalQueue`, call `setWithdrawalQueue` to change the order.* @@ -849,7 +849,7 @@ function updateStrategyDebtRatio(address,uint256) ``` -Change the quantity of assets `strategy` may manage. This may be called by governance or management. +Change the quantity of assets `strategy` may manage. This may be called by governance or management. @@ -871,7 +871,7 @@ function updateStrategyMinDebtPerHarvest(address,uint256) ``` -Change the quantity assets per block this Vault may deposit to or withdraw from `strategy`. This may only be called by governance or management. +Change the quantity assets per block this Vault may deposit to or withdraw from `strategy`. This may only be called by governance or management. @@ -893,7 +893,7 @@ function updateStrategyMaxDebtPerHarvest(address,uint256) ``` -Change the quantity assets per block this Vault may deposit to or withdraw from `strategy`. This may only be called by governance or management. +Change the quantity assets per block this Vault may deposit to or withdraw from `strategy`. This may only be called by governance or management. @@ -915,7 +915,7 @@ function updateStrategyPerformanceFee(address,uint256) ``` -Change the fee the strategist will receive based on this Vault's performance. This may only be called by governance. +Change the fee the strategist will receive based on this Vault's performance. This may only be called by governance. @@ -937,7 +937,7 @@ function migrateStrategy(address,address) ``` -Migrates a Strategy, including all assets from `oldVersion` to `newVersion`. This may only be called by governance. +Migrates a Strategy, including all assets from `oldVersion` to `newVersion`. This may only be called by governance. *Strategy must successfully migrate all capital and positions to new Strategy, or else this will upset the balance of the Vault. The new Strategy should be "empty" e.g. have no prior commitments to this Vault, otherwise it could have issues.* @@ -961,7 +961,7 @@ function revokeStrategy() ``` -Revoke a Strategy, setting its debt limit to 0 and preventing any future deposits. This function should only be used in the scenario where the Strategy is being retired but no migration of the positions are possible, or in the extreme scenario that the Strategy needs to be put into "Emergency Exit" mode in order for it to exit as quickly as possible. The latter scenario could be for any reason that is considered "critical" that the Strategy exits its position as fast as possible, such as a sudden change in market conditions leading to losses, or an imminent failure in an external dependency. This may only be called by governance, the guardian, or the Strategy itself. Note that a Strategy will only revoke itself during emergency shutdown. +Revoke a Strategy, setting its debt limit to 0 and preventing any future deposits. This function should only be used in the scenario where the Strategy is being retired but no migration of the positions are possible, or in the extreme scenario that the Strategy needs to be put into "Emergency Exit" mode in order for it to exit as quickly as possible. The latter scenario could be for any reason that is considered "critical" that the Strategy exits its position as fast as possible, such as a sudden change in market conditions leading to losses, or an imminent failure in an external dependency. This may only be called by governance, the guardian, or the Strategy itself. Note that a Strategy will only revoke itself during emergency shutdown. @@ -1001,7 +1001,7 @@ function addStrategyToQueue(address) ``` -Adds `strategy` to `withdrawalQueue`. This may only be called by governance or management. +Adds `strategy` to `withdrawalQueue`. This may only be called by governance or management. *The Strategy will be appended to `withdrawalQueue`, call `setWithdrawalQueue` to change the order.* @@ -1024,7 +1024,7 @@ function removeStrategyFromQueue(address) ``` -Remove `strategy` from `withdrawalQueue`. This may only be called by governance or management. +Remove `strategy` from `withdrawalQueue`. This may only be called by governance or management. *We don't do this with revokeStrategy because it should still be possible to withdraw from the Strategy if it's unwinding.* @@ -1047,7 +1047,7 @@ function debtOutstanding() ``` -Determines if `strategy` is past its debt limit and if any tokens should be withdrawn to the Vault. +Determines if `strategy` is past its debt limit and if any tokens should be withdrawn to the Vault. @@ -1099,7 +1099,7 @@ function creditAvailable() ``` -Amount of tokens in Vault a Strategy has access to as a credit line. This will check the Strategy's debt limit, as well as the tokens available in the Vault, and determine the maximum amount of tokens (if any) the Strategy may draw on. In the rare case the Vault is in emergency shutdown this will return 0. +Amount of tokens in Vault a Strategy has access to as a credit line. This will check the Strategy's debt limit, as well as the tokens available in the Vault, and determine the maximum amount of tokens (if any) the Strategy may draw on. In the rare case the Vault is in emergency shutdown this will return 0. @@ -1151,7 +1151,7 @@ function expectedReturn() ``` -Provide an accurate expected value for the return this `strategy` would provide to the Vault the next time `report()` is called (since the last time it was called). +Provide an accurate expected value for the return this `strategy` would provide to the Vault the next time `report()` is called (since the last time it was called). @@ -1203,7 +1203,7 @@ function report(uint256,uint256,uint256) ``` -Reports the amount of assets the calling Strategy has free (usually in terms of ROI). The performance fee is determined here, off of the strategy's profits (if any), and sent to governance. The strategist's fee is also determined here (off of profits), to be handled according to the strategist on the next harvest. This may only be called by a Strategy managed by this Vault. +Reports the amount of assets the calling Strategy has free (usually in terms of ROI). The performance fee is determined here, off of the strategy's profits (if any), and sent to governance. The strategist's fee is also determined here (off of profits), to be handled according to the strategist on the next harvest. This may only be called by a Strategy managed by this Vault. *For approved strategies, this is the most efficient behavior. The Strategy reports back what it has free, then Vault "decides" whether to take some back or give it more. Note that the most it can take is `gain + _debtPayment`, and the most it can give is all of the remaining reserves. Anything outside of those bounds is abnormal behavior. All approved strategies must have increased diligence around calling this function, as abnormal behavior could become catastrophic.* @@ -1212,8 +1212,8 @@ Reports the amount of assets the calling Strategy has free (usually in terms of #### Parameters: | Name | Type | Description | | :----------------------------- | :------------ | :--------------------------------------------- | -| * gain * | * * | * Amount Strategy has realized as a gain on it's investment since its last report, and is free to be given back to Vault as earnings * | -| * loss * | * * | * Amount Strategy has realized as a loss on it's investment since its last report, and should be accounted for on the Vault's balance sheet. The loss will reduce the debtRatio. The next time the strategy will harvest, it will pay back the debt in an attempt to adjust to the new debt limit. * | +| * gain * | * * | * Amount Strategy has realized as a gain on its investment since its last report, and is free to be given back to Vault as earnings * | +| * loss * | * * | * Amount Strategy has realized as a loss on its investment since its last report, and should be accounted for on the Vault's balance sheet. The loss will reduce the debtRatio. The next time the strategy will harvest, it will pay back the debt in an attempt to adjust to the new debt limit. * | | * _debtPayment * | * * | * Amount Strategy has made available to cover outstanding debt * | @@ -1234,7 +1234,7 @@ function sweep(address) ``` -Removes tokens from this Vault that are not the type of token managed by this Vault. This may be used in case of accidentally sending the wrong kind of token to this Vault. Tokens will be sent to `governance`. This will fail if an attempt is made to sweep the tokens that this Vault manages. This may only be called by governance. +Removes tokens from this Vault that are not the type of token managed by this Vault. This may be used in case of accidentally sending the wrong kind of token to this Vault. Tokens will be sent to `governance`. This will fail if an attempt is made to sweep the tokens that this Vault manages. This may only be called by governance. diff --git a/docs/developers/smart-contracts/deprecated/V2/version-0.4.2/yearn-lens/yearn-lens.md b/docs/developers/smart-contracts/deprecated/V2/version-0.4.2/yearn-lens/yearn-lens.md index a59c8451cc..82292045b9 100644 --- a/docs/developers/smart-contracts/deprecated/V2/version-0.4.2/yearn-lens/yearn-lens.md +++ b/docs/developers/smart-contracts/deprecated/V2/version-0.4.2/yearn-lens/yearn-lens.md @@ -26,7 +26,7 @@ Yearn Lens is a series of smart contracts that aggregate and format Yearn family - Registry adapters have the ability to return metadata specific to an asset type (for example for vaults: `pricePerShare`, `controller`, etc.) - Oracle - The oracle contract is responsible for fetching price information from various sources - - The oracle is intended for non-critical off-chain calculations + - The oracle is intended for non-critical offchain calculations - TVL calculations - Token and asset balance normalizations - Not intended to be used with strategies or other contracts diff --git a/docs/developers/smart-contracts/deprecated/V2/version-0.4.2/yearn-sdk/yearn-stack.md b/docs/developers/smart-contracts/deprecated/V2/version-0.4.2/yearn-sdk/yearn-stack.md index 06eb1ff14f..63cbc0b1be 100644 --- a/docs/developers/smart-contracts/deprecated/V2/version-0.4.2/yearn-sdk/yearn-stack.md +++ b/docs/developers/smart-contracts/deprecated/V2/version-0.4.2/yearn-sdk/yearn-stack.md @@ -1,12 +1,12 @@ # Yearn Stack + FE Features -Yearn SDK integrates several components, both on-chain and off-chain. +Yearn SDK integrates several components, both onchain and offchain. ## Backend stack ![Backend Chart](https://i.imgur.com/2koeiK5.jpg) -### On Chain +### Onchain - 🔍 Yearn Lens - Oracle @@ -25,7 +25,7 @@ Yearn SDK integrates several components, both on-chain and off-chain. - disabling asset interactions - Yearn Frontend -### Off Chain +### Offchain - Yearn Exporter: stores (and displays) stats about yearn assets, exposing: - historical TVL @@ -35,16 +35,16 @@ Yearn SDK integrates several components, both on-chain and off-chain. ## Backend features -### Resilience powered by on-chain data and IPFS storage +### Resilience powered by onchain data and IPFS storage - Critical data (assets, positions, vault deprecations) will be fetched exclusively from the chain / IPFS - maximizing uptime - reducing reliance on other services -- Historical TVL, historical APY and other non critical data will be stored off chain and fetched dinamically. +- Historical TVL, historical APY and other non critical data will be stored offchain and fetched dinamically. -#### On-chain assets and positions +#### Onchain assets and positions -- Lens does what the old off-chain API does, but directly on-chain. This will speed up the fetching time and greatly reduce our reliance on scheduled jobs in servers. +- Lens does what the old offchain API does, but directly onchain. This will speed up the fetching time and greatly reduce our reliance on scheduled jobs in servers. #### IPFS CI/CD for frontend and metadata @@ -59,7 +59,7 @@ Yearn SDK integrates several components, both on-chain and off-chain. - SDK will provide a simple interface for all integrators, including ourselves. - Read methods will seamlessly integrate with all datasources, while keeping coherent datastructures. -- Write methods talk directly to assets on chain. Execution of write transactions will trigger refresh events so data freshness of frontend (or other integration platforms) will still be preserved. +- Write methods talk directly to assets onchain. Execution of write transactions will trigger refresh events so data freshness of frontend (or other integration platforms) will still be preserved. ### Historical User Earnings diff --git a/docs/developers/smart-contracts/deprecated/V2/version-0.4.3/smart-contracts/BaseStrategy.md b/docs/developers/smart-contracts/deprecated/V2/version-0.4.3/smart-contracts/BaseStrategy.md index 5445799328..b7d8e2a7fa 100644 --- a/docs/developers/smart-contracts/deprecated/V2/version-0.4.3/smart-contracts/BaseStrategy.md +++ b/docs/developers/smart-contracts/deprecated/V2/version-0.4.3/smart-contracts/BaseStrategy.md @@ -304,11 +304,11 @@ on protected functions in the Strategy. This total should be "realizable" e.g. the total value that could *actually* be obtained from this Strategy if it were to divest its - entire position based on current on-chain conditions. + entire position based on current onchain conditions. @dev Care must be taken in using this function, since it relies on external systems, which could be manipulated by the attacker to give an inflated - (or reduced) value produced by this function, based on current on-chain + (or reduced) value produced by this function, based on current onchain conditions (e.g. this function is possible to influence through flashloan attacks, oracle manipulations, or other DeFi attack mechanisms). @@ -580,7 +580,7 @@ interacted with the vault before. Activates emergency exit. Once activated, the Strategy will exit its position upon the next harvest, depositing all funds into the Vault as - quickly as is reasonable given on-chain conditions. + quickly as is reasonable given onchain conditions. This may only be called by governance or the strategist. @dev diff --git a/docs/developers/smart-contracts/deprecated/V2/version-0.4.3/smart-contracts/vault.md b/docs/developers/smart-contracts/deprecated/V2/version-0.4.3/smart-contracts/vault.md index b03ae8d149..834653728b 100644 --- a/docs/developers/smart-contracts/deprecated/V2/version-0.4.3/smart-contracts/vault.md +++ b/docs/developers/smart-contracts/deprecated/V2/version-0.4.3/smart-contracts/vault.md @@ -7,7 +7,7 @@ -*Yearn Token Vault. Holds an underlying token, and allows users to interact with the Yearn ecosystem through Strategies connected to the Vault. Vaults are not limited to a single Strategy, they can have as many Strategies as can be designed (however the withdrawal queue is capped at 20.) Deposited funds are moved into the most impactful strategy that has not already reached its limit for assets under management, regardless of which Strategy a user's funds end up in, they receive their portion of yields generated across all Strategies. When a user withdraws, if there are no funds sitting undeployed in the Vault, the Vault withdraws funds from Strategies in the order of least impact. (Funds are taken from the Strategy that will disturb everyone's gains the least, then the next least, etc.) In order to achieve this, the withdrawal queue's order must be properly set and managed by the community (through governance). Vault Strategies are parameterized to pursue the highest risk-adjusted yield. There is an "Emergency Shutdown" mode. When the Vault is put into emergency shutdown, assets will be recalled from the Strategies as quickly as is practical (given on-chain conditions), minimizing loss. Deposits are halted, new Strategies may not be added, and each Strategy exits with the minimum possible damage to position, while opening up deposits to be withdrawn by users. There are no restrictions on withdrawals above what is expected under Normal Operation. For further details, please refer to the specification: https://github.com/iearn-finance/yearn-vaults/blob/master/SPECIFICATION.md* +*Yearn Token Vault. Holds an underlying token, and allows users to interact with the Yearn ecosystem through Strategies connected to the Vault. Vaults are not limited to a single Strategy, they can have as many Strategies as can be designed (however the withdrawal queue is capped at 20.) Deposited funds are moved into the most impactful strategy that has not already reached its limit for assets under management, regardless of which Strategy a user's funds end up in, they receive their portion of yields generated across all Strategies. When a user withdraws, if there are no funds sitting undeployed in the Vault, the Vault withdraws funds from Strategies in the order of least impact. (Funds are taken from the Strategy that will disturb everyone's gains the least, then the next least, etc.) In order to achieve this, the withdrawal queue's order must be properly set and managed by the community (through governance). Vault Strategies are parameterized to pursue the highest risk-adjusted yield. There is an "Emergency Shutdown" mode. When the Vault is put into emergency shutdown, assets will be recalled from the Strategies as quickly as is practical (given onchain conditions), minimizing loss. Deposits are halted, new Strategies may not be added, and each Strategy exits with the minimum possible damage to position, while opening up deposits to be withdrawn by users. There are no restrictions on withdrawals above what is expected under Normal Operation. For further details, please refer to the specification: https://github.com/iearn-finance/yearn-vaults/blob/master/SPECIFICATION.md* ## Functions @@ -20,7 +20,7 @@ function initialize(address,address,address,string,string) ``` -Initializes the Vault, this is called only once, when the contract is deployed. The performance fee is set to 10% of yield, per Strategy. The management fee is set to 2%, per year. The initial deposit limit is set to 0 (deposits disabled); it must be updated after initialization. +Initializes the Vault, this is called only once, when the contract is deployed. The performance fee is set to 10% of yield, per Strategy. The management fee is set to 2%, per year. The initial deposit limit is set to 0 (deposits disabled); it must be updated after initialization. *If `nameOverride` is not specified, the name will be 'yearn' combined with the name of `token`. If `symbolOverride` is not specified, the symbol will be 'yv' combined with the symbol of `token`. The token used by the vault should not change balances outside transfers and it must transfer the exact amount requested. Fee on transfer and rebasing are not supported.* @@ -103,7 +103,7 @@ function apiVersion() ``` -Used to track the deployed version of this contract. In practice you can use this version number to compare with Yearn's GitHub and determine which version of the source matches this deployed contract. +Used to track the deployed version of this contract. In practice you can use this version number to compare with Yearn's GitHub and determine which version of the source matches this deployed contract. *All strategies must have an `apiVersion()` that matches the Vault's `API_VERSION`.* @@ -126,7 +126,7 @@ function setName(string) ``` -Used to change the value of `name`. This may only be called by governance. +Used to change the value of `name`. This may only be called by governance. @@ -147,7 +147,7 @@ function setSymbol(string) ``` -Used to change the value of `symbol`. This may only be called by governance. +Used to change the value of `symbol`. This may only be called by governance. @@ -168,7 +168,7 @@ function setGovernance(address) ``` -Nominate a new address to use as governance. The change does not go into effect immediately. This function sets a pending change, and the governance address is not updated until the proposed governance address has accepted the responsibility. This may only be called by the current governance address. +Nominate a new address to use as governance. The change does not go into effect immediately. This function sets a pending change, and the governance address is not updated until the proposed governance address has accepted the responsibility. This may only be called by the current governance address. @@ -189,7 +189,7 @@ function acceptGovernance() ``` -Once a new governance address has been proposed using setGovernance(), this function may be called by the proposed address to accept the responsibility of taking over governance for this contract. This may only be called by the proposed governance address. +Once a new governance address has been proposed using setGovernance(), this function may be called by the proposed address to accept the responsibility of taking over governance for this contract. This may only be called by the proposed governance address. *setGovernance() should be called by the existing governance address, prior to calling this function.* @@ -206,7 +206,7 @@ function setManagement(address) ``` -Changes the management address. Management is able to make some investment decisions adjusting parameters. This may only be called by governance. +Changes the management address. Management is able to make some investment decisions adjusting parameters. This may only be called by governance. @@ -227,7 +227,7 @@ function setRewards(address) ``` -Changes the rewards address. Any distributed rewards will cease flowing to the old address and begin flowing to this address once the change is in effect. This will not change any Strategy reports in progress, only new reports made after this change goes into effect. This may only be called by governance. +Changes the rewards address. Any distributed rewards will cease flowing to the old address and begin flowing to this address once the change is in effect. This will not change any Strategy reports in progress, only new reports made after this change goes into effect. This may only be called by governance. @@ -248,7 +248,7 @@ function setLockedProfitDegradation(uint256) ``` -Changes the locked profit degradation. +Changes the locked profit degradation. @@ -269,7 +269,7 @@ function setDepositLimit(uint256) ``` -Changes the maximum amount of tokens that can be deposited in this Vault. Note, this is not how much may be deposited by a single depositor, but the maximum amount that may be deposited across all depositors. This may only be called by governance. +Changes the maximum amount of tokens that can be deposited in this Vault. Note, this is not how much may be deposited by a single depositor, but the maximum amount that may be deposited across all depositors. This may only be called by governance. @@ -290,7 +290,7 @@ function setPerformanceFee(uint256) ``` -Used to change the value of `performanceFee`. Should set this value below the maximum strategist performance fee. This may only be called by governance. +Used to change the value of `performanceFee`. Should set this value below the maximum strategist performance fee. This may only be called by governance. @@ -311,7 +311,7 @@ function setManagementFee(uint256) ``` -Used to change the value of `managementFee`. This may only be called by governance. +Used to change the value of `managementFee`. This may only be called by governance. @@ -332,7 +332,7 @@ function setGuardian(address) ``` -Used to change the address of `guardian`. This may only be called by governance or the existing guardian. +Used to change the address of `guardian`. This may only be called by governance or the existing guardian. @@ -353,7 +353,7 @@ function setEmergencyShutdown(bool) ``` -Activates or deactivates Vault mode where all Strategies go into full withdrawal. During Emergency Shutdown: 1. No Users may deposit into the Vault (but may withdraw as usual.) 2. Governance may not add new Strategies. 3. Each Strategy must pay back their debt as quickly as reasonable to minimally affect their position. 4. Only Governance may undo Emergency Shutdown. See contract level note for further details. This may only be called by governance or the guardian. +Activates or deactivates Vault mode where all Strategies go into full withdrawal. During Emergency Shutdown: 1. No Users may deposit into the Vault (but may withdraw as usual.) 2. Governance may not add new Strategies. 3. Each Strategy must pay back their debt as quickly as reasonable to minimally affect their position. 4. Only Governance may undo Emergency Shutdown. See contract level note for further details. This may only be called by governance or the guardian. @@ -374,7 +374,7 @@ function setWithdrawalQueue(address[20]) ``` -Updates the withdrawalQueue to match the addresses and order specified by `queue`. There can be fewer strategies than the maximum, as well as fewer than the total number of strategies active in the vault. `withdrawalQueue` will be updated in a gas-efficient manner, assuming the input is well- ordered with 0x0 only at the end. This may only be called by governance or management. +Updates the withdrawalQueue to match the addresses and order specified by `queue`. There can be fewer strategies than the maximum, as well as fewer than the total number of strategies active in the vault. `withdrawalQueue` will be updated in a gas-efficient manner, assuming the input is well- ordered with 0x0 only at the end. This may only be called by governance or management. *This is order sensitive, specify the addresses in the order in which funds should be withdrawn (so `queue`[0] is the first Strategy withdrawn from, `queue`[1] is the second, etc.) This means that the least impactful Strategy (the Strategy that will have its core positions impacted the least by having funds removed) should be at `queue`[0], then the next least impactful at `queue`[1], and so on.* @@ -397,7 +397,7 @@ function transfer(address,uint256) ``` -Transfers shares from the caller's address to `receiver`. This function will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. +Transfers shares from the caller's address to `receiver`. This function will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. @@ -425,7 +425,7 @@ function transferFrom(address,address,uint256) ``` -Transfers `amount` shares from `sender` to `receiver`. This operation will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. Unless the caller has given this contract unlimited approval, transfering shares will decrement the caller's `allowance` by `amount`. +Transfers `amount` shares from `sender` to `receiver`. This operation will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. Unless the caller has given this contract unlimited approval, transfering shares will decrement the caller's `allowance` by `amount`. @@ -520,7 +520,7 @@ function permit(address,address,uint256,uint256,bytes) ``` -Approves spender by owner's signature to expend owner's tokens. See https://eips.ethereum.org/EIPS/eip-2612. +Approves spender by owner's signature to expend owner's tokens. See https://eips.ethereum.org/EIPS/eip-2612. @@ -551,7 +551,7 @@ function totalAssets() ``` -Returns the total quantity of all assets under control of this Vault, whether they're loaned out to a Strategy, or currently held in the Vault. +Returns the total quantity of all assets under control of this Vault, whether they're loaned out to a Strategy, or currently held in the Vault. @@ -572,10 +572,10 @@ function deposit() ``` -Deposits `_amount` `token`, issuing shares to `recipient`. If the Vault is in Emergency Shutdown, deposits will not be accepted and this call will fail. +Deposits `_amount` `token`, issuing shares to `recipient`. If the Vault is in Emergency Shutdown, deposits will not be accepted and this call will fail. -*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both off-chain and on-chain) to determine if depositing into the Vault is a "good idea".* +*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both offchain and onchain) to determine if depositing into the Vault is a "good idea".* #### Parameters: @@ -603,7 +603,7 @@ function deposit(uint256) -*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both off-chain and on-chain) to determine if depositing into the Vault is a "good idea".* +*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both offchain and onchain) to determine if depositing into the Vault is a "good idea".* #### Parameters: @@ -631,7 +631,7 @@ function deposit(uint256,address) -*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both off-chain and on-chain) to determine if depositing into the Vault is a "good idea".* +*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both offchain and onchain) to determine if depositing into the Vault is a "good idea".* #### Parameters: @@ -658,7 +658,7 @@ function maxAvailableShares() ``` -Determines the maximum quantity of shares this Vault can facilitate a withdrawal for, factoring in assets currently residing in the Vault, as well as those deployed to strategies on the Vault's balance sheet. +Determines the maximum quantity of shares this Vault can facilitate a withdrawal for, factoring in assets currently residing in the Vault, as well as those deployed to strategies on the Vault's balance sheet. *Regarding how shares are calculated, see dev note on `deposit`. If you want to calculated the maximum a user could withdraw up to, you want to use this function. Note that the amount provided by this function is the theoretical maximum possible from withdrawing, the real amount depends on the realized losses incurred during withdrawal.* @@ -681,7 +681,7 @@ function withdraw() ``` -Withdraws the calling account's tokens from this Vault, redeeming amount `_shares` for an appropriate amount of tokens. See note on `setWithdrawalQueue` for further details of withdrawal ordering and behavior. +Withdraws the calling account's tokens from this Vault, redeeming amount `_shares` for an appropriate amount of tokens. See note on `setWithdrawalQueue` for further details of withdrawal ordering and behavior. *Measuring the value of shares is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On withdrawal, this means that shares are redeemed against the total amount that the deposited capital had "realized" since the point it was deposited, up until the point it was withdrawn. If that number were to be higher than the "expected value" at some future point, withdrawing shares via this method could entitle the depositor to *more* than the expected value once the "realized value" is updated from further reports by the Strategies to the Vaults. Under exceptional scenarios, this could cause earlier withdrawals to earn "more" of the underlying assets than Users might otherwise be entitled to, if the Vault's estimated value were otherwise measured through external means, accounting for whatever exceptional scenarios exist for the Vault (that aren't covered by the Vault's own design.) In the situation where a large withdrawal happens, it can empty the vault balance and the strategies in the withdrawal queue. Strategies not in the withdrawal queue will have to be harvested to rebalance the funds and make the funds available again to withdraw.* @@ -799,7 +799,7 @@ function pricePerShare() ``` -Gives the price for a single Vault share. +Gives the price for a single Vault share. *See dev note on `withdraw`.* @@ -822,7 +822,7 @@ function addStrategy(address,uint256,uint256,uint256,uint256) ``` -Add a Strategy to the Vault. This may only be called by governance. +Add a Strategy to the Vault. This may only be called by governance. *The Strategy will be appended to `withdrawalQueue`, call `setWithdrawalQueue` to change the order.* @@ -849,7 +849,7 @@ function updateStrategyDebtRatio(address,uint256) ``` -Change the quantity of assets `strategy` may manage. This may be called by governance or management. +Change the quantity of assets `strategy` may manage. This may be called by governance or management. @@ -871,7 +871,7 @@ function updateStrategyMinDebtPerHarvest(address,uint256) ``` -Change the quantity assets per block this Vault may deposit to or withdraw from `strategy`. This may only be called by governance or management. +Change the quantity assets per block this Vault may deposit to or withdraw from `strategy`. This may only be called by governance or management. @@ -893,7 +893,7 @@ function updateStrategyMaxDebtPerHarvest(address,uint256) ``` -Change the quantity assets per block this Vault may deposit to or withdraw from `strategy`. This may only be called by governance or management. +Change the quantity assets per block this Vault may deposit to or withdraw from `strategy`. This may only be called by governance or management. @@ -915,7 +915,7 @@ function updateStrategyPerformanceFee(address,uint256) ``` -Change the fee the strategist will receive based on this Vault's performance. This may only be called by governance. +Change the fee the strategist will receive based on this Vault's performance. This may only be called by governance. @@ -937,7 +937,7 @@ function migrateStrategy(address,address) ``` -Migrates a Strategy, including all assets from `oldVersion` to `newVersion`. This may only be called by governance. +Migrates a Strategy, including all assets from `oldVersion` to `newVersion`. This may only be called by governance. *Strategy must successfully migrate all capital and positions to new Strategy, or else this will upset the balance of the Vault. The new Strategy should be "empty" e.g. have no prior commitments to this Vault, otherwise it could have issues.* @@ -961,7 +961,7 @@ function revokeStrategy() ``` -Revoke a Strategy, setting its debt limit to 0 and preventing any future deposits. This function should only be used in the scenario where the Strategy is being retired but no migration of the positions are possible, or in the extreme scenario that the Strategy needs to be put into "Emergency Exit" mode in order for it to exit as quickly as possible. The latter scenario could be for any reason that is considered "critical" that the Strategy exits its position as fast as possible, such as a sudden change in market conditions leading to losses, or an imminent failure in an external dependency. This may only be called by governance, the guardian, or the Strategy itself. Note that a Strategy will only revoke itself during emergency shutdown. +Revoke a Strategy, setting its debt limit to 0 and preventing any future deposits. This function should only be used in the scenario where the Strategy is being retired but no migration of the positions are possible, or in the extreme scenario that the Strategy needs to be put into "Emergency Exit" mode in order for it to exit as quickly as possible. The latter scenario could be for any reason that is considered "critical" that the Strategy exits its position as fast as possible, such as a sudden change in market conditions leading to losses, or an imminent failure in an external dependency. This may only be called by governance, the guardian, or the Strategy itself. Note that a Strategy will only revoke itself during emergency shutdown. @@ -1001,7 +1001,7 @@ function addStrategyToQueue(address) ``` -Adds `strategy` to `withdrawalQueue`. This may only be called by governance or management. +Adds `strategy` to `withdrawalQueue`. This may only be called by governance or management. *The Strategy will be appended to `withdrawalQueue`, call `setWithdrawalQueue` to change the order.* @@ -1024,7 +1024,7 @@ function removeStrategyFromQueue(address) ``` -Remove `strategy` from `withdrawalQueue`. This may only be called by governance or management. +Remove `strategy` from `withdrawalQueue`. This may only be called by governance or management. *We don't do this with revokeStrategy because it should still be possible to withdraw from the Strategy if it's unwinding.* @@ -1047,7 +1047,7 @@ function debtOutstanding() ``` -Determines if `strategy` is past its debt limit and if any tokens should be withdrawn to the Vault. +Determines if `strategy` is past its debt limit and if any tokens should be withdrawn to the Vault. @@ -1099,7 +1099,7 @@ function creditAvailable() ``` -Amount of tokens in Vault a Strategy has access to as a credit line. This will check the Strategy's debt limit, as well as the tokens available in the Vault, and determine the maximum amount of tokens (if any) the Strategy may draw on. In the rare case the Vault is in emergency shutdown this will return 0. +Amount of tokens in Vault a Strategy has access to as a credit line. This will check the Strategy's debt limit, as well as the tokens available in the Vault, and determine the maximum amount of tokens (if any) the Strategy may draw on. In the rare case the Vault is in emergency shutdown this will return 0. @@ -1151,7 +1151,7 @@ function expectedReturn() ``` -Provide an accurate expected value for the return this `strategy` would provide to the Vault the next time `report()` is called (since the last time it was called). +Provide an accurate expected value for the return this `strategy` would provide to the Vault the next time `report()` is called (since the last time it was called). @@ -1203,7 +1203,7 @@ function report(uint256,uint256,uint256) ``` -Reports the amount of assets the calling Strategy has free (usually in terms of ROI). The performance fee is determined here, off of the strategy's profits (if any), and sent to governance. The strategist's fee is also determined here (off of profits), to be handled according to the strategist on the next harvest. This may only be called by a Strategy managed by this Vault. +Reports the amount of assets the calling Strategy has free (usually in terms of ROI). The performance fee is determined here, off of the strategy's profits (if any), and sent to governance. The strategist's fee is also determined here (off of profits), to be handled according to the strategist on the next harvest. This may only be called by a Strategy managed by this Vault. *For approved strategies, this is the most efficient behavior. The Strategy reports back what it has free, then Vault "decides" whether to take some back or give it more. Note that the most it can take is `gain + _debtPayment`, and the most it can give is all of the remaining reserves. Anything outside of those bounds is abnormal behavior. All approved strategies must have increased diligence around calling this function, as abnormal behavior could become catastrophic.* @@ -1212,8 +1212,8 @@ Reports the amount of assets the calling Strategy has free (usually in terms of #### Parameters: | Name | Type | Description | | :----------------------------- | :------------ | :--------------------------------------------- | -| * gain * | * * | * Amount Strategy has realized as a gain on it's investment since its last report, and is free to be given back to Vault as earnings * | -| * loss * | * * | * Amount Strategy has realized as a loss on it's investment since its last report, and should be accounted for on the Vault's balance sheet. The loss will reduce the debtRatio. The next time the strategy will harvest, it will pay back the debt in an attempt to adjust to the new debt limit. * | +| * gain * | * * | * Amount Strategy has realized as a gain on its investment since its last report, and is free to be given back to Vault as earnings * | +| * loss * | * * | * Amount Strategy has realized as a loss on its investment since its last report, and should be accounted for on the Vault's balance sheet. The loss will reduce the debtRatio. The next time the strategy will harvest, it will pay back the debt in an attempt to adjust to the new debt limit. * | | * _debtPayment * | * * | * Amount Strategy has made available to cover outstanding debt * | @@ -1234,7 +1234,7 @@ function sweep(address) ``` -Removes tokens from this Vault that are not the type of token managed by this Vault. This may be used in case of accidentally sending the wrong kind of token to this Vault. Tokens will be sent to `governance`. This will fail if an attempt is made to sweep the tokens that this Vault manages. This may only be called by governance. +Removes tokens from this Vault that are not the type of token managed by this Vault. This may be used in case of accidentally sending the wrong kind of token to this Vault. Tokens will be sent to `governance`. This will fail if an attempt is made to sweep the tokens that this Vault manages. This may only be called by governance. diff --git a/docs/developers/smart-contracts/deprecated/V2/version-0.4.3/yearn-lens/yearn-lens.md b/docs/developers/smart-contracts/deprecated/V2/version-0.4.3/yearn-lens/yearn-lens.md index 9d6b75e6c2..11ccaae0a3 100644 --- a/docs/developers/smart-contracts/deprecated/V2/version-0.4.3/yearn-lens/yearn-lens.md +++ b/docs/developers/smart-contracts/deprecated/V2/version-0.4.3/yearn-lens/yearn-lens.md @@ -26,7 +26,7 @@ Yearn Lens is a series of smart contracts that aggregate and format Yearn family - Registry adapters have the ability to return metadata specific to an asset type (for example for vaults: `pricePerShare`, `controller`, etc.) - Oracle - The oracle contract is responsible for fetching price information from various sources - - The oracle is intended for non-critical off-chain calculations + - The oracle is intended for non-critical offchain calculations - TVL calculations - Token and asset balance normalizations - Not intended to be used with strategies or other contracts diff --git a/docs/developers/smart-contracts/deprecated/V2/version-0.4.3/yearn-sdk/yearn-stack.md b/docs/developers/smart-contracts/deprecated/V2/version-0.4.3/yearn-sdk/yearn-stack.md index bd52ec1f7d..2f3264444f 100644 --- a/docs/developers/smart-contracts/deprecated/V2/version-0.4.3/yearn-sdk/yearn-stack.md +++ b/docs/developers/smart-contracts/deprecated/V2/version-0.4.3/yearn-sdk/yearn-stack.md @@ -1,6 +1,6 @@ # Yearn Stack + FE Features -Yearn SDK integrates several components, both on-chain and off-chain. +Yearn SDK integrates several components, both onchain and offchain. ## Backend stack @@ -8,7 +8,7 @@ Yearn SDK integrates several components, both on-chain and off-chain. Backend Chart

-### On Chain +### Onchain - 🔍 Yearn Lens - Oracle @@ -31,7 +31,7 @@ Yearn SDK integrates several components, both on-chain and off-chain. - disabling asset interactions - Yearn Frontend -### Off Chain +### Offchain - Yearn Exporter: stores (and displays) stats about yearn assets, exposing: - historical TVL @@ -41,16 +41,16 @@ Yearn SDK integrates several components, both on-chain and off-chain. ## Backend features -### Resilience powered by on-chain data and IPFS storage +### Resilience powered by onchain data and IPFS storage - Critical data (assets, positions, vault deprecations) will be fetched exclusively from the chain / IPFS - maximizing uptime - reducing reliance on other services -- Historical TVL, historical APY and other non critical data will be stored off chain and fetched dinamically. +- Historical TVL, historical APY and other non critical data will be stored offchain and fetched dinamically. -#### On-chain assets and positions +#### Onchain assets and positions -- Lens does what the old off-chain API does, but directly on-chain. This will speed up the fetching time and greatly reduce our reliance on scheduled jobs in servers. +- Lens does what the old offchain API does, but directly onchain. This will speed up the fetching time and greatly reduce our reliance on scheduled jobs in servers. #### IPFS CI/CD for frontend and metadata @@ -65,7 +65,7 @@ Yearn SDK integrates several components, both on-chain and off-chain. - SDK will provide a simple interface for all integrators, including ourselves. - Read methods will seamlessly integrate with all datasources, while keeping coherent datastructures. -- Write methods talk directly to assets on chain. Execution of write transactions will trigger refresh events so data freshness of frontend (or other integration platforms) will still be preserved. +- Write methods talk directly to assets onchain. Execution of write transactions will trigger refresh events so data freshness of frontend (or other integration platforms) will still be preserved. ### Historical User Earnings diff --git a/docs/developers/smart-contracts/deprecated/V2/version-0.4.5/smart-contracts/BaseStrategy.md b/docs/developers/smart-contracts/deprecated/V2/version-0.4.5/smart-contracts/BaseStrategy.md index 996d4cb87e..18ab771c88 100644 --- a/docs/developers/smart-contracts/deprecated/V2/version-0.4.5/smart-contracts/BaseStrategy.md +++ b/docs/developers/smart-contracts/deprecated/V2/version-0.4.5/smart-contracts/BaseStrategy.md @@ -17,7 +17,7 @@ The Strategy's version must match the Vault's `API_VERSION`. #### Return Values: | Name | Type | Description | | :----------------------------- | :------------ | :--------------------------------------------------------------------------- | -|`A`| | string which holds the current API version of this contract. +|`_apiVersion`| string | The current API version of this contract.| ### name ```solidity function name( @@ -35,7 +35,7 @@ This Strategy's name. #### Return Values: | Name | Type | Description | | :----------------------------- | :------------ | :--------------------------------------------------------------------------- | -|`This`| | Strategy's name. +|`_name`| string | Strategy's name.| ### delegatedAssets ```solidity function delegatedAssets( @@ -54,7 +54,7 @@ The amount (priced in want) of the total assets managed by this strategy should @return The amount of assets this strategy manages that should not be included in Yearn's Total Value - Locked (TVL) calculation across it's ecosystem. + Locked (TVL) calculation across its ecosystem. @@ -147,12 +147,10 @@ Initializes the Strategy, this is called only once, when the #### Parameters: | Name | Type | Description | | :--- | :--- | :------------------------------------------------------------------- | -|`_vault` | address | The address of the Vault responsible for this Strategy. -|`_strategist` | address | The address to assign as `strategist`. -The strategist is able to change the reward address -|`_rewards` | address | The address to use for pulling rewards. -|`_keeper` | address | The adddress of the _keeper. _keeper -can harvest and tend a strategy. +|`_vault` | address | The address of the Vault responsible for this Strategy.| +|`_strategist` | address | The address to assign as `strategist`. The strategist is able to change the reward address.| +|`_rewards` | address | The address to use for pulling rewards.| +|`_keeper` | address | The address of the keeper. Keeper can harvest and tend a strategy.| ### setHealthCheck ```solidity @@ -376,7 +374,7 @@ Provide an accurate conversion from `_amtInWei` (denominated in wei) #### Return Values: | Name | Type | Description | | :----------------------------- | :------------ | :--------------------------------------------------------------------------- | -|`The`| uint256 | amount in `want` of `_amtInEth` converted to `want` +|`_amountInWant`| uint256 | amount in `want` of `_amtInEth` converted to `want`| ### estimatedTotalAssets ```solidity @@ -389,12 +387,12 @@ Provide an accurate estimate for the total amount of assets This total should be "realizable" e.g. the total value that could *actually* be obtained from this Strategy if it were to divest its - entire position based on current on-chain conditions. + entire position based on current onchain conditions. @dev Care must be taken in using this function, since it relies on external systems, which could be manipulated by the attacker to give an inflated - (or reduced) value produced by this function, based on current on-chain + (or reduced) value produced by this function, based on current onchain conditions (e.g. this function is possible to influence through flashloan attacks, oracle manipulations, or other DeFi attack mechanisms). @@ -410,7 +408,7 @@ Provide an accurate estimate for the total amount of assets #### Return Values: | Name | Type | Description | | :----------------------------- | :------------ | :--------------------------------------------------------------------------- | -|`The`| | estimated total assets in this Strategy. +|`_totalAssets`| uint256 | Estimated total assets in this Strategy.| ### isActive ```solidity function isActive( @@ -522,7 +520,7 @@ Provide a signal to the keeper that `tend()` should be called. The #### Return Values: | Name | Type | Description | | :----------------------------- | :------------ | :--------------------------------------------------------------------------- | -|`if`| uint256 | `tend()` should be called, `false` otherwise. +|`_shouldTend`| bool | `true` if `tend()` should be called, `false` otherwise.| ### tend ```solidity function tend( @@ -585,7 +583,7 @@ Provide a signal to the keeper that `harvest()` should be called. The #### Return Values: | Name | Type | Description | | :----------------------------- | :------------ | :--------------------------------------------------------------------------- | -|`if`| uint256 | `harvest()` should be called, `false` otherwise. +|`_shouldHarvest`| bool | `true` if `harvest()` should be called, `false` otherwise.| ### isBaseFeeAcceptable ```solidity function isBaseFeeAcceptable( @@ -599,7 +597,7 @@ Check if the current network base fee is below our external target. If #### Return Values: | Name | Type | Description | | :----------------------------- | :------------ | :--------------------------------------------------------------------------- | -|`if`| | `harvest()` should be allowed, `false` otherwise. +|`_isAcceptable`| bool | `true` if `harvest()` should be allowed, `false` otherwise.| ### harvest ```solidity function harvest( @@ -683,7 +681,7 @@ interacted with the vault before. ``` Activates emergency exit. Once activated, the Strategy will exit its position upon the next harvest, depositing all funds into the Vault as - quickly as is reasonable given on-chain conditions. + quickly as is reasonable given onchain conditions. This may only be called by governance or the strategist. diff --git a/docs/developers/smart-contracts/deprecated/V2/version-0.4.5/smart-contracts/vault.md b/docs/developers/smart-contracts/deprecated/V2/version-0.4.5/smart-contracts/vault.md index 207932e8c3..98e22b29f4 100644 --- a/docs/developers/smart-contracts/deprecated/V2/version-0.4.5/smart-contracts/vault.md +++ b/docs/developers/smart-contracts/deprecated/V2/version-0.4.5/smart-contracts/vault.md @@ -7,7 +7,7 @@ -*Yearn Token Vault. Holds an underlying token, and allows users to interact with the Yearn ecosystem through Strategies connected to the Vault. Vaults are not limited to a single Strategy, they can have as many Strategies as can be designed (however the withdrawal queue is capped at 20.) Deposited funds are moved into the most impactful strategy that has not already reached its limit for assets under management, regardless of which Strategy a user's funds end up in, they receive their portion of yields generated across all Strategies. When a user withdraws, if there are no funds sitting undeployed in the Vault, the Vault withdraws funds from Strategies in the order of least impact. (Funds are taken from the Strategy that will disturb everyone's gains the least, then the next least, etc.) In order to achieve this, the withdrawal queue's order must be properly set and managed by the community (through governance). Vault Strategies are parameterized to pursue the highest risk-adjusted yield. There is an "Emergency Shutdown" mode. When the Vault is put into emergency shutdown, assets will be recalled from the Strategies as quickly as is practical (given on-chain conditions), minimizing loss. Deposits are halted, new Strategies may not be added, and each Strategy exits with the minimum possible damage to position, while opening up deposits to be withdrawn by users. There are no restrictions on withdrawals above what is expected under Normal Operation. For further details, please refer to the specification: https://github.com/iearn-finance/yearn-vaults/blob/main/SPECIFICATION.md* +*Yearn Token Vault. Holds an underlying token, and allows users to interact with the Yearn ecosystem through Strategies connected to the Vault. Vaults are not limited to a single Strategy, they can have as many Strategies as can be designed (however the withdrawal queue is capped at 20.) Deposited funds are moved into the most impactful strategy that has not already reached its limit for assets under management, regardless of which Strategy a user's funds end up in, they receive their portion of yields generated across all Strategies. When a user withdraws, if there are no funds sitting undeployed in the Vault, the Vault withdraws funds from Strategies in the order of least impact. (Funds are taken from the Strategy that will disturb everyone's gains the least, then the next least, etc.) In order to achieve this, the withdrawal queue's order must be properly set and managed by the community (through governance). Vault Strategies are parameterized to pursue the highest risk-adjusted yield. There is an "Emergency Shutdown" mode. When the Vault is put into emergency shutdown, assets will be recalled from the Strategies as quickly as is practical (given onchain conditions), minimizing loss. Deposits are halted, new Strategies may not be added, and each Strategy exits with the minimum possible damage to position, while opening up deposits to be withdrawn by users. There are no restrictions on withdrawals above what is expected under Normal Operation. For further details, please refer to the specification: https://github.com/iearn-finance/yearn-vaults/blob/main/SPECIFICATION.md* ## Functions @@ -20,7 +20,7 @@ function initialize(address,address,address,string,string) ``` -Initializes the Vault, this is called only once, when the contract is deployed. The performance fee is set to 10% of yield, per Strategy. The management fee is set to 2%, per year. The initial deposit limit is set to 0 (deposits disabled); it must be updated after initialization. +Initializes the Vault, this is called only once, when the contract is deployed. The performance fee is set to 10% of yield, per Strategy. The management fee is set to 2%, per year. The initial deposit limit is set to 0 (deposits disabled); it must be updated after initialization. *If `nameOverride` is not specified, the name will be 'yearn' combined with the name of `token`. If `symbolOverride` is not specified, the symbol will be 'yv' combined with the symbol of `token`. The token used by the vault should not change balances outside transfers and it must transfer the exact amount requested. Fee on transfer and rebasing are not supported.* @@ -103,7 +103,7 @@ function apiVersion() ``` -Used to track the deployed version of this contract. In practice you can use this version number to compare with Yearn's GitHub and determine which version of the source matches this deployed contract. +Used to track the deployed version of this contract. In practice you can use this version number to compare with Yearn's GitHub and determine which version of the source matches this deployed contract. *All strategies must have an `apiVersion()` that matches the Vault's `API_VERSION`.* @@ -126,7 +126,7 @@ function setName(string) ``` -Used to change the value of `name`. This may only be called by governance. +Used to change the value of `name`. This may only be called by governance. @@ -147,7 +147,7 @@ function setSymbol(string) ``` -Used to change the value of `symbol`. This may only be called by governance. +Used to change the value of `symbol`. This may only be called by governance. @@ -168,7 +168,7 @@ function setGovernance(address) ``` -Nominate a new address to use as governance. The change does not go into effect immediately. This function sets a pending change, and the governance address is not updated until the proposed governance address has accepted the responsibility. This may only be called by the current governance address. +Nominate a new address to use as governance. The change does not go into effect immediately. This function sets a pending change, and the governance address is not updated until the proposed governance address has accepted the responsibility. This may only be called by the current governance address. @@ -189,7 +189,7 @@ function acceptGovernance() ``` -Once a new governance address has been proposed using setGovernance(), this function may be called by the proposed address to accept the responsibility of taking over governance for this contract. This may only be called by the proposed governance address. +Once a new governance address has been proposed using setGovernance(), this function may be called by the proposed address to accept the responsibility of taking over governance for this contract. This may only be called by the proposed governance address. *setGovernance() should be called by the existing governance address, prior to calling this function.* @@ -206,7 +206,7 @@ function setManagement(address) ``` -Changes the management address. Management is able to make some investment decisions adjusting parameters. This may only be called by governance. +Changes the management address. Management is able to make some investment decisions adjusting parameters. This may only be called by governance. @@ -227,7 +227,7 @@ function setRewards(address) ``` -Changes the rewards address. Any distributed rewards will cease flowing to the old address and begin flowing to this address once the change is in effect. This will not change any Strategy reports in progress, only new reports made after this change goes into effect. This may only be called by governance. +Changes the rewards address. Any distributed rewards will cease flowing to the old address and begin flowing to this address once the change is in effect. This will not change any Strategy reports in progress, only new reports made after this change goes into effect. This may only be called by governance. @@ -248,7 +248,7 @@ function setLockedProfitDegradation(uint256) ``` -Changes the locked profit degradation. +Changes the locked profit degradation. @@ -269,7 +269,7 @@ function setDepositLimit(uint256) ``` -Changes the maximum amount of tokens that can be deposited in this Vault. Note, this is not how much may be deposited by a single depositor, but the maximum amount that may be deposited across all depositors. This may only be called by governance. +Changes the maximum amount of tokens that can be deposited in this Vault. Note, this is not how much may be deposited by a single depositor, but the maximum amount that may be deposited across all depositors. This may only be called by governance. @@ -290,7 +290,7 @@ function setPerformanceFee(uint256) ``` -Used to change the value of `performanceFee`. Should set this value below the maximum strategist performance fee. This may only be called by governance. +Used to change the value of `performanceFee`. Should set this value below the maximum strategist performance fee. This may only be called by governance. @@ -311,7 +311,7 @@ function setManagementFee(uint256) ``` -Used to change the value of `managementFee`. This may only be called by governance. +Used to change the value of `managementFee`. This may only be called by governance. @@ -332,7 +332,7 @@ function setGuardian(address) ``` -Used to change the address of `guardian`. This may only be called by governance or the existing guardian. +Used to change the address of `guardian`. This may only be called by governance or the existing guardian. @@ -353,7 +353,7 @@ function setEmergencyShutdown(bool) ``` -Activates or deactivates Vault mode where all Strategies go into full withdrawal. During Emergency Shutdown: 1. No Users may deposit into the Vault (but may withdraw as usual.) 2. Governance may not add new Strategies. 3. Each Strategy must pay back their debt as quickly as reasonable to minimally affect their position. 4. Only Governance may undo Emergency Shutdown. See contract level note for further details. This may only be called by governance or the guardian. +Activates or deactivates Vault mode where all Strategies go into full withdrawal. During Emergency Shutdown: 1. No Users may deposit into the Vault (but may withdraw as usual.) 2. Governance may not add new Strategies. 3. Each Strategy must pay back their debt as quickly as reasonable to minimally affect their position. 4. Only Governance may undo Emergency Shutdown. See contract level note for further details. This may only be called by governance or the guardian. @@ -374,7 +374,7 @@ function setWithdrawalQueue(address[20]) ``` -Updates the withdrawalQueue to match the addresses and order specified by `queue`. There can be fewer strategies than the maximum, as well as fewer than the total number of strategies active in the vault. `withdrawalQueue` will be updated in a gas-efficient manner, assuming the input is well- ordered with 0x0 only at the end. This may only be called by governance or management. +Updates the withdrawalQueue to match the addresses and order specified by `queue`. There can be fewer strategies than the maximum, as well as fewer than the total number of strategies active in the vault. `withdrawalQueue` will be updated in a gas-efficient manner, assuming the input is well- ordered with 0x0 only at the end. This may only be called by governance or management. *This is order sensitive, specify the addresses in the order in which funds should be withdrawn (so `queue`[0] is the first Strategy withdrawn from, `queue`[1] is the second, etc.) This means that the least impactful Strategy (the Strategy that will have its core positions impacted the least by having funds removed) should be at `queue`[0], then the next least impactful at `queue`[1], and so on.* @@ -397,7 +397,7 @@ function transfer(address,uint256) ``` -Transfers shares from the caller's address to `receiver`. This function will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. +Transfers shares from the caller's address to `receiver`. This function will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. @@ -425,7 +425,7 @@ function transferFrom(address,address,uint256) ``` -Transfers `amount` shares from `sender` to `receiver`. This operation will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. Unless the caller has given this contract unlimited approval, transfering shares will decrement the caller's `allowance` by `amount`. +Transfers `amount` shares from `sender` to `receiver`. This operation will always return true, unless the user is attempting to transfer shares to this contract's address, or to 0x0. Unless the caller has given this contract unlimited approval, transfering shares will decrement the caller's `allowance` by `amount`. @@ -520,7 +520,7 @@ function permit(address,address,uint256,uint256,bytes) ``` -Approves spender by owner's signature to expend owner's tokens. See https://eips.ethereum.org/EIPS/eip-2612. +Approves spender by owner's signature to expend owner's tokens. See https://eips.ethereum.org/EIPS/eip-2612. @@ -551,7 +551,7 @@ function totalAssets() ``` -Returns the total quantity of all assets under control of this Vault, whether they're loaned out to a Strategy, or currently held in the Vault. +Returns the total quantity of all assets under control of this Vault, whether they're loaned out to a Strategy, or currently held in the Vault. @@ -572,10 +572,10 @@ function deposit() ``` -Deposits `_amount` `token`, issuing shares to `recipient`. If the Vault is in Emergency Shutdown, deposits will not be accepted and this call will fail. +Deposits `_amount` `token`, issuing shares to `recipient`. If the Vault is in Emergency Shutdown, deposits will not be accepted and this call will fail. -*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both off-chain and on-chain) to determine if depositing into the Vault is a "good idea".* +*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both offchain and onchain) to determine if depositing into the Vault is a "good idea".* #### Parameters: @@ -603,7 +603,7 @@ function deposit(uint256) -*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both off-chain and on-chain) to determine if depositing into the Vault is a "good idea".* +*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both offchain and onchain) to determine if depositing into the Vault is a "good idea".* #### Parameters: @@ -631,7 +631,7 @@ function deposit(uint256,address) -*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both off-chain and on-chain) to determine if depositing into the Vault is a "good idea".* +*Measuring quantity of shares to issues is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On deposit, this means that shares are issued against the total amount that the deposited capital can be given in service of the debt that Strategies assume. If that number were to be lower than the "expected value" at some future point, depositing shares via this method could entitle the depositor to *less* than the deposited value once the "realized value" is updated from further reports by the Strategies to the Vaults. Care should be taken by integrators to account for this discrepancy, by using the view-only methods of this contract (both offchain and onchain) to determine if depositing into the Vault is a "good idea".* #### Parameters: @@ -658,7 +658,7 @@ function maxAvailableShares() ``` -Determines the maximum quantity of shares this Vault can facilitate a withdrawal for, factoring in assets currently residing in the Vault, as well as those deployed to strategies on the Vault's balance sheet. +Determines the maximum quantity of shares this Vault can facilitate a withdrawal for, factoring in assets currently residing in the Vault, as well as those deployed to strategies on the Vault's balance sheet. *Regarding how shares are calculated, see dev note on `deposit`. If you want to calculated the maximum a user could withdraw up to, you want to use this function. Note that the amount provided by this function is the theoretical maximum possible from withdrawing, the real amount depends on the realized losses incurred during withdrawal.* @@ -681,7 +681,7 @@ function withdraw() ``` -Withdraws the calling account's tokens from this Vault, redeeming amount `_shares` for an appropriate amount of tokens. See note on `setWithdrawalQueue` for further details of withdrawal ordering and behavior. +Withdraws the calling account's tokens from this Vault, redeeming amount `_shares` for an appropriate amount of tokens. See note on `setWithdrawalQueue` for further details of withdrawal ordering and behavior. *Measuring the value of shares is based on the total outstanding debt that this contract has ("expected value") instead of the total balance sheet it has ("estimated value") has important security considerations, and is done intentionally. If this value were measured against external systems, it could be purposely manipulated by an attacker to withdraw more assets than they otherwise should be able to claim by redeeming their shares. On withdrawal, this means that shares are redeemed against the total amount that the deposited capital had "realized" since the point it was deposited, up until the point it was withdrawn. If that number were to be higher than the "expected value" at some future point, withdrawing shares via this method could entitle the depositor to *more* than the expected value once the "realized value" is updated from further reports by the Strategies to the Vaults. Under exceptional scenarios, this could cause earlier withdrawals to earn "more" of the underlying assets than Users might otherwise be entitled to, if the Vault's estimated value were otherwise measured through external means, accounting for whatever exceptional scenarios exist for the Vault (that aren't covered by the Vault's own design.) In the situation where a large withdrawal happens, it can empty the vault balance and the strategies in the withdrawal queue. Strategies not in the withdrawal queue will have to be harvested to rebalance the funds and make the funds available again to withdraw.* @@ -799,7 +799,7 @@ function pricePerShare() ``` -Gives the price for a single Vault share. +Gives the price for a single Vault share. *See dev note on `withdraw`.* @@ -822,7 +822,7 @@ function addStrategy(address,uint256,uint256,uint256,uint256) ``` -Add a Strategy to the Vault. This may only be called by governance. +Add a Strategy to the Vault. This may only be called by governance. *The Strategy will be appended to `withdrawalQueue`, call `setWithdrawalQueue` to change the order.* @@ -849,7 +849,7 @@ function updateStrategyDebtRatio(address,uint256) ``` -Change the quantity of assets `strategy` may manage. This may be called by governance or management. +Change the quantity of assets `strategy` may manage. This may be called by governance or management. @@ -871,7 +871,7 @@ function updateStrategyMinDebtPerHarvest(address,uint256) ``` -Change the quantity assets per block this Vault may deposit to or withdraw from `strategy`. This may only be called by governance or management. +Change the quantity assets per block this Vault may deposit to or withdraw from `strategy`. This may only be called by governance or management. @@ -893,7 +893,7 @@ function updateStrategyMaxDebtPerHarvest(address,uint256) ``` -Change the quantity assets per block this Vault may deposit to or withdraw from `strategy`. This may only be called by governance or management. +Change the quantity assets per block this Vault may deposit to or withdraw from `strategy`. This may only be called by governance or management. @@ -915,7 +915,7 @@ function updateStrategyPerformanceFee(address,uint256) ``` -Change the fee the strategist will receive based on this Vault's performance. This may only be called by governance. +Change the fee the strategist will receive based on this Vault's performance. This may only be called by governance. @@ -937,7 +937,7 @@ function migrateStrategy(address,address) ``` -Migrates a Strategy, including all assets from `oldVersion` to `newVersion`. This may only be called by governance. +Migrates a Strategy, including all assets from `oldVersion` to `newVersion`. This may only be called by governance. *Strategy must successfully migrate all capital and positions to new Strategy, or else this will upset the balance of the Vault. The new Strategy should be "empty" e.g. have no prior commitments to this Vault, otherwise it could have issues.* @@ -961,7 +961,7 @@ function revokeStrategy() ``` -Revoke a Strategy, setting its debt limit to 0 and preventing any future deposits. This function should only be used in the scenario where the Strategy is being retired but no migration of the positions are possible, or in the extreme scenario that the Strategy needs to be put into "Emergency Exit" mode in order for it to exit as quickly as possible. The latter scenario could be for any reason that is considered "critical" that the Strategy exits its position as fast as possible, such as a sudden change in market conditions leading to losses, or an imminent failure in an external dependency. This may only be called by governance, the guardian, or the Strategy itself. Note that a Strategy will only revoke itself during emergency shutdown. +Revoke a Strategy, setting its debt limit to 0 and preventing any future deposits. This function should only be used in the scenario where the Strategy is being retired but no migration of the positions are possible, or in the extreme scenario that the Strategy needs to be put into "Emergency Exit" mode in order for it to exit as quickly as possible. The latter scenario could be for any reason that is considered "critical" that the Strategy exits its position as fast as possible, such as a sudden change in market conditions leading to losses, or an imminent failure in an external dependency. This may only be called by governance, the guardian, or the Strategy itself. Note that a Strategy will only revoke itself during emergency shutdown. @@ -1001,7 +1001,7 @@ function addStrategyToQueue(address) ``` -Adds `strategy` to `withdrawalQueue`. This may only be called by governance or management. +Adds `strategy` to `withdrawalQueue`. This may only be called by governance or management. *The Strategy will be appended to `withdrawalQueue`, call `setWithdrawalQueue` to change the order.* @@ -1024,7 +1024,7 @@ function removeStrategyFromQueue(address) ``` -Remove `strategy` from `withdrawalQueue`. This may only be called by governance or management. +Remove `strategy` from `withdrawalQueue`. This may only be called by governance or management. *We don't do this with revokeStrategy because it should still be possible to withdraw from the Strategy if it's unwinding.* @@ -1047,7 +1047,7 @@ function debtOutstanding() ``` -Determines if `strategy` is past its debt limit and if any tokens should be withdrawn to the Vault. +Determines if `strategy` is past its debt limit and if any tokens should be withdrawn to the Vault. @@ -1099,7 +1099,7 @@ function creditAvailable() ``` -Amount of tokens in Vault a Strategy has access to as a credit line. This will check the Strategy's debt limit, as well as the tokens available in the Vault, and determine the maximum amount of tokens (if any) the Strategy may draw on. In the rare case the Vault is in emergency shutdown this will return 0. +Amount of tokens in Vault a Strategy has access to as a credit line. This will check the Strategy's debt limit, as well as the tokens available in the Vault, and determine the maximum amount of tokens (if any) the Strategy may draw on. In the rare case the Vault is in emergency shutdown this will return 0. @@ -1151,7 +1151,7 @@ function expectedReturn() ``` -Provide an accurate expected value for the return this `strategy` would provide to the Vault the next time `report()` is called (since the last time it was called). +Provide an accurate expected value for the return this `strategy` would provide to the Vault the next time `report()` is called (since the last time it was called). @@ -1203,7 +1203,7 @@ function report(uint256,uint256,uint256) ``` -Reports the amount of assets the calling Strategy has free (usually in terms of ROI). The performance fee is determined here, off of the strategy's profits (if any), and sent to governance. The strategist's fee is also determined here (off of profits), to be handled according to the strategist on the next harvest. This may only be called by a Strategy managed by this Vault. +Reports the amount of assets the calling Strategy has free (usually in terms of ROI). The performance fee is determined here, off of the strategy's profits (if any), and sent to governance. The strategist's fee is also determined here (off of profits), to be handled according to the strategist on the next harvest. This may only be called by a Strategy managed by this Vault. *For approved strategies, this is the most efficient behavior. The Strategy reports back what it has free, then Vault "decides" whether to take some back or give it more. Note that the most it can take is `gain + _debtPayment`, and the most it can give is all of the remaining reserves. Anything outside of those bounds is abnormal behavior. All approved strategies must have increased diligence around calling this function, as abnormal behavior could become catastrophic.* @@ -1212,8 +1212,8 @@ Reports the amount of assets the calling Strategy has free (usually in terms of #### Parameters: | Name | Type | Description | | :----------------------------- | :------------ | :--------------------------------------------- | -| * gain * | * * | * Amount Strategy has realized as a gain on it's investment since its last report, and is free to be given back to Vault as earnings * | -| * loss * | * * | * Amount Strategy has realized as a loss on it's investment since its last report, and should be accounted for on the Vault's balance sheet. The loss will reduce the debtRatio. The next time the strategy will harvest, it will pay back the debt in an attempt to adjust to the new debt limit. * | +| * gain * | * * | * Amount Strategy has realized as a gain on its investment since its last report, and is free to be given back to Vault as earnings * | +| * loss * | * * | * Amount Strategy has realized as a loss on its investment since its last report, and should be accounted for on the Vault's balance sheet. The loss will reduce the debtRatio. The next time the strategy will harvest, it will pay back the debt in an attempt to adjust to the new debt limit. * | | * _debtPayment * | * * | * Amount Strategy has made available to cover outstanding debt * | @@ -1234,7 +1234,7 @@ function sweep(address) ``` -Removes tokens from this Vault that are not the type of token managed by this Vault. This may be used in case of accidentally sending the wrong kind of token to this Vault. Tokens will be sent to `governance`. This will fail if an attempt is made to sweep the tokens that this Vault manages. This may only be called by governance. +Removes tokens from this Vault that are not the type of token managed by this Vault. This may be used in case of accidentally sending the wrong kind of token to this Vault. Tokens will be sent to `governance`. This will fail if an attempt is made to sweep the tokens that this Vault manages. This may only be called by governance. diff --git a/docs/developers/smart-contracts/deprecated/V2/version-0.4.5/yearn-lens/yearn-lens.md b/docs/developers/smart-contracts/deprecated/V2/version-0.4.5/yearn-lens/yearn-lens.md index 9d6b75e6c2..11ccaae0a3 100644 --- a/docs/developers/smart-contracts/deprecated/V2/version-0.4.5/yearn-lens/yearn-lens.md +++ b/docs/developers/smart-contracts/deprecated/V2/version-0.4.5/yearn-lens/yearn-lens.md @@ -26,7 +26,7 @@ Yearn Lens is a series of smart contracts that aggregate and format Yearn family - Registry adapters have the ability to return metadata specific to an asset type (for example for vaults: `pricePerShare`, `controller`, etc.) - Oracle - The oracle contract is responsible for fetching price information from various sources - - The oracle is intended for non-critical off-chain calculations + - The oracle is intended for non-critical offchain calculations - TVL calculations - Token and asset balance normalizations - Not intended to be used with strategies or other contracts diff --git a/docs/developers/smart-contracts/deprecated/V2/version-0.4.5/yearn-sdk/yearn-stack.md b/docs/developers/smart-contracts/deprecated/V2/version-0.4.5/yearn-sdk/yearn-stack.md index c96e740b63..ad03d2a99c 100644 --- a/docs/developers/smart-contracts/deprecated/V2/version-0.4.5/yearn-sdk/yearn-stack.md +++ b/docs/developers/smart-contracts/deprecated/V2/version-0.4.5/yearn-sdk/yearn-stack.md @@ -1,6 +1,6 @@ # Yearn Stack + FE Features -Yearn SDK integrates several components, both on-chain and off-chain. +Yearn SDK integrates several components, both onchain and offchain. ## Backend stack @@ -8,7 +8,7 @@ Yearn SDK integrates several components, both on-chain and off-chain. Backend Chart

-### On Chain +### Onchain - 🔍 Yearn Lens - Oracle @@ -31,7 +31,7 @@ Yearn SDK integrates several components, both on-chain and off-chain. - disabling asset interactions - Yearn Frontend -### Off Chain +### Offchain - Yearn Exporter: stores (and displays) stats about yearn assets, exposing: - historical TVL @@ -41,16 +41,16 @@ Yearn SDK integrates several components, both on-chain and off-chain. ## Backend features -### Resilience powered by on-chain data and IPFS storage +### Resilience powered by onchain data and IPFS storage - Critical data (assets, positions, vault deprecations) will be fetched exclusively from the chain / IPFS - maximizing uptime - reducing reliance on other services -- Historical TVL, historical APY and other non critical data will be stored off chain and fetched dinamically. +- Historical TVL, historical APY and other non critical data will be stored offchain and fetched dinamically. -#### On-chain assets and positions +#### Onchain assets and positions -- Lens does what the old off-chain API does, but directly on-chain. This will speed up the fetching time and greatly reduce our reliance on scheduled jobs in servers. +- Lens does what the old offchain API does, but directly onchain. This will speed up the fetching time and greatly reduce our reliance on scheduled jobs in servers. #### IPFS CI/CD for frontend and metadata @@ -65,7 +65,7 @@ Yearn SDK integrates several components, both on-chain and off-chain. - SDK will provide a simple interface for all integrators, including ourselves. - Read methods will seamlessly integrate with all datasources, while keeping coherent datastructures. -- Write methods talk directly to assets on chain. Execution of write transactions will trigger refresh events so data freshness of frontend (or other integration platforms) will still be preserved. +- Write methods talk directly to assets onchain. Execution of write transactions will trigger refresh events so data freshness of frontend (or other integration platforms) will still be preserved. ### Historical User Earnings diff --git a/docs/developers/smart-contracts/deprecated/V3/version-3.0.2/TokenizedStrategy.md b/docs/developers/smart-contracts/deprecated/V3/version-3.0.2/TokenizedStrategy.md index 4451c99511..a63b0d8a4e 100644 --- a/docs/developers/smart-contracts/deprecated/V3/version-3.0.2/TokenizedStrategy.md +++ b/docs/developers/smart-contracts/deprecated/V3/version-3.0.2/TokenizedStrategy.md @@ -172,7 +172,7 @@ deployed and can only be called once for each strategy. This will set all the default storage that must be set for a strategy to function. Any changes can be made post deployment through external calls from `management`. -The function will also emit an event that off chain indexers can +The function will also emit an event that offchain indexers can look for to track any new deployments using this TokenizedStrategy.* ```solidity @@ -427,9 +427,9 @@ function convertToAssets(uint256 shares) external view returns (uint256); ### previewDeposit -Allows an on-chain or off-chain user to simulate +Allows an onchain or offchain user to simulate the effects of their deposit at the current block, given -current on-chain conditions. +current onchain conditions. *This will round down.* @@ -451,9 +451,9 @@ function previewDeposit(uint256 assets) external view returns (uint256); ### previewMint -Allows an on-chain or off-chain user to simulate +Allows an onchain or offchain user to simulate the effects of their mint at the current block, given -current on-chain conditions. +current onchain conditions. *This is used instead of convertToAssets so that it can round up for safer mints.* @@ -476,9 +476,9 @@ function previewMint(uint256 shares) external view returns (uint256); ### previewWithdraw -Allows an on-chain or off-chain user to simulate +Allows an onchain or offchain user to simulate the effects of their withdrawal at the current block, -given current on-chain conditions. +given current onchain conditions. *This is used instead of convertToShares so that it can round up for safer withdraws.* @@ -501,9 +501,9 @@ function previewWithdraw(uint256 assets) external view returns (uint256); ### previewRedeem -Allows an on-chain or off-chain user to simulate +Allows an onchain or offchain user to simulate the effects of their redemption at the current block, -given current on-chain conditions. +given current onchain conditions. *This will round down.* diff --git a/docs/developers/smart-contracts/deprecated/V3/version-3.0.2/periphery/Registry.md b/docs/developers/smart-contracts/deprecated/V3/version-3.0.2/periphery/Registry.md index c8b66fd257..0b3b233a2d 100644 --- a/docs/developers/smart-contracts/deprecated/V3/version-3.0.2/periphery/Registry.md +++ b/docs/developers/smart-contracts/deprecated/V3/version-3.0.2/periphery/Registry.md @@ -8,7 +8,7 @@ **Author:** yearn.finance -Serves as an on chain registry to track any Yearn +Serves as an onchain registry to track any Yearn vaults and strategies that a certain party wants to endorse. Can also be used to deploy new vaults of any specific @@ -192,8 +192,8 @@ Get all endorsed vaults deployed using the Registry. *This will return a nested array of all vaults deployed separated by their underlying asset. -This is only meant for off chain viewing and should not be used during any -on chain tx's.* +This is only meant for offchain viewing and should not be used during any +onchain tx's.* ```solidity function getAllEndorsedVaults() external view virtual returns (address[][] memory allEndorsedVaults); @@ -254,7 +254,7 @@ function newEndorsedVault( |Name|Type|Description| |----|----|-----------| |`_asset`|`address`|The asset that may be deposited into the new Vault.| -|`_name`|`string`|Specify a custom Vault name. .| +|`_name`|`string`|Specify a custom Vault name.| |`_symbol`|`string`|Specify a custom Vault symbol name.| |`_roleManager`|`address`|The address authorized for guardian interactions in the new Vault.| |`_profitMaxUnlockTime`|`uint256`|The time strategy profits will unlock over.| @@ -292,7 +292,7 @@ function newEndorsedVault( |Name|Type|Description| |----|----|-----------| |`_asset`|`address`|The asset that may be deposited into the new Vault.| -|`_name`|`string`|Specify a custom Vault name. .| +|`_name`|`string`|Specify a custom Vault name.| |`_symbol`|`string`|Specify a custom Vault symbol name.| |`_roleManager`|`address`|The address authorized for guardian interactions in the new Vault.| |`_profitMaxUnlockTime`|`uint256`|The time strategy profits will unlock over.| @@ -387,7 +387,7 @@ function _registerVault( Tag a vault with a specific string. *This is available to governance to tag any vault or strategy -on chain if desired to arbitrarily classify any vaults. +onchain if desired to arbitrarily classify any vaults. i.e. Certain ratings ("A") / Vault status ("Shutdown") etc.* ```solidity diff --git a/docs/developers/smart-contracts/deprecated/V3/version-3.0.2/periphery/ReleaseRegistry.md b/docs/developers/smart-contracts/deprecated/V3/version-3.0.2/periphery/ReleaseRegistry.md index 745985d893..09d48da462 100644 --- a/docs/developers/smart-contracts/deprecated/V3/version-3.0.2/periphery/ReleaseRegistry.md +++ b/docs/developers/smart-contracts/deprecated/V3/version-3.0.2/periphery/ReleaseRegistry.md @@ -8,7 +8,7 @@ **Author:** yearn.finance -Used by Yearn Governance to track on chain all +Used by Yearn Governance to track onchain all releases of the V3 vaults by API Version. ## State Variables diff --git a/docs/developers/smart-contracts/deprecated/V3/version-3.0.3/Periphery/Registry.md b/docs/developers/smart-contracts/deprecated/V3/version-3.0.3/Periphery/Registry.md index ac45ffc3a5..a493334e8c 100644 --- a/docs/developers/smart-contracts/deprecated/V3/version-3.0.3/Periphery/Registry.md +++ b/docs/developers/smart-contracts/deprecated/V3/version-3.0.3/Periphery/Registry.md @@ -9,7 +9,7 @@ **Author:** yearn.finance -Serves as an on chain registry to track any Yearn V3 +Serves as an onchain registry to track any Yearn V3 vaults and strategies that a certain party wants to endorse. Can also be used to deploy new vaults of any specific @@ -199,8 +199,8 @@ Get all endorsed vaults deployed using the Registry. *This will return a nested array of all vaults deployed separated by their underlying asset. -This is only meant for off chain viewing and should not be used during any -on chain tx's.* +This is only meant for offchain viewing and should not be used during any +onchain tx's.* ```solidity function getAllEndorsedVaults() external view virtual returns (address[][] memory allEndorsedVaults); @@ -281,7 +281,7 @@ function newEndorsedVault( |Name|Type|Description| |----|----|-----------| |`_asset`|`address`|The asset that may be deposited into the new Vault.| -|`_name`|`string`|Specify a custom Vault name. .| +|`_name`|`string`|Specify a custom Vault name.| |`_symbol`|`string`|Specify a custom Vault symbol name.| |`_roleManager`|`address`|The address authorized for guardian interactions in the new Vault.| |`_profitMaxUnlockTime`|`uint256`|The time strategy profits will unlock over.| @@ -319,7 +319,7 @@ function newEndorsedVault( |Name|Type|Description| |----|----|-----------| |`_asset`|`address`|The asset that may be deposited into the new Vault.| -|`_name`|`string`|Specify a custom Vault name. .| +|`_name`|`string`|Specify a custom Vault name.| |`_symbol`|`string`|Specify a custom Vault symbol name.| |`_roleManager`|`address`|The address authorized for guardian interactions in the new Vault.| |`_profitMaxUnlockTime`|`uint256`|The time strategy profits will unlock over.| @@ -414,7 +414,7 @@ function _registerVault( Tag a vault with a specific string. *This is available to governance to tag any vault or strategy -on chain if desired to arbitrarily classify any vaults. +onchain if desired to arbitrarily classify any vaults. i.e. Certain ratings ("A") / Vault status ("Shutdown") etc.* ```solidity diff --git a/docs/developers/smart-contracts/deprecated/V3/version-3.0.3/Periphery/ReleaseRegistry.md b/docs/developers/smart-contracts/deprecated/V3/version-3.0.3/Periphery/ReleaseRegistry.md index 4120b1809e..9450982998 100644 --- a/docs/developers/smart-contracts/deprecated/V3/version-3.0.3/Periphery/ReleaseRegistry.md +++ b/docs/developers/smart-contracts/deprecated/V3/version-3.0.3/Periphery/ReleaseRegistry.md @@ -9,7 +9,7 @@ **Author:** yearn.finance -Used by Yearn Governance to track on chain all +Used by Yearn Governance to track onchain all releases of the V3 vaults by API Version. ## State Variables diff --git a/docs/developers/smart-contracts/deprecated/V3/version-3.0.3/TokenizedStrategy.md b/docs/developers/smart-contracts/deprecated/V3/version-3.0.3/TokenizedStrategy.md index 94d7d065ab..a52956d579 100644 --- a/docs/developers/smart-contracts/deprecated/V3/version-3.0.3/TokenizedStrategy.md +++ b/docs/developers/smart-contracts/deprecated/V3/version-3.0.3/TokenizedStrategy.md @@ -213,7 +213,7 @@ deployed and can only be called once for each strategy. This will set all the default storage that must be set for a strategy to function. Any changes can be made post deployment through external calls from `management`. -The function will also emit an event that off chain indexers can +The function will also emit an event that offchain indexers can look for to track any new deployments using this TokenizedStrategy.* ```solidity @@ -468,9 +468,9 @@ function convertToAssets(uint256 shares) external view returns (uint256); ### previewDeposit -Allows an on-chain or off-chain user to simulate +Allows an onchain or offchain user to simulate the effects of their deposit at the current block, given -current on-chain conditions. +current onchain conditions. *This will round down.* @@ -492,9 +492,9 @@ function previewDeposit(uint256 assets) external view returns (uint256); ### previewMint -Allows an on-chain or off-chain user to simulate +Allows an onchain or offchain user to simulate the effects of their mint at the current block, given -current on-chain conditions. +current onchain conditions. *This is used instead of convertToAssets so that it can round up for safer mints.* @@ -517,9 +517,9 @@ function previewMint(uint256 shares) external view returns (uint256); ### previewWithdraw -Allows an on-chain or off-chain user to simulate +Allows an onchain or offchain user to simulate the effects of their withdrawal at the current block, -given current on-chain conditions. +given current onchain conditions. *This is used instead of convertToShares so that it can round up for safer withdraws.* @@ -542,9 +542,9 @@ function previewWithdraw(uint256 assets) external view returns (uint256); ### previewRedeem -Allows an on-chain or off-chain user to simulate +Allows an onchain or offchain user to simulate the effects of their redemption at the current block, -given current on-chain conditions. +given current onchain conditions. *This will round down.* diff --git a/docs/developers/v2/DEPLOYMENT.md b/docs/developers/v2/DEPLOYMENT.md index ad25266d3f..cda96a67c1 100644 --- a/docs/developers/v2/DEPLOYMENT.md +++ b/docs/developers/v2/DEPLOYMENT.md @@ -21,7 +21,7 @@ The below instructions show some python commands that assume you are using the b - Set Treasury (`treasury.ychad.eth`) as the rewards address. - Set Core Dev multisig (`dev.ychad.eth`) as guardian. - Set Strategist multisig (`brain.ychad.eth`) as management. - - Set name and symbol for vault or use suggested as default (can be changed on-chain later). + - Set name and symbol for vault or use suggested as default (can be changed onchain later). 8. Confirm the Parameters are correct and press `y` and ENTER to deploy the vault. 9. Check new vault has ABI setup on Etherscan (Some vault versions from older releases may have verification issues with Vyper and proxy detection on Etherscan, consider using later releases >0.3.5 to ensure verification works). @@ -148,7 +148,7 @@ In addition to the two strategist reviews, a Core Developer has to review the st - Set Treasury (`treasury.ychad.eth`) as the rewards address. - Set Core Dev multisig (`dev.ychad.eth`) as guardian. - Set Strategist multisig (`brain.ychad.eth`) as management. - - Set description and symbol for vault or use suggested as default (can be changed on-chain later) + - Set description and symbol for vault or use suggested as default (can be changed onchain later) 5. Yearn's governance now must accept this vault's governance and endorse it: @@ -229,9 +229,9 @@ These are the standard deposit limits per stage, and they can be adjusted on a c Since the v0.4.3 release, we have introduced the concept of Health Checks contracts to vaults and strategies. These are helper contracts that can validate the end state of a harvest, or critical transaction, to ensure the accounting stays within established safe parameters. -You can think of these contracts as on-chain unit tests, or "self asserts", ensuring that the end state of a critical transaction matches an expected condition. The design allows health checks to be configured per individual vault or strategy. If the "assert" doesn't match expectations, the entire transaction will revert and require manual intervention by strategists or core devs. +You can think of these contracts as onchain unit tests, or "self asserts", ensuring that the end state of a critical transaction matches an expected condition. The design allows health checks to be configured per individual vault or strategy. If the "assert" doesn't match expectations, the entire transaction will revert and require manual intervention by strategists or core devs. -Vaults from release v0.4.3 and onward, support attaching an on-chain health check contract to be called after every harvest report. +Vaults from release v0.4.3 and onward, support attaching an onchain health check contract to be called after every harvest report. ## Note on Health Checks Backward Compatibility @@ -258,7 +258,7 @@ strategy.setHealthCheck(commonHealthCheck) A global setting check against deviations in reported profit and losses within a safe interval. Any report/harvest that falls outside this global safe interval will report. -If a harvest/report revert transaction is detected on-chain, manual intervention is required to debug and accept the transaction into the vaults accounting. This should be done after proper validation by the strategist's multi-sig and Core Devs group. +If a harvest/report revert transaction is detected onchain, manual intervention is required to debug and accept the transaction into the vaults accounting. This should be done after proper validation by the strategist's multi-sig and Core Devs group. Disabling health checks is meant to be a one-time special event using the following steps: diff --git a/docs/developers/v2/SPECIFICATION.md b/docs/developers/v2/SPECIFICATION.md index acbd976388..811dfc0880 100644 --- a/docs/developers/v2/SPECIFICATION.md +++ b/docs/developers/v2/SPECIFICATION.md @@ -7,7 +7,7 @@ - Vault: Only user touch-point, manages funds - Strategy: Complex external interactions w/ limited access to Vault - Strategist: original creator of strategy, is in charge of monitoring its position for adverse effects. -- Registry: On-chain registry of deployed Vaults for tokens, indexed by API version +- Registry: Onchain registry of deployed Vaults for tokens, indexed by API version ## Vault Specification @@ -54,7 +54,7 @@ The vault doesn’t rely on oracle because it doesn’t require a price informat ### Emergency Shutdown Mode -NOTE: During Emergency Shutdown mode of the Vault, the intention is for the Vault to recall the debt as quickly as reasonable (given on-chain conditions) with minimal losses, and open up deposits to be withdrawn by Users as easily as possible. There is no restrictions on withdrawals above what is expected under Normal Operation. +NOTE: During Emergency Shutdown mode of the Vault, the intention is for the Vault to recall the debt as quickly as reasonable (given onchain conditions) with minimal losses, and open up deposits to be withdrawn by Users as easily as possible. There is no restrictions on withdrawals above what is expected under Normal Operation. 1. During Emergency Shutdown, no Users may deposit into the Vault. 1. During Emergency Shutdown, Governance cannot add new Strategies. @@ -92,7 +92,7 @@ NOTE: In this mode, the Strategy defines a reversionary set of actions that seek ### Normal Operation -NOTE: The Registry allows an on-chain reference for Vault deployment events, to be used with external integrations. It is also possible to reconstruct the deployment and release history via on-chain calls. +NOTE: The Registry allows an onchain reference for Vault deployment events, to be used with external integrations. It is also possible to reconstruct the deployment and release history via onchain calls. NOTE: The API version of each Vault deployment for a token should increase according to [Semantic Versioning](https://semver.org/). However, this is not practically enforced. diff --git a/docs/developers/v2/hacking-with-yearn.md b/docs/developers/v2/hacking-with-yearn.md index 849ffc0f47..eccf6f1b87 100644 --- a/docs/developers/v2/hacking-with-yearn.md +++ b/docs/developers/v2/hacking-with-yearn.md @@ -43,7 +43,7 @@ Make sure to switch your wallet provider to the appropriate testnet network in o Testnet networks are different environments from mainnet and simulate real use cases for development, testing or production. The assets on a testnet are not “real,” meaning that they cannot be withdrawn to your wallet for any real economic value. -Testing is possible through Ethereum Rinkeby +Testing is possible through Ethereum Sepolia **Steps**: - Deploy your vault with your own token @@ -58,12 +58,12 @@ When accessing each testnet, you will need to use its own native asset token. - Go to https://hack.yearn.fi/ - Switch to the testnet you wish to utilize over your wallet provider - Make sure to have the native asset for the specific network -- Get some tokens from the test client faucet (Ethereum Rinkeby https://faucet.rinkeby.io/) +- Get some tokens from the test client faucet (Ethereum Sepolia https://sepoliafaucet.com/) Make sure to select the correct market in the top right corner. You can find this on the left side of the address. Select the token you need and submit the faucet transaction but be mindful to make sure that you have certain amount of the native asset of the testnet you wish to transact on. #### How do I select a supported testnet? -First, be sure to check if your wallet provider allows you to switch to testnet. Some providers, such as the Metamask extension, display the network selection on top of the menu over the extension and, in the case of mobile Metamask, above the wallet section. It’s important to always do your research for compatible wallets with compatible networks. +First, be sure to check if your wallet provider allows you to switch to testnet. Some providers, such as the MetaMask extension, display the network selection on top of the menu over the extension and, in the case of mobile MetaMask, above the wallet section. It’s important to always do your research for compatible wallets with compatible networks. #### Additional Resources * Workshop: Building and Integrating with Yearn Vaults: https://www.youtube.com/watch?v=urC35PMbpJ4 @@ -73,7 +73,7 @@ First, be sure to check if your wallet provider allows you to switch to testnet. # Frontend Integrations -Yearn uses a JavaScript SDK for formatting protocol data and generating transactions for reading/writing protocol data. Yearn SDK integrates several components, both on-chain and off-chain. +Yearn uses a JavaScript SDK for formatting protocol data and generating transactions for reading/writing protocol data. Yearn SDK integrates several components, both onchain and offchain. [The repository here](https://github.com/turtlemoji/yearn-sdk-examples) contains a live preview and example usage of the Yearn SDK. Explore this codebase to learn how to start interacting with the Yearn protocol in your own app. @@ -98,7 +98,7 @@ By having a strategy, users only need to deposit single assets and let the strat # Data Analysis -Yearn aims to provide more insights into our products to our customers and partners through analyzing the on-chain and off-chain data. Given that all Yearn protocol data is publicly stored on-chain, there are lots of insights to be gained from analyzing these transactions. +Yearn aims to provide more insights into our products to our customers and partners through analyzing the onchain and offchain data. Given that all Yearn protocol data is publicly stored onchain, there are lots of insights to be gained from analyzing these transactions. ## Some of the research questions that we are interested in: * Screening profitable liquidity pools for our strategies diff --git a/docs/developers/v2/yswaps.md b/docs/developers/v2/yswaps.md index 6a06806e06..2836088ee9 100644 --- a/docs/developers/v2/yswaps.md +++ b/docs/developers/v2/yswaps.md @@ -1,6 +1,6 @@ # ySwaps -*This document contain links to private repositories that might not be publicly available* +*This document contains links to private repositories that might not be publicly available* ySwaps is used to **abstract** the token trading logic from the strategies harvest method, which means strategies can focus on farming tokens and don't have to handle tokens trading logic and paths. The "swappers" smart contracts allows trading optimizations and new paths to be added since the code is not hardcoded in strategies. @@ -30,26 +30,26 @@ ySwaps is used to **abstract** the token trading logic from the strategies harve ### Swappers -Contracts in charge of making the swaps (uniswap, balancer, sushiswap, solidly and more). We can separated them in two types: +Contracts in charge of making the swaps (uniswap, balancer, sushiswap, solidly and more). We can separate them in two types: #### Single swapper -Uniswap, balancer, sushiswap, etc. These are straightforward contracts that will make a simple swap on these dexes (`token A` to `token B`). It is also worth to mention that these swappers take care of few extra stuff like: `approval needed to make the swap`, `transfering final tokens to strategy if needed`. +Uniswap, balancer, sushiswap, etc. These are straightforward contracts that will make a simple swap on these dexes (`token A` to `token B`). It is also worth to mention that these swappers take care of few extra stuff like: `approval needed to make the swap`, `transferring final tokens to strategy if needed`. #### Multicall swapper -This contract will receive a bundle of transactions that are required to acquire the wanted token/tokens. This is used in specific cases where trade can not be made in a normal exchange due to liquidity issues, dex not having that token or route, needing extra steps to aquire the token such as depositing or withdrawing, and more. It is important to mention that this swapper does NOT take care of things like approvals, or transfers (important difference with `single swappers`). +This contract will receive a bundle of transactions that are required to acquire the wanted token/tokens. This is used in specific cases where trade can not be made in a normal exchange due to liquidity issues, dex not having that token or route, needing extra steps to acquire the token such as depositing or withdrawing, and more. It is important to mention that this swapper does NOT take care of things like approvals, or transfers (important difference with `single swappers`). #### Swappers Usage -**Single swapper example:** We have `tokenIn` and `tokenOut` and we know that we can go straight to sushiswap that has enought liquidity to make the trade with good conditions. +**Single swapper example:** We have `tokenIn` and `tokenOut` and we know that we can go straight to sushiswap that has enough liquidity to make the trade with good conditions. -**Multicall example:** We have a `tokenIn` and we want a `tokenOut`. But theres no path on any dex to do the trade directly, so we need to split the swap in two steps: +**Multicall example:** We have a `tokenIn` and we want a `tokenOut`. But there's no path on any dex to do the trade directly, so we need to split the swap in two steps: 1. Step 1: `tokenIn` for `hopToken`. 2. Step 2: `hopToken` for `tokenOut`. -For this example we are gonna assume that we will need to use two different dexes for each step. Since we are gonna split the trade in two different transactions and the main objective is to use TWO DIFFERENT dexes, this is where we use the `Multicall Swapper`.Everything that requires more than just a single swap tx, will use multicall dexes. +For this example we are gonna assume that we will need to use two different dexes for each step. Since we are gonna split the trade in two different transactions and the main objective is to use TWO DIFFERENT dexes, this is where we use the `Multicall Swapper`. Everything that requires more than just a single swap tx, will use multicall dexes. #### Swapper Contracts (version 0.2.0) @@ -76,9 +76,9 @@ For this example we are gonna assume that we will need to use two different dexe - This contract has the `enabled trades` that each strategy can make. Enabled trades are just a list of possible swaps that a strategy can make. So it only contains three variables: `strategyAddress`, `tokenIn`, `tokenOut`. We have these enabled trades to know which swaps can/should be made with each strategy. -- This contract is also in changer of verifying the trades. To do that it will use the different `execute` methods in it and call the `swapper contracts` that needs to use. Remember that `swappers` are the contracts responsible to making the actual swap. +- This contract is also in charge of verifying the trades. To do that it will use the different `execute` methods in it and call the `swapper contracts` that need to be used. Remember that `swappers` are the contracts responsible for making the actual swap. -- When we execute the swap its important to point out that this takes care of: `transfering tokenIn from strat to swapper`, `make final the check if the amount received > minAmountOut`. +- When we execute the swap its important to point out that this takes care of: `transferring tokenIn from strat to swapper`, `make final the check if the amount received > minAmountOut`. #### Trade Factory Contracts (version 0.2.0) @@ -94,7 +94,7 @@ For this example we are gonna assume that we will need to use two different dexe Scripts in charge of providing the swap transaction that will be used and sent to `Trade Factory contract`. -- **Custom solvers**: There are custom solvers for specific cases/strategies that will need to make multiple transactions for a specific swap. Each of these scripts aims to an specific strategy and trade that needs to be made. Some examples (`ThreePoolCrvMulticall.ts`). This is for specific strategies's trades that will need to swap tokens that can not be swaped/resolved on a single dex swap. The tx provided by this solver is gonna be used with the `Multicall swapper`. +- **Custom solvers**: There are custom solvers for specific cases/strategies that will need to make multiple transactions for a specific swap. Each of these scripts aims at a specific strategy and trade that needs to be made. Some examples (`ThreePoolCrvMulticall.ts`). This is for specific strategies' trades that will need to swap tokens that can not be swapped/resolved on a single dex swap. The tx provided by this solver is gonna be used with the `Multicall swapper`. - **Dexes solvers**: this script is used for situations where the trade can be resolved with a normal swap on an exchange and does NOT require multiple tx to ensure the trade is possible. Different to `Custom Solvers`, this can be used in a generic way for different strategies/swaps. This script checks with every DeX and chooses the best one to make the trade. The tx provided by this solver is gonna be used with the `Single swapper`. diff --git a/docs/developers/v3/Integrating_v3.md b/docs/developers/v3/Integrating_v3.md index 19d60691e8..e87bea5f94 100644 --- a/docs/developers/v3/Integrating_v3.md +++ b/docs/developers/v3/Integrating_v3.md @@ -69,9 +69,9 @@ The max amount that a vault will allow an address to redeem/withdraw can be retu Generic pricing of vault tokens can be done using the standard 4626 [`convertToShares`](https://eips.ethereum.org/EIPS/eip-4626#converttoshares) and [`convertToAssets`](https://eips.ethereum.org/EIPS/eip-4626#converttoassets) functions. -While Yearn takes great care to try and prevent manipulation of the conversion functions, it is important to know that there are some security considerations if using these functions on chain as part of another protocol. +While Yearn takes great care to try and prevent manipulation of the conversion functions, it is important to know that there are some security considerations if using these functions onchain as part of another protocol. -V3 vaults also contain the legacy `pricePerShare` function from the V2 Vaults implementation. However, this is intended as a simple off-chain helper and should not be used for on chain integrations due to precision loss. +V3 vaults also contain the legacy `pricePerShare` function from the V2 Vaults implementation. However, this is intended as a simple offchain helper and should not be used for onchain integrations due to precision loss. ## Periphery diff --git a/docs/developers/v3/overview.md b/docs/developers/v3/overview.md index 35d94b0fb1..f4770ba6d7 100644 --- a/docs/developers/v3/overview.md +++ b/docs/developers/v3/overview.md @@ -30,7 +30,7 @@ A few examples of periphery contracts used in V3 are: - **Accountant**: Handles changing fees for vault operations. - **Deposit/Withdraw Limit Modules**: Allows dynamic control over a vaults deposit or withdraw limits for full customization. - **Swappers**: Pre-built contracts for strategies to inherit to easily implement their desired swap logic. -- **APR Oracles**: Retrieve the expected current APY on-chain for different vaults or strategies to properly allocate debt. +- **APR Oracles**: Retrieve the expected current APY onchain for different vaults or strategies to properly allocate debt. - And any others you can come up with! To read more about the periphery contracts or where to find the current versions click [here](./periphery.md) @@ -54,5 +54,5 @@ To find deployed contracts see [Contract Addresses](/developers/addresses/v3-con [Tokenized Strategy GitHub Repo](https://github.com/yearn/tokenized-strategy) [Tokenized Strategy Specification](https://github.com/yearn/tokenized-strategy/blob/master/SPECIFICATION.md) [V3 Design Article](https://medium.com/iearn/yearnv3-motivation-and-design-107840cb4844) -[ERC4626 Info](https://erc4626.info/) -[ERC4626 EIP](https://eips.ethereum.org/EIPS/eip-4626) +[ERC-4626 Info](https://erc4626.info/) +[ERC-4626 EIP](https://eips.ethereum.org/EIPS/eip-4626) diff --git a/docs/developers/v3/periphery.md b/docs/developers/v3/periphery.md index ca9f3338ed..8f48c0ccad 100644 --- a/docs/developers/v3/periphery.md +++ b/docs/developers/v3/periphery.md @@ -9,7 +9,7 @@ For the most updated contracts visit: - Vault Periphery Repo: https://github.com/yearn/vault-periphery - TokenizedStrategy Periphery: https://github.com/yearn/tokenized-strategy-periphery -The deployed address of most periphery contracts or their corresponding factories can be found on chain from the Protocol Address provider: `0x775F09d6f3c8D2182DFA8bce8628acf51105653c` +The deployed address of most periphery contracts or their corresponding factories can be found onchain from the Protocol Address provider: `0x775F09d6f3c8D2182DFA8bce8628acf51105653c` The Yearn-specific periphery contracts can be retrieved from the relevant chain's [Role Manager](/developers/smart-contracts/V3/Periphery/RoleManager) @@ -75,6 +75,6 @@ https://github.com/yearn/vault-periphery/blob/master/contracts/Managers/RoleMana The Role Manager is used to hold the `role_manager` position in Yearns multi strategy vaults and make deployments simpler. All role configuration and periphery contracts are set up during the vaults deployment. -Yearn specific periphery contracts can also all be retrieved on chain from the Role Manager on that chain. +Yearn specific periphery contracts can also all be retrieved onchain from the Role Manager on that chain. For Yearn specific implementation addresses check [Contract Addresses](/developers/addresses/) diff --git a/docs/developers/v3/strategy_writing_guide.md b/docs/developers/v3/strategy_writing_guide.md index d2c689bb29..3668570f80 100644 --- a/docs/developers/v3/strategy_writing_guide.md +++ b/docs/developers/v3/strategy_writing_guide.md @@ -29,10 +29,10 @@ This increased functionality not only means strategies have a much larger potent ## Definitions - [Strategy](https://github.com/yearn/tokenized-strategy) : A strategy or "Tokenized Strategy" in V3 refers to an ERC-4626 compliant contract that utilizes the [TokenizedStrategy](https://github.com/yearn/tokenized-strategy/blob/master/src/TokenizedStrategy.sol) pattern that either allocator vaults or individual users can deposit directly into and receive shares in return. The strategy takes the underlying asset and deploys it in a single source in order to generate yield on that asset. -- Vault: Or "Allocator Vault" is a Yearn ERC4626 compliant Smart contract that receives assets from Depositors to distribute among the different Strategies added to the vault, managing accounting and asset distribution. +- Vault: Or "Allocator Vault" is a Yearn ERC-4626 compliant Smart contract that receives assets from Depositors to distribute among the different Strategies added to the vault, managing accounting and asset distribution. - Asset: Any ERC20-compliant token - Shares: ERC20-compliant token that tracks the asset balance in the strategy for every depositor. -- [TokenizedStrategy.sol](https://github.com/yearn/tokenized-strategy/blob/master/src/TokenizedStrategy.sol): The implementation contract that all strategies delegateCall to for the standard ERC4626 and profit locking functions. +- [TokenizedStrategy.sol](https://github.com/yearn/tokenized-strategy/blob/master/src/TokenizedStrategy.sol): The implementation contract that all strategies delegateCall to for the standard ERC-4626 and profit locking functions. - [BaseStrategy.sol](https://github.com/yearn/tokenized-strategy/blob/master/src/BaseStrategy.sol): The abstract contract that a strategy should inherit from that handles all communication with the Tokenized Strategy contract. - Strategist: The developer of a specific strategy. - Depositor: Account that deposits the asset and holds Shares @@ -294,7 +294,7 @@ function availableDepositLimit( function _tend(uint256 _totalIdle) internal override { if (currentLTV() < targetLTV()) { _leverUp(_totalIdle); - } else if (currentLTV > warningLTV()) { + } else if (currentLTV() > warningLTV()) { _leverDown(_totalIdle); } } diff --git a/docs/developers/v3/yield_accrual.md b/docs/developers/v3/yield_accrual.md index e58a1a0bc0..89a6b02bc5 100644 --- a/docs/developers/v3/yield_accrual.md +++ b/docs/developers/v3/yield_accrual.md @@ -4,7 +4,7 @@ This page describes how yield accrues and is accounted in Yearn V3. Yield can ac ## Overview -1. Yield accrues off-chain or in external protocols. This changes the strategy's real holdings but not its recorded accounting. +1. Yield accrues offchain or in external protocols. This changes the strategy's real holdings but not its recorded accounting. 2. `strategy.report()` is called by a keeper or management. The strategy harvests, computes a total asset value, and updates internal accounting. 3. `vault.process_report(strategy)` is called by the vault’s reporting manager. The vault reads the strategy’s ERC-4626 value and realizes gain or loss against its recorded debt, charging fees and locking profits at the vault level. diff --git a/docs/developers/wallet-integration.md b/docs/developers/wallet-integration.md index 3ccaf36c08..7b6d367bd6 100644 --- a/docs/developers/wallet-integration.md +++ b/docs/developers/wallet-integration.md @@ -64,7 +64,7 @@ The above query will retrieve all vaults from Kong with the following fields for - `apy` (the current APY of the vault. There are other ways to get APY we will discuss below). - `pricePerShare` (the current price per Vault Share) -The returned list of vaults will include all v2 and v3 vaults as well as many popular ERC4626 vaults deployed on ethereum and other L2s. If you want to limit your result to just endorsed vaults, you will need to filter the resulting object on the `yearn` boolean. +The returned list of vaults will include all v2 and v3 vaults as well as many popular ERC-4626 vaults deployed on ethereum and other L2s. If you want to limit your result to just endorsed vaults, you will need to filter the resulting object on the `yearn` boolean. ```js title="Example pseudo-code" const filterYearnVaults = (vaults) => @@ -207,7 +207,7 @@ Additional vault data can then be found by calling the respective read functions ## Vault Prices -Now that you have the vaults, you are going to need to price them. Yearn vaults use the standard ERC4626 vault share pattern where depositors receive a number of vault shares when they deposit that represent their share of the pool total. As yield is harvested and returned to the vault, the vault share values increase and the underlying value of tokens the user can withdraw also increases. +Now that you have the vaults, you are going to need to price them. Yearn vaults use the standard ERC-4626 vault share pattern where depositors receive a number of vault shares when they deposit that represent their share of the pool total. As yield is harvested and returned to the vault, the vault share values increase and the underlying value of tokens the user can withdraw also increases. To get the value of a deposit into a vault, you need to multiply the number of vault shares held by the user (or contract) by the price per share. All Yearn vault contracts have a `pricePerShare()` read function that is denominated in the underlying asset and can be called to get the price per share. @@ -283,7 +283,7 @@ The above query will need to be made with variables passed into it The above query will give daily values for the `weeklyAPY` value for a chosen vault. -## Calculating APRs from on-chain APR Oracles +## Calculating APRs from onchain APR Oracles :::info diff --git a/docs/developers/yvusd/cross-chain-strategies.md b/docs/developers/yvusd/cross-chain-strategies.md index 386b7eeb6d..56e5bdb079 100644 --- a/docs/developers/yvusd/cross-chain-strategies.md +++ b/docs/developers/yvusd/cross-chain-strategies.md @@ -22,7 +22,7 @@ The Origin Strategy is a standard Yearn V3 tokenized strategy deployed on Ethere ## Discovering Destinations (Onchain) -The yvUSD vault does not store a list of destination-chain addresses. Instead, yvUSD allocates to **origin-chain strategies**, and each cross-chain strategy contains its own destination configuration as queryable public immutables. +The yvUSD vault does not store a list of destinationchain addresses. Instead, yvUSD allocates to **origin-chain strategies**, and each cross-chain strategy contains its own destination configuration as queryable public immutables. Not all yvUSD strategies are cross-chain. The vault can also hold mainnet-only strategies (for example, Morpho-based looper strategies that deploy capital without bridging). Cross-chain strategies can be identified because a set of `REMOTE_*` public immutables that mainnet strategies do not have. diff --git a/docs/getting-started/guides/user-faq.md b/docs/getting-started/guides/user-faq.md index 0a9da3132d..e843d990b3 100644 --- a/docs/getting-started/guides/user-faq.md +++ b/docs/getting-started/guides/user-faq.md @@ -38,7 +38,7 @@ If you don't have veYFI, you can deposit and stake your tokens using liquid lock Read more about the current governance staking system on the [stYFI page](/contributing/governance/styfi). Legacy veYFI/dYFI docs are still available under [veYFI (Deprecated)](/contributing/governance/veYFI-intro). -And remember, you have to consider transaction costs when using Yearn. If using Ethereum mainnet, prices for transactions vary from a few dollars to tens or hundreds of dollars, depending on chain congestion (Yearn has no control over this). If you are depositing lower amounts (\<$500-1000), you may want to consider using Yearn on an L2 so fees don't negate your interest earned. +And remember, you have to consider transaction costs when using Yearn. If using Ethereum mainnet, prices for transactions vary from a few dollars to tens or hundreds of dollars, depending onchain congestion (Yearn has no control over this). If you are depositing lower amounts (\<$500-1000), you may want to consider using Yearn on an L2 so fees don't negate your interest earned. diff --git a/docs/getting-started/products/curating/introduction.md b/docs/getting-started/products/curating/introduction.md index 88808be40e..876d52e1c0 100644 --- a/docs/getting-started/products/curating/introduction.md +++ b/docs/getting-started/products/curating/introduction.md @@ -20,17 +20,17 @@ We sort our vaults into three risk tiers: This is the most important thing we do. Choosing which markets to support and how much to send to each directly impacts the vault’s risk and its APY. -We don’t just guess! We use on-chain data and simulations to calculate how these markets perform. The simulations look at market liquidity, asset liquidity, defined caps, and more. Based on this, we can take a few actions: +We don’t just guess! We use onchain data and simulations to calculate how these markets perform. The simulations look at market liquidity, asset liquidity, defined caps, and more. Based on this, we can take a few actions: - **Adding New Markets**: When we find a good, safe market that fits the vault’s risk level, we can add it in. - **Tweaking Allocations**: Markets change! We constantly watch them and shift funds around to keep the vault optimized for the best risk-adjusted yield. Our automated systems check this hourly and reallocate if the potential APY boost is worth the gas cost. To avoid extremely high utilization, the optimization always targets a max of 95% utilization. This keeps the system liquid while still maintaining strong yield performance. -- **Setting Supply Caps**: We limit how much of the vault’s total funds can go into any single market. This prevents putting too many eggs in one basket. These caps aren’t static; they’re adjusted based on real-time on-chain liquidity and how close borrowers are to being liquidated. If slippage (the price impact of selling collateral during liquidations) looks high, we will lower the cap for that market. +- **Setting Supply Caps**: We limit how much of the vault’s total funds can go into any single market. This prevents putting too many eggs in one basket. These caps aren’t static; they’re adjusted based on real-time onchain liquidity and how close borrowers are to being liquidated. If slippage (the price impact of selling collateral during liquidations) looks high, we will lower the cap for that market. ## Keeping Things Running Smoothly Once a vault is set up, the job isn’t done. Market conditions, borrowing demand, and risks can change fast, so we’re always monitoring and ready to make adjustments. -- **Playing it Safe**: We constantly check on-chain liquidity on DEXs for potential liquidation capacity and monitor borrower health on the Morpho market. We evaluate the collateral of risky positions and compare it with available on-chain DEX liquidity to adjust the cap accordingly. We also aim to avoid overly utilized markets to ensure there’s always some breathing room for withdrawals. +- **Playing it Safe**: We constantly check onchain liquidity on DEXs for potential liquidation capacity and monitor borrower health on the Morpho market. We evaluate the collateral of risky positions and compare it with available onchain DEX liquidity to adjust the cap accordingly. We also aim to avoid overly utilized markets to ensure there’s always some breathing room for withdrawals. - **Yield Optimization**: We analyze which markets are offering the best returns for their risk level and shift funds accordingly. Our goal is always the best risk-adjusted yield, not just the highest yield. And we use our models to predict how yield might change based on time market allocation. Our strategy boils down to deeply understanding and managing risk. We use: @@ -38,7 +38,7 @@ Our strategy boils down to deeply understanding and managing risk. We use: - Frequent Data Checks: Looking at liquidity, volatility, potential slippage, risky positions. - Automated Optimization: Our tools constantly work to find the best allocations and adjust safety caps. - Sensible Guardrails: A 72-hour time-lock for major changes gives everyone time to react if needed, and specific roles (Guardian, Reallocator, Owner) ensure actions are taken by the right parties with the right permissions. -- Monitoring: We monitor assets and protocols that we use. From governance decisions to contract upgrades, on-chain liquidity to borrower health on the lending market, and other key risk factors. +- Monitoring: We monitor assets and protocols that we use. From governance decisions to contract upgrades, onchain liquidity to borrower health on the lending market, and other key risk factors. By combining automated optimization with careful, real-time monitoring and a risk-first mindset, we aim to provide curated lending vaults that are both high-performing and aligned with Yearn’s safety standards. This means Yearn users can confidently use these vaults, and lending market users get access to expertly managed options. @@ -55,9 +55,9 @@ Capabilities include: - Bad Debt Monitoring: Tracking protocol bad debt levels, often using external data sources like [Risk DAO](https://github.com/Risk-DAO/simulation-results), alerting if [thresholds are breached](https://github.com/yearn/monitoring-scripts-py/blob/main/bad-debt/bad-debt-trigger.py). - Market Utilization: Monitoring asset utilization rates in lending markets and sending alerts when utilization approaches critical levels. - Supply Caps: Calculating supply caps multiple times a day and alerting if the cap is too high and should be lowered. We don't immediately lower the supply cap in Morpho contracts, but we lower it in our internal reallocation configuration. This allows us to keep the vault's allocation below calculated caps and set higher caps if the market gets healthier without waiting for the 3-day timelock delay. If the caps remain high over a long period of time, we will lower the cap in the Morpho contracts to ensure maximum safety. -- Collateral Liquidity: Calculating liquidity multiple times a day to verify that collaterals backing risky borrowing positions have enough on-chain liquidity. This assures smooth liquidations for the borrowed asset without slippage, and minimizes the risk that a position becomes unprofitable to liquidate and lead to bad debt in lending vaults. +- Collateral Liquidity: Calculating liquidity multiple times a day to verify that collaterals backing risky borrowing positions have enough onchain liquidity. This assures smooth liquidations for the borrowed asset without slippage, and minimizes the risk that a position becomes unprofitable to liquidate and lead to bad debt in lending vaults. -Alerts are primarily delivered via Telegram, triggered by scheduled GitHub Actions running Python scripts or real-time Tenderly alerts based on on-chain events. +Alerts are primarily delivered via Telegram, triggered by scheduled GitHub Actions running Python scripts or real-time Tenderly alerts based on onchain events. For more details, check our [GitHub monitoring repository](https://github.com/yearn/monitoring-scripts-py) and [detailed documentation generated by DeepWiki](https://deepwiki.com/yearn/monitoring-scripts-py/). This is only part of our monitoring stack that we have open sourced. diff --git a/docs/getting-started/products/curating/term-curating.md b/docs/getting-started/products/curating/term-curating.md index 52368a037a..af4e098d76 100644 --- a/docs/getting-started/products/curating/term-curating.md +++ b/docs/getting-started/products/curating/term-curating.md @@ -2,7 +2,7 @@ ![image](/img/curating/term.jpg) -Term Finance enables noncustodial, fixed-rate over-collateralized lending on-chain. Yearn-curated Term Vaults take the deposited underlying asset and allocate it into a Yearn v3 allocator or a single-strategy vault. When a borrower requests funds, the requested amount is withdrawn from the underlying Yearn vault. The borrowing rate is targeted to be at least 1-2% more than the 30-day average APY of the Yearn vault where the funds are deposited. This design ensures that Term Vault depositors always earn at least the base yield provided by Yearn v3 vaults. +Term Finance enables noncustodial, fixed-rate over-collateralized lending onchain. Yearn-curated Term Vaults take the deposited underlying asset and allocate it into a Yearn V3 allocator or a single-strategy vault. When a borrower requests funds, the requested amount is withdrawn from the underlying Yearn vault. The borrowing rate is targeted to be at least 1-2% more than the 30-day average APY of the Yearn vault where the funds are deposited. This design ensures that Term Vault depositors always earn at least the base yield provided by Yearn V3 vaults. ## Live Vaults diff --git a/docs/getting-started/products/ylockers/ycrv/overview.md b/docs/getting-started/products/ylockers/ycrv/overview.md index 0c5598dddf..44f1fdc04a 100644 --- a/docs/getting-started/products/ylockers/ycrv/overview.md +++ b/docs/getting-started/products/ylockers/ycrv/overview.md @@ -23,7 +23,7 @@ If you have CRV tokens, you can convert them to yCRV either by minting yCRV at a ## Earn Yield on yCRV -Yearn has 2 ways to earn yield on your yCRV; depositing to the `YearnBoostedStaker` contract to earn crvUSD or depositing to the yCRV Auto-Compounder vault (yvyCRV) to earn more yCRV. The Differences and details are documented [here](/getting-started/products/ylockers/overview). Once you know which path you want to take, you can follow the step by step guide [here](/getting-started/products/ylockers/ycrv/ycrv-guide). +Yearn has 2 ways to earn yield on your yCRV; depositing to the `YearnBoostedStaker` contract to earn crvUSD or depositing to the yCRV Auto-Compounder vault (yvyCRV) to earn more yCRV. The differences and details are documented [here](/getting-started/products/ylockers/overview). Once you know which path you want to take, you can follow the step by step guide [here](/getting-started/products/ylockers/ycrv/ycrv-guide). :::info diff --git a/docs/getting-started/products/ylockers/ycrv/ycrv-guide.md b/docs/getting-started/products/ylockers/ycrv/ycrv-guide.md index 2816424a5e..6b55c69db6 100644 --- a/docs/getting-started/products/ylockers/ycrv/ycrv-guide.md +++ b/docs/getting-started/products/ylockers/ycrv/ycrv-guide.md @@ -61,7 +61,7 @@ You can view the $ value of your claimable rewards in this tab, as well as the a As the vault earns yield, the price of your vault tokens will increase as there is more underlying crvUSD in the vault for you to redeem upon withdrawal. For example, 100 yvcrvUSD-A could represent 150 crvUSD (~$150.00), dependent on the total cumulative earnings of the vault. -Your crvUSD rewards accrue week over week and are never lost if unclaimed. To claim them to your wallet, all you need to do is click "Claim All" and confirm the transaction . +Your crvUSD rewards accrue week over week and are never lost if unclaimed. To claim them to your wallet, all you need to do is click "Claim All" and confirm the transaction. ### 4. Get yCRV diff --git a/docs/getting-started/products/ylockers/yyb/yyb-guide.md b/docs/getting-started/products/ylockers/yyb/yyb-guide.md index 804c8bb73e..5cdca8efe2 100644 --- a/docs/getting-started/products/ylockers/yyb/yyb-guide.md +++ b/docs/getting-started/products/ylockers/yyb/yyb-guide.md @@ -58,7 +58,7 @@ You can view the $ value of your claimable rewards in this tab, as well as the a As the vault earns yield, the price of your vault tokens will increase as there is more underlying crvUSD in the vault for you to redeem upon withdrawal. For example, 100 yvcrvUSD-2 could represent 150 crvUSD (~$150.00), dependent on the total cumulative earnings of the vault. -Your crvUSD rewards accrue week over week and are never lost if unclaimed. To claim them to your wallet, all you need to do is click "Claim All" and confirm the transaction . +Your crvUSD rewards accrue week over week and are never lost if unclaimed. To claim them to your wallet, all you need to do is click "Claim All" and confirm the transaction. ### 4. Get yYB