jellyfishsdk icon indicating copy to clipboard operation
jellyfishsdk copied to clipboard

feat(whale-api): add commission fee on best path

Open pierregee opened this issue 3 years ago β€’ 3 comments

What this PR does / why we need it:

  • To further improve the estimation of return, this PR would deduct the commission fees as part of the computation Deduct Commission fees first, then DEX fees

Which issue(s) does this PR fixes?:

Fixes #

Additional comments?:

  • This PR based the computation here -- commission fees are deducted first before the DEX fees
  • Added commission fees to the following to test commission in multiple hops (compounding)
graph TD;
    I---J;
    J---|commission:0.10| L
    J---|commission:0.25| K
    L---K;
    L---|commission:0.50| M*
    M*---N*;

pierregee avatar Aug 31 '22 05:08 pierregee

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

View more on Code Climate.

qlty-cloud-legacy[bot] avatar Aug 31 '22 05:08 qlty-cloud-legacy[bot]

Deploy Preview for jellyfishsdk ready!

Name Link
Latest commit ec89f88b9b5591e1b70eeec50b1f1e5a211e66c2
Latest deploy log https://app.netlify.com/sites/jellyfishsdk/deploys/633cf219e31e3d0008c1bf86
Deploy Preview https://deploy-preview-1732--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.

netlify[bot] avatar Aug 31 '22 05:08 netlify[bot]

Codecov Report

Base: 93.16% // Head: 93.78% // Increases project coverage by +0.61% :tada:

Coverage data is based on head (ec89f88) compared to base (467b7c5). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1732      +/-   ##
==========================================
+ Coverage   93.16%   93.78%   +0.61%     
==========================================
  Files         361      361              
  Lines       10437    10439       +2     
  Branches     1306     1306              
==========================================
+ Hits         9724     9790      +66     
+ Misses        686      621      -65     
- Partials       27       28       +1     
Impacted Files Coverage Ξ”
packages/whale-api-client/src/api/poolpairs.ts 100.00% <ΓΈ> (ΓΈ)
...api/src/module.api/poolswap.pathfinding.service.ts 94.07% <100.00%> (-2.92%) :arrow_down:
...hale-api/src/module.api/poolpair.prices.service.ts 82.97% <0.00%> (-12.77%) :arrow_down:
...transaction-builder/src/txn/txn_builder_oracles.ts 87.50% <0.00%> (-12.50%) :arrow_down:
...h-transaction-builder/src/txn/txn_builder_loans.ts 94.28% <0.00%> (-5.72%) :arrow_down:
...ps/whale-api/src/module.api/poolpair.controller.ts 93.68% <0.00%> (-4.22%) :arrow_down:
...whale-api/src/module.indexer/rpc.block.provider.ts 89.28% <0.00%> (-2.39%) :arrow_down:
packages/jellyfish-api-jsonrpc/src/index.ts 97.67% <0.00%> (-2.33%) :arrow_down:
...ckages/jellyfish-transaction/src/script/mapping.ts 96.73% <0.00%> (-1.31%) :arrow_down:
... and 16 more

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

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

codecov[bot] avatar Aug 31 '22 06:08 codecov[bot]

@fuxingloh @canonbrother Need your review on this πŸ™

thedoublejay avatar Sep 27 '22 06:09 thedoublejay

Looks like there are breaking tests that should be fixed.

fuxingloh avatar Sep 27 '22 08:09 fuxingloh