Ellipsis-Labs / phoenix-sdk

SDK for interacting with the Phoenix DEX.
83 stars 41 forks source link

Jarry/ell 87 fix rust core sdk unit conversions #91

Closed jarry-xiao closed 1 year ago

linear[bot] commented 1 year ago
ELL-87 Fix Rust core SDK unit conversions

All consumers need to be updated as well (definitely phoenix-bots, anything else?) * raw_base_units_to_base_lots should include "rounded_down" in method name and docs, for consistency * base_atoms_to_base_unit_as_float should be base_atoms_to_raw_base_units_as_float, with docs updated appropriately * print_quote_amount, print_base_amount--are these used? feels like they can be deleted? If we want methods like this, they should return strings that the consumer can choose to print * order_to_quote_amount currently returns quote atoms, method name and docs should reflect this * float_price_to_ticks should include "rounded_down" in method name and docs, for consistency * ticks_to_float_price conversion is incorrect, missing raw base units per base unit conversion * base_lots_to_base_units_multiplier, ensure the consumers actually want base units rather than raw base units * ticks_to_float_price_multiplier is incorrect, missing raw base units per base unit conversion * Why do we have base_lots_to_base_units_multiplier and ticks_to_float_price_multiplier? Why wouldn't the consumer just use the conversion method rather than doing the multiplication themselves?

eugene-chen commented 1 year ago

Let's update the ESL docs that are currently on all the conversion methods