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(apps/whale-api): always return the highest yield #1978

Merged
merged 2 commits into from
Jan 17, 2023

Conversation

thedoublejay
Copy link
Member

@thedoublejay thedoublejay commented Jan 16, 2023

What this PR does / why we need it:

Initially, the behavior is always to return the highest yield when doing swaps. We have updated it to use direct path first (if available) before considering other options. Even if direct path is more expensive.

This will revert it to its original behavior as some pairs are cheaper via composite swaps. (e.g, DFI -> DUSD). Will fix this issue - BirthdayResearch/defichain-wallet#3885

Which issue(s) does this PR fixes?:

Fixes #

Additional comments?:

@codeclimate
Copy link

codeclimate bot commented Jan 16, 2023

Code Climate has analyzed commit a2afd1e and detected 0 issues on this pull request.

View more on Code Climate.

@netlify
Copy link

netlify bot commented Jan 16, 2023

Deploy Preview for jellyfishsdk ready!

Name Link
🔨 Latest commit a2afd1e
🔍 Latest deploy log https://app.netlify.com/sites/jellyfishsdk/deploys/63c5294c7b1d84000894ed47
😎 Deploy Preview https://deploy-preview-1978--jellyfishsdk.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@codecov
Copy link

codecov bot commented Jan 16, 2023

Codecov Report

Base: 91.22% // Head: 93.84% // Increases project coverage by +2.62% 🎉

Coverage data is based on head (a2afd1e) compared to base (050a0a2).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1978      +/-   ##
==========================================
+ Coverage   91.22%   93.84%   +2.62%     
==========================================
  Files         368      368              
  Lines       10829    10825       -4     
  Branches     1378     1377       -1     
==========================================
+ Hits         9879    10159     +280     
+ Misses        908      637     -271     
+ Partials       42       29      -13     
Impacted Files Coverage Δ
...api/src/module.api/poolswap.pathfinding.service.ts 96.94% <ø> (+2.87%) ⬆️
packages/jellyfish-address/src/p2wsh.ts 48.27% <0.00%> (-51.73%) ⬇️
packages/whale-api-client/src/api/masternodes.ts 71.42% <0.00%> (-28.58%) ⬇️
packages/whale-api-client/src/errors/api.error.ts 84.00% <0.00%> (-16.00%) ⬇️
...h-transaction-builder/src/txn/txn_builder_vault.ts 82.35% <0.00%> (-5.89%) ⬇️
...pps/whale-api/src/module.api/loan.vault.service.ts 87.50% <0.00%> (-2.68%) ⬇️
...ckages/jellyfish-transaction/src/script/mapping.ts 96.81% <0.00%> (-1.28%) ⬇️
...ages/jellyfish-api-core/src/category/blockchain.ts 95.55% <0.00%> (ø)
...action-builder/src/txn/txn_builder_icxorderbook.ts 78.57% <0.00%> (ø)
packages/jellyfish-api-core/src/category/wallet.ts 100.00% <0.00%> (+2.24%) ⬆️
... and 26 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@github-actions
Copy link

Docker build preview for jellyfish/apps is ready!

Built with commit 9883ec0

  • ghcr.io/jellyfishsdk/legacy-api:pr-1978
  • ghcr.io/jellyfishsdk/ocean-api:pr-1978
  • ghcr.io/jellyfishsdk/playground-api:pr-1978
  • ghcr.io/jellyfishsdk/status-api:pr-1978
  • ghcr.io/jellyfishsdk/whale-api:pr-1978

You can also get an immutable image with the commit hash

  • ghcr.io/jellyfishsdk/legacy-api:9883ec0818a400e9b3fec923864699f66636c916
  • ghcr.io/jellyfishsdk/ocean-api:9883ec0818a400e9b3fec923864699f66636c916
  • ghcr.io/jellyfishsdk/playground-api:9883ec0818a400e9b3fec923864699f66636c916
  • ghcr.io/jellyfishsdk/status-api:9883ec0818a400e9b3fec923864699f66636c916
  • ghcr.io/jellyfishsdk/whale-api:9883ec0818a400e9b3fec923864699f66636c916

@thedoublejay thedoublejay marked this pull request as ready for review January 17, 2023 01:25
@thedoublejay thedoublejay changed the title feat(pathfinding): always return cheapest price feat(pathfinding): always return the highest yield Jan 17, 2023
@fuxingloh fuxingloh merged commit 5c44e0e into main Jan 17, 2023
@fuxingloh fuxingloh deleted the thedoublejay/use_best_path branch January 17, 2023 15:29
@fuxingloh fuxingloh changed the title feat(pathfinding): always return the highest yield feat(apps/whale-api): always return the highest yield Jan 17, 2023
thedoublejay added a commit that referenced this pull request Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants