Skip to content

Commit

Permalink
Revert "feat: tick init/deinit for CL (#7622) (#7628)"
Browse files Browse the repository at this point in the history
This reverts commit ea4238e.
  • Loading branch information
czarcas7ic committed Feb 29, 2024
1 parent ea4238e commit ac59c15
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 28 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* [#7590](https://github.com/osmosis-labs/osmosis/pull/7590) fix cwpool migration prop disallowing only one of code id or bytecode.
* [#7582](https://github.com/osmosis-labs/osmosis/pull/7582) IAVL v1
* [#7622](https://github.com/osmosis-labs/osmosis/pull/7622) Create/remove tick events.

## v23.0.0

Expand Down
26 changes: 1 addition & 25 deletions x/concentrated-liquidity/tick.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,21 +153,7 @@ func (k Keeper) makeInitialTickInfo(ctx sdk.Context, poolId uint64, tickIndex in
initialUptimeTrackers = append(initialUptimeTrackers, model.UptimeTracker{UptimeGrowthOutside: uptimeTrackerValue})
}

uptimeTrackers := model.UptimeTrackers{List: initialUptimeTrackers}

// Emit init tick event
ctx.EventManager().EmitEvents(sdk.Events{
sdk.NewEvent(
types.TypeEvtInitTick,
sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory),
sdk.NewAttribute(types.AttributeKeyPoolId, strconv.FormatUint(poolId, 10)),
sdk.NewAttribute(types.AttributeKeyTickIndex, strconv.FormatInt(tickIndex, 10)),
sdk.NewAttribute(types.AttributeKeySpreadRewardGrowthOppositeDirectionOfLastTraversal, initialSpreadRewardGrowthOppositeDirectionOfLastTraversal.String()),
sdk.NewAttribute(types.AttributeKeyUptimeGrowthOppositeDirectionOfLastTraversal, uptimeTrackers.String()),
),
})

return model.TickInfo{LiquidityGross: osmomath.ZeroDec(), LiquidityNet: osmomath.ZeroDec(), SpreadRewardGrowthOppositeDirectionOfLastTraversal: initialSpreadRewardGrowthOppositeDirectionOfLastTraversal, UptimeTrackers: uptimeTrackers}, nil
return model.TickInfo{LiquidityGross: osmomath.ZeroDec(), LiquidityNet: osmomath.ZeroDec(), SpreadRewardGrowthOppositeDirectionOfLastTraversal: initialSpreadRewardGrowthOppositeDirectionOfLastTraversal, UptimeTrackers: model.UptimeTrackers{List: initialUptimeTrackers}}, nil
}

func (k Keeper) SetTickInfo(ctx sdk.Context, poolId uint64, tickIndex int64, tickInfo *model.TickInfo) {
Expand All @@ -181,16 +167,6 @@ func (k Keeper) RemoveTickInfo(ctx sdk.Context, poolId uint64, tickIndex int64)
store := ctx.KVStore(k.storeKey)
key := types.KeyTick(poolId, tickIndex)
store.Delete(key)

// Emit remove tick event
ctx.EventManager().EmitEvents(sdk.Events{
sdk.NewEvent(
types.TypeEvtRemoveTick,
sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory),
sdk.NewAttribute(types.AttributeKeyPoolId, strconv.FormatUint(poolId, 10)),
sdk.NewAttribute(types.AttributeKeyTickIndex, strconv.FormatInt(tickIndex, 10)),
),
})
}

func (k Keeper) GetAllInitializedTicksForPool(ctx sdk.Context, poolId uint64) ([]genesis.FullTick, error) {
Expand Down
2 changes: 0 additions & 2 deletions x/concentrated-liquidity/types/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ const (
TypeEvtMoveRewards = "move_rewards"
TypeEvtCrossTick = "cross_tick"
TypeEvtTransferPositions = "transfer_positions"
TypeEvtInitTick = "init_tick"
TypeEvtRemoveTick = "remove_tick"

AttributeValueCategory = ModuleName
AttributeKeyPositionId = "position_id"
Expand Down

0 comments on commit ac59c15

Please sign in to comment.