Skip to content

Commit d0e113a

Browse files
author
marcelkb
committed
updated readme
1 parent fb888b1 commit d0e113a

2 files changed

Lines changed: 33 additions & 5 deletions

File tree

README.md

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,47 @@ from sdk.reya_rest_api import TradingConfig, ReyaTradingClient
3333
load_dotenv()
3434
config = TradingConfig.from_env()
3535
36-
#signer = ReyaSignerAdapter(private_key = config.private_key, wallet_address=config.wallet_address, account_id=config.account_id, chain_id=config.chain_id) TODO not working right now
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
3737
exchange = Reya({
38-
'walletAddress': config.wallet_address,
38+
'walletAddress': config.owner_wallet_address,
3939
'privateKey': config.private_key,
4040
'options':{'account_id': config.account_id},
4141
'verbose': True,
4242
})
4343
client = ReyaTradingClient()
4444
exchange.withClient(client)
45-
45+
46+
symbol = 'SOL/RUSD:RUSD' # market symbol
47+
ticker = exchange.fetch_ticker(symbol)
48+
print(f"{symbol} price: {ticker['last']}")
49+
50+
position = exchange.fetch_position(symbol)
51+
print(f"{position['info']['unrealisedPnl']} {position['info']['curRealisedPnl']} {position['info']['size']}")
52+
53+
print(f"Creating LIMIT BUY order for {symbol}")
54+
print(exchange.create_order(symbol, EOrderType.LIMIT.value, EOrderSide.BUY.value, AMOUNT, ticker['last'] * 0.5))
55+
56+
print(f"Creating TAKE PROFIT MARKET SELL order for {symbol}")
57+
print(exchange.create_order(
58+
symbol,
59+
EOrderType.MARKET.value,
60+
EOrderSide.SELL.value,
61+
AMOUNT,
62+
ticker['last'] * 1.01,
63+
params={'takeProfitPrice': '250', 'reduceOnly': True}
64+
))
65+
66+
print(f"Creating STOP LOSS MARKET SELL order for {symbol}")
67+
print(exchange.create_order(
68+
symbol,
69+
EOrderType.MARKET.value,
70+
EOrderSide.SELL.value,
71+
AMOUNT,
72+
ticker['last'] * 1.01,
73+
params={'stopLossPrice': '100', 'reduceOnly': True}
74+
))
4675
```
4776

48-
4977
## Versioning
5078

5179
The SDK uses a 4-digit semantic versioning scheme: `X.Y.Z.W`

reya_ccxt_wrapper/test/ReyaTest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def main():
1515
load_dotenv()
1616
config = TradingConfig.from_env()
1717

18-
#signer = ReyaSignerAdapter(private_key = config.private_key, wallet_address=config.wallet_address, account_id=config.account_id, chain_id=config.chain_id) TODO not working right now
18+
#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
1919
exchange = Reya({
2020
'walletAddress': config.owner_wallet_address,
2121
'privateKey': config.private_key,

0 commit comments

Comments
 (0)