Refactor user settings management to remove IsGmxEnabled and DefaultExchange from updatable fields, introducing GmxSlippage instead. Update UserController, UserService, and related DTOs to reflect these changes, ensuring proper handling of user settings. Adjust database schema and migrations to accommodate the new GmxSlippage property, enhancing user customization options for trading configurations.
This commit is contained in:
@@ -26,6 +26,7 @@ public class UserEntity
|
||||
public int? MaxWaitingTimeForPositionToGetFilledSeconds { get; set; } = 600; // Default: 10 minutes (600 seconds)
|
||||
[Column(TypeName = "decimal(18,8)")] public decimal? MaxTxnGasFeePerPosition { get; set; } = 1.5m; // Default: MaximumGasFeeUsd
|
||||
public bool IsGmxEnabled { get; set; } = false;
|
||||
[Column(TypeName = "decimal(5,2)")] public decimal? GmxSlippage { get; set; } = 0.5m; // Default: 0.5% slippage for GMX trades
|
||||
|
||||
// User Settings - Indicator Combo Configuration
|
||||
public Confidence? MinimumConfidence { get; set; } = Confidence.Medium; // Default: Medium confidence for context indicators
|
||||
|
||||
@@ -140,6 +140,7 @@ public static class PostgreSqlMappers
|
||||
MaxWaitingTimeForPositionToGetFilledSeconds = entity.MaxWaitingTimeForPositionToGetFilledSeconds,
|
||||
MaxTxnGasFeePerPosition = entity.MaxTxnGasFeePerPosition,
|
||||
IsGmxEnabled = entity.IsGmxEnabled,
|
||||
GmxSlippage = entity.GmxSlippage,
|
||||
MinimumConfidence = entity.MinimumConfidence,
|
||||
TrendStrongAgreementThreshold = entity.TrendStrongAgreementThreshold,
|
||||
SignalAgreementThreshold = entity.SignalAgreementThreshold,
|
||||
@@ -187,6 +188,7 @@ public static class PostgreSqlMappers
|
||||
MaxWaitingTimeForPositionToGetFilledSeconds = user.MaxWaitingTimeForPositionToGetFilledSeconds,
|
||||
MaxTxnGasFeePerPosition = user.MaxTxnGasFeePerPosition,
|
||||
IsGmxEnabled = user.IsGmxEnabled,
|
||||
GmxSlippage = user.GmxSlippage,
|
||||
MinimumConfidence = user.MinimumConfidence,
|
||||
TrendStrongAgreementThreshold = user.TrendStrongAgreementThreshold,
|
||||
SignalAgreementThreshold = user.SignalAgreementThreshold,
|
||||
|
||||
@@ -263,6 +263,7 @@ public class PostgreSqlUserRepository : BaseRepositoryWithLogging, IUserReposito
|
||||
existingUser.MaxWaitingTimeForPositionToGetFilledSeconds = user.MaxWaitingTimeForPositionToGetFilledSeconds;
|
||||
existingUser.MaxTxnGasFeePerPosition = user.MaxTxnGasFeePerPosition;
|
||||
existingUser.IsGmxEnabled = user.IsGmxEnabled;
|
||||
existingUser.GmxSlippage = user.GmxSlippage;
|
||||
existingUser.MinimumConfidence = user.MinimumConfidence;
|
||||
existingUser.TrendStrongAgreementThreshold = user.TrendStrongAgreementThreshold;
|
||||
existingUser.SignalAgreementThreshold = user.SignalAgreementThreshold;
|
||||
|
||||
Reference in New Issue
Block a user