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

[MGX-521]Runtime api for checking FeeLocks #509

Merged
merged 2 commits into from
Jun 12, 2023

Conversation

mateuszaaa
Copy link
Member

@mateuszaaa mateuszaaa commented Jun 9, 2023

Dedicated api for FE team, so they dont have to reimplement feelock logic

is_buy_asset_lock_free
params:

  • path : Vec<TokenId>
  • input_amount: Balance

is_sell_asset_lock_free
params:

  • path : Vec<TokenId>
  • input_amount: Balance

The swap is lock free when all of the below conditions are met:

  • feelock is initialized
  • swap is between 2 tokens only (path.len() == 2)
  • at least one of the swapped tokens (input or output) is whitliested in feelock pallet
  • valuation of input or output tokens is higher than threshold set in feelock

@mateuszaaa mateuszaaa force-pushed the feature/threshold-rpc-info branch from 1707665 to 4fdf73f Compare June 9, 2023 08:18
@mateuszaaa mateuszaaa changed the title [WIP] Runtime api for checking FeeLocks [MGX-521][WIP] Runtime api for checking FeeLocks Jun 9, 2023
@mateuszaaa mateuszaaa force-pushed the feature/threshold-rpc-info branch 4 times, most recently from 3d6cccc to d1de642 Compare June 9, 2023 16:24
@mateuszaaa mateuszaaa force-pushed the feature/threshold-rpc-info branch from d1de642 to be57e2d Compare June 9, 2023 18:11
@mateuszaaa mateuszaaa changed the title [MGX-521][WIP] Runtime api for checking FeeLocks [MGX-521]Runtime api for checking FeeLocks Jun 12, 2023
@mateuszaaa mateuszaaa merged commit 088856c into develop Jun 12, 2023
@mateuszaaa mateuszaaa deleted the feature/threshold-rpc-info branch June 12, 2023 21:05
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.

3 participants