{"action":"created","issue":{"url":"https://api.github.com/repos/OmniLayer/omnicore/issues/202","labels_url":"https://api.github.com/repos/OmniLayer/omnicore/issues/202/labels{/name}","comments_url":"https://api.github.com/repos/OmniLayer/omnicore/issues/202/comments","events_url":"https://api.github.com/repos/OmniLayer/omnicore/issues/202/events","html_url":"https://github.com/OmniLayer/omnicore/issues/202","id":103818402,"number":202,"title":"Appearingly same unit price, but no trade match in UI","user":{"login":"dexX7","id":5836089,"avatar_url":"https://avatars.githubusercontent.com/u/5836089?v=3","gravatar_id":"","url":"https://api.github.com/users/dexX7","html_url":"https://github.com/dexX7","followers_url":"https://api.github.com/users/dexX7/followers","following_url":"https://api.github.com/users/dexX7/following{/other_user}","gists_url":"https://api.github.com/users/dexX7/gists{/gist_id}","starred_url":"https://api.github.com/users/dexX7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dexX7/subscriptions","organizations_url":"https://api.github.com/users/dexX7/orgs","repos_url":"https://api.github.com/users/dexX7/repos","events_url":"https://api.github.com/users/dexX7/events{/privacy}","received_events_url":"https://api.github.com/users/dexX7/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OmniLayer/omnicore/labels/meta%20dex","name":"meta dex","color":"5319e7"},{"url":"https://api.github.com/repos/OmniLayer/omnicore/labels/user%20interface","name":"user interface","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-29T00:55:13Z","updated_at":"2015-09-05T10:16:33Z","closed_at":null,"body":"Setup:\r\n```\r\nB offers 1 SP5 for 1.0 MSC\r\nB offers 1 SP5 for 2.0 MSC\r\n```\r\nWhen:\r\n```\r\nA offers 20.0 MSC for 10 SP5\r\n```\r\nThen:\r\n```\r\nA clears all offers of B\r\n```\r\nAnd:\r\n```\r\nA still has 17.0 MSC for sale @ 2.0 MSC/SP5\r\nA could buy 8.5 SP5\r\n```\r\nNote: SP5 is indivible, so buying 0.5 SP5 won't be possible.\r\n\r\n---\r\n\r\nThis is the presentation in the UI:\r\n\r\n![20-10_17_8_indiv_b](https://cloud.githubusercontent.com/assets/5836089/9559627/bb717550-4df6-11e5-984c-3141fbe3cc70.png)\r\n\r\nTotal MSC is correct, unit price is also correct, and the amount to purchase is rounded up.\r\n\r\n---\r\n\r\nSince there is a \"buy\" order \"to purchase\" 9 SP5 at a price of 2.0 MSC/SP5 are shown, one may assume it should be possible to sell 9 SP5 for 2.0 MSC/SP5 and clear the trade:\r\n\r\n![20-10_17_8_indiv](https://cloud.githubusercontent.com/assets/5836089/9559681/c9bc0656-4df7-11e5-822e-8d1d07dcae6b.png)\r\n\r\n---\r\n\r\nHowever ...\r\n\r\n![cross](https://cloud.githubusercontent.com/assets/5836089/9559682/ce9281dc-4df7-11e5-82ff-5b8ee402642a.png)\r\n\r\n---\r\n\r\nI recall that I pushed towards \"ideally no fractional amounts\" and \"amounts should be rounded\", but I think this situation is very unintuitive and misleading. :/\r\n\r\nFrom the buyer's perspective showing \"9 SP5 to be purchased\" is acceptable, because this is indeed the minimum amount to be matched.\r\n\r\nFrom the seller's perspective this may not be obvious though.\r\n\r\nThe underlying issue is that, while the original price is indeed 2.0 MSC/SP5, the effective price, due to the indivisible amount, is actually 1.888~ MSC/SP5.\r\n\r\nWhen the seller attempts to match at 2.0 MSC/SP5, it's therefore \"too expensive\"."},"comment":{"url":"https://api.github.com/repos/OmniLayer/omnicore/issues/comments/137939583","html_url":"https://github.com/OmniLayer/omnicore/issues/202#issuecomment-137939583","issue_url":"https://api.github.com/repos/OmniLayer/omnicore/issues/202","id":137939583,"user":{"login":"dexX7","id":5836089,"avatar_url":"https://avatars.githubusercontent.com/u/5836089?v=3","gravatar_id":"","url":"https://api.github.com/users/dexX7","html_url":"https://github.com/dexX7","followers_url":"https://api.github.com/users/dexX7/followers","following_url":"https://api.github.com/users/dexX7/following{/other_user}","gists_url":"https://api.github.com/users/dexX7/gists{/gist_id}","starred_url":"https://api.github.com/users/dexX7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dexX7/subscriptions","organizations_url":"https://api.github.com/users/dexX7/orgs","repos_url":"https://api.github.com/users/dexX7/repos","events_url":"https://api.github.com/users/dexX7/events{/privacy}","received_events_url":"https://api.github.com/users/dexX7/received_events","type":"User","site_admin":false},"created_at":"2015-09-05T10:16:33Z","updated_at":"2015-09-05T10:16:33Z","body":"To keep in mind: in `MetaDExDialog::UpdateOffers()` I stumbled upon:\r\n\r\n```c++\r\nif (obj.displayUnitPrice() == \"0.00000000\") continue; // hide trades that have a lower than 0.00000001 MSC unit price\r\n```"}}