Skip to content

Conversation

@ndr-ds
Copy link
Contributor

@ndr-ds ndr-ds commented Jan 29, 2026

Motivation

Add support for benchmarking PM (Prediction Market) order submission to measure performance under load. This enables stress testing the prediction market infrastructure with configurable order patterns.

Proposal

Adds a new linera benchmark pm subcommand that:

  • Creates benchmark chains and funds them via the standard Linera faucet
  • Claims BASE tokens from the PM faucet for each benchmark chain
  • Generates PM orders (YES/NO bids) and submits them to the market chain
  • Supports configurable order patterns:
  • matching: Generates complementary YES+NO bid pairs that will match
  • mixed: Configurable mix of matching and non-matching orders

AMM not supported yet.

Key changes:

  • New BenchmarkMode enum to distinguish between native transfer, fungible transfer, and PM benchmarks
  • PmOrderGenerator for generating order book operations with realistic price distributions (does not query and follow the actual market value)
  • Refactored BenchmarkOperationGenerator (renamed from ChainDestinationManager) to handle different operation
    types

Test Plan

  • Manual testing against deployed PM infrastructure on andre-test-c77l3j network
  • Verified benchmark chains are created and funded correctly
  • Confirmed orders are submitted at the target BPS rate

@ndr-ds ndr-ds force-pushed the ndr-ds/pm_benchmark_client_backport branch from 7e60e81 to 399beba Compare January 29, 2026 19:55
@ndr-ds ndr-ds force-pushed the ndr-ds/pm_benchmark_client_backport branch from 399beba to 890efc1 Compare January 29, 2026 22:44

/// Pattern for generating PM orders (for CLI parsing).
///
/// These types mirror pm-engine but are defined here to avoid a dependency on pm-app.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not ideal. We're still changing the APIs

Copy link
Contributor Author

ndr-ds commented Feb 10, 2026

Will take a different approach with this, so closing

@ndr-ds ndr-ds closed this Feb 10, 2026
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