Skip to content

Instantly share code, notes, and snippets.


diomidov/ Secret

Created September 19, 2022 22:04
What would you like to do?
from manifoldpy import api as mf
from time import sleep
API_KEY = "[redacted]"
USERNAME = "LiquidityBonusBot"
def should_exploit(market):
# Only bet on binary CPMM markets
if market.outcomeType != 'BINARY' or market.mechanism != 'cpmm-1':
return False
# Don't try to bet on resolved markets
if market.isResolved:
return False
# Skip own markets
if market.creatorUsername == USERNAME:
return False
# Skip markets on which you've already bet
if len(mf.get_bets(market=market.slug, username=USERNAME)) > 0:
return False
# Skip markets with any limit orders (TODO: this can be weakened)
if any(b.limitProb != None for b in mf.get_bets(market=market.slug)):
return False
return True
def exploit(market):
outcome = "YES" if market.probability <= 0.5 else "NO"
amount = 1000
mf.make_bet(API_KEY, amount,, outcome)
for i in range(20):
if mf.get_market( != market.totalLiquidity:
mf.sell_shares(API_KEY,, outcome)
def exploit_recent():
markets = mf.get_markets(20)
for m in markets:
if should_exploit(m):
#print("Market:", m.question)
#print("By:", m.creatorName)
#if input('Exploit? [y/n]') != 'y':
# continue
if __name__ == "__main__":
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment