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

Fix Volume calculations #289

Closed
AugurIntegration opened this issue Nov 30, 2018 · 2 comments

Comments

Projects
5 participants
@AugurIntegration
Copy link

commented Nov 30, 2018

Currently the volume calculations in Augur Node are done by taking the trade amount multiplied by the trade price and summing that with previous volume.

Instead when we update the volumetrics we should increase overall volume by:

  • (The lowest of makerSharesProvided and takerSharesProvided) * numTicks
  • makerTokensProvided
  • takerTokensProvided

The actual log data will use the terms:

numCreatorShares
numCreatorTokens
numFillerShares
numFillerTokens

This was referenced Nov 30, 2018

@adrake33 adrake33 added this to Ready for Development in Story Board Dec 1, 2018

@adrake33 adrake33 removed the Release 1.9.0 label Dec 4, 2018

@adrake33 adrake33 added this to Medium Priority in Triage Board Dec 6, 2018

@adrake33 adrake33 added this to the Features milestone Dec 6, 2018

@adrake33 adrake33 moved this from Medium Priority to Current Sprint in Triage Board Dec 6, 2018

@adrake33 adrake33 modified the milestones: Features, Milestone 1 Dec 8, 2018

@adrake33 adrake33 modified the milestones: Milestone 1, Milestone 2 Dec 20, 2018

@joeykrug

This comment has been minimized.

Copy link
Member

commented Dec 28, 2018

Shouldn't this actually be data from https://github.com/AugurProject/augur-core/blob/master/source/contracts/trading/FillOrder.sol#L397 so:

Instead when we update the volumetrics we should increase overall volume by:

(The lowest of makerSharesDepleted and takerSharesDepleted) * numTicks
makerTokensDepleted
takerTokensDepleted

Basically using the amounts that actually got "depleted" / filled instead of the amounts provided (which may not necessarily get used in a trade)?

@nuevoalex

This comment has been minimized.

Copy link
Member

commented Dec 28, 2018

The actual log data will use the terms:

  • numCreatorShares
  • numCreatorTokens
  • numFillerShares
  • numFillerTokens

ryanberckmans added a commit to AugurProject/augur-node that referenced this issue Jan 9, 2019

ryanberckmans added a commit to AugurProject/augur-node that referenced this issue Jan 9, 2019

Story Board automation moved this from Ready for Development to Done Jan 11, 2019

Triage Board automation moved this from Current Sprint (Nov 26-Dec 7) to Closed Jan 11, 2019

ryanberckmans added a commit to AugurProject/augur-node that referenced this issue Jan 11, 2019

Fix volume calculations
Fixes AugurProject/augur#289

augur-node `db.{markets,outcomes}.volume` has a new business definition.
See comments on `volumeForTrade()` for details.

Volume is updated incrementally each order filled log and will be incorrect
for existing markets with non-zero volume until db is recreated.

ryanberckmans added a commit to AugurProject/augur-node that referenced this issue Feb 1, 2019

Add rebuildVolumeForAllMarkets() and migration to run it
rebuildVolumeForAllMarkets() was added to facilitate a recent volume fix which
required a full DB reset.

It can also be used in future unit testing to verify that incremental and
non-incremental methods of volume calculation produce the correct result.

Or as an ongoing sanity check: executing rebuildVolumeForAllMarkets() on a
production database should result in no changes.

Related to AugurProject/augur#289

ryanberckmans added a commit to AugurProject/augur-node that referenced this issue Feb 1, 2019

Add rebuildVolumeForAllMarkets() and migration to run it (#808)
rebuildVolumeForAllMarkets() was added to facilitate a recent volume fix which
required a full DB reset.

It can also be used in future unit testing to verify that incremental and
non-incremental methods of volume calculation produce the correct result.

Or as an ongoing sanity check: executing rebuildVolumeForAllMarkets() on a
production database should result in no changes.

Related to AugurProject/augur#289
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.