BitShares Forum

Main => Technical Support => Topic started by: monsterer on October 08, 2014, 01:05:16 pm

Title: How is flip markets functionality dealt with in the RPC API?
Post by: monsterer on October 08, 2014, 01:05:16 pm
I notice there is a flip markets button in the GUI client, but in the RPC API I can't see any reference to it. In addition, calling blockchain_market_status with flipped base and quote just causes an assert for every market I've tried it with.

Any ideas?

Cheers, Paul.

Title: Re: How is flip markets functionality dealt with in the RPC API?
Post by: xeroc on October 08, 2014, 01:34:03 pm
I can confirm that issue .. not sure why it is that way :-\
Title: Re: How is flip markets functionality dealt with in the RPC API?
Post by: monsterer on October 08, 2014, 02:06:49 pm
I can confirm that issue .. not sure why it is that way :-\

Hmmm, so do these flipped markets actually exist as separate markets?

Right now, for example, there appears to be no market existing for USD/BTSX, which surely must be the default and the BTSX/USD market (which does appear to exist) must be the flipped market?
Title: Re: How is flip markets functionality dealt with in the RPC API?
Post by: xeroc on October 08, 2014, 02:46:18 pm
Hmmm, so do these flipped markets actually exist as separate markets?
No they do not .. why should they

Quote
Right now, for example, there appears to be no market existing for USD/BTSX, which surely must be the default and the BTSX/USD market (which does appear to exist) must be the flipped market?
flipping is just a "different perspective" .. you can flip prices with 1/price and then flip ask<->bid .. that's it .. do not expect to be able to 'short BTSX'!
Title: Re: How is flip markets functionality dealt with in the RPC API?
Post by: valzav on October 08, 2014, 03:37:46 pm
Valid API market pair should have asset with lower id on the right.
E.g. USD/BTSX is valid because USD's id is 22 and BTSX is 0, BTSX/USD is not valid (doesn't exist), so "blockchain_market_status BTSX USD" will return an exception.
Market flipping functionality is entirely implemented on a GUI side.
Title: Re: How is flip markets functionality dealt with in the RPC API?
Post by: xeroc on October 08, 2014, 03:57:39 pm
Valid API market pair should have asset with lower id on the right.
Aha .. learn sth. new every day :)
Title: Re: How is flip markets functionality dealt with in the RPC API?
Post by: monsterer on October 08, 2014, 05:32:34 pm
flipping is just a "different perspective" .. you can flip prices with 1/price and then flip ask<->bid .. that's it .. do not expect to be able to 'short BTSX'!

Is that why the price is always named 'ratio'?

I detect a problem with this idea:

buying BTSX with USD, priced 1.0001 USDs, ratio = 1.0001

flipping the market:

1 / ratio = 0.99990000999900009999000099990000 recurring which isn't going to fit in any amount of precision?

Wont this cause problems all over the place?

Cheers, Paul.