Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: taker fee share #8310

Merged
merged 105 commits into from
Jul 26, 2024
Merged

feat: taker fee share #8310

merged 105 commits into from
Jul 26, 2024

Conversation

czarcas7ic
Copy link
Member

@czarcas7ic czarcas7ic commented May 24, 2024

Closes: #8227

What is the purpose of the change

This PR implements the taker fee share logic that will be used to skim taker fee shares generated by swap routes that contain denoms that have a taker fee share agreement with the Osmosis protocol.

To review this PR, I recommend the following order:

  1. Read the README additions here
  2. Review the taker fee skim logic here
  3. Review the Begin/EndBlock logic here
  4. Review the taker fee skim fund clearing logic here and here
  5. Review the entire store.go file here
  6. Review all remaining tests/protos/files

Testing and Verifying

Setting a Taker Fee Share Agreement

To set a taker fee share agreement for a denom, use the new gov v1 type, sending a message of type MsgSetTakerFeeShareAgreementForDenom, with [denom] [skim_percent] [skim_address] as inputs. This message can only be executed by the gov module account.

Querying Taker Fee Share Agreements

To query all taker fee share agreements:

osmosisd query poolmanager all-taker-fee-share-agreements

To query the taker fee share agreement for a specific denom:

osmosisd query poolmanager taker-fee-share-agreement-from-denom [denom]

Querying Accrued Value and Accumulators

To query all taker fee share accumulators:

osmosisd query poolmanager all-taker-fee-share-accumulators

To query the accrued value of taker fees for specific denoms:

osmosisd query poolmanager taker-fee-share-denoms-to-accrued-value [takerFeeDenom] [denom]

Registering an Alloyed Pool

To register an alloyed pool for taker fee revenue sharing, use the new gov v1 type, sending a message of type MsgSetRegisteredAlloyedPool, with [pool_id] as the input. This message can only be executed by the gov module account.

Querying an Alloyed Pool

To query all registered alloyed pools:

osmosisd query poolmanager all-registered-alloyed-pools

To query the registered alloyed pool state from a specific denom:

osmosisd query poolmanager registered-alloyed-pool-from-denom [denom]

@czarcas7ic czarcas7ic added the V:state/breaking State machine breaking PR label May 24, 2024
@github-actions github-actions bot added C:docs Improvements or additions to documentation C:x/lockup C:x/gamm Changes, features and bugs related to the gamm module. T:CI C:x/mint C:x/epochs C:x/pool-incentives T:build C:x/tokenfactory C:simulator Edits simulator or simulations C:x/concentrated-liquidity labels May 24, 2024
@czarcas7ic czarcas7ic closed this May 24, 2024
@czarcas7ic czarcas7ic reopened this May 24, 2024
@@ -358,7 +358,7 @@ func (q Querier) EstimateTradeBasedOnPriceImpact(

poolI, poolErr := swapModule.GetPool(ctx, req.PoolId)
if poolErr != nil {
return nil, status.Error(codes.Internal, err.Error())
return nil, status.Error(codes.Internal, poolErr.Error())
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drive by

x/poolmanager/keeper.go Show resolved Hide resolved
x/poolmanager/keeper.go Outdated Show resolved Hide resolved
x/poolmanager/keeper.go Outdated Show resolved Hide resolved
x/poolmanager/store.go Outdated Show resolved Hide resolved
x/poolmanager/store.go Show resolved Hide resolved
x/txfees/keeper/hooks.go Show resolved Hide resolved
x/poolmanager/store.go Outdated Show resolved Hide resolved
x/poolmanager/store.go Outdated Show resolved Hide resolved
Copy link
Member

@p0mvn p0mvn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work

x/poolmanager/store.go Outdated Show resolved Hide resolved
x/poolmanager/taker_fee.go Outdated Show resolved Hide resolved
x/poolmanager/taker_fee.go Outdated Show resolved Hide resolved
x/txfees/keeper/hooks.go Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:app-wiring Changes to the app folder C:CLI C:docs Improvements or additions to documentation C:simulator Edits simulator or simulations C:x/concentrated-liquidity C:x/epochs C:x/gamm Changes, features and bugs related to the gamm module. C:x/incentives C:x/lockup C:x/mint C:x/pool-incentives C:x/poolmanager C:x/superfluid C:x/tokenfactory C:x/twap Changes to the twap module C:x/txfees T:build T:CI V:state/breaking State machine breaking PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: taker fee revenue share for alloyed assets
3 participants