github.com/Finschia/finschia-sdk@v0.49.1/x/fswap/keeper/calc.go (about)

     1  package keeper
     2  
     3  import "github.com/Finschia/finschia-sdk/types"
     4  
     5  func CalcSwap(swapRate types.Dec, fromCoinAmount types.Int) types.Int {
     6  	return swapRate.MulTruncate(types.NewDecFromBigInt(fromCoinAmount.BigInt())).TruncateInt()
     7  }