Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Simplify and Refactor RAM Market Equations #222

Merged
merged 7 commits into from
Apr 19, 2019
Merged

Simplify and Refactor RAM Market Equations #222

merged 7 commits into from
Apr 19, 2019

Conversation

zorba80
Copy link
Contributor

@zorba80 zorba80 commented Apr 4, 2019

Change Description

  1. Simplified RAM market Bancor calculations by using direct conversion from SYS to RAM and vice-versa instead of the indirect conversion: SYS -> RAMCORE-> RAM and RAM->RAMCORE->SYS.
  2. Changed the exchange_state functions convert_to_exchange and convert_from_exchange to reflect directly the equations in Bancor white paper.
  3. Updated REX to use get_bancor_output from exchange_state in order to avoid code repetition.
  4. Verified that the indirect conversion using the old functions and the indirect conversion using the new functions both give the same effective direct conversion equation introduced in this PR. The old convert_to_exchange and convert_from_exchange functions when used individually were not an accurate implementation of the Bancor equations in the white paper, but when used together, the variations cancelled and the overall output is the same. We verified that both mathematically and in unit tests.

Deployment Changes

  • Deployment Changes

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

@zorba80 zorba80 changed the title Simplify and Refactor Ram Market Equations Simplify and Refactor RAM Market Equations Apr 4, 2019
@zorba80 zorba80 merged commit 6cf80d6 into develop Apr 19, 2019
@zorba80 zorba80 deleted the ram-bancor branch April 19, 2019 21:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants