RWA SDK QDF - by QuantDeFi.ai
🚀 Professional Python SDK for Real-World Asset Data Analysis
Access comprehensive tokenized asset data from RWA.xyz platform through QuantDeFi.ai's optimized SDK. Track $297B+ in global assets including stablecoins, tokenized treasuries, and real-world assets across 26+ blockchain networks.
Built by QuantDeFi.ai - Advanced Quantitative DeFi Analytics
Features
- Async and Sync Support: Both asynchronous and synchronous client implementations
- Complete API Coverage: Access to all RWA.xyz API endpoints
- Type Safety: Full type hints for better IDE support
- Easy to Use: Simple, intuitive API design
- Comprehensive Data Models: Well-structured data models for all API responses
Installation
From PyPI
pip install rwa-sdk-qdf
From Source
git clone https://github.com/quantdefi/rwa-sdk-qdf.git
cd rwa-sdk-qdf
pip install -e .
Quick Start
Synchronous Usage
from rwa_sdk import RWAClientSync
# Initialize the client
client = RWAClientSync()
# Get USDT stablecoin data
usdt = client.get_stablecoin("USDT")
print(f"USDT Market Cap: ${usdt['marketCap']:,.2f}")
# Get stablecoins overview
stables = client.get_stablecoins_overview()
print(f"Total Stablecoin Market: ${stables['total']:,.2f}")
# Get treasuries overview
treasuries = client.get_treasuries_overview()
print(f"Total Tokenized Treasuries: ${treasuries['total']:,.2f}")
Asynchronous Usage
import asyncio
from rwa_sdk import RWAClient, RWAAuth
async def main():
# Initialize with authentication (optional)
auth = RWAAuth(email="user@example.com")
async with RWAClient(auth=auth) as client:
# Get USDC details
usdc = await client.get_stablecoin("USDC")
print(f"USDC Data: {usdc}")
# Get stablecoins overview
stables = await client.assets.get_stablecoins_overview()
print(f"Stablecoins Overview: {stables}")
# Get transactions for a specific token
txns = await client.transactions.query(
token_address="0x45804880de22913dafe09f4980848ece6ecbaf78",
per_page=5
)
print(f"Recent Transactions: {txns}")
# Run the async example
asyncio.run(main())
API Modules
Assets
Access asset-related data including stablecoins, treasuries, and other tokenized assets.
# Get specific asset
asset = await client.assets.get_asset("USDT")
# Get timeseries data with custom query
from rwa_sdk import TimeseriesQuery, Filter, FilterOperator, MeasureID
query = TimeseriesQuery(
filter=Filter("measureID", FilterOperator.EQUALS, MeasureID.MARKET_CAP.value)
)
data = await client.assets.get_timeseries(query)
Transactions
Query blockchain transactions for tokens.
# Get transactions for a token
transactions = await client.transactions.query(
token_address="0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
per_page=10
)
Token Holders
Get information about token holders.
# Get top holders for a token
holders = await client.token_holders.query(
token_id=123,
per_page=100
)
Platforms
Access platform-specific data.
# Get platform details
platform = await client.platforms.get_platform("tether-holdings")
# List all platforms
platforms = await client.platforms.list_platforms()
Networks
Get blockchain network information.
# Get network details
from rwa_sdk import Network
ethereum = await client.networks.get_network(Network.ETHEREUM.value)
# List all networks
networks = await client.networks.list_networks()
Data Models
The SDK provides comprehensive data models for working with the API:
- AssetClass: Enum for asset categories (STABLECOINS, TREASURIES, etc.)
- Network: Enum for blockchain networks
- Filter/CompositeFilter: Build complex queries
- Sort: Define sorting parameters
- Pagination: Control result pagination
- TimeseriesQuery: Create timeseries queries
Advanced Usage
Custom Queries
from rwa_sdk import (
TimeseriesQuery,
CompositeFilter,
Filter,
FilterOperator,
Sort,
SortField,
SortDirection,
Pagination,
Aggregate,
AggregateFunction
)
# Build a complex query
query = TimeseriesQuery(
filter=CompositeFilter(
operator=FilterOperator.AND,
filters=[
Filter("assetClassID", FilterOperator.EQUALS, 28),
Filter("date", FilterOperator.ON_OR_AFTER, "2023-01-01"),
Filter("isInvestable", FilterOperator.EQUALS, True)
]
),
sort=Sort(SortField.DATE, SortDirection.DESC),
pagination=Pagination(page=1, per_page=50),
aggregate=Aggregate(
group_by="asset",
aggregate_function=AggregateFunction.SUM,
interval="day"
)
)
result = await client.assets.get_timeseries(query)
Error Handling
from rwa_sdk import RWAAPIError, RWANetworkError
try:
asset = await client.assets.get_asset("USDT")
except RWAAPIError as e:
print(f"API error: {e.message}, Status: {e.status_code}")
except RWANetworkError as e:
print(f"Network error: {e.message}")
Authentication
Some endpoints require authentication. You can provide authentication credentials:
from rwa_sdk import RWAAuth
# With email
auth = RWAAuth(email="user@example.com")
# With session token
auth = RWAAuth(session_token="your-session-token")
# Set session later
auth.set_session("new-session-token")
client = RWAClient(auth=auth)
Known Limitations
Compressed Data Responses
Some API endpoints return compressed data in a proprietary Next.js format. These responses appear as base64-like encoded strings. The SDK currently returns this data as-is. For most use cases, we recommend using endpoints that return standard JSON data, such as:
- Platform listings and details
- Direct asset queries
- Network information
If you encounter compressed data and need to access it, consider:
- Using alternative endpoints that provide uncompressed data
- Checking the RWA.xyz official documentation for data format specifications
- Using the web interface at https://app.rwa.xyz for visual data access
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
For support, please open an issue on the GitHub repository or contact support@rwa.xyz
Disclaimer
This SDK is provided as-is. Please ensure you comply with RWA.xyz's terms of service when using this SDK.
Metadata
Release files for rwa-sdk-qdf 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rwa-sdk-qdf-0.1.0.tar.gz | 16.6 kB | Without provenance | Details for rwa-sdk-qdf-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rwa_sdk_qdf-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for rwa_sdk_qdf-0.1.0-py3-none-any.whl |
Total release size: 35.6 kB
Release files / rwa-sdk-qdf-0.1.0.tar.gz
| Download URL | rwa-sdk-qdf-0.1.0.tar.gz |
|---|---|
| Size | 16.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a5a5c5fda8599aee7bf16d90202da77c83444d87aafecbc824f9c5c129fd8e21
|
|
BLAKE2b-256 checksum How to use checksums |
38b5cb6a3f484c563d8902b504a499bc6a0b3810d005c0c9a3f18305de25168b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.7.9
|
Release files / rwa_sdk_qdf-0.1.0-py3-none-any.whl
| Download URL | rwa_sdk_qdf-0.1.0-py3-none-any.whl |
|---|---|
| Size | 18.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1bb3182c06cb90647314fc91a2a96e4a4d44e1748fdd570e2ba8488afba6d2e0
|
|
BLAKE2b-256 checksum How to use checksums |
0016f51059bf3c3e55355a7ca622c4d7bea8a57f72d1ff9fec2797e5efb5a24c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.7.9
|
Security for rwa-sdk-qdf 0.1.0
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.