Skip to content

OHLC oracle: bigint or number for crypto.decimal scale #230

@s-leroux

Description

@s-leroux

OHLC oracle passes BigInt(crypto.decimal) to Fixed.div; decimal should be typed as bigint at the boundary to avoid repeated coercion bugs.

Location: src/services/oracles/ohlcoracle.mts:77

Code:

BigInt(crypto.decimal), // XXX crypto.decimal should be a bigint

Possible approach: Widen crypto metadata typings so decimal is already bigint (or validated at construction); remove BigInt() once types guarantee correctness.

Concerns: Numbers are highly optimized and are perfectly suitable to store "small" integers. Maybe Fixed.precision should be a number?

Shell

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions