-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Small tweaks to the EV and Market model #36
Conversation
) | ||
|
||
# If we don't bet, we don't have any expected returns. | ||
if yes_shares == 0 and no_shares == 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sometimes it happens the outcomes probs are 0 and 0
expected_returns_pct = ( | ||
# Assume that market starts at 50/50 and so the price is 0.5 at the time we are buying it, | ||
# we can't use {yes,no}_outcome_price atm, because it would just cancel out to EV = 0.0, | ||
# as it's the same as the probability. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just added the comment because I confused myself in the morning 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's just confused me too! 😄 Maybe could do with adding a block comment at the start of the function, like:
"""
The expected value if betting on a binary market in its initialized state of 50:50 'yes' and 'no' shares, with the assumption that the correct `p_yes` is that of the market.
"""
Can also take away the # TODO
on 319, as:
- the returned expected value is as a %, so the size of
bet_units
doesn't matter. - as you say, we can't calculate shares based on market odds if we're also using market odds as the 'correct' odds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adding a block comment
Added
Can also take away the # TODO on 319, as:
I updated it, bet size actually should make a difference, but it doesn't in our simplified calculation atm. But I would leave the comment there, so we don't forget about it.
) -> t.List[Market]: | ||
if number > 100: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It behaves differently if closed
is not set, vs. if it's false or true.
So adding it to params only if it's not none, and removing this as it can return more markets than 100.
@property | ||
def yes_outcome_price(self) -> float: | ||
# Use the outcome price if available, otherwise assume it's p_yes. | ||
return self.outcomePrices[0] if self.outcomePrices else self.p_yes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this ever not == self.p_yes
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Polymarket returns outcomePrices
, so I thought, why not use it directly? I never seen self.outcomePrices[0] != self.p_yes
(as we are doing p_yes=m_json["outcomePrices"][0]
in get_polymarket_markets
), but I have seen self.outcomePrices[1] != (1 - p_yes)
, so it does make sense to differ it.
expected_returns_pct = ( | ||
# Assume that market starts at 50/50 and so the price is 0.5 at the time we are buying it, | ||
# we can't use {yes,no}_outcome_price atm, because it would just cancel out to EV = 0.0, | ||
# as it's the same as the probability. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's just confused me too! 😄 Maybe could do with adding a block comment at the start of the function, like:
"""
The expected value if betting on a binary market in its initialized state of 50:50 'yes' and 'no' shares, with the assumption that the correct `p_yes` is that of the market.
"""
Can also take away the # TODO
on 319, as:
- the returned expected value is as a %, so the size of
bet_units
doesn't matter. - as you say, we can't calculate shares based on market odds if we're also using market odds as the 'correct' odds
No description provided.