diff --git a/brownie/abi/oethb_dripper.json b/brownie/abi/oethb_dripper.json new file mode 100644 index 0000000000..5aaf604d48 --- /dev/null +++ b/brownie/abi/oethb_dripper.json @@ -0,0 +1,223 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint192", + "name": "oldDripRate", + "type": "uint192" + }, + { + "indexed": false, + "internalType": "uint192", + "name": "newDripRate", + "type": "uint192" + } + ], + "name": "DripRateUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousGovernor", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newGovernor", + "type": "address" + } + ], + "name": "GovernorshipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousGovernor", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newGovernor", + "type": "address" + } + ], + "name": "PendingGovernorshipTransfer", + "type": "event" + }, + { + "inputs": [], + "name": "availableFunds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "claimGovernance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "collect", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "collectAndRebase", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "drip", + "outputs": [ + { + "internalType": "uint64", + "name": "lastCollect", + "type": "uint64" + }, + { + "internalType": "uint192", + "name": "perSecond", + "type": "uint192" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "dripDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isGovernor", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "setDripDuration", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint192", + "name": "_perSecond", + "type": "uint192" + } + ], + "name": "setDripRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newGovernor", + "type": "address" + } + ], + "name": "transferGovernance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_asset", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "transferToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] \ No newline at end of file diff --git a/brownie/runlogs/2024_09_strategist.py b/brownie/runlogs/2024_09_strategist.py index 5ecb944a2a..c97058f63d 100644 --- a/brownie/runlogs/2024_09_strategist.py +++ b/brownie/runlogs/2024_09_strategist.py @@ -600,7 +600,7 @@ def main(): ) ) - amo_snapsnot() + amo_snapshot() swapWeth = True swapAmount = 0 minAmount = swapAmount * 0.98 @@ -627,7 +627,7 @@ def main(): txs.append(vault_value_checker.checkDelta(profit, (1 * 10**18), vault_change, (1 * 10**18), {'from': OETHB_STRATEGIST})) - amo_snapsnot() + amo_snapshot() print("--------------------") print("Profit ", c18(profit), profit) print("Vault Change ", c18(vault_change), vault_change) @@ -655,7 +655,7 @@ def main(): ) ) - amo_snapsnot() + amo_snapshot() swapWeth = False swapAmount = 3 * 10**18 minAmount = swapAmount * 0.98 @@ -682,7 +682,7 @@ def main(): txs.append(vault_value_checker.checkDelta(profit, (0.1 * 10**18), vault_change, (10 * 10**18), {'from': OETHB_STRATEGIST})) - amo_snapsnot() + amo_snapshot() print("--------------------") print("Profit ", c18(profit), profit) print("Vault Change ", c18(vault_change), vault_change) @@ -710,7 +710,7 @@ def main(): ) ) - amo_snapsnot() + amo_snapshot() swapWeth = True swapAmount = 0 minAmount = swapAmount * 0.98 @@ -737,7 +737,7 @@ def main(): txs.append(vault_value_checker.checkDelta(profit, (1 * 10**18), vault_change, (1 * 10**18), {'from': OETHB_STRATEGIST})) - amo_snapsnot() + amo_snapshot() print("--------------------") print("Profit ", c18(profit), profit) print("Vault Change ", c18(vault_change), vault_change) @@ -1219,7 +1219,7 @@ def main(): ) ) - amo_snapsnot() + amo_snapshot() swapWeth = True swapAmount = 0 minAmount = swapAmount * 0.98 @@ -1246,7 +1246,7 @@ def main(): txs.append(vault_value_checker.checkDelta(profit, (1 * 10**18), vault_change, (1 * 10**18), {'from': OETHB_STRATEGIST})) - amo_snapsnot() + amo_snapshot() print("--------------------") print("Profit ", c18(profit), profit) print("Vault Change ", c18(vault_change), vault_change) diff --git a/brownie/runlogs/2024_10_strategist.py b/brownie/runlogs/2024_10_strategist.py index 4fcd62aa90..173bcd9e2b 100644 --- a/brownie/runlogs/2024_10_strategist.py +++ b/brownie/runlogs/2024_10_strategist.py @@ -21,7 +21,7 @@ def main(): ) ) - amo_snapsnot() + amo_snapshot() swapWeth = True swapAmount = 1e18 minAmount = swapAmount * 0.98 @@ -48,7 +48,7 @@ def main(): txs.append(vault_value_checker.checkDelta(profit, (1 * 10**18), vault_change, (1 * 10**18), {'from': OETHB_STRATEGIST})) - amo_snapsnot() + amo_snapshot() print("--------------------") print("Profit ", c18(profit), profit) print("Vault Change ", c18(vault_change), vault_change) @@ -233,7 +233,7 @@ def main(): ) ) - amo_snapsnot() + amo_snapshot() swapWeth = True swapAmount = 0 minAmount = swapAmount * 0.98 @@ -260,7 +260,42 @@ def main(): txs.append(vault_value_checker.checkDelta(profit, (1 * 10**18), vault_change, (1 * 10**18), {'from': OETHB_STRATEGIST})) - amo_snapsnot() + amo_snapshot() print("--------------------") print("Profit ", c18(profit), profit) print("Vault Change ", c18(vault_change), vault_change) + + +# ---------------------------------------------------------- +# Oct 11, 2024 - Fund dripper and change drip rate +# ---------------------------------------------------------- +from world_base import * +def main(): + txs = [] + + amount = 79759 * 10**18 + min_amount = 39.5 * 10**18 + fee_bps = 2000 # 20% + send_to_dripper = True + + # Approve harvester to move AERO + txs.append( + aero.approve(OETHB_HARVESTER, amount, from_strategist) + ) + + # Collect AERO from the strategy & swap to get yields + txs.append( + harvester.harvestAndSwap(amount, min_amount, fee_bps, send_to_dripper, from_strategist) + ) + + # Change dripper rate + txs.append( + dripper.setDripRate(106200624970822, from_strategist) + ) + + # Reset harvester allowance + txs.append( + aero.approve(OETHB_HARVESTER, 0, from_strategist) + ) + + print(to_gnosis_json(txs, OETHB_STRATEGIST, "8453")) \ No newline at end of file diff --git a/brownie/world_base.py b/brownie/world_base.py index d84679b5c0..bc919528e3 100644 --- a/brownie/world_base.py +++ b/brownie/world_base.py @@ -25,7 +25,7 @@ woeth_strat = load_contract('woeth_strategy', OETHB_WOETH_STRATEGY) -dripper = load_contract('dripper', OETHB_DRIPPER) +dripper = load_contract('oethb_dripper', OETHB_DRIPPER) harvester = load_contract('oethb_harvester', OETHB_HARVESTER) @@ -46,7 +46,7 @@ def scale_amount(from_token, to_token, amount, decimals=0): return int(scale_amount * 10**decimals) / (10**decimals) -def amo_snapsnot(): +def amo_snapshot(): wethPoolBalance = weth.balanceOf(AERODROME_WETH_OETHB_POOL_BASE) superOETHbPoolBalance = oethb.balanceOf(AERODROME_WETH_OETHB_POOL_BASE) poolTotal = wethPoolBalance + superOETHbPoolBalance