GMX v2 - Trading (#7)
* Move PrivateKeys.cs * Update gitignore * Update gitignore * updt * Extract GmxServiceTests.cs * Refact * update todo * Update code * Fix hashdata * Replace static token hashed datas * Set allowance * Add get orders * Add get orders tests * Add ignore * add close orders * revert * Add get gas limit * Start increasePosition. Todo: Finish GetExecutionFee and estimateGas * little refact * Update gitignore * Fix namespaces and clean repo * Add tests samples * Add execution fee * Add increase position * Handle backtest on the frontend * Add tests * Update increase * Test increase * fix increase * Fix size * Start get position * Update get positions * Fix get position * Update rpc and trade mappers * Finish close position * Fix leverage
This commit is contained in:
29
src/Managing.Infrastructure.Tests/GmxTradingTests.cs
Normal file
29
src/Managing.Infrastructure.Tests/GmxTradingTests.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using Managing.Common;
|
||||
using Managing.Domain.Trades;
|
||||
using Managing.Infrastructure.Evm;
|
||||
using Xunit;
|
||||
|
||||
namespace Managing.Infrastructure.Tests;
|
||||
|
||||
public class GmxTradingTests : EvmManagerTests
|
||||
{
|
||||
[Fact]
|
||||
public async void Should_return_orders()
|
||||
{
|
||||
var manager = new EvmManager(Subgraphs);
|
||||
var account = PrivateKeys.GetAccount();
|
||||
|
||||
var orders = await manager.GetOrders(account, Enums.Ticker.SOL);
|
||||
Assert.IsType<List<Trade>>(orders);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void Should_cancel_order()
|
||||
{
|
||||
var manager = new EvmManager(Subgraphs);
|
||||
var account = PrivateKeys.GetAccount();
|
||||
|
||||
var result = await manager.CancelOrders(account, Enums.Ticker.BTC);
|
||||
Assert.True(result);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user