Open sindresorhus opened 6 years ago
what happened was somebody traded KMD for PIZZA, KMD has actual value, so it lists PIZZA with value.
it seems to be a higher level issue as to what is and isnt a test currency. couldnt the GUI just as easily not use any value for PIZZA?
i can make a hardcoded special case, but in general putting such things in the core leads to unintended consequences.
We have worked around it in HyperDEX, but technically it belongs in Marketmaker. If it's not handled in Marketmaker, each GUI app has to be surprised by the behavior, spend time looking into why it's showing a price, and then work around it.
but even the coins definitions is not internal to marketmaker. how can it know what to do about coins that are created externally?
i guess if a "testcoin":1 is added to the coin definition, then marketmaker could change behavior based on that. is suppressing a price the only difference?
this is a slippery slope adding special cases for externally defined things, but if we can abstract it into a specific behavior change, it should be ok.
maybe better is "noportfolio":1 ?
maybe better is "noportfolio":1 ?
If it doesn't get returned in the response of the portfolio
command, it'll break our GUI.
We need it to act like a normal coin, the only difference being the price is always 0
.
@sindresorhus mentioned isTest: true
in our internal discussion which I think makes sense.
@jl777 ah, just re-read your message above:
i guess if a "testcoin":1 is added to the coin definition, then marketmaker could change behavior based on that. is suppressing a price the only difference?
Yes, this is exactly what we should do IMO.
portfoliozero:1
something to indicate the specific behavior of the coin
also making it istest:1 could be done, but I feat that will be overloaded by other behavior changes that are wanted for test coins
are you sure zero portfolio value is the only change we will ever do for test coins?
portfoliozero:1
Should be portfolioPrice: false
or if you insist noportfolioprice: 1
.
also making it istest:1 could be done, but I feat that will be overloaded by other behavior changes that are wanted for test coins
Is that a bad thing? It's normal to have some specific behavior for test fixtures.
are you sure zero portfolio value is the only change we will ever do for test coins?
No, that's why we suggested isTest: true
.
ok, i can do istest:true
PIZZA
returns a price when calling theportfolio
endpoint. I assume this is because Marketmaker uses the coinmarketcap API and there actually is a real currency calledPIZZA
, so it return the value for that. This case should be detected and theprice
returned should always be0
.