Skip to content

Commit ff8e1d7

Browse files
committed
indev
1 parent bd37662 commit ff8e1d7

24 files changed

Lines changed: 1513 additions & 205 deletions

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,5 +150,5 @@ cython_debug/
150150
package_testing.ipynb
151151
Result/*
152152
dev_ref/*
153-
testing.py
153+
testing*
154154
tests/report.csv

README.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
A Python3.9+ package that models open 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>Get Rewards Value | Get Position Value | Get Debt Ratio | Get LP Info | <del>Get Current APY</del></i><br>
11-
<i>Harvest Rewards | Close Position</i><br>
10+
<i>Rewards Value | Position Value | Debt & Leverage Ratio | Pool Info | <del>Current APY</del></i><br>
11+
<i>Harvest Rewards | Close Position | Add & Remove Liquidity</i><br>
1212
<h3><strong>Current Supported Networks</strong></h3>
1313
<i>Avalanche</i><br>
1414
<i><del>Ethereum</del> (WIP)</i><br>
@@ -21,6 +21,9 @@
2121
<ol>
2222
<li><a href="#installation">Installation</a></li>
2323
<li><a href="#usage">Usage</a></li>
24+
<ol>
25+
<li><a href="#avalanche">Avalanche</a></li>
26+
</ol>
2427
<li><a href="#uninstallation">Uninstallation</a></li>
2528
<li><a href="#roadmap">Roadmap</a></li>
2629
</ol>
@@ -34,7 +37,7 @@ This package is set up to be installed using the `pip` package manager.
3437

3538
2. Install the package using pip (you must use the git+url as this project is private and not listed on PyPi):
3639
```bash
37-
pip install git+https://github.com/PathX-Projects/Alpha-Homora-V2-Python.git
40+
pip install --upgrade git+https://github.com/PathX-Projects/Alpha-Homora-V2-Python.git
3841
```
3942

4043
***Note:*** You may need to provide your git credentials depending on the repository privacy settings. In the event, if you need help generating a personal access token see [here](https://catalyst.zoho.com/help/tutorials/githubbot/generate-access-token.html)
@@ -47,7 +50,7 @@ When updates are made to the package, the version will automatically be incremen
4750

4851
How to use the package:
4952

50-
### For Avalanche Positions:
53+
### Avalanche:
5154

5255
1. Import the package into your Python script:
5356
```python
@@ -128,7 +131,7 @@ How to use the package:
128131
- Private wallet key ***required*** for use to sign transactions
129132
```python
130133
# Harvest available rewards:
131-
position.claim_all_rewards()
134+
position.harvest()
132135

133136
# Close the position:
134137
position.close()
@@ -143,24 +146,23 @@ pip uninstall alpha-homora-v2
143146
144147
## Feature Roadmap:
145148
146-
- [ ] Avalanche:
149+
- [x] Avalanche:
147150
- [x] Get all open positions by owner wallet address
148151
- [x] Harvest Position Rewards
149152
- [x] Close Position
150153
- [x] Get position value of equity and debt
151154
- [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
155+
- [x] Get outstanding rewards value in native rewards token and USD
156+
- [x] Add Liquidity
157+
- [x] Remove Liquidity
158+
- [x] Get aggregate pool APY (incl. borrowAPY)
158159
- [ ] Ethereum:
160+
- [ ] Get all open positions by owner wallet address
159161
- [ ] Harvest Position Rewards
160162
- [ ] Close Position
161163
- [ ] Get position value of equity and debt
162164
- [ ] Get current debt ratio
163165
- [ ] Get outstanding rewards value in native rewards token and USD
164-
- [ ] Get current pool APY
165166
- [ ] Add Liquidity
166-
- [ ] Remove Liquidity
167+
- [ ] Remove Liquidity
168+
- [ ] Get aggregate pool APY (incl. borrowAPY)

alpha_homora_v2/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
__version__ = "2.0.0"
2+

alpha_homora_v2/_config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Default RPC URLS:
2+
AVAX_RPC_URL = "https://api.avax.network/ext/bc/C/rpc"
File renamed without changes.

alpha_homora_v2/abi/ERC20_ABI.json

Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
1+
[
2+
{
3+
"constant": true,
4+
"inputs": [],
5+
"name": "name",
6+
"outputs": [
7+
{
8+
"name": "",
9+
"type": "string"
10+
}
11+
],
12+
"payable": false,
13+
"stateMutability": "view",
14+
"type": "function"
15+
},
16+
{
17+
"constant": false,
18+
"inputs": [
19+
{
20+
"name": "_spender",
21+
"type": "address"
22+
},
23+
{
24+
"name": "_value",
25+
"type": "uint256"
26+
}
27+
],
28+
"name": "approve",
29+
"outputs": [
30+
{
31+
"name": "",
32+
"type": "bool"
33+
}
34+
],
35+
"payable": false,
36+
"stateMutability": "nonpayable",
37+
"type": "function"
38+
},
39+
{
40+
"constant": true,
41+
"inputs": [],
42+
"name": "totalSupply",
43+
"outputs": [
44+
{
45+
"name": "",
46+
"type": "uint256"
47+
}
48+
],
49+
"payable": false,
50+
"stateMutability": "view",
51+
"type": "function"
52+
},
53+
{
54+
"constant": false,
55+
"inputs": [
56+
{
57+
"name": "_from",
58+
"type": "address"
59+
},
60+
{
61+
"name": "_to",
62+
"type": "address"
63+
},
64+
{
65+
"name": "_value",
66+
"type": "uint256"
67+
}
68+
],
69+
"name": "transferFrom",
70+
"outputs": [
71+
{
72+
"name": "",
73+
"type": "bool"
74+
}
75+
],
76+
"payable": false,
77+
"stateMutability": "nonpayable",
78+
"type": "function"
79+
},
80+
{
81+
"constant": true,
82+
"inputs": [],
83+
"name": "decimals",
84+
"outputs": [
85+
{
86+
"name": "",
87+
"type": "uint8"
88+
}
89+
],
90+
"payable": false,
91+
"stateMutability": "view",
92+
"type": "function"
93+
},
94+
{
95+
"constant": true,
96+
"inputs": [
97+
{
98+
"name": "_owner",
99+
"type": "address"
100+
}
101+
],
102+
"name": "balanceOf",
103+
"outputs": [
104+
{
105+
"name": "balance",
106+
"type": "uint256"
107+
}
108+
],
109+
"payable": false,
110+
"stateMutability": "view",
111+
"type": "function"
112+
},
113+
{
114+
"constant": true,
115+
"inputs": [],
116+
"name": "symbol",
117+
"outputs": [
118+
{
119+
"name": "",
120+
"type": "string"
121+
}
122+
],
123+
"payable": false,
124+
"stateMutability": "view",
125+
"type": "function"
126+
},
127+
{
128+
"constant": false,
129+
"inputs": [
130+
{
131+
"name": "_to",
132+
"type": "address"
133+
},
134+
{
135+
"name": "_value",
136+
"type": "uint256"
137+
}
138+
],
139+
"name": "transfer",
140+
"outputs": [
141+
{
142+
"name": "",
143+
"type": "bool"
144+
}
145+
],
146+
"payable": false,
147+
"stateMutability": "nonpayable",
148+
"type": "function"
149+
},
150+
{
151+
"constant": true,
152+
"inputs": [
153+
{
154+
"name": "_owner",
155+
"type": "address"
156+
},
157+
{
158+
"name": "_spender",
159+
"type": "address"
160+
}
161+
],
162+
"name": "allowance",
163+
"outputs": [
164+
{
165+
"name": "",
166+
"type": "uint256"
167+
}
168+
],
169+
"payable": false,
170+
"stateMutability": "view",
171+
"type": "function"
172+
},
173+
{
174+
"payable": true,
175+
"stateMutability": "payable",
176+
"type": "fallback"
177+
},
178+
{
179+
"anonymous": false,
180+
"inputs": [
181+
{
182+
"indexed": true,
183+
"name": "owner",
184+
"type": "address"
185+
},
186+
{
187+
"indexed": true,
188+
"name": "spender",
189+
"type": "address"
190+
},
191+
{
192+
"indexed": false,
193+
"name": "value",
194+
"type": "uint256"
195+
}
196+
],
197+
"name": "Approval",
198+
"type": "event"
199+
},
200+
{
201+
"anonymous": false,
202+
"inputs": [
203+
{
204+
"indexed": true,
205+
"name": "from",
206+
"type": "address"
207+
},
208+
{
209+
"indexed": true,
210+
"name": "to",
211+
"type": "address"
212+
},
213+
{
214+
"indexed": false,
215+
"name": "value",
216+
"type": "uint256"
217+
}
218+
],
219+
"name": "Transfer",
220+
"type": "event"
221+
}
222+
]

0 commit comments

Comments
 (0)