Skip to content

Commit a810da0

Browse files
authored
userFillsByTime method support (#66)
Add support for userFillsByTime info API method.
1 parent 381c417 commit a810da0

File tree

3 files changed

+578
-0
lines changed

3 files changed

+578
-0
lines changed

hyperliquid/info.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,37 @@ def user_fills(self, address: str) -> Any:
187187
"""
188188
return self.post("/info", {"type": "userFills", "user": address})
189189

190+
def user_fills_by_time(self, address: str, start_time: int, end_time: Optional[int] = None) -> Any:
191+
"""Retrieve a given user's fills by time.
192+
193+
POST /info
194+
195+
Args:
196+
address (str): Onchain address in 42-character hexadecimal format;
197+
e.g. 0x0000000000000000000000000000000000000000.
198+
start_time (int): Unix timestamp in milliseconds
199+
end_time (Optional[int]): Unix timestamp in milliseconds
200+
201+
Returns:
202+
[
203+
{
204+
closedPnl: float string,
205+
coin: str,
206+
crossed: bool,
207+
dir: str,
208+
hash: str,
209+
oid: int,
210+
px: float string,
211+
side: str,
212+
startPosition: float string,
213+
sz: float string,
214+
time: int
215+
},
216+
...
217+
]
218+
"""
219+
return self.post("/info", {"type": "userFillsByTime", "user": address, "startTime": start_time, "endTime": end_time})
220+
190221
def meta(self) -> Meta:
191222
"""Retrieve exchange perp metadata
192223

0 commit comments

Comments
 (0)