ostium-python-sdk 0.1.13__tar.gz → 0.1.16__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. {ostium_python_sdk-0.1.13 → ostium_python_sdk-0.1.16}/PKG-INFO +67 -4
  2. {ostium_python_sdk-0.1.13 → ostium_python_sdk-0.1.16}/README.md +66 -3
  3. {ostium_python_sdk-0.1.13 → ostium_python_sdk-0.1.16}/ostium_python_sdk.egg-info/PKG-INFO +67 -4
  4. {ostium_python_sdk-0.1.13 → ostium_python_sdk-0.1.16}/setup.py +1 -1
  5. {ostium_python_sdk-0.1.13 → ostium_python_sdk-0.1.16}/ostium_python_sdk/__init__.py +0 -0
  6. {ostium_python_sdk-0.1.13 → ostium_python_sdk-0.1.16}/ostium_python_sdk/abi.py +0 -0
  7. {ostium_python_sdk-0.1.13 → ostium_python_sdk-0.1.16}/ostium_python_sdk/balance.py +0 -0
  8. {ostium_python_sdk-0.1.13 → ostium_python_sdk-0.1.16}/ostium_python_sdk/config.py +0 -0
  9. {ostium_python_sdk-0.1.13 → ostium_python_sdk-0.1.16}/ostium_python_sdk/constants.py +0 -0
  10. {ostium_python_sdk-0.1.13 → ostium_python_sdk-0.1.16}/ostium_python_sdk/formulae.py +0 -0
  11. {ostium_python_sdk-0.1.13 → ostium_python_sdk-0.1.16}/ostium_python_sdk/formulae_wrapper.py +0 -0
  12. {ostium_python_sdk-0.1.13 → ostium_python_sdk-0.1.16}/ostium_python_sdk/ostium.py +0 -0
  13. {ostium_python_sdk-0.1.13 → ostium_python_sdk-0.1.16}/ostium_python_sdk/price.py +0 -0
  14. {ostium_python_sdk-0.1.13 → ostium_python_sdk-0.1.16}/ostium_python_sdk/sdk.py +0 -0
  15. {ostium_python_sdk-0.1.13 → ostium_python_sdk-0.1.16}/ostium_python_sdk/subgraph.py +0 -0
  16. {ostium_python_sdk-0.1.13 → ostium_python_sdk-0.1.16}/ostium_python_sdk/utils.py +0 -0
  17. {ostium_python_sdk-0.1.13 → ostium_python_sdk-0.1.16}/ostium_python_sdk.egg-info/SOURCES.txt +0 -0
  18. {ostium_python_sdk-0.1.13 → ostium_python_sdk-0.1.16}/ostium_python_sdk.egg-info/dependency_links.txt +0 -0
  19. {ostium_python_sdk-0.1.13 → ostium_python_sdk-0.1.16}/ostium_python_sdk.egg-info/requires.txt +0 -0
  20. {ostium_python_sdk-0.1.13 → ostium_python_sdk-0.1.16}/ostium_python_sdk.egg-info/top_level.txt +0 -0
  21. {ostium_python_sdk-0.1.13 → ostium_python_sdk-0.1.16}/pyproject.toml +0 -0
  22. {ostium_python_sdk-0.1.13 → ostium_python_sdk-0.1.16}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ostium-python-sdk
3
- Version: 0.1.13
3
+ Version: 0.1.16
4
4
  Summary: A python based SDK developed for interacting with Ostium, a leveraged trading application for trading currencies, commodities, indices, crypto and more.
5
5
  Home-page: https://github.com/0xOstium/ostium-python-sdk
6
6
  Author: ami@ostium.io
@@ -22,7 +22,7 @@ Ostium is a decentralized perpetuals exchange on Arbitrum (Ethereum L2) with a f
22
22
  This SDK is designed to be used by developers who want to build applications on top of Ostium and automate their trading strategies.
23
23
 
24
24
 
25
- ## Pip Install
25
+ ## Installation
26
26
 
27
27
  The SDK can be installed via pip:
28
28
 
@@ -36,10 +36,73 @@ Developed using:
36
36
  ```python
37
37
  python=3.8
38
38
  ```
