You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, all of the DEX classes return a result object to every query. It matches the following structure:
result = {
exchangeName: String,
totalPrice: Number | null,
tokenAmount: Number
tokenSymbol: String,
avgPrice: Number | null,
timestamp: Number,
error: String | null,
}
This structure doesn't always tell the full story when it comes to price and expectations. For example, the prices reported by the Bancor API are subject to slippage. That slippage isn't reflected at all anywhere in the library. While a user won't experience slippage every time they execute a trade, they should certainly be aware of the possibility. To handle these kinds of non-deterministic details, I am proposing a "metadata" field be added to the result object. This is where we can store useful details about each DEX to help users and developers make more informed decisions when analyzing price data generated from this library.
The text was updated successfully, but these errors were encountered:
Currently, all of the DEX classes return a
result
object to every query. It matches the following structure:This structure doesn't always tell the full story when it comes to price and expectations. For example, the prices reported by the Bancor API are subject to slippage. That slippage isn't reflected at all anywhere in the library. While a user won't experience slippage every time they execute a trade, they should certainly be aware of the possibility. To handle these kinds of non-deterministic details, I am proposing a "metadata" field be added to the
result
object. This is where we can store useful details about each DEX to help users and developers make more informed decisions when analyzing price data generated from this library.The text was updated successfully, but these errors were encountered: