Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce new "metadata" field to the result data #16

Open
perich opened this issue Feb 12, 2019 · 0 comments
Open

Introduce new "metadata" field to the result data #16

perich opened this issue Feb 12, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@perich
Copy link
Owner

perich commented Feb 12, 2019

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.

@perich perich added the enhancement New feature or request label Feb 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant