diff --git a/core/integration/features/verified/0029-FEES-040.feature b/core/integration/features/verified/0029-FEES-040.feature index 4c1179fe3d..f22f2e786d 100644 --- a/core/integration/features/verified/0029-FEES-040.feature +++ b/core/integration/features/verified/0029-FEES-040.feature @@ -38,9 +38,10 @@ Feature: Fees calculations | trader6 | USD | 5000 | When the parties submit the following liquidity provision: - | id | party | market id | commitment amount | fee | lp type | - | lp1 | aux1 | ETH/DEC21 | 10000 | 0.002 | submission | - | lp1 | aux1 | ETH/DEC21 | 10000 | 0.002 | submission | + | id | party | market id | commitment amount | fee | lp type | + | lp1 | aux1 | ETH/DEC21 | 10000 | 0.002 | submission | + | lp1 | aux1 | ETH/DEC21 | 10000 | 0.002 | submission | + | trader2 | trader2 | ETH/DEC21 | 100 | 0.002 | submission | When the network moves ahead "2" blocks And the parties place the following orders: @@ -58,8 +59,8 @@ Feature: Fees calculations | buyer | price | size | seller | | aux1 | 1000 | 1 | aux2 | Then the parties should have the following account balances: - | party | asset | market id | margin | general | - | aux1 | USD | ETH/DEC21 | 540 | 89460 | + | party | asset | market id | margin | general | bond | + | aux1 | USD | ETH/DEC21 | 540 | 89460 | | #0029-FEES-040:In continuous trading mode, if the price taker has insufficient asset to cover the total fee in their general + margin account, then the trade should be discarded, the orders on the book that would have been hit should remain in place with previous remaining size intact and the incoming order should be rejected (not enough fees error). @@ -68,6 +69,11 @@ Feature: Fees calculations | trader1 | ETH/DEC21 | buy | 2 | 1002 | 0 | TYPE_LIMIT | TIF_GTC | t1-b2-01 | | | trader2 | ETH/DEC21 | sell | 2 | 1002 | 0 | TYPE_LIMIT | TIF_GTC | t2-s4-01 | party has insufficient funds to cover fees | + Then the parties should have the following account balances: + | party | asset | market id | margin | general | bond | + | trader1 | USD | ETH/DEC21 | 480 | 8520 | | + | trader2 | USD | ETH/DEC21 | 0 | 240 | 60 | + And the orders should have the following status: | party | reference | status | | trader2 | t2-s4-01 | STATUS_REJECTED | @@ -127,10 +133,8 @@ Feature: Fees calculations #trader2 is closed out, after paying infra fee, trader2 does not have enough left to cover margin Then the parties should have the following account balances: - | party | asset | market id | margin | general | - | trader1 | USD | ETH/DEC21 | 1082 | 7308 | - | trader2 | USD | ETH/DEC21 | 0 | 0 | - - + | party | asset | market id | margin | general | bond | + | trader1 | USD | ETH/DEC21 | 1082 | 7308 | | + | trader2 | USD | ETH/DEC21 | 0 | 0 | 0 | diff --git a/core/integration/features/verified/0029-FEES-fees.feature b/core/integration/features/verified/0029-FEES-fees.feature index 06670469bc..326313f490 100644 --- a/core/integration/features/verified/0029-FEES-fees.feature +++ b/core/integration/features/verified/0029-FEES-fees.feature @@ -134,6 +134,15 @@ Feature: Fees calculations | trader3 | USD | ETH/DEC21 | 480 | 19 | | trader4 | USD | ETH/DEC21 | 221 | 0 | + And the following transfers should happen: + | from | to | from account | to account | market id | amount | asset | + | market | trader3 | ACCOUNT_TYPE_FEES_MAKER | ACCOUNT_TYPE_GENERAL | ETH/DEC21 | 9 | USD | + | trader4 | market | ACCOUNT_TYPE_GENERAL | ACCOUNT_TYPE_FEES_MAKER | ETH/DEC21 | 9 | USD | + | trader4 | | ACCOUNT_TYPE_GENERAL | ACCOUNT_TYPE_BUY_BACK_FEES | | 1 | USD | + | trader4 | | ACCOUNT_TYPE_MARGIN | ACCOUNT_TYPE_FEES_INFRASTRUCTURE | ETH/DEC21 | 7 | USD | + | trader4 | | ACCOUNT_TYPE_MARGIN | ACCOUNT_TYPE_FEES_LIQUIDITY | ETH/DEC21 | 5 | USD | + | trader4 | | ACCOUNT_TYPE_MARGIN | ACCOUNT_TYPE_NETWORK_TREASURY | ETH/DEC21 | 5 | USD | + And the market data for the market "ETH/DEC21" should be: | mark price | trading mode | horizon | min bound | max bound | | 1000 | TRADING_MODE_CONTINUOUS | 60 | 900 | 1100 |