You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A function for computing slippage in case of single-side liquidity provision for token_amount_in (number of tokens) tokens of token_in type - slippage_in:
Calculate the lp_token_value_in by multiplying token_amount_in on current ?USD price of token_in type
Call join_swap_extern_amount_in with token_in and token_amount_in input parameters.
The function will return pool_amount_out, which is defined as lp_pool_out in our Naming Convention
Calculate the current value of received BPT Tokens lp_pool_value using the algorithm presented in Issue 3
The absolute slippage in decimal: (lp_token_value_in - lp_pool_value)/lp_token_value_in
Activity
[-]Calculate slippage[/-][+]Compute slippage[/+]VasilySumanov commentedon Jan 20, 2021
A function for computing slippage in case of single-side liquidity provision for token_amount_in (number of tokens) tokens of token_in type -
slippage_in:lp_token_value_inby multiplyingtoken_amount_inon current?USD priceoftoken_intypejoin_swap_extern_amount_inwithtoken_inandtoken_amount_ininput parameters.The function will return
pool_amount_out, which is defined aslp_pool_outin our Naming Conventionlp_pool_valueusing the algorithm presented in Issue 3lp_token_value_in-lp_pool_value)/lp_token_value_in