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

Mainnet spell 2024-02-22 #395

Merged
merged 15 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
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
162 changes: 162 additions & 0 deletions archive/2024-02-22-DssSpell/DssSpell.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
// SPDX-FileCopyrightText: © 2020 Dai Foundation <www.daifoundation.org>
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

pragma solidity 0.8.16;

import "dss-exec-lib/DssExec.sol";
import "dss-exec-lib/DssAction.sol";
import { VestAbstract } from "dss-interfaces/dss/VestAbstract.sol";

interface InputConduitJarLike {
function push(uint256) external;
}

interface JarLike {
function void() external;
}

interface ProxyLike {
function exec(address target, bytes calldata args) external payable returns (bytes memory out);
}

contract DssSpellAction is DssAction {
// Provides a descriptive tag for bot consumption
// This should be modified weekly to provide a summary of the actions
// Hash: cast keccak -- "$(wget 'https://raw.githubusercontent.com/makerdao/community/ab5af3e3179d17d7a91a97ac0fec234bec0e26bb/governance/votes/Executive%20vote%20-%20February%2022%2C%202024.md' -q -O - 2>/dev/null)"
string public constant override description =
"2024-02-22 MakerDAO Executive Spell | Hash: 0xfbaf5ce577a6f054a014681eacff991c409f625b8146e8f8bdcd4f8f58ab386d";

// Set office hours according to the summary
function officeHours() public pure override returns (bool) {
return false;
}

// ---------- Rates ----------
// Many of the settings that change weekly rely on the rate accumulator
// described at https://docs.makerdao.com/smart-contract-modules/rates-module
// To check this yourself, use the following rate calculation (example 8%):
//
// $ bc -l <<< 'scale=27; e( l(1.08)/(60 * 60 * 24 * 365) )'
//
// A table of rates can be found at
// https://ipfs.io/ipfs/QmVp4mhhbwWGTfbh2BzwQB9eiBrQBKiqcPRZCaAxNUaar6
//
// uint256 internal constant X_PCT_RATE = ;
uint256 internal constant SIX_PT_ONE_SIX_PCT_RATE = 1000000001895522707144698926;
uint256 internal constant SIX_PT_FOUR_PCT_RATE = 1000000001967129343622160710;
uint256 internal constant SIX_PT_FOUR_ONE_PCT_RATE = 1000000001970109447195256751;
uint256 internal constant SIX_PT_FOUR_THREE_PCT_RATE = 1000000001976068814257775407;
uint256 internal constant SIX_PT_SIX_FIVE_PCT_RATE = 1000000002041548040175924154;
uint256 internal constant SIX_PT_SIX_EIGHT_PCT_RATE = 1000000002050466558600245373;
uint256 internal constant SIX_PT_NINE_ONE_PCT_RATE = 1000000002118758660201099744;
uint256 internal constant SEVEN_PT_ONE_EIGHT_PCT_RATE = 1000000002198740428552847104;

// ---------- Math ----------
uint256 internal constant WAD = 10 ** 18;
uint256 internal constant MILLION = 10 ** 6;

// ---------- Contract addresses ----------
address internal immutable DIRECT_SPARK_DAI_PLAN = DssExecLib.getChangelogAddress("DIRECT_SPARK_DAI_PLAN");
address internal immutable MCD_VEST_DAI = DssExecLib.getChangelogAddress("MCD_VEST_DAI");
address internal immutable MCD_VEST_MKR_TREASURY = DssExecLib.getChangelogAddress("MCD_VEST_MKR_TREASURY");
InputConduitJarLike internal immutable MCD_PSM_PAX_A_INPUT_CONDUIT_JAR = InputConduitJarLike(DssExecLib.getChangelogAddress("MCD_PSM_PAX_A_INPUT_CONDUIT_JAR"));
JarLike internal immutable MCD_PSM_PAX_A_JAR = JarLike(DssExecLib.getChangelogAddress("MCD_PSM_PAX_A_JAR"));

// ---------- Trigger Spark Proxy Spell ----------
// Spark Proxy: https://github.com/marsfoundation/sparklend/blob/d42587ba36523dcff24a4c827dc29ab71cd0808b/script/output/1/primary-sce-latest.json#L2
address internal constant SPARK_PROXY = 0x3300f198988e4C9C63F75dF86De36421f06af8c4;
address internal constant SPARK_SPELL = 0x5D9406F377e6aFebAE18552806EA327eC7B10000;

function actions() public override {
// ---------- Stability Fee Changes ----------
// Forum: https://forum.makerdao.com/t/stability-scope-parameter-changes-9/23688

// Decrease the ETH-A Stability Fee (SF) by 0.33 percentage points, from 6.74% to 6.41%.
DssExecLib.setIlkStabilityFee("ETH-A", SIX_PT_FOUR_ONE_PCT_RATE, true);

// Decrease the ETH-B Stability Fee (SF) by 0.33 percentage points, from 7.24% to 6.91%.
DssExecLib.setIlkStabilityFee("ETH-B", SIX_PT_NINE_ONE_PCT_RATE, true);

// Decrease the ETH-C Stability Fee (SF) by 0.33 percentage points, from 6.49% to 6.16%.
DssExecLib.setIlkStabilityFee("ETH-C", SIX_PT_ONE_SIX_PCT_RATE, true);

// Decrease the WSTETH-A Stability Fee (SF) by 0.51 percentage points, from 7.16% to 6.65%.
DssExecLib.setIlkStabilityFee("WSTETH-A", SIX_PT_SIX_FIVE_PCT_RATE, true);

// Decrease the WSTETH-B Stability Fee (SF) by 0.51 percentage points, from 6.91% to 6.40%.
DssExecLib.setIlkStabilityFee("WSTETH-B", SIX_PT_FOUR_PCT_RATE, true);

// Decrease the WBTC-A Stability Fee (SF) by 0.02 percentage points, from 6.70% to 6.68%.
DssExecLib.setIlkStabilityFee("WBTC-A", SIX_PT_SIX_EIGHT_PCT_RATE, true);

// Decrease the WBTC-B Stability Fee (SF) by 0.02 percentage points, from 7.20% to 7.18%.
DssExecLib.setIlkStabilityFee("WBTC-B", SEVEN_PT_ONE_EIGHT_PCT_RATE, true);

// Decrease the WBTC-C Stability Fee (SF) by 0.02 percentage points, from 6.45% to 6.43%.
DssExecLib.setIlkStabilityFee("WBTC-C", SIX_PT_FOUR_THREE_PCT_RATE, true);

// ---------- Spark Protocol DC-IAM Parameter Changes (main spell) ----------
// Forum: https://forum.makerdao.com/t/feb-9-2024-proposed-changes-to-sparklend-for-upcoming-spell/23656
// Poll: https://vote.makerdao.com/polling/QmS8ch8r

// Increase the DIRECT-SPARK-DAI Maximum Debt Ceiling (line) by 300 million DAI from 1.2 billion DAI to 1.5 billion DAI.
// Increase the DIRECT-SPARK-DAI Target Available Debt (gap) by 20 million DAI from 20 million DAI to 40 million DAI.
// Increase the DIRECT-SPARK-DAI Ceiling Increase Cooldown (ttl) by 12 hours from 12 hours to 24 hours.
DssExecLib.setIlkAutoLineParameters("DIRECT-SPARK-DAI", /* line = */ 1500 * MILLION, /* gap = */ 40 * MILLION, /* ttl = */ 24 hours);

// Increase the DIRECT-SPARK-DAI buffer by 20 million DAI from 30 million DAI to 50 million DAI.
DssExecLib.setValue(DIRECT_SPARK_DAI_PLAN, "buffer", 50 * MILLION * WAD); // NOTE: adjusting DIRECT_SPARK_DAI_PLAN.buffer value to WAD

// ---------- Push USDP out of input conduit ----------
// Forum: https://forum.makerdao.com/t/proposed-housekeeping-items-upcoming-executive-spell-2024-02-22/23697

// Raise PSM-PAX-A DC to 1,000,000 DAI
DssExecLib.setIlkDebtCeiling("PSM-PAX-A", MILLION);

// Call push() on MCD_PSM_PAX_A_INPUT_CONDUIT_JAR (use push(uint256 amt)) to push 754,598.72 USDP
MCD_PSM_PAX_A_INPUT_CONDUIT_JAR.push(754_598.72 ether); // Note: `ether` is only a keyword helper

// Call void() on MCD_PSM_PAX_A_JAR
MCD_PSM_PAX_A_JAR.void();

// Set PSM-PAX-A DC to 0 DAI
DssExecLib.setIlkDebtCeiling("PSM-PAX-A", 0);

// ---------- yank vest streams ----------
// Forum: https://forum.makerdao.com/t/proposed-housekeeping-items-upcoming-executive-spell-2024-02-22/23697

// yank BA Labs DAI stream 20
VestAbstract(MCD_VEST_DAI).yank(20);

// yank BA Labs DAI stream 21
VestAbstract(MCD_VEST_DAI).yank(21);

// yank BA Labs MKR stream 35
VestAbstract(MCD_VEST_MKR_TREASURY).yank(35);

// ---------- Trigger Spark Proxy Spell ----------
// Forum: https://forum.makerdao.com/t/feb-14-2024-proposed-changes-to-sparklend-for-upcoming-spell/23684
// Forum: https://forum.makerdao.com/t/stability-scope-parameter-changes-9/23688#stability-fee-changes-8
// Poll: https://vote.makerdao.com/polling/QmQC1UXZ

// Activate Spark Proxy Spell - 0x5D9406F377e6aFebAE18552806EA327eC7B10000
ProxyLike(SPARK_PROXY).exec(SPARK_SPELL, abi.encodeWithSignature("execute()"));
}
}

contract DssSpell is DssExec {
constructor() DssExec(block.timestamp + 30 days, address(new DssSpellAction())) {}
}
Loading