1212 <h3><strong>Current Supported Networks</strong></h3>
1313 <i>Avalanche</i><br>
1414 <i><del>Ethereum</del> (WIP)</i><br>
15- <i><del>Fantom</del> (WIP)</i><br>
1615</div >
1716<br >
1817
@@ -56,15 +55,12 @@ How to use the package:
5655 from alpha_homora_v2.position import AvalanchePosition
5756 ` ` `
5857
59- 2. Create your Web3 provider object to interact with the network:
58+ 2. ** (Optional) ** Create your Web3 provider object to interact with the network:
6059 ` ` ` python
6160 NETWORK_RPC_URL = " your_rpc_url"
62-
63- provider = get_provider(NETWORK_RPC_URL)
61+ provider = get_web3_provider(NETWORK_RPC_URL)
6462 ` ` `
65-
66633. Creating an [AvalanchePosition](alpha_homora_v2/position.py) instance requires the following:
67- - A web3 provider object
6864 - Your position ID (an integer)
6965 - This ID should match your position on Alpha Homora, without the " #"
7066 - ! [demo](img/id_highlight.png)
@@ -74,26 +70,39 @@ How to use the package:
7470 - This parameter should exactly match the token symbol/pair displayed on your Alpha Homora as shown below.
7571 - ! [demo](img/token_highlight.png)
7672 -->
77-
73+ < ! --- DEPRECATED
7874 - The DEX identifier (a string)
7975 - This parameter should exactly match the DEX identifier displayed on your Alpha Homora position as shown below.
8076 - ! [demo](img/dex_highlight.png)
81- - your public and private wallet keys (both a string)
82- - Your private key is required to sign transactions
77+ -->
78+
79+ - your public wallet key
80+ - ** (Optional)** your private wallet key
81+ - Your private key is required to sign transactional methods
82+ - ** (Optional)** A web3 provider object
83+ - If none is passed, an HTTP provider will be created with the [default Avalanche RPC URL](https://api.avax.network/ext/bc/C/rpc)
8384
8485 Once you' ve gathered all of these variables, you can create the position instance like this example below:
8586 ```python
8687 position = AvalanchePosition(
87- web3_provider=provider,
8888 position_id=11049,
89- dex="Pangolin V2",
9089 owner_wallet_address="0x...",
91- owner_private_key="123abc456efg789hij..." # ( Optional - see step 4)
92- )
90+ owner_private_key="123abc456efg789hij...", # <- Optional - see step 4
91+ web3_provider=provider) # <- Optional If you ' d like to use a custom provider
9392 ` ` `
94- 4. Use your position instance to interact with the Alpha Homora V2 position smart contracts on the network:
93+ 4. Alternatively, get all open positions ([AvalanchePosition](alpha_homora_v2/position.py) objects) by owner wallet address:
94+ ` ` ` python
95+ from alpha_homora_v2.position import get_avax_positions_by_owner
96+
97+ positions = get_avax_positions_by_owner(owner_address=" owner_wallet_address" ,
98+ owner_private_key=" owner_private_key" , # <- Optional
99+ web3_provider=provider) # <- Optional
100+
101+ # NOTE: Passing the private key is optional, but required if you want to use transactional methods on the returned AvalanchePosition object(s).
102+ ` ` `
103+ 5. Use your position instance(s) to interact with the Alpha Homora V2 position smart contracts on the network:
95104 - Informational Methods
96- - Return data like a JSON API
105+ - Return JSON data
97106 - Private wallet key *** not required*** for use
98107 ` ` ` python
99108 # Get value of harvestable rewards:
@@ -102,17 +111,20 @@ How to use the package:
102111 # Get current debt ratio:
103112 position.get_debt_ratio ()
104113
114+ # Get the current leverage ratio:
115+ position.get_leverage_ratio ()
116+
105117 # Get position value (equity, debt, and position value):
106118 position.get_position_value ()
107119
108- # get LP pool info:
109- position.get_pool_info()
110-
111- # (WIP) Get current pool APY
120+ # (WIP) Get current pool APY (Only returns trading and farmng APY)
112121 position.get_current_apy ()
122+
123+ # get LP pool info:
124+ position.pool
113125 ` ` `
114126 - Transactional Methods:
115- - Return a [TransactionReceipt](alpha_homora_v2/receipt.py) object with success
127+ - Return a [TransactionReceipt](alpha_homora_v2/receipt.py) object upon success
116128 - Private wallet key *** required*** for use to sign transactions
117129 ` ` ` python
118130 # Harvest available rewards:
@@ -129,15 +141,26 @@ Uninstall the package like any other Python package using the pip uninstall comm
129141pip uninstall alpha-homora-v2
130142` ` `
131143
132- ## Roadmap:
133-
134- - [x] Get position value of equity and debt
135- - [x] Get current debt ratio
136- - [ ] Get outstanding rewards value in native rewards token and USD
137- - [x] Pangolin V2
138- - [ ] Trader Joe
139- - [ ] Get current pool APY
140- - [ ] Integrate with All Supported Alpha Homora V2 Networks:
141- - [x] Avalanche
142- - [ ] Ethereum
143- - [ ] Fantom
144+ # # Feature Roadmap:
145+
146+ - [ ] Avalanche:
147+ - [x] Get all open positions by owner wallet address
148+ - [x] Harvest Position Rewards
149+ - [x] Close Position
150+ - [x] Get position value of equity and debt
151+ - [x] Get current debt ratio
152+ - [ ] Get outstanding rewards value in native rewards token and USD
153+ - [x] Pangolin V2
154+ - [ ] Trader Joe
155+ - [ ] Get current pool APY
156+ - [ ] Add Liquidity
157+ - [ ] Remove Liquidity
158+ - [ ] Ethereum:
159+ - [ ] Harvest Position Rewards
160+ - [ ] Close Position
161+ - [ ] Get position value of equity and debt
162+ - [ ] Get current debt ratio
163+ - [ ] Get outstanding rewards value in native rewards token and USD
164+ - [ ] Get current pool APY
165+ - [ ] Add Liquidity
166+ - [ ] Remove Liquidity
0 commit comments