zetamarkets / sdk

SDK for accessing the Zeta program
Other
84 stars 29 forks source link

Use automatic priority fees #236

Closed filipzeta closed 1 year ago

filipzeta commented 1 year ago

Allow the user to toggle on automatic priority fees, which polls getRecentPrioritizationFees() to determine a good fee using a median of the last 20 blocks of fees. Note that we pass in the perpsyncqueue and greeks accounts to the RPC function, as they're the most touched accounts during trading.

We also refactor the existing priority fee logic a bit, removing toggleUsePriorityFees to make things simpler. If you want manual fees, just set Exchange.updatePriorityFee() to be nonzero. If you want automatic fees, just call Exchange.toggleAutoPriorityFee().