Skip to content

Commit

Permalink
added safe docs
Browse files Browse the repository at this point in the history
  • Loading branch information
skundu42 committed Feb 4, 2025
1 parent 0a3ea89 commit 84dafb7
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 6 deletions.
44 changes: 44 additions & 0 deletions docs/deploywithsafe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Deploy your Prediction Market Agent with Safe

Prediction Market Agent Tooling (PMAT) includes in-built Safe integration, allowing users to deploy and fund a Safe wallet. This wallet is used to place bets on different prediction markets securely and efficiently. By leveraging Safe wallets, users can enhance the security and transparency of their prediction market interactions.

## Benefits of using a Safe Wallet
- Multiple owner configuration: Enables multi-signature control for enhanced security.

- Batching transactions: Allows executing multiple transactions in a single batch, reducing gas costs and improving efficiency.

- Leveraging transaction sponsorships through Safe Modules: Enables external funding or fee payment by sponsors.

## Steps to integerate Safe Wallet with PMAT

1. Install poetry if not already isntalled
```
python3.10 -m pip install poetry
python3.10 -m poetry install
python3.10 -m poetry shell
```

2. Deploy a Safe using an EOA

Make sure that the EOA has enough balance in xDAI for the transaction to go through.

```
poetry run python scripts/create_safe_for_agent.py --from-private-key <YOUR_AGENT_PRIVATE_KEY>
```

### Configuration Options

| Option | Type | Default | Description |
|----------------------|---------|----------|-------------|
| `--from-private-key` | String | Required | The private key of the agent deploying the Safe |
| `--rpc-url` | String | Optional | Custom RPC URL for deployment |
| `--salt-nonce` | Integer | Optional | Salt nonce for deterministic Safe deployment |
| `--fund-safe` | Flag | Optional | Whether to fund the Safe upon creation |
| `--fund-amount-xdai` | Integer | Optional (Default: 1) | Amount of xDAI to fund the Safe with (if `--fund-safe` is enabled) |

3. The abover step will print our the Safe wallet address. Put that address in the **SAFE_ADDRESS** env variable. Also make sure to put the Safe's owners private key in the **BET_FROM_PRIVATE_KEY** env variable.


If the above two env varibles are configured correctly, all agents by default will start using the Safe address to transact and place bets on the prediction markets.

Always make sure to have enough balace in your safe wallet for your agent to transact seamlessly.
14 changes: 8 additions & 6 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
site_name: Prediction Market Agent Tooling
nav:
- Home: index.md
- Prediction Markets: predictionmarkets.md
- Dependencies: dependencies.md
- Quickstart: quickstart.md
- DeployableTraderAgent: deployabletraderagent.md
- ExampleAgent: exampleagent.md
- Prediction Market Agnets:
- Overview: predictionmarkets.md
- Dependencies: dependencies.md
- Quickstart: quickstart.md
- Agent Development:
- Deployable Trader Agent: deployabletraderagent.md
- Example Agent: exampleagent.md
- Deploy with Safe: deploywithsafe.md
- Contributing: contributing.md

theme:
name: material

0 comments on commit 84dafb7

Please sign in to comment.