39
+ ## SDK Instantiation
40
+
41
+ You can instantiate the SDK with the following parameters.
42
+ Ostium Platform is deployed on Arbitrum. You can use the testnet or mainnet config via the `NetworkConfig` class, see below for an example.
43
+
44
+ ```python
45
+ from dotenv import load_dotenv
46
+ from ostium_python_sdk import OstiumSDK, NetworkConfig
47
+
48
+ # Load environment variables if using .env file
49
+ load_dotenv()
50
+
51
+ # Get private key from environment variable
52
+ private_key = os.getenv('PRIVATE_KEY')
53
+ if not private_key:
54
+ raise ValueError("PRIVATE_KEY not found in .env file")
55
+
56
+ rpc_url = os.getenv('RPC_URL')
57
+ if not rpc_url:
58
+ raise ValueError("RPC_URL not found in .env file")
59
+
60
+ # Initialize SDK
61
+ config = NetworkConfig.testnet()
62
+ sdk = OstiumSDK(config, private_key)
63
+ ```
64
+
65
+ ## The SDK contains the following classes:
66
+
67
+ - `OstiumSDK`: The main class for interacting with the Ostium Platform.
68
+
69
+ - `NetworkConfig`: The class for configuring the network.
70
+
71
+ - `Balance`: The class for interacting with the account, fetching balance, etc. available via `sdk.balance`.
72
+
73
+ - `SubgraphClient`: The class for interacting with the subgraph, getting pair details, open trades, open orders,etc. available via `sdk.subgraph`.
74
+
75
+ - `Price`: The class for interacting with the price, fetching latest price, etc. available via `sdk.price`
76
+
77
+ - `Ostium`: The class for interacting with the Ostium Smart contracts, opening trades, updating take profit and stop loss, closing trades, opening orders, etc. available via `sdk.ostium`.
78
+
79
+ ## Basic Usage
80
+
81
+ The intraction with Ostium platform is denoted with pair_id and trade_index.
82
+
83
+ - `pair_id`: The id of the pair, available via `sdk.subgraph.get_pairs()`
84
+ - `trade_index`: The index of the trade for this trader on the pair, available via `sdk.subgraph.get_open_trades()`
85
+
86
+ ## List of available pairs (Mainnet, as of Jnuary 2025)
87
+
88
+ | ID | Trading Pair | Description |
89
+ |----|--------------|--------------------------------|
90
+ | 0 | BTC-USD | Bitcoin |
91
+ | 1 | ETH-USD | Ethereum |
92
+ | 2 | EUR-USD | Euro |
93
+ | 3 | GBP-USD | British Pound |
94
+ | 4 | USD-JPY | US Dollar to Japanese Yen |
95
+ | 5 | XAU-USD | Gold |
96
+ | 6 | HG-USD | Copper |
97
+ | 7 | CL-USD | Crude Oil |
98
+ | 8 | XAG-USD | Silver |
99
+ | 9 | SOL-USD | Solana |
100
+ | 10 | SPX-USD | S&P 500 Index |
39
101
 
40
102
  ## Usage Example
41
103
 
42
- ### Opening a Trade
104
+ ### Opening a Trade, Reading Open Trades, Setting Take Profit and Stop Loss, Closing a Trade
105
+
43
106
  ```python
44
107
  from ostium_python_sdk import OstiumSDK
45
108
  from dotenv import load_dotenv
@@ -144,7 +207,7 @@ except Exception as e:
144
207
 
145
208
  ```
146
209
 
147
- ## Example Usage Script
210
+ ## Example Usage Scripts
148
211
 
149
212
 
150
213
  ### Read Block Number
@@ -7,7 +7,7 @@ Ostium is a decentralized perpetuals exchange on Arbitrum (Ethereum L2) with a f
7
7
  This SDK is designed to be used by developers who want to build applications on top of Ostium and automate their trading strategies.
8
8
 
9
9
 
10
- ## Pip Install
10
+ ## Installation
11
11
 
12
12
  The SDK can be installed via pip:
13
13
 
@@ -21,10 +21,73 @@ Developed using:
21
21
  ```python
22
22
  python=3.8
23
23
  ```
