Skip to main content

Polyscript

Python SDK for Polymarket — write trading strategies as decorator-based scripts.

import polyscript as bot

@bot.on_start
async def boot():
    print(f"wallet = {bot.account.address()}")
    bal = await bot.account.balance()
    print(f"balance = {bal.usdc} USDC")

@bot.tick(every="2s")
async def t():
    mid = await bot.market.midpoint("0xabc...")
    if mid < 0.50:
        await bot.order.place(
            asset_id="0xabc...", side="buy",
            size="10", price="0.45",
        )

@bot.on_fill
async def f(fill):
    print(f"filled {fill.size} @ {fill.price}")

Install

pip install polyscript

This package is a stub — provides type hints, dataclasses, and decorator registration for IDE support. To actually run strategies you need:

  • Polyscript Editor — desktop app for writing + running scripts locally
  • Polyscript Desktop — production host for automated trading

Both bundle the Rust SDK (the actual Polymarket integration). The stub package lets you author scripts with full IDE / type checker support before running them in the host app.

If you try to call an SDK method without a host, you'll see:

ImportError: polyscript._native not bundled — install and use Polyscript Editor or Polyscript Desktop ...

What's included

  • Decorators: @bot.on_start, @bot.on_stop, @bot.tick(every=...), @bot.background, @bot.on_fill, @bot.on_order, @bot.on_market_resolved, @bot.on_market_opened
  • Namespaces: bot.account, bot.market, bot.markets, bot.order, bot.position, bot.bridge, bot.relayer, bot.stream
  • Models: Balance, Book, BookLevel, Order, OrderStatus, Position, Side, Fill — frozen dataclasses with computed properties

Docs

Metadata

Release files for polyscript 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for polyscript 0.1.1
File Size Uploaded Provenance Actions
polyscript-0.1.1.tar.gz 25.8 kB Without provenance Details for polyscript-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for polyscript 0.1.1
File Interpreter ABI Platform Actions
polyscript-0.1.1-py3-none-any.whl Python 3 none any Details for polyscript-0.1.1-py3-none-any.whl

Total release size: 58.7 kB

Release files / polyscript-0.1.1.tar.gz

Download URL polyscript-0.1.1.tar.gz
Size 25.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b257ebecb0857fdada3669c722df07ab03a2fa1c2cb8926c2a250ac2c757bd1a
BLAKE2b-256 checksum
How to use checksums
88bd7eed2666473a5299f0d2576cb7f88b055286b995cc0290a7a10365666467
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / polyscript-0.1.1-py3-none-any.whl

Download URL polyscript-0.1.1-py3-none-any.whl
Size 32.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5433ad247f7e5bb86bf274928bdb8fa3a7120dd3368b07a3a422e501d3e0601e
BLAKE2b-256 checksum
How to use checksums
cd17cb4d80da44399b15e18354c15cca07f32e2df36efdf3381dd1aece6187d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Security for polyscript 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page