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

testpoolswap - add auto and true arguments to display optimal path and prices for composite swap #1065

Closed
thedoublejay opened this issue Feb 16, 2022 · 7 comments
Assignees
Labels
area/packages kind/feature New feature request priority/important-soon Will be important soon triage/accepted Triage has been accepted

Comments

@thedoublejay
Copy link
Member

What would you like to be added:

We would like to add auto and true arguments for testpoolswap so we can use get the optimal path and prices for a swap.

Why is this needed:

Currently, the path finding algorithm is done on the client side (both path and prices) and it's causing some noticeable performance issues. Note, address can be from anyone (not validated if you are the owner).

testpoolswap '{"from":"address","tokenFrom":"DFI","amountFrom":1,"to":"address","tokenTo":"GOOGL"}' auto true
Sample response:
{
  “path”: “auto”,
  “pools”: [
    “5",
    “17”
  ],
  “amount”: “35102.57338662@15”
}
@thedoublejay thedoublejay added the kind/feature New feature request label Feb 16, 2022
@defichain-bot
Copy link
Contributor

@thedoublejay: Thanks for opening an issue, it is currently awaiting triage.

The triage/accepted label can be added by foundation members by writing /triage accepted in a comment.

Details

I am a bot created to help the DeFiCh developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the DeFiCh/oss-governance-bot repository.

@defichain-bot defichain-bot added the needs/triage Waiting for triage to be accepted label Feb 16, 2022
@defichain-bot
Copy link
Contributor

@thedoublejay: There are no 'area' labels on this issue. Adding an appropriate label will greatly expedite the process for us. You can add as many area as you see fit. If you are unsure what to do you can ignore this!

You can add area labels by leaving a /area comment.

Details

I am a bot created to help the DeFiCh developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the DeFiCh/oss-governance-bot repository.

@defichain-bot defichain-bot added the needs/area Needs area label(s) label Feb 16, 2022
@fuxingloh
Copy link
Contributor

/triage accepted
/area packages
/priority important-soon
/assign @eli-lim

Similar to #48 but expanding on top of the existing testpoolswap interface as requested by @thedoublejay.

@eli-lim
Copy link
Contributor

eli-lim commented Feb 23, 2022

Linked - DeFiCh/ain#1114

Do we want to present the "optimal path" - whether it's a direct or composite swap?
If so, DeFiCh/ain#1115 will need to be adjusted very slightly

@eli-lim
Copy link
Contributor

eli-lim commented Feb 28, 2022

@thedoublejay To reduce computation load on defichain, shall we expose this optimal path finding as an endpoint on Whale instead?

@thedoublejay
Copy link
Member Author

@eli-lim Yup! Let's go with optimal path.

@thedoublejay
Copy link
Member Author

@eli-lim Ok understand your point now. We can move this calculation on Whale side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/packages kind/feature New feature request priority/important-soon Will be important soon triage/accepted Triage has been accepted
Projects
None yet
4 participants