Skip to content

Use arbitrary-precision numeric types for odds, probability and margin fields #130

Description

@sabomichal

Problem

The SDK currently exposes some calculation-sensitive values using binary floating-point types:

@Nullable public String price;

@Nullable public double probability;

@Nullable public float calculatedMargin;

Using float and double may introduce rounding errors, which is undesirable in trading and betting systems where precise calculations are important.

Proposal

Replace these fields with BigDecimal (or introduce equivalent arbitrary-precision alternatives):

@Nullable public BigDecimal price;

@Nullable public BigDecimal probability;

@Nullable public BigDecimal calculatedMargin;

This would provide deterministic calculations and avoid precision issues when consumers calculate implied probabilities, margins, or other derived values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions