diff options
| author | Adrien Hopkins <[email protected]> | 2022-06-14 16:01:21 -0500 |
|---|---|---|
| committer | Adrien Hopkins <[email protected]> | 2022-06-14 16:01:21 -0500 |
| commit | 33338d09d6cb03f089c1f053c81503c0f8c11dbc (patch) | |
| tree | a55364177265b04c67ccf66a5db76be30bfb6443 /routes/liquid/receive.js | |
| parent | ffbd27b2e9ddcb52a37febc0855e16b4fe09dbdc (diff) | |
| download | coinos-server-33338d09d6cb03f089c1f053c81503c0f8c11dbc.tar.gz coinos-server-33338d09d6cb03f089c1f053c81503c0f8c11dbc.zip | |
Moved conversion fee calculation to a single file per currency
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..432619b3 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; +import { computeConversionFee } from './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({ fee_credits: computeConversionFee(total) }, { transaction }); await p.account.reload({ transaction }); await p.save({ transaction }); |
