@@ -257,6 +257,7 @@ Feature: Ensure the vAMM positions follow the market correctly
257
257
| vamm2 -id | -74 | -304 | 0 | true |
258
258
| vamm1 -id | -74 | 0 | 0 | true |
259
259
260
+ @VAMM
260
261
Scenario : 0090-VAMM-029: The volume quoted to move from price 100 to price 90 in one step is the same as the sum of the volumes to move in 10 steps of 1.
261
262
# Move mid price to 90 in one go. A volume of 347 is the minimum required, 346 only gets us to 91
262
263
When the parties place the following orders:
@@ -267,13 +268,13 @@ Feature: Ensure the vAMM positions follow the market correctly
267
268
| 100 | TRADING_MODE_CONTINUOUS | 13915 | 1000 | 348 | 100 | 90 | 90 | 91 | 89 |
268
269
And the following trades should be executed:
269
270
| buyer | price | size | seller | is amm |
270
- | vamm1 -id | 105 | 347 | party5 | true |
271
+ | vamm1 -id | 95 | 347 | party5 | true |
271
272
# Check vAMM position
272
273
When the network moves ahead "1" blocks
273
274
Then the parties should have the following profit and loss:
274
275
| party | volume | unrealised pnl | realised pnl | is amm |
275
- | party1 | 1 | 5 | 0 | |
276
- | party2 | -1 | - 5 | 0 | |
276
+ | party1 | 1 | - 5 | 0 | |
277
+ | party2 | -1 | 5 | 0 | |
277
278
| party5 | -347 | 0 | 0 | |
278
279
| vamm1 -id | 347 | 0 | 0 | true |
279
280
@@ -287,7 +288,7 @@ Feature: Ensure the vAMM positions follow the market correctly
287
288
| 100 | TRADING_MODE_CONTINUOUS | 79 | 1000 | 2 | 100 | 99 | 99 | 100 | 98 |
288
289
And the following trades should be executed:
289
290
| buyer | price | size | seller | is amm |
290
- | vamm2 -id | 100 | 1 | party6 | true |
291
+ | vamm2 -id | 99 | 1 | party6 | true |
291
292
292
293
# Move mid price to 98
293
294
When the parties place the following orders:
@@ -298,7 +299,7 @@ Feature: Ensure the vAMM positions follow the market correctly
298
299
| 100 | TRADING_MODE_CONTINUOUS | 1519 | 1000 | 38 | 100 | 98 | 98 | 99 | 97 |
299
300
And the following trades should be executed:
300
301
| buyer | price | size | seller | is amm |
301
- | vamm2 -id | 100 | 36 | party6 | true |
302
+ | vamm2 -id | 98 | 36 | party6 | true |
302
303
303
304
# Move mid price to 97
304
305
When the parties place the following orders:
@@ -309,7 +310,7 @@ Feature: Ensure the vAMM positions follow the market correctly
309
310
| 100 | TRADING_MODE_CONTINUOUS | 2959 | 1000 | 74 | 100 | 97 | 97 | 98 | 96 |
310
311
And the following trades should be executed:
311
312
| buyer | price | size | seller | is amm |
312
- | vamm2 -id | 98 | 36 | party6 | true |
313
+ | vamm2 -id | 97 | 36 | party6 | true |
313
314
314
315
# Move mid price to 96
315
316
When the parties place the following orders:
@@ -320,7 +321,7 @@ Feature: Ensure the vAMM positions follow the market correctly
320
321
| 100 | TRADING_MODE_CONTINUOUS | 4478 | 1000 | 112 | 100 | 96 | 96 | 97 | 95 |
321
322
And the following trades should be executed:
322
323
| buyer | price | size | seller | is amm |
323
- | vamm2 -id | 97 | 38 | party6 | true |
324
+ | vamm2 -id | 96 | 38 | party6 | true |
324
325
325
326
# Move mid price to 95
326
327
When the parties place the following orders:
@@ -332,7 +333,7 @@ Feature: Ensure the vAMM positions follow the market correctly
332
333
And debug trades
333
334
And the following trades should be executed:
334
335
| buyer | price | size | seller | is amm |
335
- | vamm2 -id | 96 | 37 | party6 | true |
336
+ | vamm2 -id | 95 | 37 | party6 | true |
336
337
337
338
# Move mid price to 94
338
339
When the parties place the following orders:
@@ -343,7 +344,7 @@ Feature: Ensure the vAMM positions follow the market correctly
343
344
| 100 | TRADING_MODE_CONTINUOUS | 7517 | 1000 | 188 | 100 | 94 | 94 | 95 | 93 |
344
345
And the following trades should be executed:
345
346
| buyer | price | size | seller | is amm |
346
- | vamm2 -id | 95 | 39 | party6 | true |
347
+ | vamm2 -id | 94 | 39 | party6 | true |
347
348
348
349
# Move mid price to 93
349
350
When the parties place the following orders:
@@ -354,7 +355,7 @@ Feature: Ensure the vAMM positions follow the market correctly
354
355
| 100 | TRADING_MODE_CONTINUOUS | 9077 | 1000 | 227 | 100 | 93 | 93 | 94 | 92 |
355
356
And the following trades should be executed:
356
357
| buyer | price | size | seller | is amm |
357
- | vamm2 -id | 94 | 39 | party6 | true |
358
+ | vamm2 -id | 93 | 39 | party6 | true |
358
359
359
360
# Move mid price to 92
360
361
When the parties place the following orders:
@@ -365,7 +366,7 @@ Feature: Ensure the vAMM positions follow the market correctly
365
366
| 100 | TRADING_MODE_CONTINUOUS | 10636 | 1000 | 266 | 100 | 92 | 92 | 93 | 91 |
366
367
And the following trades should be executed:
367
368
| buyer | price | size | seller | is amm |
368
- | vamm2 -id | 93 | 39 | party6 | true |
369
+ | vamm2 -id | 92 | 39 | party6 | true |
369
370
370
371
# Move mid price to 91
371
372
When the parties place the following orders:
@@ -376,7 +377,7 @@ Feature: Ensure the vAMM positions follow the market correctly
376
377
| 100 | TRADING_MODE_CONTINUOUS | 12276 | 1000 | 307 | 100 | 91 | 91 | 92 | 90 |
377
378
And the following trades should be executed:
378
379
| buyer | price | size | seller | is amm |
379
- | vamm2 -id | 92 | 41 | party6 | true |
380
+ | vamm2 -id | 91 | 41 | party6 | true |
380
381
381
382
# Move mid price to 90
382
383
When the parties place the following orders:
@@ -387,16 +388,16 @@ Feature: Ensure the vAMM positions follow the market correctly
387
388
| 100 | TRADING_MODE_CONTINUOUS | 13915 | 1000 | 348 | 100 | 90 | 90 | 91 | 89 |
388
389
And the following trades should be executed:
389
390
| buyer | price | size | seller | is amm |
390
- | vamm2 -id | 91 | 41 | party6 | true |
391
+ | vamm2 -id | 90 | 41 | party6 | true |
391
392
392
393
# Make sure the volumes match, PnL is expected to be different
393
394
When the network moves ahead "1" blocks
394
395
Then the parties should have the following profit and loss:
395
396
| party | volume | unrealised pnl | realised pnl | is amm |
396
- | party3 | 1 | -9 | 0 | |
397
- | party4 | -1 | 9 | 0 | |
398
- | party6 | -347 | 1390 | 0 | |
399
- | vamm2 -id | 347 | -1390 | 0 | true |
397
+ | party3 | 1 | -10 | 0 | |
398
+ | party4 | -1 | 10 | 0 | |
399
+ | party6 | -347 | 1354 | 0 | |
400
+ | vamm2 -id | 347 | -1354 | 0 | true |
400
401
| vamm1 -id | 347 | 0 | 0 | true |
401
402
402
403
@VAMM
0 commit comments