24
+ ## SDK Instantiation
25
+
26
+ You can instantiate the SDK with the following parameters.
27
+ Ostium Platform is deployed on Arbitrum. You can use the testnet or mainnet config via the `NetworkConfig` class, see below for an example.
28
+
29
+ ```python
30
+ from dotenv import load_dotenv
31
+ from ostium_python_sdk import OstiumSDK, NetworkConfig
32
+
33
+ # Load environment variables if using .env file
34
+ load_dotenv()
35
+
36
+ # Get private key from environment variable
37
+ private_key = os.getenv('PRIVATE_KEY')
38
+ if not private_key:
39
+ raise ValueError("PRIVATE_KEY not found in .env file")
40
+
41
+ rpc_url = os.getenv('RPC_URL')
42
+ if not rpc_url:
43
+ raise ValueError("RPC_URL not found in .env file")
44
+
45
+ # Initialize SDK
46
+ config = NetworkConfig.testnet()
47
+ sdk = OstiumSDK(config, private_key)
48
+ ```
49
+
50
+ ## The SDK contains the following classes:
51
+
52
+ - `OstiumSDK`: The main class for interacting with the Ostium Platform.
53
+
54
+ - `NetworkConfig`: The class for configuring the network.
55
+
56
+ - `Balance`: The class for interacting with the account, fetching balance, etc. available via `sdk.balance`.
57
+
58
+ - `SubgraphClient`: The class for interacting with the subgraph, getting pair details, open trades, open orders,etc. available via `sdk.subgraph`.
59
+
60
+ - `Price`: The class for interacting with the price, fetching latest price, etc. available via `sdk.price`
61
+
62
+ - `Ostium`: The class for interacting with the Ostium Smart contracts, opening trades, updating take profit and stop loss, closing trades, opening orders, etc. available via `sdk.ostium`.
63
+
64
+ ## Basic Usage
65
+
66
+ The intraction with Ostium platform is denoted with pair_id and trade_index.
67
+
68
+ - `pair_id`: The id of the pair, available via `sdk.subgraph.get_pairs()`
69
+ - `trade_index`: The index of the trade for this trader on the pair, available via `sdk.subgraph.get_open_trades()`
70
+
71
+ ## List of available pairs (Mainnet, as of Jnuary 2025)
72
+
73
+ | ID | Trading Pair | Description |
74
+ |----|--------------|--------------------------------|
75
+ | 0 | BTC-USD | Bitcoin |
76
+ | 1 | ETH-USD | Ethereum |
77
+ | 2 | EUR-USD | Euro |
78
+ | 3 | GBP-USD | British Pound |
79
+ | 4 | USD-JPY | US Dollar to Japanese Yen |
80
+ | 5 | XAU-USD | Gold |
81
+ | 6 | HG-USD | Copper |
82
+ | 7 | CL-USD | Crude Oil |
83
+ | 8 | XAG-USD | Silver |
84
+ | 9 | SOL-USD | Solana |
85
+ | 10 | SPX-USD | S&P 500 Index |
24
86
 
25
87
  ## Usage Example
26
88
 
27
- ### Opening a Trade
89
+ ### Opening a Trade, Reading Open Trades, Setting Take Profit and Stop Loss, Closing a Trade
90
+
28
91
  ```python
29
92
  from ostium_python_sdk import OstiumSDK
30
93
  from dotenv import load_dotenv
@@ -129,7 +192,7 @@ except Exception as e:
129
192
 
130
193
  ```
131
194
 
132
- ## Example Usage Script
195
+ ## Example Usage Scripts
133
196
 
134
197
 
135
198
  ### Read Block Number
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ostium-python-sdk
3
- Version: 0.1.13
3
+ Version: 0.1.16
4
4
  Summary: A python based SDK developed for interacting with Ostium, a leveraged trading application for trading currencies, commodities, indices, crypto and more.
5
5
  Home-page: https://github.com/0xOstium/ostium-python-sdk
6
6
  Author: ami@ostium.io
@@ -22,7 +22,7 @@ Ostium is a decentralized perpetuals exchange on Arbitrum (Ethereum L2) with a f
22
22
  This SDK is designed to be used by developers who want to build applications on top of Ostium and automate their trading strategies.
