-
Notifications
You must be signed in to change notification settings - Fork 6
feat: add basic prediction market #17
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
base: main
Are you sure you want to change the base?
Conversation
| current_supply: u128, | ||
| total_liquidity: u128, | ||
| ) -> (u128, u128) { | ||
| assert(total_liquidity > 0 as u128, "ZERO_LIQUIDITY"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this cast necessary?
| /// | ||
| /// Returns: (price_before, price_after, price_impact_percentage) | ||
| /// All as fixed-point values | ||
| pub fn calculate_price_impact( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how is this function intended to be used? is it just a helper? I see its not called from anywhere
| }; | ||
| use dep::uint_note::uint_note::{UintNote, PartialUintNote}; | ||
|
|
||
| // Storage slots for deriving partial note locations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be helpful to add another line or 2 about why this is needed, or link to a relevant docs page
| collateral_balances: Map<AztecAddress, PrivateSet<UintNote, Context>, Context>, | ||
| yes_supply: PublicMutable<u128, Context>, | ||
| no_supply: PublicMutable<u128, Context>, | ||
| liquidity_constant: PublicMutable<u128, Context>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this isn't actually a constant right? maybe rename to something like "total_liquidity" or something that is more clear
| ## Overview | ||
|
|
||
| This contract allows users to: | ||
| - **Vote on binary outcomes** (YES/NO) **anonymously** - no one knows WHO voted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would consider this a vote or a bet? Are users actually using this contract to make decisions, or just to bet on them?
| aztec-up 3.0.0-devnet.4 | ||
|
|
||
| # Install npm dependencies | ||
| npm install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wdyt about updating this to be yarn install instead, to keep it consistent with our other repos/examples/docs? we pretty much use yarn everywhere else
No description provided.