Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

XRPL IOU Fee Rate calc.

node v10.24.1
version: 4.0.0
endpointsharetweet
const BigNumber = require('bignumber.js') const availableBalance = new BigNumber(10) const currency = { transfer_rate: '1050000000' } const one = new BigNumber(1) const rate = new BigNumber(currency.transfer_rate).dividedBy(10000000).minus(100) // Percentage const fee = new BigNumber(availableBalance).times(one.minus(one.dividedBy(one.plus(rate.dividedBy(100))))) const maxCanSend = availableBalance.minus(fee).toNumber() console.log({ rate: rate.toNumber(), fee: fee.toNumber(), maxCanSend })
Loading…

no comments

    sign in to comment