{"action":"created","issue":{"url":"https://api.github.com/repos/BitShares/bitshares/issues/1315","labels_url":"https://api.github.com/repos/BitShares/bitshares/issues/1315/labels{/name}","comments_url":"https://api.github.com/repos/BitShares/bitshares/issues/1315/comments","events_url":"https://api.github.com/repos/BitShares/bitshares/issues/1315/events","html_url":"https://github.com/BitShares/bitshares/issues/1315","id":55672963,"number":1315,"title":"Bug in market engine / matching cover_orders","user":{"login":"pmconrad","id":6449255,"avatar_url":"https://avatars.githubusercontent.com/u/6449255?v=3","gravatar_id":"","url":"https://api.github.com/users/pmconrad","html_url":"https://github.com/pmconrad","followers_url":"https://api.github.com/users/pmconrad/followers","following_url":"https://api.github.com/users/pmconrad/following{/other_user}","gists_url":"https://api.github.com/users/pmconrad/gists{/gist_id}","starred_url":"https://api.github.com/users/pmconrad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmconrad/subscriptions","organizations_url":"https://api.github.com/users/pmconrad/orgs","repos_url":"https://api.github.com/users/pmconrad/repos","events_url":"https://api.github.com/users/pmconrad/events{/privacy}","received_events_url":"https://api.github.com/users/pmconrad/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/BitShares/bitshares/labels/market","name":"market","color":"009800"},{"url":"https://api.github.com/repos/BitShares/bitshares/labels/theoreticalbts","name":"theoreticalbts","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/BitShares/bitshares/milestones/16","html_url":"https://github.com/BitShares/bitshares/milestones/dvs/0.8.0","labels_url":"https://api.github.com/repos/BitShares/bitshares/milestones/16/labels","id":925704,"number":16,"title":"dvs/0.8.0","description":"Market engine overhaul","creator":{"login":"vikramrajkumar","id":793567,"avatar_url":"https://avatars.githubusercontent.com/u/793567?v=3","gravatar_id":"","url":"https://api.github.com/users/vikramrajkumar","html_url":"https://github.com/vikramrajkumar","followers_url":"https://api.github.com/users/vikramrajkumar/followers","following_url":"https://api.github.com/users/vikramrajkumar/following{/other_user}","gists_url":"https://api.github.com/users/vikramrajkumar/gists{/gist_id}","starred_url":"https://api.github.com/users/vikramrajkumar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vikramrajkumar/subscriptions","organizations_url":"https://api.github.com/users/vikramrajkumar/orgs","repos_url":"https://api.github.com/users/vikramrajkumar/repos","events_url":"https://api.github.com/users/vikramrajkumar/events{/privacy}","received_events_url":"https://api.github.com/users/vikramrajkumar/received_events","type":"User","site_admin":false},"open_issues":27,"closed_issues":8,"state":"open","created_at":"2015-01-07T15:52:28Z","updated_at":"2015-03-12T19:37:55Z","due_on":"2015-03-25T04:00:00Z","closed_at":null},"comments":17,"created_at":"2015-01-27T20:54:28Z","updated_at":"2015-03-14T20:47:01Z","closed_at":null,"body":"Suppose for example on the CNY/BTS market the feed price is 0.1 CNY per BTS, there is an open bid at 0.095 CNY/BTS and a short with a limit of 0.085 CNY/BTS. Now the expiration date of a cover_order passes. What I'd expect to happen (see https://bitsharestalk.org/index.php?topic=8390.msg178760#msg178760 ) is that the cover_order is filled by the bid. What actually happens is - nothing.\r\n\r\nThe reason:\r\n\r\n1. market_engine::get_next_bid fetches the next bid in the list. If the bid price is below the price feed and there are shorts available, it returns the next short instead - the bids will be fetched after all shorts have been processed.\r\n\r\n2. market_engine::get_next_ask fetches the expired cover_order as expected.\r\n\r\n3. market_engine::execute notices that _current_ask is a cover and performs some additional checks, in particular it checks if the bid price is less than 90% of the feed price. Here this is true, and in consequence _current_ask is dropped!\r\n\r\n4. Processing continues with the next ask, if any."},"comment":{"url":"https://api.github.com/repos/BitShares/bitshares/issues/comments/80715481","html_url":"https://github.com/BitShares/bitshares/issues/1315#issuecomment-80715481","issue_url":"https://api.github.com/repos/BitShares/bitshares/issues/1315","id":80715481,"user":{"login":"abitmore","id":9946777,"avatar_url":"https://avatars.githubusercontent.com/u/9946777?v=3","gravatar_id":"","url":"https://api.github.com/users/abitmore","html_url":"https://github.com/abitmore","followers_url":"https://api.github.com/users/abitmore/followers","following_url":"https://api.github.com/users/abitmore/following{/other_user}","gists_url":"https://api.github.com/users/abitmore/gists{/gist_id}","starred_url":"https://api.github.com/users/abitmore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abitmore/subscriptions","organizations_url":"https://api.github.com/users/abitmore/orgs","repos_url":"https://api.github.com/users/abitmore/repos","events_url":"https://api.github.com/users/abitmore/events{/privacy}","received_events_url":"https://api.github.com/users/abitmore/received_events","type":"User","site_admin":false},"created_at":"2015-03-14T20:47:01Z","updated_at":"2015-03-14T20:47:01Z","body":"> I would think that with the same interest rate the owner address comes into play.\r\nCould be.. I placed a USD short \"BTS2yD2gQTnTrdUD2X7yZWLdh6pcYUJLKARh\". Will see."}}