Swap tokens

This commit is contained in:
2025-07-06 14:00:44 +07:00
parent 8096db495a
commit c7dec76809
21 changed files with 1124 additions and 173 deletions

View File

@@ -0,0 +1,45 @@
using System.ComponentModel.DataAnnotations;
using static Managing.Common.Enums;
namespace Managing.Api.Models.Requests;
/// <summary>
/// Request model for GMX token swap operations
/// </summary>
public class SwapTokensRequest
{
/// <summary>
/// The ticker symbol of the token to swap from
/// </summary>
[Required]
public Ticker FromTicker { get; set; }
/// <summary>
/// The ticker symbol of the token to swap to
/// </summary>
[Required]
public Ticker ToTicker { get; set; }
/// <summary>
/// The amount to swap
/// </summary>
[Required]
[Range(0.000001, double.MaxValue, ErrorMessage = "Amount must be greater than 0")]
public double Amount { get; set; }
/// <summary>
/// The order type (market or limit)
/// </summary>
public string OrderType { get; set; } = "market";
/// <summary>
/// The trigger ratio for limit orders (optional)
/// </summary>
public double? TriggerRatio { get; set; }
/// <summary>
/// The allowed slippage percentage (default 0.5%)
/// </summary>
[Range(0, 100, ErrorMessage = "Allowed slippage must be between 0 and 100")]
public double AllowedSlippage { get; set; } = 0.5;
}