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

feat: curve incentives script #1540

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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
6 changes: 6 additions & 0 deletions helpers/addresses.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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": {
Expand Down
6 changes: 6 additions & 0 deletions interfaces/curve/ILiquidityGaugeV6.sol
Original file line number Diff line number Diff line change
@@ -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;
}
41 changes: 41 additions & 0 deletions scripts/curve/lido_gauge_incentives.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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)
sajanrajdev marked this conversation as resolved.
Show resolved Hide resolved

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()
Loading