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

Update runlog and scripts #2274

Merged
merged 6 commits into from
Oct 11, 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
223 changes: 223 additions & 0 deletions brownie/abi/oethb_dripper.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
16 changes: 8 additions & 8 deletions brownie/runlogs/2024_09_strategist.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ def main():
)
)

amo_snapsnot()
amo_snapshot()
swapWeth = True
swapAmount = 0
minAmount = swapAmount * 0.98
Expand All @@ -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)
Expand Down Expand Up @@ -655,7 +655,7 @@ def main():
)
)

amo_snapsnot()
amo_snapshot()
swapWeth = False
swapAmount = 3 * 10**18
minAmount = swapAmount * 0.98
Expand All @@ -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)
Expand Down Expand Up @@ -710,7 +710,7 @@ def main():
)
)

amo_snapsnot()
amo_snapshot()
swapWeth = True
swapAmount = 0
minAmount = swapAmount * 0.98
Expand All @@ -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)
Expand Down Expand Up @@ -1219,7 +1219,7 @@ def main():
)
)

amo_snapsnot()
amo_snapshot()
swapWeth = True
swapAmount = 0
minAmount = swapAmount * 0.98
Expand All @@ -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)
Expand Down
43 changes: 39 additions & 4 deletions brownie/runlogs/2024_10_strategist.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def main():
)
)

amo_snapsnot()
amo_snapshot()
swapWeth = True
swapAmount = 1e18
minAmount = swapAmount * 0.98
Expand All @@ -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)
Expand Down Expand Up @@ -233,7 +233,7 @@ def main():
)
)

amo_snapsnot()
amo_snapshot()
swapWeth = True
swapAmount = 0
minAmount = swapAmount * 0.98
Expand All @@ -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"))
4 changes: 2 additions & 2 deletions brownie/world_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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
Expand Down
Loading