Metadata-Version: 2.4
Name: metpysdk
Version: 0.2.1
Summary: METEORA DLMM SDK
License: MIT
License-File: LICENSE
Author: Ivan Bezborodov
Requires-Python: >=3.9,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Provides-Extra: dev
Requires-Dist: base58 (>=2.1.1,<3.0.0)
Requires-Dist: construct (>=2.10,<3.0)
Requires-Dist: mypy (>=1.8,<2.0) ; extra == "dev"
Requires-Dist: pylint (>=3.0,<4.0) ; extra == "dev"
Requires-Dist: pytest (>=8.0,<9.0) ; extra == "dev"
Requires-Dist: ruff (>=0.6,<1.0) ; extra == "dev"
Requires-Dist: solana (>=0.36.10,<0.37.0)
Requires-Dist: solders (>=0.27.1,<0.28.0)
Description-Content-Type: text/markdown

# metpysdk

**metpysdk** is a Python SDK for interacting with **Meteora DLMM (Dynamic Liquidity Market Maker)** on Solana.

It provides high-level, async-friendly primitives for:
- querying DLMM pairs
- inspecting bins and liquidity
- reading positions and rewards
- parsing on-chain accounts safely and accurately

The SDK is designed as a **library**, not a script:
- clean public API
- explicit versioning
- byte-accurate account parsing
- minimal, modern dependency set

> ⚠️ This project is in active development (`0.x`).  
> APIs may change until `1.0.0`.

---

## Features

- 🚀 Async-first API (`asyncio`)
- 🔍 Accurate parsing of DLMM on-chain accounts
- 🧱 Construct-based binary layouts (no abandoned deps)
- 🧠 Clear separation between public API and internals
- 🛠️ Designed for bots, analytics, and backend services

---

## Installation

### Requirements
- Python **3.9+**
- Poetry (recommended) or pip

### With Poetry (recommended)

```bash
poetry add metpysdk
```
### With pip
```bash
pip install metpysdk
```
### Quick Example
```python
import asyncio

from metpysdk import DLMMClient
from solders.pubkey import Pubkey


async def main():
    client = DLMMClient()

    lb_pair = Pubkey.from_string(
        "INSERT_LB_PAIR_ADDRESS_HERE"
    )

    active_bin = await client.get_active_bin(lb_pair)

    print("Active bin ID:", active_bin.bin_id)
    print("Price:", active_bin.price)


asyncio.run(main())
```
### Project Structure
```text
metpysdk/
├── accounts/     # Parsed on-chain account models
├── dlmm/         # Core DLMM client logic
├── helpers/      # High-level helpers and combinators
├── layouts/      # Binary layouts (construct-based)
├── utils/        # RPC, filters, derivations, constants
└── __init__.py   # Public API surface
```
Only symbols re-exported from package-level modules are considered public API.\
Everything else may change without notice until 1.0.0.

### Public API
The main entry point is:

```python
from metpysdk import DLMMClient
```
Additional data models and enums are exposed via:

```python

from metpysdk.accounts import (
    Position,
    ActiveBin,
    StrategyParameters,
)
```
Deep imports from internal modules are not supported.

### Development
Setup
```bash
git clone https://github.com/yourname/metpysdk.git
cd metpysdk
poetry install
```
Poetry will create a local .venv/ automatically.

### Linting

```
poetry run ruff check src/metpysdk
poetry run pylint src/metpysdk
```
### Tests
```
poetry run pytest
```
### Versioning
This project follows semantic versioning:
```
0.x.y — unstable, breaking changes allowed
1.0.0 — first stable API
>=1.0.0 — no breaking changes without major bump
```
### License
MIT License © 2025 Ivan Bezborodov

See LICENSE for details.

### Disclaimer
This SDK is provided as-is, without warranties.\
Interacting with on-chain programs involves financial risk.\
Always validate results independently before using in production.
---

