BlockPo / BlockPo-to-Tradelayer

Incubation Repo for the TradeLayer protocol, 0.2.0
http://www.tradelayer.org
Other
8 stars 8 forks source link

getPNL/getUPNL data format revision #289

Closed patrickdugan closed 4 years ago

patrickdugan commented 4 years ago

Currently these RPC calls in the comments appear to be based on a token paradigm left over from the old metadex.

""\nResult:\n" "[ (array of JSON objects)\n" " {\n" " \"block\" : nnnnnn, (number) the index of the block that contains the trade match\n" " \"unitprice\" : \"n.nnnnnnnnnnn...\" , (string) the unit price used to execute this trade (received/sold)\n" " \"inverseprice\" : \"n.nnnnnnnnnnn...\", (string) the inverse unit price (sold/received)\n" " \"sellertxid\" : \"hash\", (string) the hash of the transaction of the seller\n" " \"address\" : \"address\", (string) the Bitcoin address of the seller\n" " \"amountsold\" : \"n.nnnnnnnn\", (string) the number of tokens sold in this trade\n" " \"amountreceived\" : \"n.nnnnnnnn\", (string) the number of tokens traded in exchange\n" " \"matchingtxid\" : \"hash\", (string) the hash of the transaction that was matched against\n" " \"matchingaddress\" : \"address\" (string) the Bitcoin address of the other party of this trade\n" " },\n" " ...\n" "]\n"

Ideally should default to showing a table of property ids for contracts, property id for the collateral, and positive or negative values, if no contractid is specified, otherwise just show the values for that property.

Galuf1 commented 4 years ago

relevant #238

Agreed, we need to take a look at these RPCs after we get the correct values from settlement. The same way we need to get the open interest from containers in Settlement, we need to populate the uPNL and PNL RPCs with correct data of opening events vs actual price, or pending payments in case of PNL. On it!

santos177 commented 4 years ago

working on new_rpcs branch