diff options
| author | Adrien Hopkins <[email protected]> | 2022-06-16 14:48:27 -0500 |
|---|---|---|
| committer | Adrien Hopkins <[email protected]> | 2022-06-16 14:48:27 -0500 |
| commit | c66b9c6b5be4b1b524ee2675dd1f65f425d72ee9 (patch) | |
| tree | eba3a920bd31da13e76afea2835c1f6e515d1d11 /routes/liquid/receive.js | |
| parent | ffbd27b2e9ddcb52a37febc0855e16b4fe09dbdc (diff) | |
| parent | 67e2ec07cf90cfbd1b5c1cbed18c4dffe38ea4aa (diff) | |
| download | coinos-server-c66b9c6b5be4b1b524ee2675dd1f65f425d72ee9.tar.gz coinos-server-c66b9c6b5be4b1b524ee2675dd1f65f425d72ee9.zip | |
Merge branch 'feature-withdrawal-fee'
Diffstat (limited to 'routes/liquid/receive.js')
| -rw-r--r-- | routes/liquid/receive.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/routes/liquid/receive.js b/routes/liquid/receive.js index 9650e5b7..2bd86805 100644 --- a/routes/liquid/receive.js +++ b/routes/liquid/receive.js @@ -13,8 +13,7 @@ const network = config.liquid.network === "mainnet" ? "liquid" : config.liquid.network ]; -// used to calculate how many credits to give -const withdrawalFeeMultiplier = 0.01; +const { computeConversionFee } = require('./conversionFee.js'); const getAccount = async (params, transaction) => { let account = await db.Account.findOne({ @@ -344,7 +343,7 @@ setInterval(async () => { { pending: Math.min(p.account.pending, total) }, { transaction } ); - await p.account.increment({ fee_credits: Math.floor(total * withdrawalFeeMultiplier) }, { transaction }); + await p.account.increment({ liquid_credits: computeConversionFee(total) }, { transaction }); await p.account.reload({ transaction }); await p.save({ transaction }); |