23
23
 
24
24
 
25
- ## Pip Install
25
+ ## Installation
26
26
 
27
27
  The SDK can be installed via pip:
28
28
 
@@ -36,10 +36,73 @@ Developed using:
36
36
  ```python
37
37
  python=3.8
38
38
  ```
39
+ ## SDK Instantiation
40
+
41
+ You can instantiate the SDK with the following parameters.
42
+ Ostium Platform is deployed on Arbitrum. You can use the testnet or mainnet config via the `NetworkConfig` class, see below for an example.
43
+
44
+ ```python
45
+ from dotenv import load_dotenv
46
+ from ostium_python_sdk import OstiumSDK, NetworkConfig
47
+
48
+ # Load environment variables if using .env file
49
+ load_dotenv()
50
+
51
+ # Get private key from environment variable
52
+ private_key = os.getenv('PRIVATE_KEY')
53
+ if not private_key:
54
+ raise ValueError("PRIVATE_KEY not found in .env file")
55
+
56
+ rpc_url = os.getenv('RPC_URL')
57
+ if not rpc_url:
58
+ raise ValueError("RPC_URL not found in .env file")
59
+
60
+ # Initialize SDK
61
+ config = NetworkConfig.testnet()
62
+ sdk = OstiumSDK(config, private_key)
63
+ ```
64
+
65
+ ## The SDK contains the following classes:
66
+
67
+ - `OstiumSDK`: The main class for interacting with the Ostium Platform.
68
+
69
+ - `NetworkConfig`: The class for configuring the network.
70
+
71
+ - `Balance`: The class for interacting with the account, fetching balance, etc. available via `sdk.balance`.
72
+
73
+ - `SubgraphClient`: The class for interacting with the subgraph, getting pair details, open trades, open orders,etc. available via `sdk.subgraph`.
74
+
75
+ - `Price`: The class for interacting with the price, fetching latest price, etc. available via `sdk.price`
76
+
77
+ - `Ostium`: The class for interacting with the Ostium Smart contracts, opening trades, updating take profit and stop loss, closing trades, opening orders, etc. available via `sdk.ostium`.
78
+
79
+ ## Basic Usage
80
+
81
+ The intraction with Ostium platform is denoted with pair_id and trade_index.
82
+
83
+ - `pair_id`: The id of the pair, available via `sdk.subgraph.get_pairs()`
84
+ - `trade_index`: The index of the trade for this trader on the pair, available via `sdk.subgraph.get_open_trades()`
85
+
86
+ ## List of available pairs (Mainnet, as of Jnuary 2025)
87
+
88
+ | ID | Trading Pair | Description |
89
+ |----|--------------|--------------------------------|
90
+ | 0 | BTC-USD | Bitcoin |
91
+ | 1 | ETH-USD | Ethereum |
92
+ | 2 | EUR-USD | Euro |
93
+ | 3 | GBP-USD | British Pound |
94
+ | 4 | USD-JPY | US Dollar to Japanese Yen |
95
+ | 5 | XAU-USD | Gold |
96
+ | 6 | HG-USD | Copper |
97
+ | 7 | CL-USD | Crude Oil |
98
+ | 8 | XAG-USD | Silver |
99
+ | 9 | SOL-USD | Solana |
100
+ | 10 | SPX-USD | S&P 500 Index |
39
101
 
40
102
  ## Usage Example
41
103
 
42
- ### Opening a Trade
104
+ ### Opening a Trade, Reading Open Trades, Setting Take Profit and Stop Loss, Closing a Trade
105
+
43
106
  ```python
44
107
  from ostium_python_sdk import OstiumSDK
45
108
  from dotenv import load_dotenv
@@ -144,7 +207,7 @@ except Exception as e:
144
207
 
145
208
  ```
146
209
 
147
- ## Example Usage Script
210
+ ## Example Usage Scripts
148
211
 
149
212
 
150
213
  ### Read Block Number
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="ostium-python-sdk",
5
- version="0.1.13",
5
+ version="0.1.16",
6
6
  packages=find_packages(),
7
7
  install_requires=[
8
8
  "web3>=6.0.0",