dydxprotocol / v4-chain

dydx v4 protocol
Other
231 stars 105 forks source link

Get funding index maps for vault positions in chunks. (backport #2525) #2527

Closed mergify[bot] closed 3 weeks ago

mergify[bot] commented 3 weeks ago

Changelist

Chunk the funding index maps to get for each vault subaccount to reduce the amount of rows scanned. Heights to get funding index maps for will be separated into chunks that cover 250k blocks each (number of blocks per chunk can be configured). Updated funding index map query to limit searches to both a min and max block height.

Additional fixes:

Test Plan

Existing unit tests.

Author/Reviewer Checklist

Summary by CodeRabbit