{"action":"created","comment":{"url":"https://api.github.com/repos/AugurProject/augur/pulls/comments/330307400","pull_request_review_id":295933462,"id":330307400,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMzMDMwNzQwMA==","diff_hunk":"@@ -3,33 +3,40 @@ import PropTypes from 'prop-types';\n \n import getValue from 'utils/get-value';\n import CustomPropTypes from 'utils/custom-prop-types';\n-import { createBigNumber } from 'utils/create-big-number';\n+import { createBigNumber, BigNumber } from 'utils/create-big-number';\n import { DashlineLong } from 'modules/common/labels';\n import MarketOutcomeTradingIndicator from 'modules/market/containers/market-outcome-trading-indicator';\n import Styles from 'modules/market/components/market-scalar-outcome-display/market-scalar-outcome-display.styles.less';\n+import { YES_NO_YES_ID } from 'modules/common/constants';\n+import { formatDai } from 'utils/format-number';\n+import { FormattedNumber } from 'modules/types';\n+\n+export function calculatePosition(\n+  min: BigNumber,\n+  max: BigNumber,\n+  lastPrice: FormattedNumber|null\n+) {  \n+  const range = max.minus(min);\n+  const pricePercentage = createBigNumber(lastPrice ? lastPrice.value : 0)\n+    .minus(min)\n+    .dividedBy(range)\n+    .times(createBigNumber(100))\n+    .toNumber();\n+\n+  return lastPrice === null ? 50 : pricePercentage;\n+};\n \n const MarketScalarOutcomeDisplay = ({\n   outcomes,\n   max,\n   min,\n   scalarDenomination = 'N/A',\n }) => {\n-  const calculatePosition = (): number => {\n-    const outcome = outcomes[1];\n-    const range = max.minus(min);\n-    const percentage = outcomes[0].lastPricePercent && outcomes[0].lastPricePercent.fullPrecision;\n-    const pricePercentage = createBigNumber(percentage || 0)\n-      .minus(min)\n-      .dividedBy(range)\n-      .times(createBigNumber(100)).toNumber();\n-\n-    return outcome && outcome.price === null\n-      ? 50\n-      : pricePercentage\n-  };\n+  const lastPrice = getValue(outcomes[YES_NO_YES_ID], 'price');","path":"packages/augur-ui/src/modules/market/components/market-scalar-outcome-display/market-scalar-outcome-display.tsx","position":47,"original_position":47,"commit_id":"4365c7038fd830ae7612c4e0937db1d67506e885","original_commit_id":"4365c7038fd830ae7612c4e0937db1d67506e885","user":{"login":"bthaile","id":3970376,"node_id":"MDQ6VXNlcjM5NzAzNzY=","avatar_url":"https://avatars0.githubusercontent.com/u/3970376?v=4","gravatar_id":"","url":"https://api.github.com/users/bthaile","html_url":"https://github.com/bthaile","followers_url":"https://api.github.com/users/bthaile/followers","following_url":"https://api.github.com/users/bthaile/following{/other_user}","gists_url":"https://api.github.com/users/bthaile/gists{/gist_id}","starred_url":"https://api.github.com/users/bthaile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bthaile/subscriptions","organizations_url":"https://api.github.com/users/bthaile/orgs","repos_url":"https://api.github.com/users/bthaile/repos","events_url":"https://api.github.com/users/bthaile/events{/privacy}","received_events_url":"https://api.github.com/users/bthaile/received_events","type":"User","site_admin":false},"body":"use constant\r\nexport const SCALAR_UP_ID = 2;","created_at":"2019-10-01T22:39:28Z","updated_at":"2019-10-01T22:39:28Z","html_url":"https://github.com/AugurProject/augur/pull/3965#discussion_r330307400","pull_request_url":"https://api.github.com/repos/AugurProject/augur/pulls/3965","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/AugurProject/augur/pulls/comments/330307400"},"html":{"href":"https://github.com/AugurProject/augur/pull/3965#discussion_r330307400"},"pull_request":{"href":"https://api.github.com/repos/AugurProject/augur/pulls/3965"}}},"pull_request":{"url":"https://api.github.com/repos/AugurProject/augur/pulls/3965","id":323454073,"node_id":"MDExOlB1bGxSZXF1ZXN0MzIzNDU0MDcz","html_url":"https://github.com/AugurProject/augur/pull/3965","diff_url":"https://github.com/AugurProject/augur/pull/3965.diff","patch_url":"https://github.com/AugurProject/augur/pull/3965.patch","issue_url":"https://api.github.com/repos/AugurProject/augur/issues/3965","number":3965,"state":"open","locked":false,"title":"add buttons to trading header","user":{"login":"phoebemirman","id":6775839,"node_id":"MDQ6VXNlcjY3NzU4Mzk=","avatar_url":"https://avatars0.githubusercontent.com/u/6775839?v=4","gravatar_id":"","url":"https://api.github.com/users/phoebemirman","html_url":"https://github.com/phoebemirman","followers_url":"https://api.github.com/users/phoebemirman/followers","following_url":"https://api.github.com/users/phoebemirman/following{/other_user}","gists_url":"https://api.github.com/users/phoebemirman/gists{/gist_id}","starred_url":"https://api.github.com/users/phoebemirman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phoebemirman/subscriptions","organizations_url":"https://api.github.com/users/phoebemirman/orgs","repos_url":"https://api.github.com/users/phoebemirman/repos","events_url":"https://api.github.com/users/phoebemirman/events{/privacy}","received_events_url":"https://api.github.com/users/phoebemirman/received_events","type":"User","site_admin":false},"body":"part of https://github.com/AugurProject/augur/issues/3733\r\ncloses https://github.com/AugurProject/augur/issues/3969","created_at":"2019-10-01T20:08:30Z","updated_at":"2019-10-01T22:39:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"05737305b2894a1e4a7739332cbcef328e863c9d","assignee":{"login":"bthaile","id":3970376,"node_id":"MDQ6VXNlcjM5NzAzNzY=","avatar_url":"https://avatars0.githubusercontent.com/u/3970376?v=4","gravatar_id":"","url":"https://api.github.com/users/bthaile","html_url":"https://github.com/bthaile","followers_url":"https://api.github.com/users/bthaile/followers","following_url":"https://api.github.com/users/bthaile/following{/other_user}","gists_url":"https://api.github.com/users/bthaile/gists{/gist_id}","starred_url":"https://api.github.com/users/bthaile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bthaile/subscriptions","organizations_url":"https://api.github.com/users/bthaile/orgs","repos_url":"https://api.github.com/users/bthaile/repos","events_url":"https://api.github.com/users/bthaile/events{/privacy}","received_events_url":"https://api.github.com/users/bthaile/received_events","type":"User","site_admin":false},"assignees":[{"login":"bthaile","id":3970376,"node_id":"MDQ6VXNlcjM5NzAzNzY=","avatar_url":"https://avatars0.githubusercontent.com/u/3970376?v=4","gravatar_id":"","url":"https://api.github.com/users/bthaile","html_url":"https://github.com/bthaile","followers_url":"https://api.github.com/users/bthaile/followers","following_url":"https://api.github.com/users/bthaile/following{/other_user}","gists_url":"https://api.github.com/users/bthaile/gists{/gist_id}","starred_url":"https://api.github.com/users/bthaile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bthaile/subscriptions","organizations_url":"https://api.github.com/users/bthaile/orgs","repos_url":"https://api.github.com/users/bthaile/repos","events_url":"https://api.github.com/users/bthaile/events{/privacy}","received_events_url":"https://api.github.com/users/bthaile/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/AugurProject/augur/pulls/3965/commits","review_comments_url":"https://api.github.com/repos/AugurProject/augur/pulls/3965/comments","review_comment_url":"https://api.github.com/repos/AugurProject/augur/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AugurProject/augur/issues/3965/comments","statuses_url":"https://api.github.com/repos/AugurProject/augur/statuses/4365c7038fd830ae7612c4e0937db1d67506e885","head":{"label":"AugurProject:header","ref":"header","sha":"4365c7038fd830ae7612c4e0937db1d67506e885","user":{"login":"AugurProject","id":9636524,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk2MzY1MjQ=","avatar_url":"https://avatars3.githubusercontent.com/u/9636524?v=4","gravatar_id":"","url":"https://api.github.com/users/AugurProject","html_url":"https://github.com/AugurProject","followers_url":"https://api.github.com/users/AugurProject/followers","following_url":"https://api.github.com/users/AugurProject/following{/other_user}","gists_url":"https://api.github.com/users/AugurProject/gists{/gist_id}","starred_url":"https://api.github.com/users/AugurProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AugurProject/subscriptions","organizations_url":"https://api.github.com/users/AugurProject/orgs","repos_url":"https://api.github.com/users/AugurProject/repos","events_url":"https://api.github.com/users/AugurProject/events{/privacy}","received_events_url":"https://api.github.com/users/AugurProject/received_events","type":"Organization","site_admin":false},"repo":{"id":142967010,"node_id":"MDEwOlJlcG9zaXRvcnkxNDI5NjcwMTA=","name":"augur","full_name":"AugurProject/augur","private":false,"owner":{"login":"AugurProject","id":9636524,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk2MzY1MjQ=","avatar_url":"https://avatars3.githubusercontent.com/u/9636524?v=4","gravatar_id":"","url":"https://api.github.com/users/AugurProject","html_url":"https://github.com/AugurProject","followers_url":"https://api.github.com/users/AugurProject/followers","following_url":"https://api.github.com/users/AugurProject/following{/other_user}","gists_url":"https://api.github.com/users/AugurProject/gists{/gist_id}","starred_url":"https://api.github.com/users/AugurProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AugurProject/subscriptions","organizations_url":"https://api.github.com/users/AugurProject/orgs","repos_url":"https://api.github.com/users/AugurProject/repos","events_url":"https://api.github.com/users/AugurProject/events{/privacy}","received_events_url":"https://api.github.com/users/AugurProject/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/AugurProject/augur","description":"Augur - Prediction Market Protocol and Client","fork":false,"url":"https://api.github.com/repos/AugurProject/augur","forks_url":"https://api.github.com/repos/AugurProject/augur/forks","keys_url":"https://api.github.com/repos/AugurProject/augur/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AugurProject/augur/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AugurProject/augur/teams","hooks_url":"https://api.github.com/repos/AugurProject/augur/hooks","issue_events_url":"https://api.github.com/repos/AugurProject/augur/issues/events{/number}","events_url":"https://api.github.com/repos/AugurProject/augur/events","assignees_url":"https://api.github.com/repos/AugurProject/augur/assignees{/user}","branches_url":"https://api.github.com/repos/AugurProject/augur/branches{/branch}","tags_url":"https://api.github.com/repos/AugurProject/augur/tags","blobs_url":"https://api.github.com/repos/AugurProject/augur/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AugurProject/augur/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AugurProject/augur/git/refs{/sha}","trees_url":"https://api.github.com/repos/AugurProject/augur/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AugurProject/augur/statuses/{sha}","languages_url":"https://api.github.com/repos/AugurProject/augur/languages","stargazers_url":"https://api.github.com/repos/AugurProject/augur/stargazers","contributors_url":"https://api.github.com/repos/AugurProject/augur/contributors","subscribers_url":"https://api.github.com/repos/AugurProject/augur/subscribers","subscription_url":"https://api.github.com/repos/AugurProject/augur/subscription","commits_url":"https://api.github.com/repos/AugurProject/augur/commits{/sha}","git_commits_url":"https://api.github.com/repos/AugurProject/augur/git/commits{/sha}","comments_url":"https://api.github.com/repos/AugurProject/augur/comments{/number}","issue_comment_url":"https://api.github.com/repos/AugurProject/augur/issues/comments{/number}","contents_url":"https://api.github.com/repos/AugurProject/augur/contents/{+path}","compare_url":"https://api.github.com/repos/AugurProject/augur/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AugurProject/augur/merges","archive_url":"https://api.github.com/repos/AugurProject/augur/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AugurProject/augur/downloads","issues_url":"https://api.github.com/repos/AugurProject/augur/issues{/number}","pulls_url":"https://api.github.com/repos/AugurProject/augur/pulls{/number}","milestones_url":"https://api.github.com/repos/AugurProject/augur/milestones{/number}","notifications_url":"https://api.github.com/repos/AugurProject/augur/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AugurProject/augur/labels{/name}","releases_url":"https://api.github.com/repos/AugurProject/augur/releases{/id}","deployments_url":"https://api.github.com/repos/AugurProject/augur/deployments","created_at":"2018-07-31T05:37:46Z","updated_at":"2019-10-01T22:17:56Z","pushed_at":"2019-10-01T22:37:35Z","git_url":"git://github.com/AugurProject/augur.git","ssh_url":"git@github.com:AugurProject/augur.git","clone_url":"https://github.com/AugurProject/augur.git","svn_url":"https://github.com/AugurProject/augur","homepage":null,"size":275440,"stargazers_count":106,"watchers_count":106,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":33,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":528,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":33,"open_issues":528,"watchers":106,"default_branch":"master"}},"base":{"label":"AugurProject:master","ref":"master","sha":"789e91908e20e4e462584db069bf47b0a1bde949","user":{"login":"AugurProject","id":9636524,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk2MzY1MjQ=","avatar_url":"https://avatars3.githubusercontent.com/u/9636524?v=4","gravatar_id":"","url":"https://api.github.com/users/AugurProject","html_url":"https://github.com/AugurProject","followers_url":"https://api.github.com/users/AugurProject/followers","following_url":"https://api.github.com/users/AugurProject/following{/other_user}","gists_url":"https://api.github.com/users/AugurProject/gists{/gist_id}","starred_url":"https://api.github.com/users/AugurProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AugurProject/subscriptions","organizations_url":"https://api.github.com/users/AugurProject/orgs","repos_url":"https://api.github.com/users/AugurProject/repos","events_url":"https://api.github.com/users/AugurProject/events{/privacy}","received_events_url":"https://api.github.com/users/AugurProject/received_events","type":"Organization","site_admin":false},"repo":{"id":142967010,"node_id":"MDEwOlJlcG9zaXRvcnkxNDI5NjcwMTA=","name":"augur","full_name":"AugurProject/augur","private":false,"owner":{"login":"AugurProject","id":9636524,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk2MzY1MjQ=","avatar_url":"https://avatars3.githubusercontent.com/u/9636524?v=4","gravatar_id":"","url":"https://api.github.com/users/AugurProject","html_url":"https://github.com/AugurProject","followers_url":"https://api.github.com/users/AugurProject/followers","following_url":"https://api.github.com/users/AugurProject/following{/other_user}","gists_url":"https://api.github.com/users/AugurProject/gists{/gist_id}","starred_url":"https://api.github.com/users/AugurProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AugurProject/subscriptions","organizations_url":"https://api.github.com/users/AugurProject/orgs","repos_url":"https://api.github.com/users/AugurProject/repos","events_url":"https://api.github.com/users/AugurProject/events{/privacy}","received_events_url":"https://api.github.com/users/AugurProject/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/AugurProject/augur","description":"Augur - Prediction Market Protocol and Client","fork":false,"url":"https://api.github.com/repos/AugurProject/augur","forks_url":"https://api.github.com/repos/AugurProject/augur/forks","keys_url":"https://api.github.com/repos/AugurProject/augur/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AugurProject/augur/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AugurProject/augur/teams","hooks_url":"https://api.github.com/repos/AugurProject/augur/hooks","issue_events_url":"https://api.github.com/repos/AugurProject/augur/issues/events{/number}","events_url":"https://api.github.com/repos/AugurProject/augur/events","assignees_url":"https://api.github.com/repos/AugurProject/augur/assignees{/user}","branches_url":"https://api.github.com/repos/AugurProject/augur/branches{/branch}","tags_url":"https://api.github.com/repos/AugurProject/augur/tags","blobs_url":"https://api.github.com/repos/AugurProject/augur/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AugurProject/augur/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AugurProject/augur/git/refs{/sha}","trees_url":"https://api.github.com/repos/AugurProject/augur/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AugurProject/augur/statuses/{sha}","languages_url":"https://api.github.com/repos/AugurProject/augur/languages","stargazers_url":"https://api.github.com/repos/AugurProject/augur/stargazers","contributors_url":"https://api.github.com/repos/AugurProject/augur/contributors","subscribers_url":"https://api.github.com/repos/AugurProject/augur/subscribers","subscription_url":"https://api.github.com/repos/AugurProject/augur/subscription","commits_url":"https://api.github.com/repos/AugurProject/augur/commits{/sha}","git_commits_url":"https://api.github.com/repos/AugurProject/augur/git/commits{/sha}","comments_url":"https://api.github.com/repos/AugurProject/augur/comments{/number}","issue_comment_url":"https://api.github.com/repos/AugurProject/augur/issues/comments{/number}","contents_url":"https://api.github.com/repos/AugurProject/augur/contents/{+path}","compare_url":"https://api.github.com/repos/AugurProject/augur/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AugurProject/augur/merges","archive_url":"https://api.github.com/repos/AugurProject/augur/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AugurProject/augur/downloads","issues_url":"https://api.github.com/repos/AugurProject/augur/issues{/number}","pulls_url":"https://api.github.com/repos/AugurProject/augur/pulls{/number}","milestones_url":"https://api.github.com/repos/AugurProject/augur/milestones{/number}","notifications_url":"https://api.github.com/repos/AugurProject/augur/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AugurProject/augur/labels{/name}","releases_url":"https://api.github.com/repos/AugurProject/augur/releases{/id}","deployments_url":"https://api.github.com/repos/AugurProject/augur/deployments","created_at":"2018-07-31T05:37:46Z","updated_at":"2019-10-01T22:17:56Z","pushed_at":"2019-10-01T22:37:35Z","git_url":"git://github.com/AugurProject/augur.git","ssh_url":"git@github.com:AugurProject/augur.git","clone_url":"https://github.com/AugurProject/augur.git","svn_url":"https://github.com/AugurProject/augur","homepage":null,"size":275440,"stargazers_count":106,"watchers_count":106,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":33,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":528,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":33,"open_issues":528,"watchers":106,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AugurProject/augur/pulls/3965"},"html":{"href":"https://github.com/AugurProject/augur/pull/3965"},"issue":{"href":"https://api.github.com/repos/AugurProject/augur/issues/3965"},"comments":{"href":"https://api.github.com/repos/AugurProject/augur/issues/3965/comments"},"review_comments":{"href":"https://api.github.com/repos/AugurProject/augur/pulls/3965/comments"},"review_comment":{"href":"https://api.github.com/repos/AugurProject/augur/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AugurProject/augur/pulls/3965/commits"},"statuses":{"href":"https://api.github.com/repos/AugurProject/augur/statuses/4365c7038fd830ae7612c4e0937db1d67506e885"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"bthaile"}}