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: prep separate directory for seeding with sims #38

Merged
merged 8 commits into from
Mar 22, 2024

Conversation

petrovska-petro
Copy link
Collaborator

Run sim:

brownie run scripts/seeding/seeding_prep sim_seed_pool_w1_and_w2

@petrovska-petro
Copy link
Collaborator Author

details on the requirements for each week can be found at: https://discord.com/channels/1011322803414388897/1218208598199500870/1219585892973281361

Copy link
Collaborator

@sajanrajdev sajanrajdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

  • Adds wsteth and reth to the repo, addresses confirmed
  • Creates prep script to consolidate the treasury's rETH into stETH and create the pool (confirmed eBTC address)
  • Creates scripts to seed the pool by batches with amounts according to treasury decision (left a comment)
  • Adds simulations for the full cycle

Only comment is that once the CDP is created on week1, the following weeks should use the same CDP

@petrovska-petro
Copy link
Collaborator Author

as discussed w/ @sajanrajdev we will split this pr into separate pr's. the focus on this one is uniquely the prep for swapping into the collateral and pool creation

cmd:

brownie run scripts/seeding/seeding_prep prep

Copy link
Collaborator

@sajanrajdev sajanrajdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Script was modified:

  • Limits amount of rETH to be swapped for stETH to ~800 (uses CG's spot to estimate amount of rETH to add)
  • Modifies the top-up portion of the script so that the original CDP is adjusted in order to borrow the eBTC required for the top-ups. It first tops-up collateral and then borrows more debt while preserving the target ICR (200%) - LGTM (Note: For the future, we should incorporate the adjustCdpWithColl function so that we can do this two actions in one transaction).
  • Simulations show effective pool creation, eBTC borrowing and minting of positions (seeding) - LGTM
  • Passing target ICR to function as 2e18 (200%) as expected by functions - LGTM

@petrovska-petro petrovska-petro merged commit 3b7b30f into feat/release-0.8 Mar 22, 2024
1 check passed
@petrovska-petro petrovska-petro deleted the feat/seed-exercise branch March 22, 2024 00:44
Copy link

@rayeaster rayeaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM to have support for ebtc liquidity initialization in uniswap v3

@@ -1582,9 +1582,7 @@ def cdp_withdraw_debt(self, cdp_id, debt_withdrawable_amount):
sync_tcr = self.cdp_manager.getSyncedTCR(feed_price)
assert sync_tcr > self.CCR

# verify: existing debt in cdp id is greater than amount to wd
debt_before = self.cdp_manager.getCdpDebt(cdp_id)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might use cdp_manager.getSyncedCdpDebt() for debt_before

@sajanrajdev sajanrajdev mentioned this pull request Mar 22, 2024
@sajanrajdev
Copy link
Collaborator

Transaction sent: 0x991f8a5cb1992c9074d7096f3a35f285e815a68a9b3f62b1645f540906024b63
  Gas price: 0.0 gwei   Gas limit: 12000000   Nonce: 1
  ILido.approve confirmed   Block: 19514873   Gas used: 54086 (0.45%)

Transaction sent: 0x33c9d7de1cff060b6c2a72b714c0bc776e5ae6fb0f809bfb4844f9ffaabd723f
  Gas price: 0.0 gwei   Gas limit: 12000000   Nonce: 2
  IBorrowerOperations.openCdp confirmed   Block: 19514874   Gas used: 539148 (4.49%)

$ebtc balance to seed the pool: 2567075903016267000
$wbtc balance to seed the pool: 256707590
Transaction sent: 0xd97f1ec5dfdac69bdef8e676d6cbaecad3e9a42a9f996aa4383450011cd3a55e
  Gas price: 0.0 gwei   Gas limit: 12000000   Nonce: 3
  IMintableERC20.approve confirmed   Block: 19514875   Gas used: 44932 (0.37%)

Transaction sent: 0x73907cfb59278950bde77419664ce4679bcab445e66006c70590714641c18d8a
  Gas price: 0.0 gwei   Gas limit: 12000000   Nonce: 4
  IEBTCToken.approve confirmed   Block: 19514876   Gas used: 44222 (0.37%)

Transaction sent: 0x5e65a82415e438438d615c411658e2cf96db02e1b8737fd08fc0a16ab5a8c326
  Gas price: 0.0 gwei   Gas limit: 12000000   Nonce: 5
  INonFungiblePositionManager.mint confirmed   Block: 19514877   Gas used: 449454 (3.75%)

nft_from_0925_to_099 token id: 697435
Transaction sent: 0x0ca2aa662864ca73913ebaecea7a064fd6a4fff21f0eca61b9cad3d18728fb48
  Gas price: 0.0 gwei   Gas limit: 12000000   Nonce: 6
  IMintableERC20.approve confirmed   Block: 19514878   Gas used: 29932 (0.25%)

Transaction sent: 0xe97e1cd2afb87783eb4812d82c9032a15174097c6a86ae81fa42f4860e82f51b
  Gas price: 0.0 gwei   Gas limit: 12000000   Nonce: 7
  IEBTCToken.approve confirmed   Block: 19514879   Gas used: 29222 (0.24%)

Transaction sent: 0x265e404229974bc5cbd82fd8c4c73113c341fdd74d3f6a7c6a2fd2044578ca1c
  Gas price: 0.0 gwei   Gas limit: 12000000   Nonce: 8
  INonFungiblePositionManager.mint confirmed   Block: 19514880   Gas used: 379842 (3.17%)

nft_from_099_to_1 token id: 697436
Transaction sent: 0xcc42a19524bb56ba9adb122680654ff3e60d720c60e0b877b7e58aa4b3c4ded9
  Gas price: 0.0 gwei   Gas limit: 12000000   Nonce: 9
  IMintableERC20.approve confirmed   Block: 19514881   Gas used: 29932 (0.25%)

Transaction sent: 0x7916aeca0c5228e004aaec02ac3a345f4d52e1eea43e72457be17a6c247ceb4f
  Gas price: 0.0 gwei   Gas limit: 12000000   Nonce: 10
  IEBTCToken.approve confirmed   Block: 19514882   Gas used: 29222 (0.24%)

Transaction sent: 0xf3d6362d1fb33db7e7fbc6abee1435f8b34321fba1dd67ed1e2a1ab39e84d30a
  Gas price: 0.0 gwei   Gas limit: 12000000   Nonce: 11
  INonFungiblePositionManager.mint confirmed   Block: 19514883   Gas used: 314930 (2.62%)

nft_from_1_to_101 token id: 697437
Transaction sent: 0x39fd7bf7dd911d49ac66ca7f7b70bcb815e1e715ca3f2a4202403338d72da477
  Gas price: 0.0 gwei   Gas limit: 12000000   Nonce: 12
  IMintableERC20.approve confirmed   Block: 19514884   Gas used: 29932 (0.25%)

Transaction sent: 0xd54f977b6cad341fad2b4d43b4a0af2e8f597ab054159d2e6381c38054cf58ca
  Gas price: 0.0 gwei   Gas limit: 12000000   Nonce: 13
  IEBTCToken.approve confirmed   Block: 19514885   Gas used: 29222 (0.24%)

Transaction sent: 0xb85894b6ec6d39d8a32521a87c779d204ec4e86c0bf51a1e388e10a632705d54
  Gas price: 0.0 gwei   Gas limit: 12000000   Nonce: 14
  INonFungiblePositionManager.mint confirmed   Block: 19514886   Gas used: 314846 (2.62%)

nft_from_101_to_108 token id: 697438

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants