mtbc: maze I (white-red)
[personal profile] mtbc
At work, I had to learn about a particular distributed cryptocurrency exchange. Liquidity is provided by set of reserves that each contain coins of two different kinds, an equal value of each.

For pricing an exchange "from" the coin we hold "to" the coin we want, using one of these reserves of two different kinds of coin, we have:
rf
how much of the "from" coin is in the reserve
rt
how much of the "to" coin is in the reserve
af
how much of the "from" coin we want to exchange
at
how much of the "to" coin we are to receive
cn
a constant determining the transaction cost
cd
another constant determining the transaction cost, a little larger than cn
It turns out that we decide how much currency users receive by,

at = (af × rt × cn) / (af × cn + rf × cd)

I found this quite interesting. In my ignorance, I don't know if it's a standard approach for such currency exchanges. The formula seems to have some reasonable properties, in terms of things like how the price increases as one's swapping to a currency that there is now less of (or would be less of after the swap).

(Dreamwidth doesn't appear to allow <math> markup so I did what I could.)
This account has disabled anonymous posting.
(will be screened if not on Access List)
(will be screened if not on Access List)
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org

Profile

mtbc: photograph of me (Default)
Mark T. B. Carroll

June 2025

S M T W T F S
1 2 34567
8 91011121314
15161718192021
22232425262728
2930     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 12th, 2025 02:58 am
Powered by Dreamwidth Studios