code.vegaprotocol.io/vega@v0.79.0/core/integration/features/spots/SpotFunctionalTests/TC-0012-Spot-Maker-FeeCalculation.feature (about)

     1  Feature: Simple Spot Order Market fee and infrastructure fee calculation
     2  
     3    Scenario:  Simple Spot Order Market fee and infrastructure fee calculation
     4  
     5    Background:
     6      Given the following network parameters are set:
     7        | name                                    | value |
     8        | network.markPriceUpdateMaximumFrequency | 0s    |
     9  
    10      Given the fees configuration named "fees-config-1":
    11        | maker fee | infrastructure fee |
    12        | 0.1       | 0.2                |
    13  
    14      And the price monitoring named "price-monitoring":
    15        | horizon | probability | auction extension |
    16        | 1       | 0.99        | 3                 |
    17  
    18      And the simple risk model named "my-simple-risk-model":
    19        | long                   | short                  | max move up | min move down | probability of trading |
    20        | 0.08628781058136630000 | 0.09370922348428490000 | 100         | -100          | 1                      |
    21  
    22      And the spot markets:
    23        | id      | name    | base asset | quote asset | risk model           | auction duration | fees          | price monitoring | position decimal places | sla params    |
    24        | BTC/ETH | BTC/ETH | BTC        | ETH         | my-simple-risk-model | 1                | fees-config-1 | price-monitoring | 2                       | default-basic |
    25  
    26      # setup accounts
    27      Given the parties deposit on asset's general account the following amount:
    28        | party  | asset | amount   |
    29        | party1 | ETH   | 10000000 |
    30        | party2 | BTC   | 100000   |
    31  
    32      #When the parties submit the following liquidity provision:
    33      #      | id  | party  | market id | commitment amount | fee | side | pegged reference | volume     | offset | lp type    |
    34      #     | lp1 | lpprov | BTC/ETH   | 90000000          | 0.1 | buy  | BID              | 50         | 100    | submission |
    35      #    | lp1 | lpprov | BTC/ETH   | 90000000          | 0.1 | sell | ASK              | 50         | 100    | submission |
    36  
    37      # place orders and generate trades
    38      And the parties place the following orders:
    39        | party  | market id | side | volume | price  | resulting trades | type       | tif     | reference |
    40        | party1 | BTC/ETH   | buy  | 1      | 100000 | 0                | TYPE_LIMIT | TIF_GTC | t1-b-1    |
    41        | party2 | BTC/ETH   | sell | 1      | 100000 | 0                | TYPE_LIMIT | TIF_GTC | t2-s-1    |
    42  
    43      Then "party2" should have holding account balance of "0" for asset "BTC"
    44      Then "party1" should have holding account balance of "1000" for asset "ETH"
    45  
    46      Then the orders should have the following states:
    47        | party  | market id | side | volume | remaining | price  | status        |
    48        | party1 | BTC/ETH   | buy  | 1      | 1         | 100000 | STATUS_ACTIVE |
    49        | party2 | BTC/ETH   | sell | 1      | 1         | 100000 | STATUS_ACTIVE |
    50  
    51      Then the opening auction period ends for market "BTC/ETH"
    52      And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "BTC/ETH"
    53      And the mark price should be "100000" for the market "BTC/ETH"
    54  
    55      And the market data for the market "BTC/ETH" should be:
    56        | mark price | trading mode            | target stake | supplied stake |
    57        | 100000     | TRADING_MODE_CONTINUOUS | 0            | 0              |
    58  
    59      And the following trades should be executed:
    60        | buyer  | price  | size | seller |
    61        | party1 | 100000 | 1    | party2 |
    62  
    63      Then "party2" should have holding account balance of "0" for asset "BTC"
    64      Then "party1" should have holding account balance of "0" for asset "ETH"
    65  
    66      Then the parties should have the following account balances:
    67        | party  | asset | market id | general |
    68        | party1 | ETH   | BTC/ETH   | 9999000 |
    69        | party1 | BTC   | BTC/ETH   | 0       |
    70        | party2 | ETH   | BTC/ETH   | 1000    |
    71        | party2 | BTC   | BTC/ETH   | 100000  |
    72  
    73  #Then the parties should have the following account balances:
    74  #      | party   | asset | market id | margin | general |
    75  #      | party1  | ETH   | BTC/ETH | 1330   | 0    |
    76  #      | party2  | ETH   | BTC/ETH | 718    | 0    |
    77  
    78  # @vanitha the exepctation here is wrong. Trades done at the end of opening auctions don't pay fees.
    79  # And the accumulated infrastructure fees should be "500" for the asset "ETH"
    80  # And the accumulated infrastructure fees should be "100" for the asset "BTC"
    81  # And the accumulated liquidity fees should be "20" for the market "BTC/ETH"