Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CL Incentives] Implement proper accumulator checkpointing for positi…
…ons `initOrUpdatePositionUptime` (osmosis-labs#4455) * initial push * push * untracked files * add untracked files * merge branches * add changes required for fees * lint * fix test errors * clean up * remove print lines * feat: single fee accum (osmosis-labs#4116) * single fee accum * lint * no longer need to get all positions for fee * incentive accum initialization * lint * Update x/concentrated-liquidity/store_test.go Co-authored-by: Sishir Giri <[email protected]> * add lower level tests and make uptime accum access private * lint * add gotests for helper fn * Update test to use existing variable Co-authored-by: Roman <[email protected]> * create or update records upon position creation/update * add tests and clean up * sync position-related changes * add support for negative liquidity delta * add and test helper & set up tick initialization logic * implement accumulator updates on tick crossing and clean up proto * clean up comments * minor test cleanup * ensure accum initalization follows conventions and clean up tests * update pool proto and CL pool extension for tracking liq changes * update new field at pool initialization and add tests * comment todos * clean up naming and move empty options to global var * add clarifying comments and lint * implement IncentiveRecord proto * add comments * lint * set up wiring for proto * implement updateUptimeAccumulatorsToNow * implement and test calcAccruedIncentivesForAccum * add tests for new helpers * minor comment updates Co-authored-by: Roman <[email protected]> * accum test updates * lint * clean up diff * lint * update go.mod for e2e * clean up proto and add error message * lint * sketch out testing approach * set up keys * clean up diff * clean up comments * lint * implement set and get for incentive records * comment cleanup * minor comment and test cleanup * clean up tests and comments * [CL Incentives] Implement `setIncentiveRecords` and `getIncentiveRecords` (osmosis-labs#4283) * set up keys * implement set and get for incentive records * comment cleanup * minor comment and test cleanup * Revert "[CL Incentives] Implement `setIncentiveRecords` and `getIncentiveRecords` (osmosis-labs#4283)" (osmosis-labs#4294) This reverts commit de7c146. * set incentive records in new position tests * fix merge conflicts * add check for init position record values * fix and finalize uptime accum position tests * fix go mod for e2e * clean up diff * add err check to accum update * fix rounding error * implement tick init uptime tracker logic * fix test compatibility * implement fix for global accums falling out of sync before tick init * add tests to ensure uptime trackers are initialized properly * add comment for new helper * add core logic * go mod tidy * fix conflicts * fix e2e * update go mod * fix and further test tick init logic * remove redundant values from incentive record state * cleanup from review * comment cleanup * set up cross tick tests * add further tests * test and comment cleanup * implement core logic * update osmoutils go mod and remove curTick as fn param * thorough tests for new functionality * clean up new functions for readability * clean up test comments * fix test names * lint * add godoc and further comments * update go mod for e2e * update liq change logic * update uptime accums before gettings them for tick crossing * abstract uptime init and update logic to helper * add thorough tests for initOrUpdatePositionUptime * update liquidity update logic and tests to use new helper * add todo for frozenuntil issue * lint * lint * clean up logic and add tests for helper * go mod for osmoutils e2e * move position key computation outside loop * clean up imports and go sum * fix imports --------- Co-authored-by: Adam Tucker <[email protected]> Co-authored-by: Adam Tucker <[email protected]> Co-authored-by: Sishir Giri <[email protected]> Co-authored-by: Roman <[email protected]>
- Loading branch information