attach_funding_to_trades

Documentation for eth_defi.hyperliquid.trade_history.attach_funding_to_trades function.

attach_funding_to_trades(closed_trades, open_trades, funding_payments)

Attach funding payments to the appropriate round-trip trades.

For each funding payment, finds the trade for that coin active at the payment timestamp and attributes the funding cost/income to it.

Modifies trades in place.

Parameters
Return type

None