-
Notifications
You must be signed in to change notification settings - Fork 33
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
sajanrajdev
wants to merge
4
commits into
main
Choose a base branch
from
feat/curve-lido-incentives
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ | ||
"version": "1.0", | ||
"chainId": "1", | ||
"createdAt": 1716833176007, | ||
"meta": { | ||
"name": "Lido incentives", | ||
"description": "", | ||
"txBuilderVersion": "1.16.5", | ||
"createdFromSafeAddress": "0x042B32Ac6b453485e357938bdC38e0340d4b9276", | ||
"createdFromOwnerAddress": "", | ||
"checksum": "0x399a8a1116b44bdee7fc0fd346975092a154cb5bf1698941d9a3de226986a5a8" | ||
}, | ||
"transactions": [ | ||
{ | ||
"to": "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0", | ||
"value": "0", | ||
"data": null, | ||
"contractMethod": { | ||
"inputs": [ | ||
{ | ||
"name": "spender", | ||
"type": "address", | ||
"internalType": "address" | ||
}, | ||
{ | ||
"name": "amount", | ||
"type": "uint256", | ||
"internalType": "uint256" | ||
} | ||
], | ||
"name": "approve", | ||
"payable": false | ||
}, | ||
"contractInputsValues": { | ||
"spender": "0xBEb468BEb5C72d8b4d4f076F473Db398562769ed", | ||
"amount": "4220000000000000000" | ||
} | ||
}, | ||
{ | ||
"to": "0xBEb468BEb5C72d8b4d4f076F473Db398562769ed", | ||
"value": "0", | ||
"data": null, | ||
"contractMethod": { | ||
"inputs": [ | ||
{ | ||
"name": "_reward_token", | ||
"type": "address" | ||
}, | ||
{ | ||
"name": "_amount", | ||
"type": "uint256" | ||
}, | ||
{ | ||
"name": "_epoch", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "deposit_reward_token", | ||
"payable": false | ||
}, | ||
"contractInputsValues": { | ||
"_reward_token": "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0", | ||
"_amount": "4220000000000000000", | ||
"_epoch": "2419200" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
from great_ape_safe import GreatApeSafe | ||
from helpers.addresses import r | ||
from brownie import interface | ||
from decimal import Decimal | ||
|
||
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): | ||
""" | ||
NOTE: Script fails with active ganache/brownie versions. As a workaround, | ||
the the "Lido_incentives.json" file contains a batch of the approval and deposit transactions. | ||
This can be imported into the Gnosis Safe UI to perform the operation below. Note that the | ||
amount to be approved and deposited must be adjusted as needed either through the JSON or the UI. | ||
|
||
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(Decimal(amount) * 1e18) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. did you test this? i dont think you can multiply a
|
||
|
||
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() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice adding the json file ✅
before posting it w/ either method json or working env worth having clarity of the final arguments for
deposit_reward_token
based on latest convos and then post in the pr the official json filed which will get posted