Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
danil-lashin committed Jan 29, 2019
1 parent 9622ece commit e637a17
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Changelog

## 0.11.1

BREAKING CHANGES

- [core] Fix coin convert issue

## 0.11.0

BREAKING CHANGES

- [core] Fix coin convert issue
Expand Down
5 changes: 5 additions & 0 deletions formula/formula.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ func CalculateSaleReturn(supply *big.Int, reserve *big.Int, crr uint, sellAmount

res := newFloat(0).Quo(tSellAmount, tSupply) // sellAmount / supply
res.Sub(newFloat(1), res) // (1 - sellAmount / supply)

if res.Cmp(big.NewFloat(0)) == -1 {
return big.NewInt(0)
}

res = math.Pow(res, newFloat(100/(float64(crr)))) // (1 - sellAmount / supply) ^ (100 / crr)
res.Sub(newFloat(1), res) // (1 - (1 - sellAmount / supply) ^ (1 / (crr / 100)))
res.Mul(res, tReserve) // reserve * (1 - (1 - sellAmount / supply) ^ (1 / (crr / 100)))
Expand Down
4 changes: 2 additions & 2 deletions version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ package version
const (
Maj = "0"
Min = "11"
Fix = "0"
Fix = "1"

AppVer = 2
)

var (
// Must be a string because scripts like dist.sh read this file.
Version = "0.11.0"
Version = "0.11.1"

// GitCommit is the current HEAD set using ldflags.
GitCommit string
Expand Down

0 comments on commit e637a17

Please sign in to comment.