Skip to content

swap oracle does not serialize SOL/2Z price consistently as uint #2529

@karl-dz

Description

@karl-dz

This malformed response does not happen often. But when it does, any struct assuming a u64 value will fail deserializing the JSON. Even if someone were to remove the decimals to force this value to be uint, the swap oracle has attested for the malformed value so it would be impossible to use this swap oracle message to buy SOL on the converter program.

Error: Failed to parse oracle response. Please try again

Caused by:
    0: error decoding response body
    1: invalid type: floating point `107830615957.00002`, expected u64 at line 1 column 30

Oracle found here: https://github.com/doublezerofoundation/sol-2z-conversion-v1/tree/main/off-chain/swap-oracle-service

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions