Skip to main content

dexguru-sdk.py

dexguru-logo

dexguru-sdk.py allows you to access dex.guru public methods from your async python scripts.

Installation

To install latest version, just run:

pip install dexguru-sdk

Getting Started

Take API key of your project from developers.dex.guru

import asyncio
from dexguru_sdk import DexGuru

YOUR_API_KEY = 'abc123'

sdk = DexGuru(api_key=YOUR_API_KEY)

async def main():
    response = await sdk.get_chains()
    return response

if __name__ == '__main__':
    asyncio.run(main())

Response

SDK response is Pydantic's models, so you can do whatever Pydantic allows with them.

You can find all models at dexguru_sdk.models:

class ChainModel(BaseModel):
    chain_id: int
    name: str
    description: str


class ChainsListModel(BaseModel):
    total: int
    data: List[ChainModel]
from typing import List
from dexguru_sdk.models import ChainModel, ChainsListModel


response: ChainsListModel
total: int = response.total
data: List[ChainModel] = response.data

if you need a simple dict from response, Pydantic can convert it:

response = response.dict()

Usage Examples

Ok, we want to see how your favorite wallets are trading:

import asyncio
from dexguru_sdk import DexGuru

sdk = DexGuru(api_key='my_sweet_key_from_sweet_project')

wallets = ['bot_wallet_address1', 'mistake_wallet_address2', 'heavy_wallet_address3']


async def main():
    wallets_info: WalletsListModel = await sdk.get_wallets_info(
        chain_id=1,
        wallet_addresses=wallets,
    )
    return wallets_info

if __name__ == '__main__':
    asyncio.run(main())

wallets_info.total == 2 because we have mistake in address2 and it was skipped

Print wallets_info object:

total=2 data=[
    WalletModel(
        wallet_address='bot_wallet_address1',
        volume_1m_usd=5000.123456,
        txns_1m=999999,
        category='bot',
        timestamp=1621635936 # last tx timestamp
    ),
    WalletModel(
        wallet_address='whale_wallet_address3',
        volume_1m_usd=107382.62431031652,
        txns_1m=8699,
        category='heavy',
        timestamp=1621635936 # last tx timestamp
    )]

Wow, they are good traders! Let's see what transactions they made:

wallets = ['bot_wallet_address1', 'mistake_wallet_address2', 'heavy_wallet_address3']

async def get_txs_from_list_of_wallets(wallets: List[str]) -> List:
    result = []
    for wallet in wallets:
        txs = await sdk.get_wallet_transactions(chain_id=1, wallet_address=wallet)
        result.append(txs)
    return result

if __name__ == '__main__':
    result = asyncio.run(get_txs_from_list_of_wallets(wallets))

Metadata

Release files for dexguru-sdk 0.2.8

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

Source distribution (sdist)

Source distribution for dexguru-sdk 0.2.8
File Size Uploaded Provenance
dexguru-sdk-0.2.8.tar.gz 12.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for dexguru-sdk 0.2.8
File Interpreter ABI Platform
dexguru_sdk-0.2.8-py3-none-any.whl Python 3 none any Details

Total release size: 26.1 kB

Release files / dexguru-sdk-0.2.8.tar.gz

Download URL dexguru-sdk-0.2.8.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
07d6f98768412134f6839039eef537561c4956bc772c7f0e9cf2decf2c852291
BLAKE2b-256 checksum
How to use checksums
82b8cc3660925900ac4ae7673adcdb25b15beb4d2747b7f0aa015918fb63a4d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Release files / dexguru_sdk-0.2.8-py3-none-any.whl

Download URL dexguru_sdk-0.2.8-py3-none-any.whl
Size 14.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3e4f812d4aef4e1c7d3ad8be78fb554d7bf31f23ce2e6db38a19d29ef2d32659
BLAKE2b-256 checksum
How to use checksums
6cc1e9cf3cb780121a5af8b7bf5aa16fb26defd627605f7fba5ef5070f96e7b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Security for dexguru-sdk 0.2.8

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.

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