mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-20 10:40:29 +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;
|
|
}
|
|
}
|
|
}
|