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(jellyfish-api-core): Asymmetric pool swap fee #1577

Merged
merged 13 commits into from
Jul 1, 2022

Conversation

chanakasameera
Copy link
Contributor

What this PR does / why we need it:

DeFiCh/ain#1354

Which issue(s) does this PR fixes?:

Fixes #

Additional comments?:

@codeclimate
Copy link

codeclimate bot commented Jun 22, 2022

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

View more on Code Climate.

@netlify
Copy link

netlify bot commented Jun 22, 2022

Deploy Preview for jellyfishsdk ready!

Name Link
🔨 Latest commit d11579a
🔍 Latest deploy log https://app.netlify.com/sites/jellyfishsdk/deploys/62be823d56ac710008a4715f
😎 Deploy Preview https://deploy-preview-1577--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 Jun 22, 2022

Codecov Report

Merging #1577 (d11579a) into main (273c8ef) will increase coverage by 1.24%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1577      +/-   ##
==========================================
+ Coverage   92.55%   93.79%   +1.24%     
==========================================
  Files         360      360              
  Lines       10349    10349              
  Branches     1288     1288              
==========================================
+ Hits         9578     9707     +129     
+ Misses        738      616     -122     
+ Partials       33       26       -7     
Impacted Files Coverage Δ
apps/whale-api/src/module.model/masternode.ts 85.71% <0.00%> (-14.29%) ⬇️
...s/whale-api/src/module.model/script.aggregation.ts 78.94% <0.00%> (-10.53%) ⬇️
...src/module.indexer/model/dftx/create.masternode.ts 92.15% <0.00%> (-7.85%) ⬇️
...ages/jellyfish-transaction/src/script/dftx/dftx.ts 98.54% <0.00%> (+1.45%) ⬆️
packages/jellyfish-transaction/src/tx_composer.ts 80.00% <0.00%> (+1.66%) ⬆️
...ckages/jellyfish-transaction/src/script/mapping.ts 98.03% <0.00%> (+2.61%) ⬆️
packages/jellyfish-api-core/src/category/loan.ts 100.00% <0.00%> (+3.27%) ⬆️
packages/jellyfish-crypto/src/der.ts 96.29% <0.00%> (+3.70%) ⬆️
packages/jellyfish-address/src/script/index.ts 100.00% <0.00%> (+4.08%) ⬆️
packages/jellyfish-api-core/src/category/wallet.ts 100.00% <0.00%> (+4.59%) ⬆️
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 273c8ef...d11579a. Read the comment docs.

@github-actions
Copy link

github-actions bot commented Jun 22, 2022

Docker build preview for jellyfish/apps is ready!

Built with commit 225f11a

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

You can also get an immutable image with the commit hash

  • ghcr.io/jellyfishsdk/legacy-api:225f11a5bb1e66c9c3877df504b28c3ed0ba459a
  • ghcr.io/jellyfishsdk/ocean-api:225f11a5bb1e66c9c3877df504b28c3ed0ba459a
  • ghcr.io/jellyfishsdk/playground-api:225f11a5bb1e66c9c3877df504b28c3ed0ba459a
  • ghcr.io/jellyfishsdk/status-api:225f11a5bb1e66c9c3877df504b28c3ed0ba459a
  • ghcr.io/jellyfishsdk/whale-api:225f11a5bb1e66c9c3877df504b28c3ed0ba459a

@chanakasameera chanakasameera marked this pull request as ready for review June 29, 2022 21:01
Copy link
Contributor

@surangap surangap left a comment

Choose a reason for hiding this comment

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

@chanakasameera chanakasameera requested a review from surangap June 30, 2022 19:30
surangap
surangap previously approved these changes Jul 1, 2022
@fuxingloh
Copy link
Contributor

Conflicts on:

packages/jellyfish-api-core/__tests__/category/masternode/setGov.test.ts

Copy link
Contributor

@canonbrother canonbrother left a comment

Choose a reason for hiding this comment

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

heyy.. question...
what's the diff of

[`v0/poolpairs/${ppTokenID}/token_a_fee_pct`]: '0.05'

with

[`v0/poolpairs/${ppTokenID}/token_a_fee_direction`]: 'both'

??

@surangap
Copy link
Contributor

surangap commented Jul 1, 2022

heyy.. question... what's the diff of

[`v0/poolpairs/${ppTokenID}/token_a_fee_pct`]: '0.05'

with

[`v0/poolpairs/${ppTokenID}/token_a_fee_direction`]: 'both'

??

token_a_fee_pct - token a fee %
token_a_fee_direction - direction the fee applies, in/ out/ both

@canonbrother
Copy link
Contributor

token_a_fee_pct - token a fee %
token_a_fee_direction - direction the fee applies, in/ out/ both

hmm.. feels like token_a_fee_pct and token_a_fee_direction are same use case..
btw.. the pr looks good to me

@fuxingloh fuxingloh requested a review from surangap July 1, 2022 07:07
@fuxingloh fuxingloh merged commit 38d9cc8 into main Jul 1, 2022
@fuxingloh fuxingloh deleted the chanakasameera/asymmetric-swap branch July 1, 2022 08:43
pierregee pushed a commit to pierregee/jellyfish that referenced this pull request Jul 4, 2022
…1577)

* Update the ain image

* Update to master ain image

* Added tests for fee direction set attribute

* Test getPoolPair with fee direction

* Added pool swap tests for asymmetric fee directions

* Updated with fort canning spring height, descriptions and typos

* Added a common function to pool swap

* Remove code duplications
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants