BigNumber - the balance of the asset swapped into the pool
BigNumber - the weight of in asset
BigNumber - the balance of the asset swapped out of the pool
BigNumber - the weight of out asset
BigNumber - the fee of the swap
Generated using TypeDoc
Calculate the spot price for an asset given the balance in and out and weights. Usefull for clientside calculations when rpc calls are costly or not needed.
Note
Use sdk.context.api.rpc.swaps.getSpotPrice(s) for higher accuracy and verifiability.
Returns
Decimal