Skip to content

Repository files navigation

PyManifold

Python API client for Manifold Markets.

This is still a work in progress.

Usage

frompymanifoldimportManifoldClient# List marketsclient=ManifoldClient()
markets=client.list_markets()
# Get market by slugslug="will-bitcoins-price-fall-below-25k"market=client.get_market_by_slug("will-bitcoins-price-fall-below-25k")
# Get market by idid="rIR6mWqaO9xKLifr6cLL"market=client.get_market_by_id(id)
# Create a betbetId=client.create_bet(contractId="BxFQCoaaxBqRcnzJb1mV", amount=1, outcome="NO")
# Create a marketclient=ManifoldClient(api_key=API_KEY)
market=client.create_binary_market(
question="Testing Binary Market creation through API",
initialProb=99,
description="Going to resolves as N/A",
tags=["fun"],
closeTime=4102444800000,
)
# Find optimal Kelly betfrompymanifold.utilsimportkelly_calcmarket=client.get_market_by_slug("for-this-study-published-in-nature")
utils.kelly_calc(
market=marketsubjective_probability=0.8balance=800initial_market_probability=0.5
)

TODO

  • Publish a version of this package to PyPI
  • Add instructions for running tests that require an API key (e.g. setting the MANIFOLD_API_KEY environment variable)
  • Generalize kelly_bet to correlated markets

Running Tests

$ poetry run pytest

About

Python API client for Manifold Markets

Resources

Stars

18 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages