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

Bug in calculating pricing #74

Closed
namanyayg opened this issue Oct 14, 2017 · 0 comments
Closed

Bug in calculating pricing #74

namanyayg opened this issue Oct 14, 2017 · 0 comments

Comments

@namanyayg
Copy link

Problem: According to the investInternal method, we're calling PricingStrategy.calculatePrice with first argument as amount sent by wallet in Wei and last argument as number of decimals for a token which is usually 18.

These two amounts are then multiplied again in the actual calculatePrice methods.

Fix: It seems like calculatePrice expects ether value that it can multiply by amount of decimals and divide by the price per token in Wei. Currently, it takes Wei value, multiplies it by decimals (i.e. 10^18), and divides it by price per token in Wei -- we're still left with 18 extra zeros.

If this is correct, then we need to fix the example YAML that lists price in Wei as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant