Skip to content

Commit 61f7ace

Browse files
committed
readme
1 parent 153aba1 commit 61f7ace

1 file changed

Lines changed: 25 additions & 27 deletions

File tree

examples/README.md

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,31 @@
55
- this will require you to enter your Ethereum private key
66
- the eth private key will only be used in the Py SDK to sign a message
77
- the eth private key is not required in order to trade on the platform
8-
- the eth private key is not passed to the binary
9-
- save the output of the script as you'll need to use it on all scripts
10-
- the output should look like
11-
```
12-
BASE_URL = 'https://testnet.zklighter.elliot.ai'
13-
API_KEY_PRIVATE_KEY = '0xea5d2eca5be67eca056752eaf27b173518b8a5550117c09d2b58c7ea7d306cc4426f913ccf27ab19'
14-
ACCOUNT_INDEX = 595
15-
API_KEY_INDEX = 1
16-
```
17-
## Start trading on testnet
18-
For each example, you'll need to setup the base url / api_key_private_key / account_index and api_key index using the output of the `setup.py`
8+
- the eth private key is not passed to the binary
9+
- the API key config is saved in a local file `./api_key_config.json`
1910

20-
- `create_modify_cancel_order.py`
21-
- creates an ask (sell) order for 0.1 ETH @ $4050
22-
- modified the order and increases the size to 0.11 ETH and increases the price to $4100
23-
- cancels the order
24-
- Note: all of these operations use the client order index of the order. You can use the order from the exchange as well
11+
## Start trading on testnet
12+
- `create_modify_cancel_order.py`
13+
- creates an ask (sell) order for 0.1 ETH @ $4050
14+
- modified the order and increases the size to 0.11 ETH and increases the price to $4100
15+
- cancels the order
16+
- Note: all of these operations use the client order index of the order. You can use the order from the exchange as well
2517

26-
- `create_grouped_ioc_with_attached_sl_tp.py`
27-
- creates an ask (sell) IoC order for 0.1 ETH
28-
- along w/ the order, it sets up a Stop Loss (SL) and a Take Profit (TP) order for the whole size of the order
29-
- the size of the SL/TP will be equal to the executed size of the order
30-
- the SL/TP orders are canceled when the sign of your position changes
18+
- `ws_send_tx.py`
19+
- same flow as `create_modify_cancel_order.py`
20+
- sends TXs over WS instead of HTTP
21+
22+
- `create_grouped_ioc_with_attached_sl_tp.py`
23+
- creates an ask (sell) IoC order for 0.1 ETH
24+
- along w/ the order, it sets up a Stop Loss (SL) and a Take Profit (TP) order for the whole size of the order
25+
- the size of the SL/TP will be equal to the executed size of the order
26+
- the SL/TP orders are canceled when the sign of your position changes
3127

32-
- `create_position_tied_sl_tl.py`
33-
- creates a bid (buy) Stop Loss (SL) and a Take Profit (TP) to close your short position
34-
- the size of the orders will be for your whole position (because BaseAmount=0)
35-
- the orders will grow / shrink as you accumulate more position
36-
- the SL/TP orders are canceled when the sign of your position changes
28+
- `create_position_tied_sl_tl.py`
29+
- creates a bid (buy) Stop Loss (SL) and a Take Profit (TP) to close your short position
30+
- the size of the orders will be for your whole position (because BaseAmount=0)
31+
- the orders will grow / shrink as you accumulate more position
32+
- the SL/TP orders are canceled when the sign of your position changes
3733

3834
### On SL/TP orders
3935
SL/TP orders need to be configured beyond just setting the trigger price. When the trigger price is set,
@@ -43,7 +39,9 @@ You want to set up a take profit at $120'000
4339
- order should be an ask (sell) order, to close your position
4440
- the trigger price should be $120'000
4541

46-
What about the order type
42+
What about the order types? Just as normal orders, SL/TP orders trigger an order, which can be:
43+
- market order
44+
- limit IOC / GTC
4745

4846
## Setup steps for mainnet
4947
- deposit money on Lighter to create an account first

0 commit comments

Comments
 (0)