Skip to content
This repository was archived by the owner on Feb 1, 2024. It is now read-only.
This repository was archived by the owner on Feb 1, 2024. It is now read-only.

improve number.AsRatio() conversion using stellar/go/price for more accurate pricing on centralized exchanges #264

@nikhilsaraf

Description

@nikhilsaraf

Describe the bug

The bot does not accurately handle prices for centralized exchanges

Expected behavior

I think the bot should correctly convert prices for centralized exchanges even though it leans on a 32-bit N/D conversion process for Price.

Frequency

The frequency is: Always susceptible to incorrect conversions, especially for finer grained float values

Possible Solution

This bug can be fixed by using the inbuilt price.Parse(v string) converter for the stellar library at github.com/stellar/go/price.

see commit in https://github.com/nikhilsaraf/kelp/tree/improve_number_as_ratio

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions