Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sip-344 #1715

Closed
wants to merge 2 commits into from
Closed

sip-344 #1715

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions content/sips/sip-344.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
sip: 344
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/).
Loading