From 8a1b16eb112fcaeda8c3e364235e60bfe6f5c02f Mon Sep 17 00:00:00 2001 From: sajanrajdev Date: Mon, 27 May 2024 13:09:25 -0500 Subject: [PATCH] feat: curve incentives script --- helpers/addresses.py | 6 ++++ interfaces/curve/ILiquidityGaugeV6.sol | 6 ++++ scripts/curve/lido_gauge_incentives.py | 40 ++++++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 interfaces/curve/ILiquidityGaugeV6.sol create mode 100644 scripts/curve/lido_gauge_incentives.py diff --git a/helpers/addresses.py b/helpers/addresses.py index 811be54a..d1e22984 100644 --- a/helpers/addresses.py +++ b/helpers/addresses.py @@ -256,6 +256,8 @@ "LIQ": "0xD82fd4D6D62f89A1E50b1db69AD19932314aa408", "LIQLIT": "0x03C6F0Ca0363652398abfb08d154F114e61c4Ad8", "LUSD": "0x5f98805A4E8be255a32880FDeC7F6728C6568bA0", + "STETH": "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84", + "WSTETH": "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0", }, # every slp token listed in treasury tokens above must also be listed here. # the lp_tokens in this list are processed by scount to determine holdings @@ -306,6 +308,10 @@ "t_eth_f": "0x752eBeb79963cf0732E9c0fec72a49FD1DEfAEAC", "cvx_eth_f": "0xB576491F1E6e5E62f1d8F26062Ee822B40B0E0d4", "badgerFRAXBP_f": "0x13B876C26Ad6d21cb87AE459EaF6d7A1b788A113", + "ebtc_wsteth": "0x94a5B3A7AAF67415B7F5973ed1Adf542897a45F1", + }, + "crv_gauges": { + "ebtc_wsteth_gauge": "0xBEb468BEb5C72d8b4d4f076F473Db398562769ed", }, # mStable want tokens "mstable_vaults": { diff --git a/interfaces/curve/ILiquidityGaugeV6.sol b/interfaces/curve/ILiquidityGaugeV6.sol new file mode 100644 index 00000000..52eaf6cd --- /dev/null +++ b/interfaces/curve/ILiquidityGaugeV6.sol @@ -0,0 +1,6 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.7.0; + +interface ILiquidityGaugeV6 { + function deposit_reward_token(address _reward_token, uint256 _amount, uint256 _epoch) external; +} \ No newline at end of file diff --git a/scripts/curve/lido_gauge_incentives.py b/scripts/curve/lido_gauge_incentives.py new file mode 100644 index 00000000..91321436 --- /dev/null +++ b/scripts/curve/lido_gauge_incentives.py @@ -0,0 +1,40 @@ +from great_ape_safe import GreatApeSafe +from helpers.addresses import r +from brownie import interface + +STETH = r.treasury_tokens.STETH +WSTETH = r.treasury_tokens.WSTETH +GAUGE = r.crv_gauges.ebtc_wsteth_gauge + +TROPS = r.badger_wallets.treasury_ops_multisig + +MONTH = 60 * 60 * 24 * 7 * 4 # Epoch + +def main(amount=0, epoch=MONTH, use_wsteth=True): + """ + Deposit stETH or wstETH into the eBTC/wstETH Curve gauge for a given epoch + + Args: + amount (int): Decimal amount of stETH or wstETH to deposit + epoch (int): Epoch length to deposit the amount, default 1 month + use_wsteth (bool): Use wstETH instead of stETH + """ + safe = GreatApeSafe(TROPS) + gauge = safe.contract(GAUGE, Interface=interface.ILiquidityGaugeV6) + amount = int(float(amount) * 1e18) + + if use_wsteth: + token = safe.contract(WSTETH) + else: + token = safe.contract(STETH) + + # 1. Approve amount + token.approve(GAUGE, amount) + + # 2. Deposit amount + gauge.deposit_reward_token(token.address, amount, epoch) + + # 3. Confirm deposit + print(gauge.reward_data(token)) + + safe.post_safe_tx() \ No newline at end of file