Mirror option expiry settlements from exchange bills; debit OO LIVE open premiums.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -506,6 +506,33 @@ class BinanceTradeClient:
|
||||
{"symbol": symbol, "leverage": lev},
|
||||
)
|
||||
|
||||
def get_option_exercise_records(
|
||||
self, symbol: str, *, begin_ms: int, end_ms: int | None = None
|
||||
) -> list[dict] | None:
|
||||
"""用户期权行权/到期结算记录 GET /eapi/v1/exerciseRecord。"""
|
||||
end = int(end_ms or int(time.time() * 1000))
|
||||
begin = int(begin_ms)
|
||||
try:
|
||||
rows = self._signed(
|
||||
self._eapi,
|
||||
"GET",
|
||||
"/eapi/v1/exerciseRecord",
|
||||
{
|
||||
"symbol": symbol,
|
||||
"startTime": begin,
|
||||
"endTime": end,
|
||||
"limit": 100,
|
||||
},
|
||||
)
|
||||
except Exception as e:
|
||||
logger.warning("binance exerciseRecord failed: %s", e)
|
||||
return None
|
||||
if isinstance(rows, dict):
|
||||
rows = [rows]
|
||||
if not isinstance(rows, list):
|
||||
return []
|
||||
return [r for r in rows if isinstance(r, dict)]
|
||||
|
||||
def get_funding_usdt(
|
||||
self, symbol: str, *, begin_ms: int, end_ms: int | None = None
|
||||
) -> float:
|
||||
|
||||
Reference in New Issue
Block a user