Skip to content

Conversation

@Javdu10
Copy link
Contributor

@Javdu10 Javdu10 commented Jan 27, 2026

Pull Request

NautilusTrader prioritizes correctness and reliability, please follow existing patterns for validation and testing.

  • I have reviewed the CONTRIBUTING.md and followed the established practices

Summary

This is to start a discussion about OwnOrderBook and binary markets... In the polymarket adapter we have 2 IntrumentId for YES and NO side, with the current system they would have their own OwnOrderBook, but to have proper view of the market we need to somehow diff the own bids of the NO side against the YES asks

Related Issues/PRs

Type of change

  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Improvement (non-breaking)
  • Breaking change (impacts existing behavior)
  • Documentation update
  • Maintenance / chore

Breaking change details (if applicable)

N/A

Documentation

  • Documentation changes follow the style guide (docs/developer_guide/docs.md)

Release notes

  • I added a concise entry to RELEASES.md that follows the existing conventions (when applicable)

Testing

Ensure new or changed logic is covered by tests.

  • Affected code paths are already covered by the test suite
  • I added/updated tests to cover new or changed logic

@cjdsellers cjdsellers changed the title own_synthetic_book using (1 - price) parity Add synthetic book support for binary markets Jan 29, 2026
@cjdsellers
Copy link
Member

Hi @Javdu10

Thanks for the PR, I think this is a good use case to support binary/prediction markets - but this needs some further design work for better integration.

Current approach here:

  • Adds a 6th optional parameter to core OrderBook methods
  • Embeds binary market-specific logic (1 - price) into a general-purpose component
  • Creates API inconsistency (grouped functions don't have this parameter)

I'm wondering if this functionality would be better as a standalone component rather than adding parameters to OrderBook?

Some alternatives to consider:

  • A utility function that combines/transforms OwnOrderBooks before passing to existing methods
  • A BinaryMarketBookView (or similarly named) wrapper that handles the transformation externally

Let me know your thoughts?

@Javdu10
Copy link
Contributor Author

Javdu10 commented Jan 30, 2026

Hey @cjdsellers

From my perspective as futur user, I would also be interested in an object onto which I can call other utilities functions like "get_avg_px_for_quantity"

So I would lean for BinaryMarketBookView

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