mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-23 14:40:36 +01:00
17 lines
491 B
C#
17 lines
491 B
C#
|
namespace BTCPayServer.Payments.Changelly
|
||
|
{
|
||
|
public static class ChangellyCalculationHelper
|
||
|
{
|
||
|
public static decimal ComputeBaseAmount(decimal baseRate, decimal toAmount)
|
||
|
{
|
||
|
return (1m / baseRate) * toAmount;
|
||
|
}
|
||
|
|
||
|
public static decimal ComputeCorrectAmount(decimal currentFromAmount, decimal currentAmount,
|
||
|
decimal expectedAmount)
|
||
|
{
|
||
|
return (currentFromAmount / currentAmount) * expectedAmount;
|
||
|
}
|
||
|
}
|
||
|
}
|