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: implement auto swap and burn for taker fee #16

Merged
merged 11 commits into from
Nov 29, 2023

Conversation

mtsitrin
Copy link
Collaborator

Closes: #XXX

What is the purpose of the change

Add a description of the overall background and high level changes that this PR introduces

(E.g.: This pull request improves documation of area A by adding ....

Brief Changelog

(for example:)

  • The metadata is stored in the blob store on job creation time as a persistent artifact
  • Deployments RPC transmits only the blob storage reference
  • Daemons retrieve the RPC data from the blob cache

Testing and Verifying

(Please pick one of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added unit test that validates ...
  • Added integration tests for end-to-end deployment with ...
  • Extended integration test for ...
  • Manually verified the change by ...

Documentation and Release Note

  • Does this pull request introduce a new feature or user-facing behavior changes? (yes / no)
  • Is a relevant changelog entry added to the Unreleased section in CHANGELOG.md? (yes / no)
  • How is the feature or change documented? (not applicable / specification (x/<module>/spec/) / Osmosis docs repo / not documented)

@mtsitrin mtsitrin changed the base branch from main to release/v15.x.x-dymension November 20, 2023 09:33
@mtsitrin mtsitrin marked this pull request as ready for review November 20, 2023 09:33
@mtsitrin mtsitrin changed the base branch from release/v15.x.x-dymension to main-dym November 21, 2023 07:34

//build new subroute to swap takerFeeCoin to base denom
var newRoutes []poolmanagertypes.SwapAmountInRoute
for i, route := range routes {
Copy link
Collaborator

Choose a reason for hiding this comment

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

seems like the routes are coming here from the routes used to make the switch. but why do we assume that if those routes don't provide a way to dym there isn't other routes that do? seems like we're not checking all routes possible.

e.g the switch USDC -> UDST, which may have a direct route USDC -> USDT, doesn't mean there isnt UDSC -> X -> DYM - but if I understand correctly the routes for this won't be contained in the check.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

there's no definitive requirement regarding it.
we don't manage this route mapping, and I'm not sure it's a good idea to randomly pick pools to swap the taker fee.

The issue is that the requirement is to allow pools with different base assets (DYM / USDC) but the taker fee has specific logic for DYM.
if we could treat base assets equally, there will be less edge cases

anyway, more holistic approach will probably be allowing gas with different tokens, then swap them to DYM in gov decided pools. something like that i think

Copy link
Collaborator

@omritoptix omritoptix Nov 22, 2023

Choose a reason for hiding this comment

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

there's no definitive requirement regarding it.

from my understanding of the requirement, every non-dym taker fee should be swapped to dym assuming there is some route which can facilitate this swap.

we don't manage this route mapping, and I'm not sure it's a good idea to randomly pick pools to swap the taker fee.

I believe this can be done similar to how the client calculates the route. or alternatively this client can also calculate if there is a route to swap to dym and pass it also in the request.

@mtsitrin mtsitrin merged commit c3f5b51 into main-dym Nov 29, 2023
@mtsitrin mtsitrin linked an issue Nov 29, 2023 that may be closed by this pull request
@mtsitrin mtsitrin deleted the 13-implement-auto-swap-and-burn-for-taker-fee branch November 29, 2023 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement auto swap and burn for taker fee
2 participants