Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 28 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,36 @@ The design goal isn’t “hit a home run trade”, it’s **durable growth**: d

## Quick Start

### 1. Clone
### 1. Prerequisites

**Machine**

- **Linux** or **macOS** (recommended) or **Windows** (WSL2 is easier than native Windows for Rust + Trunk; native Windows works if `cargo` and `trunk` are on `PATH`).
- ~2–4 GB free disk for Rust toolchain + first compile; stable internet for crate downloads.

**Rust (required)**

1. Install **[rustup](https://rustup.rs/)** if you don’t have Rust yet.
2. Use the default **stable** toolchain (this project targets Rust **1.70+**).
3. Confirm in a **new terminal**:

```bash
rustc --version # should show 1.70 or higher
cargo --version
```

**Polymarket (for live trading)**

- A Polymarket account, **USDC on Polygon**, and **CLOB API** credentials. See the [official CLOB docs](https://docs.polymarket.com/developers/CLOB/). You still need a valid `config.json` to start the app; use **simulation mode** (step 7) if you only want to explore the UI first.

### 2. Clone

```bash
git clone https://github.com/Krypto-Hashers-Community/polymarket-copytrading-bot-rust-sport-crypto.git
cd polymarket-copytrading-bot-rust-sport-crypto
git clone https://github.com/HyperBuildX/Polymarket-Trading-Bot-Rust.git
cd Polymarket-Trading-Bot-Rust
```

### 2. Configure
### 3. Configure

Create two files in the project root:

Expand Down Expand Up @@ -130,7 +152,7 @@ OPENROUTER_API_KEY=sk-or-...
# or ANTHROPIC_API_KEY=sk-ant-...
```

### 3. Build & Run
### 4. Build & Run

```bash
# Build the frontend (once)
Expand All @@ -142,7 +164,7 @@ cargo run --release --bin main_copytrading

Open **http://localhost:8000** — that's it. Dashboard, agent, logs, portfolio, everything is there.

### 4. Simulation mode (no real orders)
### 5. Simulation mode (no real orders)

```bash
cargo run --release --bin main_copytrading -- --simulation
Expand Down
1 change: 0 additions & 1 deletion src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ impl PolymarketApi {
let funder = self.proxy_wallet_address.clone();
*guard = ClobClientState::Creating;
let jh = tokio::task::spawn_blocking(move || {
clob_sdk::get_api_connection()?;
let chain_id = polygon();
clob_sdk::client_create(
&clob_url,
Expand Down
12 changes: 0 additions & 12 deletions src/clob_sdk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,18 +412,6 @@ pub fn update_balance_allowance(handle: u64, token_id: &str, asset_type: &str) -
Ok(())
}


pub fn get_api_connection() -> Result<()> {
let lib = load_lib()?;
let f: libloading::Symbol<unsafe extern "C" fn() -> c_int> =
unsafe { lib.get(b"clob_sdk_get_api_connection") }.context("clob_sdk_get_api_connection not found")?;
let ret = unsafe { f() };
if ret != 0 {
anyhow::bail!("clob_sdk_get_api_connection failed (ret={})", ret);
}
Ok(())
}

pub fn tick_size(handle: u64, token_id: &str) -> Result<String> {
let lib = load_lib()?;
let f: libloading::Symbol<
Expand Down