Skip to content

Commit 108b436

Browse files
author
marcelkb
committed
updated readme
streamlined env and reya test code seperate repo for adapter withoud reya sdk code included
1 parent 59d9f1d commit 108b436

4 files changed

Lines changed: 19 additions & 30 deletions

File tree

.env.example

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
# Required for consuming data
2-
REYA_WS_URL=
3-
4-
# Required for running actions on Reya DEX
5-
PRIVATE_KEY=
6-
ACCOUNT_ID=
7-
CHAIN_ID= # 1729 mainnet and 89346162 cronos
8-
9-
# The wallet address that owns ACCOUNT_ID
10-
OWNER_WALLET_ADDRESS=
11-
121
### Reya Cronos (testnet) example
132
ACCOUNT_ID=replaceme
143
PRIVATE_KEY=replacemereplacemereplacemereplacemereplacemereplacemereplaceme

README.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ It adds an CCXT Wrapper purely python based by using the direct request calls fo
66
Right now not all methods functions are implemented.
77
- fetchOHLCV delegates to Binance since Reya only support candles up to 1D-Timeframe and no easy management for calling last X Candles. Start und End Time is needed every time. Additonally the api is not as fast for complicated calculations based on a lot of candles.
88
- The Signer for Private calls is not finished, so it relays on the SDK functions.
9-
- fetchBalance only recognized staked RUSD (0xa9f32a851b1800742e47725da54a09a7ef2556a3). Different Tokens for Collateral are not supported right now (wrtETH f.e.)
9+
- fetchBalance only recognized RUSD. Different Tokens for Collateral are not supported right now (wrtETH f.e.)
1010
- fetch_canceled_and_closed_orders not supported right now
1111
- setLeverage not supported right now (no reya api endpoint)
1212
- short orders can be placed but are not fully considered by profit calculation
13+
14+
If you prefer a streamlined repo without the reya sdk integrated take a look at https://github.com/marcelkb/reya-ccxt-adapter
1315

1416
# Reya Python SDK
1517

@@ -23,6 +25,19 @@ or
2325
pip install git+https://github.com/marcelkb/reya-python-sdk_ccxt_adapter
2426
```
2527

28+
## Environment Setup
29+
30+
Create a `.env` file in the project root with the following variables:
31+
32+
```
33+
ACCOUNT_ID=your_account_id
34+
PRIVATE_KEY=your_private_key
35+
CHAIN_ID=1729 # Use 89346162 for testnet
36+
REYA_WS_URL=wss://ws.reya.xyz/ # Use wss://websocket-testnet.reya.xyz/ for testnet
37+
REYA_API_BASE_URL=https://api.reya.xyz/v2 # Use https://api-test.reya.xyz/v2 for testnet
38+
OWNER_WALLET_ADDRESS=your_wallet_address # Required: wallet address for data queries
39+
```
40+
2641
## Usage
2742

2843
```
@@ -33,7 +48,6 @@ from sdk.reya_rest_api import TradingConfig, ReyaTradingClient
3348
load_dotenv()
3449
config = TradingConfig.from_env()
3550
36-
#signer = ReyaSignerAdapter(private_key = config.private_key, wallet_address=config.owner_wallet_address, account_id=config.account_id, chain_id=config.chain_id) TODO not working right now
3751
exchange = Reya({
3852
'walletAddress': config.owner_wallet_address,
3953
'privateKey': config.private_key,
@@ -230,18 +244,6 @@ For example, the response might look like:
230244
]
231245
```
232246

233-
## Environment Setup
234-
235-
Create a `.env` file in the project root with the following variables:
236-
237-
```
238-
ACCOUNT_ID=your_account_id
239-
PRIVATE_KEY=your_private_key
240-
CHAIN_ID=1729 # Use 89346162 for testnet
241-
REYA_WS_URL=wss://ws.reya.xyz/ # Use wss://websocket-testnet.reya.xyz/ for testnet
242-
REYA_API_BASE_URL=https://api.reya.xyz/v2 # Use https://api-test.reya.xyz/v2 for testnet
243-
OWNER_WALLET_ADDRESS=your_wallet_address # Required: wallet address for data queries
244-
```
245247

246248
### Signer vs Owner Wallet
247249

reya_ccxt_wrapper/Reya.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,9 @@ def describe(self) -> Dict[str, Any]:
161161
},
162162
})
163163

164-
def withClient(self, client:ReyaTradingClient):
165-
self.client:ReyaTradingClient = client
166-
164+
def __init__(self, config: Dict[str, Any] = {}):
165+
super().__init__(config)
166+
self.client: ReyaTradingClient = ReyaTradingClient()
167167

168168
# -------------------
169169
# Signing: call SDK signer only for private endpoints, TODO right now not working good

reya_ccxt_wrapper/test/ReyaTest.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ def main():
2222
'options':{'account_id': config.account_id},
2323
'verbose': True,
2424
})
25-
client = ReyaTradingClient()
26-
exchange.withClient(client)
2725
symbol = 'SOL/RUSD:RUSD' # market symbol
2826

2927
ORDER_PLACEMENT = True

0 commit comments

Comments
 (0)