{"componentChunkName":"component---src-pages-sips-sip-markdown-remark-frontmatter-sip-tsx","path":"/sips/sip-356/","result":{"data":{"markdownRemark":{"fileAbsolutePath":"/vercel/path0/content/sips/sip-356.md","frontmatter":{"sip":356,"sccp":null,"title":"Transaction Costs based Rewards","network":"Optimism & Base","author":"Kaleb Keny (@kaleb-keny), Leo Massazza (@leomassazza)","type":"Governance","proposal":null,"implementor":"Leo Massazza (@leomassazza)","release":null,"created":"2023-11-07T00:00:00.000Z","updated":null,"status":"Implemented"},"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>Use dynamic keeper rewards based on gas price to incentivize keepers to settle/liquidate positions, even with high gas prices and not without overpaying for keeping the system.</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 an node to oracle manager that will give the cost of a settlement or liquidation transaction in USD based on current gas and ETH price. Then we'll use this new node to calculate the rewards for keepers on the different scenarios that requires a keeper activity. We include caps for lower and higher rewards to guarantee some minimum and maximum rewards are given.</p>\n<p>The minimum and maximum rewards are configurable via governance as well as the parameters to get the different kind of transaction costs.</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>SIP-2013 states the problem in perpsV2, same situation happens in V3 perps markets, where keepers are not incentivized  to settle/liquidate positions when gas prices are high if rewards are too low to cover for the transaction cost. This is a problem because it can lead to a situation where the system is undercollateralized and the liquidation queue is not being processed.\nBut if we set the rewards too high, we'll end up overpaying for keepers to keep the system, which is not ideal either.</p>\n<p>The solution proposed, based on <a href=\"https://sips.synthetix.io/sips/sip-2013/\">SIP-2013</a> mechanism, is to include the transaction cost in the rewards calculation, so keepers are incentivized to keep the system even with high gas prices, but not overpaying for it.</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<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<p>In order to get the keeper rewards we need to:</p>\n<p>1- Get the cost of transaction in eth ( <code>costOfSingleExecutionGrossEth</code> ): We add a new external node that will use <strong>Optimism Gas Price Oracle</strong>. The cost of execution can be get using the formula:</p>\n<p><code>costOfSingleExecutionGrossEth = (gasPrice * gasUnitsL2) + baseFee * (gasUnitsL1 + overhead) * scalar)</code></p>\n<p>where <code>gasPrice</code>, <code>baseFee</code>, <code>overhead</code> and <code>scalar</code> are all queried from <a href=\"https://optimistic.etherscan.io/address/0x420000000000000000000000000000000000000F#readProxyContract\">gasPriceOracle</a>;</p>\n<p>and the parameters <code>gasUnitsL1</code> and <code>gasUnitsL2</code> are configurable via SCCP and depend on the kind of transaction (settlement, liquidation or flag and liquidate).</p>\n<p><em>References and Optimism contracts for the calculation can be found at</em>:</p>\n<ul>\n<li><a href=\"https://community.optimism.io/docs/useful-tools/oracles/#gas-oracle\">https://community.optimism.io/docs/useful-tools/oracles/#gas-oracle</a></li>\n<li><a href=\"https://community.optimism.io/docs/developers/build/transaction-fees/\">https://community.optimism.io/docs/developers/build/transaction-fees/</a></li>\n<li><a href=\"https://optimistic.etherscan.io/address/0x420000000000000000000000000000000000000F#readProxyContract\">https://optimistic.etherscan.io/address/0x420000000000000000000000000000000000000F#readProxyContract</a></li>\n<li><a href=\"https://basescan.org/address/0x420000000000000000000000000000000000000F#readProxyContract\">https://basescan.org/address/0x420000000000000000000000000000000000000F#readProxyContract</a></li>\n</ul>\n<p>2- Get the cost of transaction in USD ( <code>costOfSingleExecutionGrossUsd</code> ): With the help of <strong>Oracle Manager</strong> composability, we get the <code>ETH/USD</code> ratio from a node and calculate get the cost of execution in USD by doing:</p>\n<p><code>costOfSingleExecutionGrossUsd = costOfExecutionGrossEth * ETH/USD</code></p>\n<p>Notice that <code>costOfSingleExecutionGrossUsd</code> represents the cost of a single liquidation window call or a single feed update for flagging. We'll come to this later.</p>\n<p>3- We calculate the total cost of the transaction <code>costOfExecutionGrossUsd</code>.</p>\n<p>For liquidations after an account was flagged or settlement of an order,</p>\n<p><code>costOfExecutionGrossUsd = costOfSingleExecutionGrossUsd</code>.</p>\n<p>For liquidating a non-flagged account we need to compute the cost of flagging that requires all the feeds to be updated. Since updating a feed requires a large amount of data to be passed in the callData, and due to the nature of Gas costs on Optimism based networks, the cost of flagging can be reduced as</p>\n<p><code>costOfExecutionGrossUsd = N * costOfSingleExecutionGrossUsd</code>,</p>\n<p>where <code>N</code> is the number of feeds that need to be updated (all collaterals types and positions an account has without taking into account snxUSD). We'll use this formula to calculate the cost of flagging and liquidating a non-flagged account.</p>\n<p>4- We then need to guarantee a minimum of rewards to keepers (<code>minimumKeeperRewardCap</code>), proportional to the cost of execution, or a minimum set. The minimum rewards are configurable by governance. We calculate the minimum rewards as:</p>\n<p><code>minimumKeeperRewardCap = max(costOfExecutionGrossUsd + minKeeperRewardUsd , costOfExecutionGrossUsd * (1 + minKeeperProfitRatioD18)</code></p>\n<p>where <code>minKeeperRewardUsd</code> and <code>minKeeperProfitRatioD18</code> are configurable by governance.</p>\n<p>5- We also need to guarantee a maximum of rewards to keeper(<code>maximumKeeperRewardCap</code>), in order to limit the effect it has on users in case we have a temporary surge in base fee gas prices, which result in liquidations of small positions, as we’ve experienced in PerpsV2. The cap will be the minimum of an absolute cap and a variable cap. The variable cap will be based on the size <code>availableMarginInUSD</code> meaning a larger margin allows for more tolerance of gas price surges. We calculate the maximum as:</p>\n<p><code>maximumKeeperRewardCap = min(availableMarginInUSD * maxKeeperScalingRatioD18 , maxKeeperRewardUsd)</code></p>\n<p>where <code>maxKeeperScalingRatioD18</code> and <code>maxKeeperRewardUsd</code> are both configurable by governance and that the cap defaults to simply being <code>maxKeeperRewardUsd</code> for situations where the account does not have sufficient margin to pay the keeping fees (i.e. availableMarginUSD being zero).</p>\n<p>6- Finally, we calculate the rewards for keepers, depending on the kind of transaction as the <code>costs + profit</code> (based on the kind of transaction) and bounded by the minimum and maximum rewards.</p>\n<h3 id=\"external-node\" style=\"position:relative;\"><a href=\"#external-node\" aria-label=\"external node 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>External Node</h3>\n<p>We introduce a new external node <code>TxGasPriceOracle</code> that needs to be registered in oracle manager. This node will use the Optimism Gas Price Oracle to get the cost of execution in eth.</p>\n<p>The node will be registered with the following parameters:</p>\n<ul>\n<li>l1SettleGasUnits,</li>\n<li>l2SettleGasUnits,</li>\n<li>l1FlagGasUnits,</li>\n<li>l2FlagGasUnits,</li>\n<li>l1LiquidateGasUnits,</li>\n<li>l2LiquidateGasUnits</li>\n</ul>\n<h3 id=\"settlements\" style=\"position:relative;\"><a href=\"#settlements\" aria-label=\"settlements 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>Settlements</h3>\n<p>For settlements we use the <code>l1SettleGasUnits</code> and <code>l2SettleGasUnits</code> to calculate the transaction gas costs <code>costOfExecutionGrossUsd</code>. The rewards for keepers are calculated as:</p>\n<p><code>settlementKeeperReward = min(max(minimumKeeperRewardCap, costOfExecutionGrossUsd + settlementStrategy.settlementReward), maximumKeeperRewardCap)</code></p>\n<h3 id=\"liquidations\" style=\"position:relative;\"><a href=\"#liquidations\" aria-label=\"liquidations 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>Liquidations</h3>\n<p>When a keeper calls liquidate, the account is first flagged, then attempted to fully liquidate, if it succeeds to liquidate it fully in that window, it will remove the flag on the account and it will get liquidated.</p>\n<p>If the account cannot be fully liquidated in that window, the flag will remain and the account will be liquidated in the next window(s).</p>\n<h4 id=\"non-flagged-liquidations\" style=\"position:relative;\"><a href=\"#non-flagged-liquidations\" aria-label=\"non flagged liquidations 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>Non-flagged liquidations</h4>\n<p>When a keeper calls <code>liquidate(account)</code> on a non-flagged account, it needs to update all the feeds related to the account, including the collateral types (except for snxUSD that do not require a feed update) and positions. We calculate the number of feeds as <code>N = #non_snxUSD_collateralTypes + #positions</code>.</p>\n<p>In this case we use the <code>l1FlagGasUnits</code> and <code>l2FlagGasUnits</code> and <code>N number of feeds</code> to calculate the transaction gas costs <code>costOfExecutionGrossUsd</code>. The rewards for keepers are calculated as:</p>\n<p><code>flagReward = sumOfPositions(notional * liquidationRewardRatioD18)</code></p>\n<p><code>flagAndLiquidateKeeperReward = min(max(minimumKeeperRewardCap, costOfExecutionGrossUsd + flagReward), maximumKeeperRewardCap)</code></p>\n<h4 id=\"flagged-liquidations\" style=\"position:relative;\"><a href=\"#flagged-liquidations\" aria-label=\"flagged liquidations 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>Flagged liquidations</h4>\n<p>When a keeper calls <code>liquidate(account)</code> on a non-flagged account, <code>liquidateFlagged(maxNumberOfAccounts)</code>, or <code>liquidateFlaggedAccounts([]accountIds[])</code> it doesn't need to update any feed and will just liquidate the flagged accounts that are still pending to be liquidated due to window limit.</p>\n<p>The rewards for the keeper will be the sum of the liquidation rewards for each account that is liquidated in the window.</p>\n<p>In this case, for each liquidated account, we use the <code>l1LiquidateGasUnits</code> and <code>l2LiquidateGasUnits</code> to calculate the transaction gas costs <code>costOfExecutionGrossUsd</code>. The rewards for keepers are calculated as:</p>\n<p><code>liquidateKeeperReward = min(max(minimumKeeperRewardCap, costOfExecutionGrossUsd), maximumKeeperRewardCap)</code></p>\n<h3 id=\"minimum-required-margin\" style=\"position:relative;\"><a href=\"#minimum-required-margin\" aria-label=\"minimum required margin 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>Minimum Required Margin</h3>\n<p>In order to find if a position can be liquidated, we need to calculate the minimum required margin required to pay the keeper rewards to completely liquidate the position.</p>\n<p>To fully liquidate an account we need to flag and fully liquidate it. The flagging should include the cost of updating all the feeds, while fully liquidating an account should include the number of windows of liquidation required to process it fully. Using the parameters and formulas for the scenarions above, we can calculate the minimum required margin to liquidate an account as:</p>\n<p><code>numberOfWindows = ceil(accountSize / maxSizePerWindow)</code></p>\n<p><code>minimumRequiredMargin = flagAndLiquidateKeeperReward + (numberOfWindows-1) * liquidateKeeperReward</code></p>\n<p>Notice that numberOfWindows-1 is used since the first iteration was included in the flagAndLiquidate step.</p>\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>TBD but all the different caps and parameters can be tested with the different scenarios.</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<h4 id=\"caps-related\" style=\"position:relative;\"><a href=\"#caps-related\" aria-label=\"caps related 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>Caps related</h4>\n<ul>\n<li><code>minKeeperRewardUsd</code>,</li>\n<li><code>minKeeperProfitRatioD18</code>,</li>\n<li><code>maxKeeperRewardUsd</code>,</li>\n<li><code>maxKeeperScalingRatioD18</code></li>\n</ul>\n<p>are set via <code>setKeeperRewardGuards()</code></p>\n<h4 id=\"transaction-costs-related\" style=\"position:relative;\"><a href=\"#transaction-costs-related\" aria-label=\"transaction costs related 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>Transaction costs related</h4>\n<ul>\n<li>l1SettleGasUnits,</li>\n<li>l2SettleGasUnits,</li>\n<li>l1FlagGasUnits,</li>\n<li>l2FlagGasUnits,</li>\n<li>l1LiquidateGasUnits,</li>\n<li>l2LiquidateGasUnits</li>\n</ul>\n<p>are set when registering the external node <code>TxGasPriceOracle</code> in oracle manager.</p>\n<h4 id=\"other-parameters\" style=\"position:relative;\"><a href=\"#other-parameters\" aria-label=\"other parameters 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>Other parameters</h4>\n<ul>\n<li>Settlement strategy: <code>settlementStrategy.settlementReward</code></li>\n<li>Market: <code>liquidationRewardRatioD18</code></li>\n</ul>\n<p>This sip was implemented as part of the v3 perp rollout.</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":"3fa0ec02-2056-5298-963a-9fb2fc816a78","frontmatter__sip":356,"__params":{"frontmatter__sip":"356"}}},"staticQueryHashes":[]}