code.vegaprotocol.io/vega@v0.79.0/core/integration/features/liquidity-provision/0044-LIME-029.feature (about) 1 Feature: Check we can use LIMIT, PEGGED and ICEBERG orders to cover our commitment 2 3 # Once liquidity is committed LPs can meet their commitment by placing limit orders, 4 # pegged limit orders and iceberg orders. For iceberg orders only the visible peak 5 # counts towards the commitment (0044-LIME-029) 6 7 Background: 8 Given the following network parameters are set: 9 | name | value | 10 | market.liquidity.bondPenaltyParameter | 1 | 11 | network.markPriceUpdateMaximumFrequency | 0s | 12 | limits.markets.maxPeggedOrders | 2 | 13 | validators.epoch.length | 5s | 14 | market.liquidity.earlyExitPenalty | 0.25 | 15 | market.liquidity.stakeToCcyVolume | 1.0 | 16 | market.liquidity.sla.nonPerformanceBondPenaltySlope | 0.19 | 17 | market.liquidity.sla.nonPerformanceBondPenaltyMax | 1 | 18 And the liquidity monitoring parameters: 19 | name | triggering ratio | time window | scaling factor | 20 | lqm-params | 0.1 | 24h | 1 | 21 And the average block duration is "1" 22 And the simple risk model named "simple-risk-model-1": 23 | long | short | max move up | min move down | probability of trading | 24 | 0.1 | 0.1 | 60 | 50 | 0.2 | 25 And the fees configuration named "fees-config-1": 26 | maker fee | infrastructure fee | 27 | 0.004 | 0.001 | 28 And the price monitoring named "price-monitoring-1": 29 | horizon | probability | auction extension | 30 | 1 | 0.99 | 5 | 31 And the liquidity sla params named "SLA": 32 | price range | commitment min time fraction | performance hysteresis epochs | sla competition factor | 33 | 0.01 | 0.5 | 1 | 1.0 | 34 35 And the spot markets: 36 | id | name | base asset | quote asset | risk model | auction duration | fees | price monitoring | sla params | sla params | 37 | BTC/ETH | BTC/ETH | BTC | ETH | simple-risk-model-1 | 1 | fees-config-1 | price-monitoring-1 | default-basic | SLA | 38 39 40 And the parties deposit on asset's general account the following amount: 41 | party | asset | amount | 42 | party1 | ETH | 100000000 | 43 | party3 | ETH | 100000000 | 44 | party4 | ETH | 100000000 | 45 | party1 | BTC | 100000000 | 46 | party3 | BTC | 100000000 | 47 | party4 | BTC | 100000000 | 48 And the parties submit the following liquidity provision: 49 | id | party | market id | commitment amount | fee | lp type | 50 | lp1 | party1 | BTC/ETH | 10000 | 0.001 | submission | 51 And the parties place the following orders: 52 | party | market id | side | volume | price | resulting trades | type | tif | reference | 53 | party3 | BTC/ETH | buy | 1000 | 900 | 0 | TYPE_LIMIT | TIF_GTC | p3b1 | 54 | party3 | BTC/ETH | buy | 10 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | p3b2 | 55 | party4 | BTC/ETH | sell | 1000 | 1100 | 0 | TYPE_LIMIT | TIF_GTC | p4s1 | 56 | party4 | BTC/ETH | sell | 10 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | p4s2 | 57 58 Scenario: 001, LP is covered fully with LIMIT orders 59 When the opening auction period ends for market "BTC/ETH" 60 And the auction ends with a traded volume of "10" at a price of "1000" 61 Then the market data for the market "BTC/ETH" should be: 62 | mark price | trading mode | supplied stake | best static bid price | static mid price | best static offer price | 63 | 1000 | TRADING_MODE_CONTINUOUS | 10000 | 900 | 1000 | 1100 | 64 # Place LIMIT orders to cover our commitment 65 And the parties place the following orders: 66 | party | market id | side | volume | price | resulting trades | type | tif | reference | 67 | party1 | BTC/ETH | buy | 10 | 999 | 0 | TYPE_LIMIT | TIF_GTC | party1-order1 | 68 | party1 | BTC/ETH | sell | 10 | 1001 | 0 | TYPE_LIMIT | TIF_GTC | party1-order2 | 69 # Move forward an epoch and make sure the accounts do not change as we have the full epoch covered with LIMIT orders 70 When the network moves ahead "7" blocks 71 Then the liquidity provisions should have the following states: 72 | id | party | market | commitment amount | status | 73 | lp1 | party1 | BTC/ETH | 10000 | STATUS_ACTIVE | 74 And the parties should have the following account balances: 75 | party | asset | market id | general | 76 | party1 | ETH | BTC/ETH | 99980010 | 77 78 Scenario: 002, LP is covered fully with PEGGED orders 79 When the opening auction period ends for market "BTC/ETH" 80 And the auction ends with a traded volume of "10" at a price of "1000" 81 Then the market data for the market "BTC/ETH" should be: 82 | mark price | trading mode | supplied stake | best static bid price | static mid price | best static offer price | 83 | 1000 | TRADING_MODE_CONTINUOUS | 10000 | 900 | 1000 | 1100 | 84 85 # Place PEGGED orders to cover our commitment 86 And the parties place the following orders: 87 | party | market id | side | volume | price | resulting trades | type | tif | reference | pegged reference | pegged offset | 88 | party1 | BTC/ETH | buy | 10 | 0 | 0 | TYPE_LIMIT | TIF_GTC | party1-order1 | MID | 5 | 89 | party1 | BTC/ETH | sell | 10 | 0 | 0 | TYPE_LIMIT | TIF_GTC | party1-order2 | MID | 5 | 90 91 # Move forward an epoch and make sure the accounts do not change as we have the full epoch covered with PEGGED orders 92 When the network moves ahead "7" blocks 93 Then the liquidity provisions should have the following states: 94 | id | party | market | commitment amount | status | 95 | lp1 | party1 | BTC/ETH | 10000 | STATUS_ACTIVE | 96 And the parties should have the following account balances: 97 | party | asset | market id | general | 98 | party1 | ETH | BTC/ETH | 99980050 | 99 100 Scenario: 003, LP is covered fully with ICEBERG orders 101 When the opening auction period ends for market "BTC/ETH" 102 And the auction ends with a traded volume of "10" at a price of "1000" 103 Then the market data for the market "BTC/ETH" should be: 104 | mark price | trading mode | supplied stake | best static bid price | static mid price | best static offer price | 105 | 1000 | TRADING_MODE_CONTINUOUS | 10000 | 900 | 1000 | 1100 | 106 107 # Place ICEBERG orders to cover our commitment 108 When the parties place the following iceberg orders: 109 | party | market id | side | volume | price | resulting trades | type | tif | peak size | minimum visible size | only | 110 | party1 | BTC/ETH | buy | 100 | 999 | 0 | TYPE_LIMIT | TIF_GTC | 90 | 1 | post | 111 | party1 | BTC/ETH | sell | 100 | 1001 | 0 | TYPE_LIMIT | TIF_GTC | 90 | 1 | post | 112 113 # Move forward an epoch and make sure the accounts do not change as we have the full epoch covered with ICEBERG orders 114 When the network moves ahead "7" blocks 115 Then the liquidity provisions should have the following states: 116 | id | party | market | commitment amount | status | 117 | lp1 | party1 | BTC/ETH | 10000 | STATUS_ACTIVE | 118 And the parties should have the following account balances: 119 | party | asset | market id | general | 120 | party1 | ETH | BTC/ETH | 99890100 | 121 122 Scenario: 004, LP is covered fully with ICEBERG orders even with small peak size 123 When the opening auction period ends for market "BTC/ETH" 124 And the auction ends with a traded volume of "10" at a price of "1000" 125 Then the market data for the market "BTC/ETH" should be: 126 | mark price | trading mode | supplied stake | best static bid price | static mid price | best static offer price | 127 | 1000 | TRADING_MODE_CONTINUOUS | 10000 | 900 | 1000 | 1100 | 128 129 # Place ICEBERG orders which have a too small peak to cover our commitment 130 When the parties place the following iceberg orders: 131 | party | market id | side | volume | price | resulting trades | type | tif | peak size | minimum visible size | only | 132 | party1 | BTC/ETH | buy | 100 | 999 | 0 | TYPE_LIMIT | TIF_GTC | 5 | 2 | post | 133 | party1 | BTC/ETH | sell | 100 | 1001 | 0 | TYPE_LIMIT | TIF_GTC | 5 | 2 | post | 134 135 # Move forward an epoch and make sure we get a penalty 136 When the network moves ahead "7" blocks 137 Then the liquidity provisions should have the following states: 138 | id | party | market | commitment amount | status | 139 | lp1 | party1 | BTC/ETH | 10000 | STATUS_ACTIVE | 140 And the parties should have the following account balances: 141 | party | asset | market id | general | 142 | party1 | ETH | BTC/ETH | 99890100 |