Compare commits
2 Commits
ea89103ead
...
91cc8baead
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
91cc8baead | ||
|
|
61b59f28a1 |
@@ -8,7 +8,22 @@ export async function POST(request) {
|
||||
// Add a default userId for now (in production, get from auth)
|
||||
const automationConfig = {
|
||||
userId: 'default-user',
|
||||
...config
|
||||
...config,
|
||||
// Map asset to symbol if asset is provided
|
||||
symbol: config.asset || config.symbol,
|
||||
// Map simulation to mode
|
||||
mode: config.simulation ? 'SIMULATION' : (config.mode || 'SIMULATION'),
|
||||
// Map stopLoss to stopLossPercent
|
||||
stopLossPercent: config.stopLoss || config.stopLossPercent,
|
||||
// Map takeProfit to takeProfitPercent
|
||||
takeProfitPercent: config.takeProfit || config.takeProfitPercent,
|
||||
// Map tradeSize to tradingAmount
|
||||
tradingAmount: config.tradeSize || config.tradingAmount,
|
||||
// Set defaults for missing fields
|
||||
maxLeverage: config.maxLeverage || 2,
|
||||
maxDailyTrades: config.maxDailyTrades || 5,
|
||||
dexProvider: config.dexProvider || 'DRIFT',
|
||||
selectedTimeframes: config.selectedTimeframes || [config.timeframe || '1h']
|
||||
}
|
||||
|
||||
const success = await automationService.startAutomation(automationConfig)
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user