dashed-slug.net › Forums › CoinPayments.net Wallet Adapter extension support › Calculate fees gathered from users? › Reply To: Calculate fees gathered from users?
June 5, 2020 at 7:41 am
#8521
alexg
Keymaster
Yes, or if you really want to calculate withdrawal fees paid in any arbitrary range, you can easily pull this info from your SQL console (phpMyAdmin or mysql client command line).
Assuming that your DB prefix is wp_
, which is the default:
SELECT
symbol,
SUM( fee ) as fees,
COUNT( 1 ) as count
FROM
wp_wallets_txs
WHERE
status = 'done'
AND category = 'withdraw'
AND amount < 0
AND created_time BETWEEN '2019-12-15' AND NOW()
GROUP BY
symbol
ORDER BY
symbol;
This query will sum the fees paid and transaction count for each coin, between the specified date and today. You can modify this range to fit your needs.
From these total fees, you then need to subtract the actual fee paid to the blockchain, times the transaction count.
Hope this helps. Let me know if you have any further questions.