Fix position
This commit is contained in:
@@ -182,9 +182,11 @@ public class EvmManager : IEvmManager
|
||||
var web3 = new Web3(chain.RpcUrl);
|
||||
var etherBalance = Web3.Convert.FromWei(await web3.Eth.GetBalance.SendRequestAsync(account));
|
||||
var lastCandle = await GetCandle(Ticker.ETH);
|
||||
|
||||
|
||||
return new EvmBalance()
|
||||
{ Balance = etherBalance, Price = lastCandle.Close, TokenName = "ETH", Value = etherBalance * lastCandle.Close };
|
||||
{
|
||||
Balance = etherBalance, Price = lastCandle.Close, TokenName = "ETH", Value = etherBalance * lastCandle.Close
|
||||
};
|
||||
}
|
||||
|
||||
public async Task<List<EvmBalance>> GetAllBalances(Chain chain, string publicAddress)
|
||||
@@ -401,10 +403,10 @@ public class EvmManager : IEvmManager
|
||||
var lastCandles = await GetCandles(ticker, DateTime.UtcNow.AddMinutes(-5),
|
||||
Timeframe.OneMinute);
|
||||
cachedCandle = lastCandles.Last();
|
||||
|
||||
|
||||
_cacheService.SaveValue(key, cachedCandle, TimeSpan.FromMinutes(5));
|
||||
}
|
||||
|
||||
|
||||
return cachedCandle;
|
||||
}
|
||||
|
||||
@@ -499,7 +501,7 @@ public class EvmManager : IEvmManager
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await _web3ProxyService.CallGmxServiceAsync<dynamic>("/cancel-orders",
|
||||
var response = await _web3ProxyService.CallGmxServiceAsync<Web3ProxyResponse>("/cancel-orders",
|
||||
new
|
||||
{
|
||||
account = account.Key,
|
||||
@@ -507,7 +509,7 @@ public class EvmManager : IEvmManager
|
||||
ticker = ticker.ToString()
|
||||
});
|
||||
|
||||
return response.success ?? false;
|
||||
return response.Success;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -727,11 +729,11 @@ public class EvmManager : IEvmManager
|
||||
var result = await _web3ProxyService.GetGmxServiceAsync<GetGmxPositionsResponse>(
|
||||
"/positions",
|
||||
new { account = account.Key });
|
||||
|
||||
|
||||
|
||||
|
||||
return GmxV2Mappers.Map(result.Positions);
|
||||
}
|
||||
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user