Fix futures open positions
This commit is contained in:
@@ -5,7 +5,7 @@ import {Ticker} from '../../src/generated/ManagingApiTypes'
|
||||
|
||||
test('GMX Orders Closing', async (t) => {
|
||||
await t.test('should close all orders for BTC', async () => {
|
||||
const sdk = await getClientForAddress('0x0b4A132cb6ed8fa66953bf61a53D0B91DaCaAd78')
|
||||
const sdk = await getClientForAddress('0x932167388dD9aad41149b3cA23eBD489E2E2DD78')
|
||||
|
||||
const result = await cancelGmxOrdersImpl(
|
||||
sdk,
|
||||
|
||||
@@ -5,17 +5,17 @@ import {Ticker, TradeDirection} from '../../src/generated/ManagingApiTypes'
|
||||
|
||||
test('GMX Position Opening', async (t) => {
|
||||
await t.test('should open a long position for BTC', async () => {
|
||||
const sdk = await getClientForAddress('0x0b4A132cb6ed8fa66953bf61a53D0B91DaCaAd78')
|
||||
const sdk = await getClientForAddress('0x932167388dD9aad41149b3cA23eBD489E2E2DD78')
|
||||
|
||||
const result = await openGmxPositionImpl(
|
||||
sdk,
|
||||
Ticker.BTC,
|
||||
TradeDirection.Long,
|
||||
0.00009129924572776991,
|
||||
0.00012, // ~5.3 USDC collateral with 2x leverage (fits available balance of 5.69 USDC)
|
||||
2,
|
||||
111350,
|
||||
110000,
|
||||
114000
|
||||
87856,
|
||||
undefined, // No stop-loss
|
||||
undefined // No take-profit
|
||||
)
|
||||
console.log('Position opening result:', result)
|
||||
assert.ok(result, 'Position opening result should be defined')
|
||||
|
||||
@@ -13,9 +13,9 @@ describe('swap tokens implementation', () => {
|
||||
console.log('Account', sdk.account)
|
||||
const result = await swapGmxTokensImpl(
|
||||
sdk,
|
||||
Ticker.BTC,
|
||||
Ticker.USDC,
|
||||
0.00006893,
|
||||
Ticker.SOL,
|
||||
3,
|
||||
'market',
|
||||
undefined,
|
||||
0.5
|
||||
|
||||
Reference in New Issue
Block a user