diff --git a/csharp/src/Infrastructure/Quote/QuoteService.cs b/csharp/src/Infrastructure/Quote/QuoteService.cs index 2ff6c2ed..173aa9c6 100644 --- a/csharp/src/Infrastructure/Quote/QuoteService.cs +++ b/csharp/src/Infrastructure/Quote/QuoteService.cs @@ -214,6 +214,7 @@ await CalculateTotalFeeAsync(route, amount, rewardAmountInDestNative: rewardAmou TotalServiceFee = totalServiceFee, TotalExpenseFee = totalExpenseFee, TotalRewardFee = totalRewardFee, + Rate = swapRate.Truncate(6), SourceSolverAddress = route.SourceWallet.Address, DestinationSolverAddress = route.DestinationWallet.Address, Route = route, diff --git a/csharp/src/Shared.Models/Models/QuoteDto.cs b/csharp/src/Shared.Models/Models/QuoteDto.cs index 70421889..9803ab8c 100644 --- a/csharp/src/Shared.Models/Models/QuoteDto.cs +++ b/csharp/src/Shared.Models/Models/QuoteDto.cs @@ -4,13 +4,15 @@ namespace Train.Solver.Shared.Models; public class QuoteDto { - public BigInteger TotalFee { get; set; } + public BigInteger TotalFee { get; set; } - public BigInteger TotalServiceFee { get; set; } + public BigInteger TotalServiceFee { get; set; } public BigInteger TotalExpenseFee { get; set; } public BigInteger TotalRewardFee { get; set; } public BigInteger ReceiveAmount { get; set; } + + public decimal Rate { get; set; } } \ No newline at end of file diff --git a/csharp/src/Shared.Proto/SolverProtoMapper.cs b/csharp/src/Shared.Proto/SolverProtoMapper.cs index ba90991e..f9f6de1e 100644 --- a/csharp/src/Shared.Proto/SolverProtoMapper.cs +++ b/csharp/src/Shared.Proto/SolverProtoMapper.cs @@ -53,6 +53,7 @@ public static class SolverProtoMapper TotalExpenseFee = quote.TotalExpenseFee.ToString(), TotalRewardFee = quote.TotalRewardFee.ToString(), Amount = quote.Amount.ToString(), + Rate = quote.Rate.ToString(System.Globalization.CultureInfo.InvariantCulture), }; #endregion diff --git a/protos/solver.proto b/protos/solver.proto index 6e05c34e..f2cf7179 100644 --- a/protos/solver.proto +++ b/protos/solver.proto @@ -69,6 +69,7 @@ message GetQuoteResponse { string total_expense_fee = 11; // BigInteger as string (source token units) string total_reward_fee = 12; // BigInteger as string (source token units) string amount = 13; // BigInteger as string (source amount — useful for reverse quotes) + string rate = 14; // decimal as invariant string — dest/source conversion rate, truncated to 6 decimals } message RewardInfo {