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

Chore) update entry point names #162

Merged
merged 18 commits into from
Sep 16, 2024
Merged

Conversation

0xDegenDeveloper
Copy link
Collaborator

@0xDegenDeveloper 0xDegenDeveloper commented Sep 10, 2024

OptionRound Updates

  • Added get_bid_tree_nonce()
  • update_bid(bid_id, price_increase) only increases the price of a bid by price_increase. Users can no longer increase their bid amount

Changed

  • starting_liquidity() -> get_starting_liquidity()
  • total_premiums() -> get_total_premium()
  • unsold_liquidity() -> get_unsold_liquidity()
  • clearing_price() -> get_clearing_price()
  • total_payout() -> get_total_payout()
  • vault_address() -> get_vault_address()
  • total_options_sold() -> get_options_sold()
  • total_options_available() -> get_options_available()
  • get_refundable_balance_for() -> get_account_refundable_balance()
  • get_mintable_options_for() -> get_account_mintable_options()
  • get_total_option_balance_for() -> get_account_total_options()
  • get_payout_balance_for() -> get_account_payout_balance()
  • get_bidding_nonce_for() -> get_account_bid_nonce()
  • get_bids_for() -> get_account_bids()
  • settle_option_round() -> settle_round()

Storage Var

  • bidder_nonces -> account_bid_nonce

Events

  • BidAccepted -> BidPlaced
  • AuctionStarted: {total_options_available} -> {starting_liquidity, options_available}
  • AuctionEnded: {clearing_price, total_options_sold} -> {options_sold, clearing_price, unsold_liquidity}
  • OptionRoundSettled: {total_payout, payout_per_option, settlement_price} -> {settlement_price, payout_per_option}
  • BidPlaced: {account, nonce, amount, price} -> {account, bid_id, amount, price, bid_tree_nonce_now}
  • BidUpdated: {account, id, old_amount, old_price, new_amount, new_price} -> {account, bid_id, price_increase, bid_tree_nonce_now}
  • OptionsMinted: {account, amount} -> {account, minted_amount}
  • UnusedBidsRefunded: {account, amount} -> {account, refunded_amount}
  • OptionsExercised: {account, num_options, amount} -> {account, number_of_options, exercised_amount}

Structs

  • Bid{id, nonce, owner, amount, price} -> {bid_id, owner, amount, price, tree_nonce}

Vault Updates

  • Dropped vault_manager()
  • Dropped get_lp_starting_balance()
  • Constructor dropped vault_manager,

Changes

  • vault_type() -> get_vault_type()
  • get_market_aggregator() -> get_market_aggregator_address()
  • eth_address() -> get_eth_address()
  • current_round_id() -> get_current_round_id()
  • get_total_balance() -> get_vault_total_balance()
  • get_total_locked_balance() -> get_vault_locked_balance()
  • get_total_unlocked_balance() -> get_vault_unlocked_balance()
  • get_total_stashed_balance() -> get_vault_stashed_balance()
  • get_total_queued_balance() -> get_vault_queued_bps()
  • 'get_lp_total_balance()->get_account_total_balance()`
  • get_lp_locked_balance() -> get_account_locked_balance()
  • get_lp_unlocked_balance() -> get_account_unlocked_balance()
  • get_lp_stashed_balance() -> get_account_stashed_balance()
  • get_lp_queued_bps() -> get_account_queued_bps()
  • deposit_liquidity() -> deposit()
  • withdraw_liquidity() -> withdraw()
  • claim_queued_liquidity() -> withdraw_stash()
  • settle_option_round() -> settle_round()

Storage Vars

  • market_aggregator -> market_aggregator_address
  • total_locked_balance -> vault_locked_balance
  • total_unlocked_balance -> vault_unlocked_balance
  • total_stashed_balance -> vault_stashed_balance
  • premiums_moved -> is_premiums_moved
  • withdraw_checkpoints -> position_checkpoints
  • queue_checkpoints -> stash_checkpoints
  • Combined round_queued_liquidity & user_queued_liquidity into a single queued_liquidity mapping. Instead of a mapping for round_id -> total_amount & (account, round_id) -> amount, we can just get the total for each round at slot (vault_address, round_id) -> total_amount & the account's total at slot (account_address, round_id) -> amount

Events

  • QueuedLiquidityCollected -> StashWithdrawn
  • WithdrawQueued: {account, bps, account_queued_amount_now, vault_queued_amount_now} -> {account, bps, account_queued_liquidity_now, vault_queued_liquidity_now}

reduced some logic to use less steps

updated storage var names for clarity
-removed vault_manager
-updated calls to new round interface
-changed event to StashWithdrawn (instead of QueuedLiquidityCollected)
-fixed member names for clarity
- change update bid to taking in price increase, amount cannot be altered now
- update account bid nonce to u64 to match tree nonce
- made auction start event also emit starting liquidity
- changed bid accepted event to bid placed event
- bid update event emits price increase
- made auction end event also emit unsold liquidity
- dropped total payout from round settled event
-
also store vault's and accounts' queued liquidity in the same mapping
@0xDegenDeveloper 0xDegenDeveloper marked this pull request as ready for review September 11, 2024 18:42
* Edits

* Remove Outputs

* Update gitignore

* Update withdrawal premiums logic

* Fuzzing
@dhruv035 dhruv035 merged commit 1c33f73 into develop Sep 16, 2024
2 checks passed
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.

2 participants