Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
48ea6cb
Support Spot Orderbook
danigr99727 Nov 17, 2025
4bd185e
fix
danigr99727 Nov 17, 2025
e0b74af
add tests
danigr99727 Nov 18, 2025
0186825
basic spot test
danigr99727 Nov 19, 2025
40262c2
Regenerate specs for OpenAPI
tomdevman Nov 21, 2025
e604709
Regenerate specs for AsyncAPI
tomdevman Nov 21, 2025
e00e9ee
signatures for cancels and mass cancels
danigr99727 Nov 21, 2025
5268284
Merge branch 'feat/spot' of https://github.com/Reya-Labs/reya-python-…
danigr99727 Nov 21, 2025
d9490fc
fixes
danigr99727 Nov 21, 2025
2514a60
fixes
danigr99727 Nov 21, 2025
0c48452
Add refactoring for tests
tomdevman Nov 24, 2025
979216b
Add optimizations for speeding up spot tests
tomdevman Nov 24, 2025
1ae2b91
Refactoring test code and add new tests
tomdevman Nov 25, 2025
cce4aec
Add test cleanups
tomdevman Nov 25, 2025
29c9b31
Refactor python sdk tests
tomdevman Nov 27, 2025
a78a47f
pick up latest specs
danigr99727 Nov 27, 2025
067b9a8
Add new test, various fixes for existing ones
danigr99727 Nov 28, 2025
a6a4f2a
Add more tests
tomdevman Dec 1, 2025
7b027af
Add more tests
tomdevman Dec 1, 2025
444fd77
Add tests for new spot endpoints
tomdevman Dec 1, 2025
6885b4b
Fixing nonce for SDK tests
tomdevman Dec 2, 2025
df606b2
Add fixes for Python SDK tests (all running in cronos now)
tomdevman Dec 2, 2025
962b860
Add more fixes to Python SDK tests
tomdevman Dec 2, 2025
cee74b5
Improve order matching in python tests
tomdevman Dec 2, 2025
3ad597a
Add fixes for perp sdk tests
tomdevman Dec 3, 2025
a3a1b9b
Add new tests
tomdevman Dec 3, 2025
7d981b7
formatting
danigr99727 Dec 4, 2025
3966e8a
deadline in seconds
danigr99727 Dec 5, 2025
4d044af
Add small fix
tomdevman Dec 5, 2025
92aca0d
Add fixes to python sdk tests
tomdevman Dec 9, 2025
44a8ece
Add test fixes
tomdevman Dec 10, 2025
ab98471
Update depth
tomdevman Dec 11, 2025
69851c2
Add new Python SDK examples
tomdevman Dec 13, 2025
257899d
formatting
danigr99727 Dec 15, 2025
54a65e4
linting fix
danigr99727 Dec 15, 2025
d8466a8
Add changes for SPOT accounts (all SPOT tests are now using SPOT acco…
tomdevman Dec 16, 2025
63b9941
Add fixes for PERP tests
tomdevman Dec 17, 2025
d75e762
Add more standardization between PERP and SPOT tests
tomdevman Dec 17, 2025
bdbf45f
Add changes following new on-chain parametrization
tomdevman Dec 19, 2025
18eee82
Add new spot market making script
tomdevman Dec 19, 2025
40aef5c
Add small fixes
tomdevman Dec 19, 2025
da6eba9
Add small fixes
tomdevman Dec 19, 2025
3cc3045
Add fixes to MM script
tomdevman Dec 20, 2025
469576a
Add small fixes
tomdevman Dec 20, 2025
38c3a7f
Add small fix
tomdevman Dec 20, 2025
033af39
Add small fixes
tomdevman Dec 20, 2025
d269123
Fixing linting for SDK
tomdevman Dec 24, 2025
be829ac
Fixing linting in SDK
tomdevman Dec 24, 2025
b2cba18
Update specs to latest tag and regen
tomdevman Dec 24, 2025
d5350b8
Merge b2cba18c93a0dcf21cbb8acf031558261e05235a into 7738ada8baf24f8b7…
danigr99727 Dec 24, 2025
739f548
chore: bump SDK version to 2.1.0.0
actions-user Dec 24, 2025
c9d11ae
Add small github flow fixes
tomdevman Dec 24, 2025
672ea6d
Update to latest spec and regen
tomdevman Dec 24, 2025
b49cd8e
chore: bump SDK version to 2.1.1.0 to match specs tag
tomdevman Dec 24, 2025
7401ed0
Update specs and regen
tomdevman Dec 24, 2025
0b7ca6b
chore: bump SDK version to 2.1.2.0 to match specs tag
tomdevman Dec 24, 2025
a3f6861
fix: remove timestamp assertions from test_asset_definitions - AssetD…
tomdevman Dec 24, 2025
83a9577
fix: remove Invalid is_buy test case - Python bool() converts any non…
tomdevman Dec 24, 2025
4bffdc0
Add small perp test fix
tomdevman Dec 24, 2025
e56d05d
Fix version consistency check
tomdevman Dec 24, 2025
6d80d84
Add more PERP tests
tomdevman Dec 29, 2025
7adfd5d
Add lint fixes
tomdevman Dec 29, 2025
8bbf7da
Fix linting
tomdevman Dec 30, 2025
6b21d94
Fix linting
tomdevman Dec 30, 2025
8182068
Fix linting
tomdevman Dec 30, 2025
4d34a3a
Add test fixes
tomdevman Dec 30, 2025
a129d92
Regen specs
tomdevman Dec 30, 2025
31110a3
Upgrade spec and adding fixes
tomdevman Jan 5, 2026
d9b974b
Add small fixes
tomdevman Jan 5, 2026
6833ead
Add fixes for CO tests
tomdevman Jan 6, 2026
9ebcd8e
Add depth script improvements
tomdevman Jan 8, 2026
30dd8d3
Add cleanup for Python SDK tests
tomdevman Jan 15, 2026
8d5e52b
Add support for SPOT non-empty order book tests
tomdevman Jan 16, 2026
bbe531c
Add new SPOT tests
tomdevman Jan 16, 2026
5498246
Add small changes and new tests
tomdevman Jan 17, 2026
cb8650d
Add small fixes
tomdevman Jan 17, 2026
c7c6bee
Add fixes for linting and more test fixes
tomdevman Jan 22, 2026
1fc1b35
Fix Python SDK version
tomdevman Jan 22, 2026
e30642c
Add small fixes
tomdevman Jan 22, 2026
d8ddafe
Add new SPOT examples
tomdevman Jan 22, 2026
c45eca0
Add fixes for example scripts
tomdevman Jan 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 25 additions & 20 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
# Required for consuming data
REYA_WS_URL=
### Cronos (testnet)
CHAIN_ID=89346162
REYA_WS_URL="wss://websocket-testnet.reya.xyz/"
REYA_API_URL="https://api-cronos.reya.xyz/v2"

# Required for running actions on Reya DEX
PRIVATE_KEY=
ACCOUNT_ID=
CHAIN_ID= # 1729 mainnet and 89346162 cronos
### Reya Network (mainnet)
#CHAIN_ID=1729
#REYA_WS_URL="wss://ws.reya.xyz/"
#REYA_API_URL="https://api.reya.xyz/v2"

# The wallet address that owns ACCOUNT_ID
OWNER_WALLET_ADDRESS=
### Staging (uses mainnet chain ID 1729)
#CHAIN_ID=1729
#REYA_WS_URL="wss://websocket-staging.reya.xyz"
#REYA_API_URL="https://api-staging.reya.xyz/v2"

### Reya Cronos (testnet) example
ACCOUNT_ID=replaceme
PRIVATE_KEY=replacemereplacemereplacemereplacemereplacemereplacemereplaceme
CHAIN_ID=89346162
REYA_WS_URL="wss://websocket-testnet.reya.xyz/"
OWMNER_WALLET_ADDRESS=replaceme
# PERP_ACCOUNT_ID_1
PERP_ACCOUNT_ID_1=
PERP_PRIVATE_KEY_1=
PERP_WALLET_ADDRESS_1=

# SPOT_ACCOUNT_ID_1
SPOT_ACCOUNT_ID_1=
SPOT_PRIVATE_KEY_1=
SPOT_WALLET_ADDRESS_1=

### Reya Network (mainnet) example
ACCOUNT_ID=replaceme
PRIVATE_KEY=replacemereplacemereplacemereplacemereplacemereplacemereplaceme
CHAIN_ID=1729
REYA_WS_URL="wss://ws.reya.xyz/"
OWNER_WALLET_ADDRESS=replaceme
# SPOT_ACCOUNT_ID_2
SPOT_ACCOUNT_ID_2=
SPOT_PRIVATE_KEY_2=
SPOT_WALLET_ADDRESS_2=
8 changes: 6 additions & 2 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
- pyproject.toml
- sdk/_version.py

env:
CI_COMMIT_AUTHOR: ${{ github.event.repository.name }} Reya Bot
CI_COMMIT_EMAIL: devcold@voltz.xyz

jobs:
create-release:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -76,8 +80,8 @@ jobs:
COMMIT_SHA="${{ github.sha }}"

# Create annotated tag with v prefix
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git config --local user.email "${{ env.CI_COMMIT_EMAIL }}"
git config --local user.name "${{ env.CI_COMMIT_AUTHOR }}"
git tag -a "v$VERSION" -m "Release version v$VERSION

Auto-tagged after merge to main branch.
Expand Down
32 changes: 27 additions & 5 deletions .github/workflows/version-consistency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: [main, develop]

env:
CI_COMMIT_AUTHOR: ${{ github.event.repository.name }} Reya Bot
CI_COMMIT_EMAIL: devcold@voltz.xyz

jobs:
version-consistency:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -107,11 +111,29 @@ jobs:
BASE_SHA=$(git merge-base HEAD origin/${{ github.base_ref }})

if git diff $BASE_SHA HEAD -- pyproject.toml | grep -q '^\+.*version = '; then
echo "VERSION_MANUALLY_MODIFIED=true" >> $GITHUB_ENV
echo "Version was manually modified in this PR"
echo "Version change detected in pyproject.toml"

# Check if the version change was made by the CI bot (auto-commit)
# Get the commit that last modified the version line in pyproject.toml
LAST_VERSION_COMMIT=$(git log --oneline -1 --format="%H" -- pyproject.toml)
LAST_VERSION_AUTHOR=$(git log --oneline -1 --format="%an" -- pyproject.toml)
LAST_VERSION_MESSAGE=$(git log --oneline -1 --format="%s" -- pyproject.toml)

echo "Last version commit: $LAST_VERSION_COMMIT"
echo "Last version author: $LAST_VERSION_AUTHOR"
echo "Last version message: $LAST_VERSION_MESSAGE"

# Check if it was an auto-commit by the CI bot
if [[ "$LAST_VERSION_MESSAGE" == "chore: bump SDK version to"* ]] && [[ "$LAST_VERSION_AUTHOR" == *"Reya Bot"* ]]; then
echo "VERSION_MANUALLY_MODIFIED=false" >> $GITHUB_ENV
echo "Version was modified by CI bot (auto-commit), not manually"
else
echo "VERSION_MANUALLY_MODIFIED=true" >> $GITHUB_ENV
echo "Version was manually modified in this PR"
fi
else
echo "VERSION_MANUALLY_MODIFIED=false" >> $GITHUB_ENV
echo "Version was not manually modified in this PR"
echo "Version was not modified in this PR"
fi

- name: Extract version components
Expand Down Expand Up @@ -197,8 +219,8 @@ jobs:
- name: Commit version bump
if: github.event_name == 'pull_request' && env.NEW_VERSION != ''
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git config --local user.email "${{ env.CI_COMMIT_EMAIL }}"
git config --local user.name "${{ env.CI_COMMIT_AUTHOR }}"
git add pyproject.toml
git commit -m "chore: bump SDK version to $NEW_VERSION"
git push origin HEAD:${{ github.head_ref }}
Expand Down
7 changes: 7 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,24 @@ sdk/open_api/exceptions.py
sdk/open_api/models/__init__.py
sdk/open_api/models/account.py
sdk/open_api/models/account_balance.py
sdk/open_api/models/account_type.py
sdk/open_api/models/asset_definition.py
sdk/open_api/models/cancel_order_request.py
sdk/open_api/models/cancel_order_response.py
sdk/open_api/models/candle_history_data.py
sdk/open_api/models/create_order_request.py
sdk/open_api/models/create_order_response.py
sdk/open_api/models/depth.py
sdk/open_api/models/depth_type.py
sdk/open_api/models/execution_type.py
sdk/open_api/models/fee_tier_parameters.py
sdk/open_api/models/global_fee_parameters.py
sdk/open_api/models/level.py
sdk/open_api/models/liquidity_parameters.py
sdk/open_api/models/market_definition.py
sdk/open_api/models/market_summary.py
sdk/open_api/models/mass_cancel_request.py
sdk/open_api/models/mass_cancel_response.py
sdk/open_api/models/order.py
sdk/open_api/models/order_status.py
sdk/open_api/models/order_type.py
Expand All @@ -40,6 +46,7 @@ sdk/open_api/models/server_error_code.py
sdk/open_api/models/side.py
sdk/open_api/models/spot_execution.py
sdk/open_api/models/spot_execution_list.py
sdk/open_api/models/spot_market_definition.py
sdk/open_api/models/tier_type.py
sdk/open_api/models/time_in_force.py
sdk/open_api/models/wallet_configuration.py
Expand Down
6 changes: 6 additions & 0 deletions examples/rest_api/perps/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""
REST API examples for perpetual (perps) trading.

These examples demonstrate how to interact with the Reya Trading API
for perpetual futures markets (e.g., ETHRUSDPERP, BTCRUSDPERP).
"""
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
"""
Example script showing how to get accounts for a wallet address using the Reya Trading SDK.

Before running this example, ensure you have a .env file with the following variables:
- PRIVATE_KEY: Your Ethereum private key
Requirements:
- CHAIN_ID: The chain ID (1729 for mainnet, 89346162 for testnet)
- PERP_PRIVATE_KEY_1: Your Ethereum private key
- PERP_WALLET_ADDRESS_1: Your wallet address

Usage:
python -m examples.rest_api.perps.account_info
"""
import asyncio

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
"""
Example script showing how to get assets information using the Reya Trading SDK.

Before running this example, ensure you have a .env file with the following variables:
- API_URL: (optional) The API URL to use
Requirements:
- CHAIN_ID: The chain ID (1729 for mainnet, 89346162 for testnet)
- PERP_WALLET_ADDRESS_1: Your wallet address

Usage:
python -m examples.rest_api.perps.assets_example
"""
import asyncio

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
"""
Example script showing how to get markets information using the Reya Trading SDK.

Before running this example, ensure you have a .env file with the following variables:
- API_URL: (optional) The API URL to use
Requirements:
- CHAIN_ID: The chain ID (1729 for mainnet, 89346162 for testnet)
- PERP_WALLET_ADDRESS_1: Your wallet address

Usage:
python -m examples.rest_api.perps.markets_example
"""

import asyncio
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@
- Take Profit (TP) Orders
- Order Cancellation

Before running this example, ensure you have a .env file with the following variables:
- PRIVATE_KEY: Your Ethereum private key
- ACCOUNT_ID: Your Reya account ID
Requirements:
- CHAIN_ID: The chain ID (1729 for mainnet, 89346162 for testnet)
- API_URL: The API URL (optional, defaults based on chain ID)
- PERP_ACCOUNT_ID_1: Your Reya account ID
- PERP_PRIVATE_KEY_1: Your Ethereum private key
- PERP_WALLET_ADDRESS_1: Your wallet address

Usage:
python -m examples.rest_api.perps.order_entry
"""
import asyncio
import logging
Expand Down Expand Up @@ -239,7 +242,7 @@ async def main():
load_dotenv()

# Verify required environment variables
required_vars = ["PRIVATE_KEY", "ACCOUNT_ID"]
required_vars = ["PERP_PRIVATE_KEY_1", "PERP_ACCOUNT_ID_1", "PERP_WALLET_ADDRESS_1"]
missing_vars = [var for var in required_vars if not os.getenv(var)]

if missing_vars:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#!/usr/bin/env python3
"""Example script showing how to get price information using the Reya Trading SDK.
"""
Example script showing how to get price information using the Reya Trading SDK.

Requirements:
- CHAIN_ID: The chain ID (1729 for mainnet, 89346162 for testnet)
- PERP_WALLET_ADDRESS_1: Your wallet address

Before running this example, ensure you have a .env file with the following variables:
- API_URL: (optional) The API URL to use
Usage:
python -m examples.rest_api.perps.prices_example
"""
import asyncio

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@
- Getting auto exchange settings
- Getting wallet stats

Before running this example, ensure you have a .env file with the following variables:
- PRIVATE_KEY: Your Ethereum private key
- ACCOUNT_ID: Your Reya account ID
Requirements:
- CHAIN_ID: The chain ID (1729 for mainnet, 89346162 for testnet)
- PERP_ACCOUNT_ID_1: Your Reya account ID
- PERP_PRIVATE_KEY_1: Your Ethereum private key
- PERP_WALLET_ADDRESS_1: Your wallet address

Usage:
python -m examples.rest_api.perps.wallet_example
"""
import asyncio

Expand Down
6 changes: 6 additions & 0 deletions examples/rest_api/spot/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""
REST API examples for spot trading.

These examples demonstrate how to interact with the Reya Trading API
for spot markets (e.g., WETHRUSD).
"""
Loading
Loading