33 <a href =" https://homora-v2.alphaventuredao.io/ " ><img src =" img/ahv2.png " alt =" Alpha Homora V2 Logo " height =" 200 " ></a >
44 <br ></br >
55 <h2 align =" center " ><strong >Alpha-Homora-V2-Python</strong ></h2 >
6+ <a href="https://homora-v2.alphaventuredao.io/"><img src="https://img.shields.io/website?down_color=red&down_message=Disconnected&label=Alpha%20Homora%20V2&up_color=blue&up_message=Online&url=https%3A%2F%2Fhomora-v2.alphaventuredao.io%2F"/></a>
7+ <img src="https://img.shields.io/badge/Python-3.9%2B-yellow"/>
8+ <a href="https://github.com/PathX-Projects/Alpha-Homora-V2-Python/issues"><img src="https://img.shields.io/github/issues/PathX-Projects/Alpha-Homora-V2-Python?color=red"/></a>
69 <p align="center">
7- A Python3.9+ package that models open Alpha Homora V2 positions to simplify interaction with their smart contracts in your Python projects.
10+ A Python3.9+ package that wraps Alpha Homora V2 positions to simplify interaction with their smart contracts in your Python projects.
811 </p>
912 <h3><strong>Current Features</strong></h3>
10- <i>Rewards Value | Position Value | Debt & Leverage Ratio | Pool Info | <del> Current APY</del> </i><br>
13+ <i>Rewards Value | Position Value | Debt & Leverage Ratio | Pool Info | Current APY</i><br>
1114 <i>Harvest Rewards | Close Position | Add & Remove Liquidity</i><br>
1215 <h3><strong>Current Supported Networks</strong></h3>
1316 <i>Avalanche</i><br>
@@ -54,7 +57,7 @@ How to use the package:
5457
55581. Import the AvalanchePosition class into your Python script:
5659 ` ` ` python
57- from alpha_homora_v2.position import AvalanchePosition
60+ from alpha_homora_v2 import AvalanchePosition
5861 ` ` `
5962
60632. ** (Optional)** Instantiate your custom Web3 provider object to interact with the network:
@@ -105,10 +108,31 @@ How to use the package:
105108 # NOTE: Passing the private key is optional, but required if you want to use transactional methods on the returned AvalanchePosition object(s).
106109 ` ` `
1071105. Use your position instance(s) to interact with the Alpha Homora V2 position smart contracts on the network:
111+ - Transactional Methods:
112+ - Return a [TransactionReceipt](alpha_homora_v2/receipt.py) object upon success
113+ - Private wallet key *** required*** for use to sign transactions
114+ - See the documentation in the [AvalanchePosition](alpha_homora_v2/position.py) class for function parameters.
115+ ` ` ` python
116+ # Add liquidity to the LP
117+ position.add(params)
118+
119+ # Remove liquidity from the LP
120+ position.remove(params)
121+
122+ # Harvest available rewards:
123+ position.harvest ()
124+
125+ # Close the position:
126+ position.close ()
127+ ` ` `
108128 - Informational Methods
109129 - Return JSON data
110130 - Private wallet key *** not required*** for use
131+ - See [` examples/position_info.ipynb` ](examples\a valanche\p osition_info.ipynb) for output examples.
111132 ` ` ` python
133+ # Get position value (equity, debt, and position value):
134+ position.get_position_value ()
135+
112136 # Get value of harvestable rewards:
113137 position.get_rewards_value ()
114138
@@ -118,25 +142,23 @@ How to use the package:
118142 # Get the current leverage ratio:
119143 position.get_leverage_ratio ()
120144
121- # Get position value (equity, debt, and position value):
122- position.get_position_value ()
123-
124- # (WIP) Get current pool APY (Only returns trading and farmng APY)
145+ # Get current pool APY
125146 position.get_current_apy ()
126147
148+ # Get underlying tokens and LP for the pool:
149+ position.get_pool_tokens ()
150+
151+ # Get the debt of each token in the position (token, debt_uint256, debt_token, debt_usd):
152+ position.get_tokens_debts ()
153+ # Alternatively, get the debt of a single token:
154+ position.get_token_debts(token_address)
155+
156+ # Get all token borrow rates from CREAM:
157+ position.get_cream_borrow_rates ()
158+
127159 # get LP pool info:
128160 position.pool
129161 ` ` `
130- - Transactional Methods:
131- - Return a [TransactionReceipt](alpha_homora_v2/receipt.py) object upon success
132- - Private wallet key *** required*** for use to sign transactions
133- ` ` ` python
134- # Harvest available rewards:
135- position.harvest ()
136-
137- # Close the position:
138- position.close ()
139- ` ` `
140162
141163# # Uninstallation:
142164
0 commit comments