{"componentChunkName":"component---src-pages-sips-sip-markdown-remark-frontmatter-sip-tsx","path":"/sips/sip-83/","result":{"data":{"markdownRemark":{"fileAbsolutePath":"/vercel/path0/content/sips/sip-83.md","frontmatter":{"sip":83,"sccp":null,"title":"Total Issued Synths (Debt pool) Snapshots","network":"Ethereum","author":"Kain Warwick (@kaiynne), Jackson Chan (@jacko125), Anton Jurisevic (@zyzek)","type":"Governance","proposal":null,"implementor":null,"release":null,"created":"2020-08-31T00:00:00.000Z","updated":null,"status":"Implemented"},"html":"<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 to implement a mechanism to calculate and store a snapshot of the total issued synths\n(total debt pool) value for minting, burning and claiming rewards to significantly reduce the cost of these transactions.</p>\n<h2 id=\"abstract\" style=\"position:relative;\"><a href=\"#abstract\" aria-label=\"abstract 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>Abstract</h2>\n<!--A short (~200 word) description of the proposed change, the abstract should clearly describe the proposed change. This is what *will* be done if the SIP is implemented, not *why* it should be done or *how* it will be done. If the SIP proposes deploying a new contract, write, \"we propose to deploy a new contract that will do x\".-->\n<p>We propose to add the ability to create a snapshot of the system's debt pool and total issued synths that can be\ncalculated on-chain, where the gas costs are paid by the invoking account, and used for subsequent minting, burning and\nreward claiming. The recomputation of the system debt pool will be managed by three distinct processes:</p>\n<ol>\n<li>Public functions to save or update a snapshot of the total system debt at current prices.</li>\n<li>On each synth exchange, minting, or burning operation the debt snapshot will be updated with the debt deltas of the involved synths.</li>\n<li>Periodic recomputation of the overall debt by minters rather than by keepers.</li>\n</ol>\n<p>Together these will ensure that the on-chain total system debt does not diverge far from its true value without having\nto expensively recompute total system debt on every mint, burn, or transfer.</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 innaccurate or wrong. This is not the place to describe how the SIP will address the issue!-->\n<p>In order to enable minting, burning and claiming rewards the system needs to know the size of the debt pool and the\nuser's collateral ratio, calculating this value is expensive and contributes to the cost of each mint and burn transaction.\nThis is because each time the system must read the price and amount of every synth in the system, currently 40+.</p>\n<p>The current size of the debt pool is calculated as:</p>\n<p>\\[ Debt pool = \\sum{Synths Total Supply * Synth Price}\\]</p>\n<p>Not only does this cost increase linearly with the number of synths in the system, it also necessitates retrieving\nthe latest prices, timestamps, and total supplies of each synth from external contracts, rather than being able to read\nthem all from the current <code>ExchangeRates</code> contract.</p>\n<p>In the current gas environment minting, burning and claiming costs can reach $50 USD+ per tx or higher, with the\nmigration to external oracles this could rise by 50-100% (See <a href=\"/ad9c5a3b8a9bda848e5a82b3e470230a/sip-84.md\">SIP 84</a>).\nThe projected cost of reading all 40+ synth prices on-chain from external oracles to calculate the debt pool on each\ntransaction is <code>~800,000 gas</code> providing a huge reduction for stakers on Synthetix to issue, burn and claim rewards.</p>\n<p>About 70% of the gas costs are spent in calculating the total size of the debt pool during minting, burning and claiming\nrewards. Saving a snapshot of the debt pool allows subsequent minting and burning transactions to rely on\nthis precomputed value, saving the multiple contract calls and calculation.</p>\n<p>This would reduce the bottleneck of increasing gas costs when new synths are added and allow Synthetix protocol to\nonboard many more liquid synthetic assets such as sOIL and commodities in the future.</p>\n<h2 id=\"specification\" style=\"position:relative;\"><a href=\"#specification\" aria-label=\"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>Specification</h2>\n<!--The specification should describe the syntax and semantics of any new feature, there are five sections\n1. Overview\n2. Rationale\n3. Technical Specification\n4. Test Cases\n5. Configurable Values\n-->\n<h3 id=\"overview\" style=\"position:relative;\"><a href=\"#overview\" aria-label=\"overview 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>Overview</h3>\n<!--This is a high level overview of *how* the SIP will solve the problem. The overview should clearly describe how the new feature will be implemented.-->\n<h4 id=\"system-debt-caching\" style=\"position:relative;\"><a href=\"#system-debt-caching\" aria-label=\"system debt caching 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>System Debt Caching</h4>\n<p>To solve the problem of requiring every minting, burning and claiming rewards transaction to read 40+ synth prices from\nexternal oracles, the debt pool snapshot will allow the total system's issued synths value to be re-used for calculating\nhow much debt and the relative % shift someone is issuing / burning based on the debt pool snapshot.\nAs a system-wide value, the snapshot will be stored in the flexible storage contract described in <a href=\"/7b5b57a349350d4c9a17eda7e285542a/sip-64.md\">SIP 64</a>.</p>\n<p>The debt pool snapshot captures the current synth prices and supplies at the time of the snapshot and removes the need\nto retrieve latest data on every operation, relying on the fact that Synthetix exchanges involve repricing one synth\ninto another based on their respective USD prices.</p>\n<p>We propose the addition of public functions that can be called to update the debt pool snapshot, with the caller\npaying the gas to execute the on-chain cost of reading the latest synth prices from external oracles and updating the\ndebt pool snapshot value. By frequent calls to these functions, the debt pool snapshot can be kept arbitrarily accurate.\nAlthough they could be expensive to execute by themselves, these functions will provide a great deal\nof utility for subsequent minting and burning transactions that can read the cached value cheaply.</p>\n<p>To ensure that the liveness of the debt pool snapshot, a view will be exposed that reports the current\n<code>totalIssuedSynths</code> value and debt pool by reading the synth's prices and <code>synth.totalSupply</code> as occurs whenever the\nsystem debt is currently computed. An acceptable deviation between this reported system debt and the cached value will\nbe established at an initial value of <code>2%</code>. It may be useful in the future to reward the caller of this function\nif an invocation corrects a deviation that exceeded this bound.</p>\n<p>This will be monitored by a keeper bot paying for the gas to update the snapshot whenever the cached value breaches\nthe acceptable deviation, up to a maximum update frequency. In order to save on gas, the keeper will have the option\nof only updating the debt contributions of a minimal subset of synths that would bring the total system debt snapshot\nback under the acceptable deviation, as there may be many synths whose contributions are negligible, and this facility\nwould be useful in the case that an individual synth price moves dramatically by itself.</p>\n<p>The bot could also monitor the mempool for upcoming prices and pre-calculate the new <code>totalIssuedSynths</code> values to\ndetect if it needs to update the debt pool snapshot after.</p>\n<h4 id=\"liveness\" style=\"position:relative;\"><a href=\"#liveness\" aria-label=\"liveness 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>Liveness</h4>\n<p>To ensure that the debt pool snapshot is not stale, there will be a staleness check on the last <code>timestamp</code> of when a\ncomplete debt pool snapshot was last computed. Minting, burning and claiming rewards will revert if the debt pool\nsnapshot is stale until it has been updated.</p>\n<p>The staleness period will be initially set to <code>60 minutes</code> and will be configurable via an SCCP.</p>\n<p>An additional point is that Synthetix already tracks whether the rates being supplied to the system are individually\nstale, or have been invalidated by chainlink warning flags (see <a href=\"/d27948231c863ec572c964ed76c7376f/sip-76.md\">SIP 76</a>). Currently, if any synth price is\ninvalid at the time of a system debt calculation, the operation that triggered it will fail. Therefore system debt\nupdates must also cache in flexible storage the validity of the debt snapshot in order to maintain this safety check.\nAs such any keeper bots performing the work of updating the system snapshot should monitor the validity of each\nsynth rate, and trigger a snaphot if any rate falls invalid, to protect the system. With moves towards a generalised\ncompensated keeper framework, triggering a snapshot when the system must be frozen may come with a reward.</p>\n<p>The debt snapshot function being public and unrestricted also means that, upon an invalid rate being fixed,\nthe debt snapshot can be immediately recalculated by any account in order to re-enable dependent operations.</p>\n<h4 id=\"mint-burn--exchange-debt-delta-adjustments\" style=\"position:relative;\"><a href=\"#mint-burn--exchange-debt-delta-adjustments\" aria-label=\"mint burn  exchange debt delta adjustments 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>Mint, Burn, &#x26; Exchange Debt Delta Adjustments</h4>\n<p>Utilising a debt pool snapshot could expose frontminting opportunities when there are large price shifts observed on the\ndebt pool's underlying synths such as the ETH / BTC prices moving.\nIt is worth noting that frontminting mitigation strategies were implemented in <a href=\"/27d0b6bd7078e12bbe525f27b31c4158/sip-40.md\">SIP40</a> in the form of a\n24-hours mint and burn lock. This value can be increased via an SCCP to <code>48+ hours</code> to further reduce the frontminting\nopportunities until continuous rewards are implemented.</p>\n<p>However, to ensure that such front-minting opportunities are minimised, and that the debt deviation keeper needs to\nexecute as infrequently as possible, the debt will also be adjusted whenever synth supplies change.</p>\n<p>This is simple in the case of minting and burning; when these operations occur, the debt pool snapshot will be updated\nwith the amount of sUSD that is issued or burned as the issuance / burning of sUSD debt will change the\ndebt pool size but not require latest prices to be retrieved.</p>\n<p>When exchanges between non-sUSD synths occur, the prices are already retrieved to\nperform the exchange, but we will additionally retrieve the post-exchange total supplies of the involved non-sUSD\nsynths to compute their total sUSD-denominated value. The delta between these value and the previously-computed ones\nwill be applied to the total debt snapshot, and the new values cached to be used next time an exchange of those\nsynths occurs.</p>\n<p>In this way the current debt snapshot will be responsive to the latest price updates of those synths which are most\nfrequently used, and the public keeper function will ideally only need to be invoked at times of extreme synth price\nvolatility or heavy network congestion. This system will assist in protecting against front minting attacks,\nbut if it proves to keep the debt snapshot accurate enough, then its constant-time execution cost implies\nthat an unbounded number of synths could be added to the system.</p>\n<h4 id=\"phase-2-amortised-minter-debt-recomputation-levy\" style=\"position:relative;\"><a href=\"#phase-2-amortised-minter-debt-recomputation-levy\" aria-label=\"phase 2 amortised minter debt recomputation levy 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>Phase 2: Amortised Minter Debt Recomputation Levy</h4>\n<p>The debt snapshot keeper is the least technically complex solution to the debt calculation problem posed in this\nSIP, and is a useful safety mechanism for protocol participants to protect the system if required, but ideally\nno keeper functions would be required to maintain the integrity of the Synthetix debt pool.</p>\n<p>Therefore in a future phase of the implementation it will be expedient to allow a full debt snapshot to occur at periodic\nheartbeats once every 15 minutes, for example.\nThese heartbeats could either be computed by a separate compensated keeper function, or at the first mint, burn, or\nclaim operations to be performed after a given heartbeat is due. However, given the extra expense involved, the gas cost\nof the recalculation will be measured and rebated to the caller from a common pool of ether held in a manner similar to the\n<a href=\"/450b3a1431184c718be8ebc7d1331912/sip-79.md\">deferred transaction gas tank</a>. This pool will be replenished by a small fee charged on the\nexecution cost of each mint, burn, and claim operation, which will be less than the gas saved for these function calls\nby eliminating continual system debt recomputations.\nAs the number of snapshot-dependent operations occurring greatly exceeds the number of heartbeats required per day even\nat one heartbeat every 15 minutes, the size of the levy will be modest, still representing a great savings for\nall participants in the system.\nSince the number of heartbeats per day at a given frequency is constant, any increase in system usage\nallows the gas charge to be decreased, or the heartbeat frequency to be increased.</p>\n<h3 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</h3>\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>The rationale of the debt pool snapshot value is the ability to capture a snapshot of all the synths prices and their\nrespective synth's totalSupply (collectively as the <code>totalIssuedSynths</code>) for the purposes of minting, burning and\nclaiming rewards.</p>\n<p>The snapshot is updated when minting and burning sUSD synths as sUSD synths don't require a new price update but is a\nbasic addition / subtraction to the last snapshot value.</p>\n<p>Having a public function that reads the latest prices and synth total supply on-chain and writes the new debt pool\nsnapshot also provides a decentralised mechanism for the snapshot value to be executed on chain.\nInitially there will be no incentives to run this transaction to update the snapshot, future iterations of the debt pool\nsnapshot update could rely on funds contributed by SNX stakers on each minting and burning transaction as there is a\nvery high utility for them in gas savings.</p>\n<h3 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</h3>\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>\n<p><code>uint debtPoolSnapshot</code> Snapshot value of all the circulating <code>synths supply * synth prices</code> (in $USD) at the last snapshot, taking into account the contributions from mint, burn, and exchange operations since the last snapshot. Wherever <code>Issuer._totalIssuedSynths</code> is currently used, the snapshot will be substituted instead of a freshly-computed value.</p>\n</li>\n<li>\n<p><code>uint snapshotTimestamp</code> Timestamp of the debt pool snapshot: Updated when <code>Issuer.updateDebtPoolSnapshot()</code> is executed but not updated when mint, burn, or exchange transactions update the snapshot value.</p>\n</li>\n<li>\n<p><code>bool debtPoolSnapshotIsInvalid</code> True if and only if any rate involved in the computation of the cached debt pool snapshot (and SNX) was reported as invalid at the time of the snapshot. <code>Issuer._totalIssuedSynths</code> currently reports this value freshly-recomputed at each invocation, the new implementation should return the cached value instead.</p>\n</li>\n<li>\n<p><code>Issuer.updateDebtPoolSnapshot()</code> Public function that updates the <code>debtPoolSnapshot</code>, <code>snapshotTimestamp</code>, and <code>debtPoolSnapshotIsInvalid</code> to their latest values.</p>\n</li>\n<li>\n<p><code>Issuer.updateDebtPoolSnapshotForCurrencies(bytes32[] currencyKeys)</code> Public function that operates like <code>Issuer.updateDebtPoolSnapshot()</code>, but only accounts for the contributions of the provided currency keys. This may set <code>debtPoolSnapshotIsInvalid</code> to true, but not set it back to false, which requires a full recomputation of the system debt snapshot.</p>\n</li>\n<li>\n<p><code>Issuer.totalIssuedSynths()</code> Current view function to get latest total issued synths and debt pool size. Used by bot to view and calculate the % deviation between last snapshot and the current actual <code>totalIssuedSynths()</code>. Excludes any of the EtherCollateral backed synths generated as not backed by SNX collateral.</p>\n</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<p>Test cases for an implementation are mandatory for SIPs but can be included with the implementation.</p>\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 list all values configurable via SCCP under this implementation.</p>\n<table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>initial Value</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Debt snapshot stale time</td>\n<td>60 minutes</td>\n</tr>\n<tr>\n<td>Debt snapshot max deviation</td>\n<td>2 percent</td>\n</tr>\n</tbody>\n</table>\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":"ab4f831c-455b-5285-aeea-48aa682541d9","frontmatter__sip":83,"__params":{"frontmatter__sip":"83"}}},"staticQueryHashes":[]}