Update position worker (#11)

* Update position worker

* Update todo
This commit is contained in:
Oda
2025-02-20 12:06:15 +07:00
committed by GitHub
parent d7731dda0e
commit 160fd02aac
9 changed files with 199 additions and 133 deletions

View File

@@ -618,7 +618,7 @@ public class EvmManager : IEvmManager
{
var chain = ChainService.GetChain(chainName);
var web3 = new Web3(chain.RpcUrl);
var quantity = await GmxService.QuantityInPosition(web3, publicAddress, ticker);
var quantity = await _gmxV2Service.QuantityInPosition(web3, publicAddress, ticker);
return quantity;
}

View File

@@ -1372,4 +1372,9 @@ public class GmxV2Service
{
return $"{account}-{market}-{collateralToken}-{(isLong ? "true" : "false")}";
}
public async Task<decimal> QuantityInPosition(Web3 web3, string publicAddress, Enums.Ticker ticker)
{
return (await GetTrade(web3, publicAddress, ticker)).Status == Enums.TradeStatus.Filled ? 1 : 0;
}
}