{"componentChunkName":"component---src-pages-sips-sip-markdown-remark-frontmatter-sip-tsx","path":"/sips/sip-347/","result":{"data":{"markdownRemark":{"fileAbsolutePath":"/vercel/path0/content/sips/sip-347.md","frontmatter":{"sip":347,"sccp":null,"title":"Collateral Delegation Cooldown","network":"Ethereum, Optimism & Base","author":"Kaleb Keny (@kaleb-keny), Afif (@aband1), MEB (@barrasso)","type":"Governance","proposal":null,"implementor":null,"release":null,"created":"2023-10-25T00:00:00.000Z","updated":null,"status":"Rejected"},"html":"<!--You can leave these HTML comments in your merged SIP and delete the visible duplicate text guides, they will not appear and may be helpful to refer to if you edit it again. This is the suggested template for new SIPs. Note that an SIP number will be assigned by an editor. When opening a pull request to submit your SIP, please use an abbreviated title in the filename, `sip-draft_title_abbrev.md`. The title should be 44 characters or less.-->\n<h2 id=\"simple-summary\" style=\"position:relative;\"><a href=\"#simple-summary\" aria-label=\"simple summary permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Simple Summary</h2>\n<!--\"If you can't explain it simply, you don't understand it well enough.\" Simply describe the outcome the proposed changes intends to achieve. This should be non-technical and accessible to a casual community member.-->\n<p>This SIP proposes the implementation of a cooldown mechanism for accounts wishing to exit or decrease their delegated collateral in a given market. It introduces a configurable cooldown duration (<code>cooldownDuration</code>), that a user must await after signaling his intent to decrease his delegated liquidity to a given market. The undelegation action can only be executed  when the block time is within a configurable cooldown window <code>cooldownWindow</code> (after the <code>cooldownDuration</code> lapses). Failure to execute the action within the window, results in the expiration of the intent, requiring users to run a new intent of undelegation.</p>\n<p>An account who signaled his intent to decrease his delegation on a given market cannot increase his delegated liquidity to that market during the <code>cooldownDuration</code> period. However, the account can signal multiple decreases of staked collateral on different markets simultaneously. Once a user signals his intention to reduce his delegated collateral on a specific market, he cannot schedule another reduction on that same market until the previous intent is executed or is expired.</p>\n<p>In case a users' collateral is liquidated, all the accounts' cooldown intents are revoked.</p>\n<p>The <code>cooldownDuration</code> and <code>cooldownWindow</code>  are both configurable per market. Markets that do not require this intent/execute pattern can have this feature disabled by setting <code>cooldownDuration</code> to zero.</p>\n<p>Note that a user can signal an intent, but cannot execute that intent, if the <code>minDelegateTime</code> specified in <a href=\"https://sips.synthetix.io/sips/sip-320/\">SIP-320</a> had not lapsed.</p>\n<h2 id=\"motivation\" style=\"position:relative;\"><a href=\"#motivation\" aria-label=\"motivation permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Motivation</h2>\n<!--This is the problem statement. This is the *why* of the SIP. It should clearly explain *why* the current state of the protocol is inadequate.  It is critical that you explain *why* the change is needed, if the SIP proposes changing how something is calculated, you must address *why* the current calculation is inaccurate or wrong. This is not the place to describe how the SIP will address the issue!-->\n<p>In Perp V3, differences in the liquidation speeds of margin and positions could lead to deterministic profit/loss impacts. To ensure fair compensation for liquidity providers and prevent taking advantage of these determinisms, a cooldown period is proposed when undelegating liquidity from a market.</p>\n<h2 id=\"rationale\" style=\"position:relative;\"><a href=\"#rationale\" aria-label=\"rationale permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Rationale</h2>\n<!--This is where you explain the reasoning behind how you propose to solve the problem. Why did you propose to implement the change in this way, what were the considerations and trade-offs. The rationale fleshes out what motivated the design and why particular design decisions were made. It should describe alternate designs that were considered and related work. The rationale may also provide evidence of consensus within the community, and should discuss important objections or concerns raised during discussion.-->\n<p>This functionality aims to introduce friction in removing or decreasing a user's delegated collateral to discourage taking advantage of deterministic changes in profit/loss impact from liquidations.</p>\n<h2 id=\"technical-specification\" style=\"position:relative;\"><a href=\"#technical-specification\" aria-label=\"technical specification permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Technical Specification</h2>\n<!--The technical specification should outline the public API of the changes proposed. That is, changes to any of the interfaces Synthetix currently exposes or the creations of new ones.-->\n<ul>\n<li><code>cooldownDuration</code>: A configurable duration in seconds, representing the minimum time before an intent can be executed.</li>\n<li><code>setCooldownDuration(int128)</code>: An addition to the <code>IMarketManager</code> interface, allowing markets to associate a cooldown duration.</li>\n<li><code>cooldownWindow</code>: A configurable duration in seconds, determining the maximum time an intent can be executed after the <code>cooldownDuration</code> lapses.</li>\n<li><code>setCooldownWindow(int128)</code>: An addition to the <code>IMarketManager</code> interface, enabling markets to associate a cooldown window.</li>\n</ul>\n<h3 id=\"test-cases\" style=\"position:relative;\"><a href=\"#test-cases\" aria-label=\"test cases permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Test Cases</h3>\n<!--Test cases for an implementation are mandatory for SIPs but can be included with the implementation..-->\n<ul>\n<li>Setting the <code>cooldownDuration</code> to 12 hours, <code>cooldownWindow</code> to 6 hours\n<ul>\n<li>When a random account, with delegated liquidity to the perp super market attempts to signal an intent to undelegate his liquidity\n<ul>\n<li>✅ Then the transaction succeeds\n<ul>\n<li>After the <code>cooloffDuration</code> and <code>minDelegateTime</code> lapse\n<ul>\n<li>the user attempts to execute the intent in the <code>cooldownWindow</code>\n<ul>\n<li>✅ Then the transaction succeeds  and the users' delegated liquidity is reduced</li>\n</ul>\n</li>\n<li>the user attempts to execute the intent after the <code>cooldownWindow</code> lapses\n<ul>\n<li>❌ Then transaction reverts, as the <code>cooldown</code> intent had expired</li>\n</ul>\n</li>\n</ul>\n</li>\n<li>Before the <code>cooloffDuration</code> lapses\n<ul>\n<li>the user attempts to execute the intent\n<ul>\n<li>❌ Then transaction reverts, as the <code>cooloffDuration</code> had not lapsed</li>\n</ul>\n</li>\n</ul>\n</li>\n<li>The user attempts to delegate more collateral to the perp supermarket\n<ul>\n<li>❌ Then transaction reverts, due to a cooldown intent being signalled by the user</li>\n</ul>\n</li>\n<li>The user attempts to undelegate more collateral from the perp supermarket\n<ul>\n<li>❌ Then transaction reverts, due to a cooldown intent already being signalled by the user</li>\n</ul>\n</li>\n<li>The user gets liquidated before the <code>minDelegateTime</code> and <code>cooloffDuration</code> has lapsed\n<ul>\n<li>✅ Then the transaction succeeds and the <code>cooloff</code> intent is revoked</li>\n</ul>\n</li>\n<li>After the <code>cooloffDuration</code> lapse but before the <code>minDelegateTime</code> has lapsed\n<ul>\n<li>the user attempts to execute the intent in the <code>cooldownWindow</code>\n<ul>\n<li>❌ Then transaction reverts, due to the <code>minDelegateTime</code> not having lapsed</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n<h3 id=\"configurable-values-via-sccp\" style=\"position:relative;\"><a href=\"#configurable-values-via-sccp\" aria-label=\"configurable values via sccp permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Configurable Values (Via SCCP)</h3>\n<!--Please list all values configurable via SCCP under this implementation.-->\n<p>Please refer to technical specification for definitions of the below configurable values:</p>\n<ul>\n<li><code>cooldownDuration</code></li>\n<li><code>cooldownWindow</code></li>\n</ul>\n<p>Status changed to rejected, as per the authors' request.</p>\n<h2 id=\"copyright\" style=\"position:relative;\"><a href=\"#copyright\" aria-label=\"copyright permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Copyright</h2>\n<p>Copyright and related rights waived via <a href=\"https://creativecommons.org/publicdomain/zero/1.0/\">CC0</a>.</p>"}},"pageContext":{"id":"82962c80-932d-5281-9551-49b6114e8838","frontmatter__sip":347,"__params":{"frontmatter__sip":"347"}}},"staticQueryHashes":[]}