From c34ca88d2f80b64772693f38424051dbf2b30c31 Mon Sep 17 00:00:00 2001 From: Noah Litvin <335975+noahlitvin@users.noreply.github.com> Date: Mon, 9 Oct 2023 13:35:43 -0400 Subject: [PATCH 1/2] init --- content/sips/sip-344.md | 53 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 content/sips/sip-344.md diff --git a/content/sips/sip-344.md b/content/sips/sip-344.md new file mode 100644 index 000000000..a89fc786e --- /dev/null +++ b/content/sips/sip-344.md @@ -0,0 +1,53 @@ +--- +sip: 343 +network: Ethereum & Optimism +title: Collateral Delegation Caps +author: Noah Litvin (@noahlitvin) +status: Draft +created: 2023-10-09 +type: Governance +--- + +## Simple Summary + +The SIP proposes an SCCP-configurable parameter that sets a nominal, maximum amount of each type of collateral that can be delegated to all pools across a deployment. + +## Motivation + +[SIP-333](https://github.com/Synthetixio/SIPs/blob/master/SIPS/sip-333.md) adds the ability for a pool owner to limit the amount of collateral delegated to a pool as `collateralLimitD18`. Regardless of the decisions of particular pool owners, governance may desire a limit on the total amount of a particular type of collateral that can be added to pools in aggregate. For instance, if a new type of collateral is introduced to the system that is perceived as risky, in addition to high collateralization ratios, the total amount of this collateral that could be used to issue derivatives against could be limited via SCCP. + +## Specification + +### Overview + +Implementation of this SIP entails adding `maxTotalDelegationD18` to `CollateralConfiguration`, having an increase of delegated collateral revert if it will cause this value to be exceeded, caching the total amount of delegated collateral after `delegateCollateral` is called, and the addition of a function to manually update these cached values. + +### Rationale + +Though the additional reads and writes to implement this SIP will result in additional gas cost to the `delegateCollateral` function, this will incur a flat amount regardless of the number of collateral types added (or amounts of collateral). Further, this will incur no additional gas costs to markets or their participants. + +This could alternatively be implemented to limit the amounts deposited rather than delegated. The intent of this SIP as written is to limit the stablecoin (and other derivatives) exposure to the collateral’s value, so it does not limit the amount of collateral deposited into the protocol and just associated with the depositor’s account. + +Note that this limit is only enforced per deployment. If a deployment is connected to a deployment on another chain via stablecoin teleportation or pool synthesis, it would have no effect on this behavior. + +### Technical Specification + +When a `delegateCollateral` call is being used to increase the amount of delegated collateral, the system should check if the addition will cause the total amount of this type of collateral delegated to exceed `maxTotalDelegationD18` (as set by governance). + +After every `delegateCollateral` call, a cached value of the total delegated amount of the collateral type must be updated. + +A public `updateCache` function should be added, which loops over each collateral type in the configuration and updates the cached total amounts. It should be called once after the upgrade is executed. This is necessary to ensure the cached values for any deployments that predate this SIP can rely on an accurate value. + +`maxTotalDelegationD18 == 0` should be treated as _unset_, rather than a maximum delegation amount of 0. It may be desired to set `maxTotalDelegationD18` for the stablecoin `1`, for a similar effect as setting `minDelegationD18` to the maximum integer value. + +## Test Case + +Relevant tests will be developed during implementation. + +## Configurable Values (Via SCCP) + +- `uint256 maxTotalDelegationD18` added to `CollateralConfiguration` + +## Copyright + +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). From 5e0166f3a3e539150f3fd3d5a14b7baef3bd529f Mon Sep 17 00:00:00 2001 From: Noah Litvin <335975+noahlitvin@users.noreply.github.com> Date: Mon, 9 Oct 2023 13:36:17 -0400 Subject: [PATCH 2/2] fix number --- content/sips/sip-344.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/sips/sip-344.md b/content/sips/sip-344.md index a89fc786e..096a3b2ff 100644 --- a/content/sips/sip-344.md +++ b/content/sips/sip-344.md @@ -1,5 +1,5 @@ --- -sip: 343 +sip: 344 network: Ethereum & Optimism title: Collateral Delegation Caps author: Noah Litvin (@noahlitvin)