bancorprotocol / contracts-solidity

Bancor Protocol Contracts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Description of the Sell formula in the white-paper

barakman opened this issue · comments

In the white-paper, section 3.3 (Handling Price Slippage), the Sell formula is denoted by:

image

It should be noted that the values of connected tokens paid out and tokens destroyed are considered negative in this formula.

There have been several cases where users raised concerns about the formula (such as this one), due to this fact missing in the description.

If one wishes to input these variables as positive values, then the formula to use is denoted by:

image

This is also how the formula is implemented in the contract.

@yudilevi:

Reminder - you might want to add this as an appendix or a clarification paragraph in the white-paper.