code.vegaprotocol.io/vega@v0.79.0/core/integration/features/spots/pegged-orders.feature (about) 1 2 Feature: Set up a spot market, with an opening auction, then uncross the book. Make sure opening auction can end. 3 Background: 4 Given the fees configuration named "fees-config-1": 5 | maker fee | infrastructure fee | 6 | 0.005 | 0.002 | 7 And the simple risk model named "my-simple-risk-model": 8 | long | short | max move up | min move down | probability of trading | 9 | 0.08628781058136630000 | 0.09370922348428490000 | -1 | -1 | 0.2 | 10 And the fees configuration named "my-fees-config": 11 | maker fee | infrastructure fee | 12 | 0.004 | 0.001 | 13 And the spot markets: 14 | id | name | base asset | quote asset | risk model | auction duration | fees | price monitoring | sla params | 15 | BTC/ETH | BTC/ETH | BTC | ETH | my-simple-risk-model | 5 | fees-config-1 | default-none | default-basic | 16 And the parties deposit on asset's general account the following amount: 17 | party | asset | amount | 18 | party1 | ETH | 1000000000 | 19 | party2 | ETH | 1000000000 | 20 | party2 | BTC | 5 | 21 | party4 | ETH | 10000000 | 22 | party5 | BTC | 10 | 23 24 Scenario: Party submits pegged orders and they are getting priced and repriced as needed 25 Given the following network parameters are set: 26 | name | value | 27 | limits.markets.maxPeggedOrders | 10 | 28 29 # place orders and generate trades 30 When the parties place the following orders: 31 | party | market id | side | volume | price | resulting trades | type | tif | reference | 32 | party2 | BTC/ETH | buy | 1 | 950000 | 0 | TYPE_LIMIT | TIF_GTC | t2-b-1 | 33 | party1 | BTC/ETH | buy | 1 | 1000000 | 0 | TYPE_LIMIT | TIF_GFA | t1-b-1 | 34 | party2 | BTC/ETH | sell | 5 | 1000000 | 0 | TYPE_LIMIT | TIF_GTC | t2-s-1 | 35 36 And the parties place the following pegged orders: 37 | party | market id | side | volume | pegged reference | offset | 38 | party4 | BTC/ETH | buy | 1 | BID | 100 | 39 | party4 | BTC/ETH | buy | 1 | MID | 100 | 40 | party5 | BTC/ETH | sell | 1 | ASK | 100 | 41 | party5 | BTC/ETH | sell | 1 | MID | 100 | 42 43 Then the pegged orders should have the following states: 44 | party | market id | side | volume | reference | offset | price | status | 45 | party4 | BTC/ETH | buy | 1 | BID | 100 | 0 | STATUS_PARKED | 46 | party4 | BTC/ETH | buy | 1 | MID | 100 | 0 | STATUS_PARKED | 47 | party5 | BTC/ETH | sell | 1 | ASK | 100 | 0 | STATUS_PARKED | 48 | party5 | BTC/ETH | sell | 1 | MID | 100 | 0 | STATUS_PARKED | 49 50 When the opening auction period ends for market "BTC/ETH" 51 Then the market data for the market "BTC/ETH" should be: 52 | mark price | trading mode | auction trigger | 53 | 1000000 | TRADING_MODE_CONTINUOUS | AUCTION_TRIGGER_UNSPECIFIED | 54 55 And the pegged orders should have the following states: 56 | party | market id | side | volume | reference | offset | price | status | 57 | party4 | BTC/ETH | buy | 1 | BID | 100 | 949900 | STATUS_ACTIVE | 58 | party4 | BTC/ETH | buy | 1 | MID | 100 | 974900 | STATUS_ACTIVE | 59 | party5 | BTC/ETH | sell | 1 | ASK | 100 | 1000100 | STATUS_ACTIVE | 60 | party5 | BTC/ETH | sell | 1 | MID | 100 | 975100 | STATUS_ACTIVE | 61 62 And the order book should have the following volumes for market "BTC/ETH": 63 | side | price | volume | 64 | sell | 975100 | 1 | 65 | sell | 1000000 | 4 | 66 | sell | 1000100 | 1 | 67 | buy | 974900 | 1 | 68 | buy | 950000 | 1 | 69 | buy | 949900 | 1 | 70 71 72 # Move the best bid and assure the orders are repriced 73 When the parties amend the following orders: 74 | party | reference | price | size delta | tif | 75 | party2 | t2-b-1 | 970000 | 0 | TIF_GTC | 76 77 Then the pegged orders should have the following states: 78 | party | market id | side | volume | reference | offset | price | status | 79 | party4 | BTC/ETH | buy | 1 | BID | 100 | 969900 | STATUS_ACTIVE | 80 | party4 | BTC/ETH | buy | 1 | MID | 100 | 984900 | STATUS_ACTIVE | 81 | party5 | BTC/ETH | sell | 1 | ASK | 100 | 1000100 | STATUS_ACTIVE | 82 | party5 | BTC/ETH | sell | 1 | MID | 100 | 985100 | STATUS_ACTIVE | 83 84 And the order book should have the following volumes for market "BTC/ETH": 85 | side | price | volume | 86 | sell | 1000100 | 1 | 87 | sell | 985100 | 1 | 88 | sell | 1000000 | 4 | 89 | buy | 970000 | 1 | 90 | buy | 969900 | 1 | 91 | buy | 984900 | 1 | 92 93 # example for submitting LP for spots 94 When the parties submit the following liquidity provision: 95 | id | party | market id | commitment amount | fee | lp type | 96 | lp1 | party1 | BTC/ETH | 1000 | 0.1 | submission |