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: market matching pool tidy up #100

Conversation

eoin-betdex
Copy link
Contributor

This change updates the MarketMatchingPool account to include the data used as seeds in the data stored in the account. This should make it easy for anyone using/building on the protocol to interact with MarketMatchingPools.

This also enables the addition of getProgramAccounts queries for these accounts simplifying the fetching of interesting MarketMatchingPools.

The fields added are:

    pub market_outcome_index: u16,
    pub for_outcome: bool,
    pub price: f64,

As the seeds are stored on the account now, including the market pk, there was no longer any need to rely on validation of the seeds in the CloseMarketMatchingPool context to ensure the market was valid for the matching pool. This can now be done using a has_one constraint.

Additionally purchaser was renamed to payer to better fit convention in the protocol.

A bug was also discovered in the client query code when fields being used as filters were non-contiguous incorrect filtering would occur. This has been fixed in this PR also.

@eoin-betdex eoin-betdex merged commit 7031252 into MonacoProtocol:develop Jul 10, 2023
@eoin-betdex eoin-betdex deleted the feat/mp-96-MarketMatchingPool-tidy-up branch July 10, 2023 08:46
This was referenced Jul 11, 2023
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.

3 participants