Update the keep for influx request
This commit is contained in:
@@ -88,8 +88,8 @@ public class AgentBalanceRepository : IAgentBalanceRepository
|
||||
$") " +
|
||||
$"|> filter(fn: (r) => r[\"user_id\"] == \"{userId}\") " +
|
||||
$"|> aggregateWindow(every: {samplingInterval}, fn: last, createEmpty: false) " +
|
||||
$"|> drop(columns: [\"_start\", \"_stop\"])" +
|
||||
$"|> pivot(rowKey: [\"_time\"], columnKey: [\"_field\"], valueColumn: \"_value\")";
|
||||
$"|> pivot(rowKey: [\"_time\"], columnKey: [\"_field\"], valueColumn: \"_value\")" +
|
||||
$"|> keep(columns: [\"_time\", \"user_id\", \"total_balance_value\", \"usdc_wallet_value\", \"usdc_in_positions_value\", \"bots_allocation_usd_value\", \"pnl\"])";
|
||||
|
||||
var result = await query.QueryAsync<AgentBalanceDto>(flux, _influxDbRepository.Organization);
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@ public class CandleRepository : ICandleRepository
|
||||
$"|> filter(fn: (r) => r[\"exchange\"] == \"{exchange}\")" +
|
||||
$"|> filter(fn: (r) => r[\"ticker\"] == \"{ticker}\")" +
|
||||
$"|> filter(fn: (r) => r[\"timeframe\"] == \"{timeframe}\")" +
|
||||
$"|> drop(columns: [\"_start\", \"_stop\"])" +
|
||||
$"|> pivot(rowKey:[\"_time\"], columnKey: [\"_field\"], valueColumn: \"_value\")";
|
||||
$"|> pivot(rowKey:[\"_time\"], columnKey: [\"_field\"], valueColumn: \"_value\")" +
|
||||
$"|> keep(columns: [\"_time\", \"exchange\", \"ticker\", \"timeframe\", \"openTime\", \"closeTime\", \"open\", \"close\", \"high\", \"low\", \"baseVolume\", \"quoteVolume\", \"TradeCount\", \"takerBuyBaseVolume\", \"takerBuyQuoteVolume\"])";
|
||||
if (limit != null)
|
||||
{
|
||||
flux += $"|> tail(n:{limit})";
|
||||
@@ -66,8 +66,8 @@ public class CandleRepository : ICandleRepository
|
||||
$"|> filter(fn: (r) => r[\"exchange\"] == \"{exchange}\")" +
|
||||
$"|> filter(fn: (r) => r[\"ticker\"] == \"{ticker}\")" +
|
||||
$"|> filter(fn: (r) => r[\"timeframe\"] == \"{timeframe}\")" +
|
||||
$"|> drop(columns: [\"_start\", \"_stop\"])" +
|
||||
$"|> pivot(rowKey:[\"_time\"], columnKey: [\"_field\"], valueColumn: \"_value\")";
|
||||
$"|> pivot(rowKey:[\"_time\"], columnKey: [\"_field\"], valueColumn: \"_value\")" +
|
||||
$"|> keep(columns: [\"_time\", \"exchange\", \"ticker\", \"timeframe\", \"openTime\", \"closeTime\", \"open\", \"close\", \"high\", \"low\", \"baseVolume\", \"quoteVolume\", \"TradeCount\", \"takerBuyBaseVolume\", \"takerBuyQuoteVolume\"])";
|
||||
if (limit != null)
|
||||
{
|
||||
flux += $"|> tail(n:{limit})";
|
||||
|
||||
Reference in New Issue
Block a user