OriginProtocol / origin-dollar

OUSD and OETH are stablecoins that passively accrue yield while you are holding it
https://originprotocol.com
MIT License
119 stars 80 forks source link

Runlog for deposit to native staking strategy #2101

Closed naddison36 closed 3 months ago

naddison36 commented 3 months ago

Changes

Script

# -------------------------------------
# Jun 18, 2024 - Initial deposit to Native Staking Strategy
# -------------------------------------
from world import *

def main():
  with TemporaryForkForReallocations() as txs:
    # Before
    txs.append(vault_oeth_core.rebase(std))
    txs.append(oeth_vault_value_checker.takeSnapshot(std))

    # Deposit WETH to Native Staking Strategy
    txs.append(
      vault_oeth_admin.depositToStrategy(
        OETH_NATIVE_STAKING_STRAT, 
        [WETH], 
        [124 * 10**18],
        std
      )
    )

    # After
    vault_change = vault_oeth_core.totalValue() - oeth_vault_value_checker.snapshots(STRATEGIST)[0]
    supply_change = oeth.totalSupply() - oeth_vault_value_checker.snapshots(STRATEGIST)[1]
    profit = vault_change - supply_change
    txs.append(oeth_vault_value_checker.checkDelta(profit, (1 * 10**18), vault_change, (1 * 10**18), std))
    print("-----")
    print("Profit", "{:.6f}".format(profit / 10**18), profit)
    print("OETH supply change", "{:.6f}".format(supply_change / 10**18), supply_change)
    print("Vault Change", "{:.6f}".format(vault_change / 10**18), vault_change)
    print("-----")

Results

Transaction sent: 0x6935c05363a17cd23fed6ac82ef65383ff9edc8611a9e376b52e5e577f0046dd
  Gas price: 0.0 gwei   Gas limit: 30000000   Nonce: 1
  vault_core.rebase confirmed   Block: 20114701   Gas used: 538075 (1.79%)

Transaction sent: 0x0c5193954757b00567283a58f9fd8dac288d0fd48790cebf9650c31eace61f6f
  Gas price: 0.0 gwei   Gas limit: 30000000   Nonce: 2
  vault_value_checker.takeSnapshot confirmed   Block: 20114702   Gas used: 499743 (1.67%)

Transaction sent: 0x78dfae21339c69c416d8b875334603919145373c3ad2d555714ed0d371a82e5e
  Gas price: 0.0 gwei   Gas limit: 30000000   Nonce: 3
  Transaction confirmed   Block: 20114703   Gas used: 131937 (0.44%)

Transaction sent: 0x53cd640b17d49878d977e1ab395d61a7407fcc924c65def6407d5a12c8621808
  Gas price: 0.0 gwei   Gas limit: 30000000   Nonce: 4
  vault_value_checker.checkDelta confirmed   Block: 20114704   Gas used: 494168 (1.65%)

-----
Profit 0.000000 0
OETH supply change 0.000000 0
Vault Change 0.000000 0
-----
----
Gnosis json:
{"version": "1.0", "chainId": "1", "createdAt": 1718665498, "meta": {"name": "Transactions Batch", "description": "", "txBuilderVersion": "1.16.1", "createdFromSafeAddress": "0xF14BBdf064E3F67f51cd9BD646aE3716aD938FDC", "createdFromOwnerAddress": ""}, "transactions": [{"to": "0x39254033945AA2E4809Cc2977E7087BEE48bd7Ab", "value": "0", "data": "0xaf14052c", "contractMethod": null, "contractInputsValues": null}, {"to": "0x31FD8618379D8e473Ec2B1540B906E8e11D2A99b", "value": "0", "data": "0xb3d3d37e", "contractMethod": null, "contractInputsValues": null}, {"to": "0x39254033945AA2E4809Cc2977E7087BEE48bd7Ab", "value": "0", "data": "0x840c4c7a00000000000000000000000034edb2ee25751ee67f68a45813b22811687c0238000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000006b8d87f0514700000", "contractMethod": null, "contractInputsValues": null}, {"to": "0x31FD8618379D8e473Ec2B1540B906E8e11D2A99b", "value": "0", "data": "0xb1d79df500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000de0b6b3a7640000", "contractMethod": null, "contractInputsValues": null}]}
codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 61.86%. Comparing base (c06bfb6) to head (5b3c5fa).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2101 +/- ## ======================================= Coverage 61.86% 61.86% ======================================= Files 66 66 Lines 3322 3322 Branches 863 863 ======================================= Hits 2055 2055 Misses 1264 1264 Partials 3 3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.