diff --git a/freqtrade/aws/backtesting_lambda.py b/freqtrade/aws/backtesting_lambda.py index d4fe6824a..5295a2a07 100644 --- a/freqtrade/aws/backtesting_lambda.py +++ b/freqtrade/aws/backtesting_lambda.py @@ -215,7 +215,9 @@ def _store_aggregated_data(interval, name, result, timerange, user): "losses": row[6], "wins": row[5], "duration": row[4], - "profit_percent": row[2] + "profit_percent": row[2], + "strategy": name, + "user": user } print(data) @@ -238,7 +240,10 @@ def _store_trade_data(interval, name, result, timerange, user): "profit_percent": row['profit_percent'], "profit_stake": row['profit_BTC'], "entry_date": row['entry'].strftime('%Y-%m-%d %H:%M:%S'), - "exit_date": row['exit'].strftime('%Y-%m-%d %H:%M:%S') + "exit_date": row['exit'].strftime('%Y-%m-%d %H:%M:%S'), + "strategy": name, + "user": user + } print(data) diff --git a/freqtrade/aws/trade.py b/freqtrade/aws/trade.py index b392d7e87..6d0c5d5cc 100644 --- a/freqtrade/aws/trade.py +++ b/freqtrade/aws/trade.py @@ -15,24 +15,7 @@ def store(event, context): for x in event['Records']: if 'Sns' in x and 'Message' in x['Sns']: data = json.loads(x['Sns']['Message'], use_decimal=True) - - table = get_strategy_table() - - response = table.query( - KeyConditionExpression=Key('user').eq(data['user']) & - Key('name').eq(data['strategy']) - ) - - if "Items" in response and len(response['Items']) > 0: - item = response['Items'][0] - - data['strategy'] = { - "name": item['name'], - "user": item['user'], - "public": item['public'] - } - - get_trade_table().put_item(Item=data) + get_trade_table().put_item(Item=data) def submit(event, context): diff --git a/serverless.yml b/serverless.yml index 2cce49a73..b5379b0d4 100644 --- a/serverless.yml +++ b/serverless.yml @@ -258,6 +258,8 @@ functions: strategyTable: ${self:custom.strategyTable} BASE_URL: https://${self:custom.customDomain.domainName}/${self:custom.customDomain.stage} + reservedConcurrency: 1 + # schedules all registered strategies on a daily base schedule: memorySize: 128 @@ -275,3 +277,5 @@ functions: topic: ${self:custom.snsTopic} tradeTable: ${self:custom.tradeTable} strategyTable: ${self:custom.strategyTable} + + reservedConcurrency: 1