diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..36bd6ed --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,26 @@ +--- +name: Bug Report +about: Report a bug in the PerpCity Python SDK +title: '' +labels: bug +assignees: '' +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To reproduce** +Steps to reproduce the behavior: +1. Code snippet or minimal reproduction +2. Expected output vs actual output + +**Expected behavior** +What you expected to happen. + +**Environment** +- SDK version: [e.g. 0.4.2] +- Python version: [e.g. 3.12] +- OS: [e.g. macOS 15, Ubuntu 24.04] + +**Additional context** +Any other context, stack traces, or error messages. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..bd954f5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,19 @@ +--- +name: Feature Request +about: Suggest a new feature for the PerpCity Python SDK +title: '' +labels: enhancement +assignees: '' +--- + +**What problem does this solve?** +A clear description of the use case or pain point. + +**Proposed solution** +How you think this could be implemented. + +**Alternatives considered** +Any alternative solutions or workarounds you've considered. + +**Additional context** +Any other context or examples. diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..a69a688 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,20 @@ +# Changelog + +All notable changes to the PerpCity Python SDK will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.4.2] - 2026-02-25 + +Initial public release. + +### Added + +- **PerpCityContext** -- Core context for RPC connection, wallet, and contract addresses +- **Position management** -- Open/close taker and maker positions, adjust margin and notional +- **Market data** -- Fetch perp data (mark price, fees, bounds, liquidity) +- **Token approvals** -- USDC approval flow for perp manager +- **Pure math** -- Tick/price conversions, sqrt price math, PnL calculations, liquidation checks +- **Integration tests** -- Full test suite against Anvil with mock contract deployment +- **CI** -- Lint (Ruff), unit tests (pytest), integration tests with Anvil diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..7c10552 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,58 @@ +# Contributing to PerpCity Python SDK + +Thanks for your interest in contributing! This document covers everything you need to get started. + +## Prerequisites + +- Python >= 3.10 +- [Foundry](https://book.getfoundry.sh/) (for integration tests) + +## Getting Started + +```bash +git clone https://github.com/StrobeLabs/perpcity-python-sdk.git +cd perpcity-python-sdk +pip install -e ".[dev]" +``` + +## Development + +```bash +# Run unit tests +make test + +# Run integration tests (spawns Anvil automatically) +make test-integration + +# Lint and format check +make lint + +# Auto-format +make format + +# Full CI check (lint + unit tests) +make ci +``` + +## Pull Requests + +1. Fork the repo and create a branch from `main` +2. Write your code and add tests for new functionality +3. Run `make ci` to verify everything passes +4. Open a PR against `main` + +## Code Style + +- Follow [Ruff](https://docs.astral.sh/ruff/) formatting and linting rules (enforced by CI) +- Type hints encouraged +- Write tests using [pytest](https://pytest.org/) + +## Reporting Issues + +- Use the bug report template for bugs +- Use the feature request template for new features +- Include SDK version, Python version, and steps to reproduce + +## License + +By contributing, you agree that your contributions will be licensed under the MIT License.