Add test to check if backtest behavior changed

This commit is contained in:
2025-10-24 19:08:10 +07:00
parent fc4369a008
commit 38e6998ff3
12 changed files with 11797 additions and 38 deletions

View File

@@ -5,7 +5,7 @@
# Configuration
BASE_URL="http://localhost:4111"
ACCOUNT="0xb54a2f65D79bDeD20F9cBd9a1F85C3855EC3c210"
ACCOUNT="0x987b67313ee4827FE55e1FBcd8883D3bb0Bde83b"
# Calculate dates (last 1 hour)
TO_DATE=$(date -u +"%Y-%m-%dT%H:%M:%S.000Z")

View File

@@ -4,7 +4,7 @@ import {getClientForAddress, getPositionHistoryImpl} from '../../src/plugins/cus
test('GMX get position history - Closed positions with actual PnL', async (t) => {
await t.test('should get closed positions with actual GMX PnL data', async () => {
const sdk = await getClientForAddress('0xb54a2f65d79bded20f9cbd9a1f85c3855ec3c210')
const sdk = await getClientForAddress('0x987b67313ee4827FE55e1FBcd8883D3bb0Bde83b')
const result = await getPositionHistoryImpl(
sdk,
@@ -50,7 +50,7 @@ test('GMX get position history - Closed positions with actual PnL', async (t) =>
})
await t.test('should get closed positions with date range', async () => {
const sdk = await getClientForAddress('0xb54a2f65D79bDeD20F9cBd9a1F85C3855EC3c210')
const sdk = await getClientForAddress('0x987b67313ee4827FE55e1FBcd8883D3bb0Bde83b')
// Get positions from the last 1 hour
const toDate = new Date()
@@ -89,7 +89,7 @@ test('GMX get position history - Closed positions with actual PnL', async (t) =>
})
await t.test('should verify PnL data is suitable for reconciliation', async () => {
const sdk = await getClientForAddress('0xb54a2f65d79bded20f9cbd9a1f85c3855ec3c210')
const sdk = await getClientForAddress('0x987b67313ee4827FE55e1FBcd8883D3bb0Bde83b')
const result = await getPositionHistoryImpl(sdk, 0, 5)

View File

@@ -1,10 +1,10 @@
import { test } from 'node:test'
import {test} from 'node:test'
import assert from 'node:assert'
import { getClientForAddress, getGmxPositionsImpl } from '../../src/plugins/custom/gmx'
import {getClientForAddress, getGmxPositionsImpl} from '../../src/plugins/custom/gmx'
test('GMX get positions', async (t) => {
await t.test('should get positions', async () => {
const sdk = await getClientForAddress('0x932167388dD9aad41149b3cA23eBD489E2E2DD78')
const sdk = await getClientForAddress('0x987b67313ee4827FE55e1FBcd8883D3bb0Bde83b')
const result = await getGmxPositionsImpl(
sdk