77 A Python3.9+ package that models Alpha Homora V2 positions to simplify interaction with their smart contracts in your Python projects.
88 </p>
99 <h3><strong>Current Features</strong></h3>
10- <i>Fetch Position Data</i><br>
11- <i>Harvest Rewards</i><br>
12- <i>Close Position</i><br>
10+ <i>Get Rewards Value | Get Position Value | Get Debt Ratio | Get LP Info</i><br>
11+ <i>Harvest Rewards | Close Position</i><br>
1312 <h3><strong>Current Supported DEXes</strong></h3>
1413 <i>Pangolin V2 on Avalanche</i><br>
1514 <i>Trader Joe on Avalanche</i><br>
@@ -48,27 +47,31 @@ When updates are made to the package, the version will automatically be incremen
4847
4948How to use the package:
5049
51- - Import the package into your Python script:
50+ 1. Import the package into your Python script:
5251 ` ` ` python
5352 from alpha_homora_v2.util import get_web3_provider
5453 from alpha_homora_v2.position import AlphaHomoraV2Position
5554 ` ` `
5655
57- - Create your Web3 provider object to interact with the network:
56+ 2. Create your Web3 provider object to interact with the network:
5857 ` ` ` python
5958 NETWORK_RPC_URL = " your_rpc_url"
6059
6160 provider = get_provider(NETWORK_RPC_URL)
6261 ` ` `
6362
64- - Creating an [AlphaHomoraV2Position](alpha_homora_v2/position.py) instance requires the following:
63+ 3. Creating an [AlphaHomoraV2Position](alpha_homora_v2/position.py) instance requires the following:
6564 - A web3 provider object
6665 - Your position ID (an integer)
6766 - This ID should match your position on Alpha Homora, without the " #"
6867 - ! [demo](img/id_highlight.png)
68+
69+ < ! --- DEPRECATED
6970 - The token symbol/pair (a string)
7071 - This parameter should exactly match the token symbol/pair displayed on your Alpha Homora as shown below.
7172 - ! [demo](img/token_highlight.png)
73+ -->
74+
7275 - The DEX identifier (a string)
7376 - This parameter should exactly match the DEX identifier displayed on your Alpha Homora position as shown below.
7477 - ! [demo](img/dex_highlight.png)
@@ -80,20 +83,33 @@ How to use the package:
8083 position = AlphaHomoraV2Position(
8184 web3_provider=provider,
8285 position_id=11049,
83- position_symbol="AVAX/USDT.e",
8486 dex="Pangolin V2",
8587 owner_wallet_address="0x...",
86- owner_private_key="123abc456efg789hij..."
88+ owner_private_key="123abc456efg789hij..." # (Optional - see step 4)
8789 )
8890 ```
89- - Use your position instance to interact with the Alpha Homora V2 position smart contracts on the network:
91+ 4. Use your position instance to interact with the Alpha Homora V2 position smart contracts on the network:
9092 ```python
91- # Harvest rewards:
92- position.claim_all_rewards()
93+ """ Informational Methods (Private Key not Required) """
94+ # Get value of harvestable rewards:
95+ position.get_rewards_value()
96+
97+ # Get current debt ratio:
98+ position.get_debt_ratio()
99+
100+ # Get position value (equity, debt, and position value):
101+ position.get_position_value()
93102
94103 # get LP pool info:
95104 position.get_pool_info()
96105
106+ # (WIP) Get current pool APY
107+ position.get_current_apy()
108+
109+ """ Transactional Methods (Private Key Required) """
110+ # Harvest available rewards:
111+ position.claim_all_rewards()
112+
97113 # Close the position:
98114 position.close()
99115 ```
@@ -107,7 +123,13 @@ pip uninstall alpha-homora-v2
107123
108124## Roadmap:
109125
110- 1. ***(WIP)*** Get position value of equity and debt
111- 2. ***(WIP)*** Get outstanding rewards value in native rewards token and USD
112- 3. ***(WIP)*** Get current debt ratio
113- 4. Integrate other DEXes outside of the Avalanche network
126+ 1. ~~Get position value of equity and debt~~
127+ 2. ~~Get current debt ratio~~
128+ 3. Get outstanding rewards value in native rewards token and USD
129+ - ~~Pangolin V2~~
130+ - Trader Joe
131+ 4. Get current pool APY
132+ 5. Integrate with Alpha Homora V2 Networks:
133+ - ~~Avalanche~~
134+ - Ethereum
135+ - Fantom
0 commit comments