From cde80691d92aeb9aafcf5c33e12c12ccc41fb751 Mon Sep 17 00:00:00 2001 From: gordsport Date: Mon, 25 Mar 2024 17:06:01 +0000 Subject: [PATCH] chore: add AC codes --- protocol/0014-ORDT-order_types.md | 82 +++++----- protocol/0041-TSTK-target_stake.md | 16 +- ...042-LIQF-setting_fees_and_rewarding_lps.md | 70 ++++---- protocol/0044-LIME-lp_mechanics.md | 36 ++--- protocol/features.json | 152 +++++++++++++++++- 5 files changed, 253 insertions(+), 103 deletions(-) diff --git a/protocol/0014-ORDT-order_types.md b/protocol/0014-ORDT-order_types.md index 6906a7665..5d62b07f6 100644 --- a/protocol/0014-ORDT-order_types.md +++ b/protocol/0014-ORDT-order_types.md @@ -340,67 +340,67 @@ In Spot market, for multiple iceberg orders submitted as a batch of orders with ### Stop orders -- Once triggered, a stop order is removed from the book and cannot be triggered again. (0014-ORDT-041). For spot products (0014-ORDT-XXX) +- Once triggered, a stop order is removed from the book and cannot be triggered again. (0014-ORDT-041). For spot products (0014-ORDT-124) - A stop order placed by a key with a zero position and no open orders will be rejected. (0014-ORDT-042) - A stop order placed by a key with a zero position but open orders will be accepted. (0014-ORDT-043) -- In a spot market, a stop order placed by a key with no position or open orders will be accepted. (0014-ORDT-XXX) -- Attempting to create more stop orders than is allowed by the relevant network parameter will result in the transaction failing to execute. (0014-ORDT-044). For spot products (0014-ORDT-XXX) +- In a spot market, a stop order placed by a key with no position or open orders will be accepted. (0014-ORDT-125) +- Attempting to create more stop orders than is allowed by the relevant network parameter will result in the transaction failing to execute. (0014-ORDT-044). For spot products (0014-ORDT-126) -- A stop order wrapping a limit order will, once triggered, place the limit order as if it just arrived as an order without the stop order wrapping. (0014-ORDT-045). For spot products (0014-ORDT-XXX) -- A stop order wrapping a market order will, once triggered, place the market order as if it just arrived as an order without the stop order wrapping. (0014-ORDT-046). For spot products (0014-ORDT-XXX) +- A stop order wrapping a limit order will, once triggered, place the limit order as if it just arrived as an order without the stop order wrapping. (0014-ORDT-045). For spot products (0014-ORDT-127) +- A stop order wrapping a market order will, once triggered, place the market order as if it just arrived as an order without the stop order wrapping. (0014-ORDT-046). For spot products (0014-ORDT-128) -- With a last traded price at 50, a stop order placed with `Rises Above` setting at 75 will be triggered by any trade at price 75 or higher. (0014-ORDT-047). For spot products (0014-ORDT-XXX) -- With a last traded price at 50, a stop order placed with `Rises Above` setting at 25 will be triggered immediately (before another trade is even necessary). (0014-ORDT-048). For spot products (0014-ORDT-XXX) -- With a last traded price at 50, a stop order placed with `Falls Below` setting at 25 will be triggered by any trade at price 25 or lower. (0014-ORDT-049). For spot products (0014-ORDT-XXX) -- With a last traded price at 50, a stop order placed with `Falls Below` setting at 75 will be triggered immediately (before another trade is even necessary). (0014-ORDT-050). For spot products (0014-ORDT-XXX) +- With a last traded price at 50, a stop order placed with `Rises Above` setting at 75 will be triggered by any trade at price 75 or higher. (0014-ORDT-047). For spot products (0014-ORDT-129) +- With a last traded price at 50, a stop order placed with `Rises Above` setting at 25 will be triggered immediately (before another trade is even necessary). (0014-ORDT-048). For spot products (0014-ORDT-130) +- With a last traded price at 50, a stop order placed with `Falls Below` setting at 25 will be triggered by any trade at price 25 or lower. (0014-ORDT-049). For spot products (0014-ORDT-131) +- With a last traded price at 50, a stop order placed with `Falls Below` setting at 75 will be triggered immediately (before another trade is even necessary). (0014-ORDT-050). For spot products (0014-ORDT-132) - With a last traded price at 50, a stop order placed with any trigger price which does not trigger immediately will trigger as soon as a trade occurs at a trigger price, and will not wait until the next mark price update to trigger. (0014-ORDT-051) -- A stop order with expiration time `T` set to expire at that time will expire at time `T` if reached without being triggered. (0014-ORDT-052). For spot products (0014-ORDT-XXX) -- A stop order with expiration time `T` set to execute at that time will execute at time `T` if reached without being triggered. (0014-ORDT-053). For spot products (0014-ORDT-XXX) - - If the order is triggered before reaching time `T`, the order will have been removed and will *not* trigger at time `T`. (0014-ORDT-054). For spot products (0014-ORDT-XXX) - - An OCO stop order with expiration time `T` with one side set to execute at that time will execute at time `T` if reached without being triggered, with the specified side triggering and the other side cancelling. This must be tested both sides (fall below and rise above). (0014-ORDT-131). For spot products (0014-ORDT-XXX) - - An OCO stop order with expiration time `T` with both sides set to execute at that time will be rejected on submission (0014-ORDT-130). For spot products (0014-ORDT-XXX) +- A stop order with expiration time `T` set to expire at that time will expire at time `T` if reached without being triggered. (0014-ORDT-052). For spot products (0014-ORDT-133) +- A stop order with expiration time `T` set to execute at that time will execute at time `T` if reached without being triggered. (0014-ORDT-053). For spot products (0014-ORDT-134) + - If the order is triggered before reaching time `T`, the order will have been removed and will *not* trigger at time `T`. (0014-ORDT-054). For spot products (0014-ORDT-135) + - An OCO stop order with expiration time `T` with one side set to execute at that time will execute at time `T` if reached without being triggered, with the specified side triggering and the other side cancelling. This must be tested both sides (fall below and rise above). (0014-ORDT-131). For spot products (0014-ORDT-136) + - An OCO stop order with expiration time `T` with both sides set to execute at that time will be rejected on submission (0014-ORDT-130). For spot products (0014-ORDT-137) -- A stop order set to trade volume `x` with a trigger set to `Rises Above` at a given price will trigger at the first trade at or above that price. (0014-ORDT-055). For spot products (0014-ORDT-XXX) -- If a pair of stop orders are specified as OCO, one being triggered also removes the other from the book. (0014-ORDT-056). For spot products (0014-ORDT-XXX) -- If a pair of stop orders are specified as OCO and one triggers but is invalid at time of triggering (e.g. a buy when the trader is already long) the other will still be cancelled. (0014-ORDT-058). For spot products (0014-ORDT-XXX) +- A stop order set to trade volume `x` with a trigger set to `Rises Above` at a given price will trigger at the first trade at or above that price. (0014-ORDT-055). For spot products (0014-ORDT-138) +- If a pair of stop orders are specified as OCO, one being triggered also removes the other from the book. (0014-ORDT-056). For spot products (0014-ORDT-139) +- If a pair of stop orders are specified as OCO and one triggers but is invalid at time of triggering (e.g. a buy when the trader is already long) the other will still be cancelled. (0014-ORDT-058). For spot products (0014-ORDT-140) - A trailing stop order for a 5% drop placed when the price is `50`, followed by a price rise to `60` will: - - Be triggered by a fall to `57`. (0014-ORDT-059). For spot products (0014-ORDT-XXX) - - Not be triggered by a fall to `58`. (0014-ORDT-060). For spot products (0014-ORDT-XXX) + - Be triggered by a fall to `57`. (0014-ORDT-059). For spot products (0014-ORDT-141) + - Not be triggered by a fall to `58`. (0014-ORDT-060). For spot products (0014-ORDT-142) - A trailing stop order for a 5% rise placed when the price is `50`, followed by a drop to `40` will: - - Be triggered by a rise to `42`. (0014-ORDT-061). For spot products (0014-ORDT-XXX) - - Not be triggered by a rise to `41`. (0014-ORDT-062). For spot products (0014-ORDT-XXX) + - Be triggered by a rise to `42`. (0014-ORDT-061). For spot products (0014-ORDT-143) + - Not be triggered by a rise to `41`. (0014-ORDT-062). For spot products (0014-ORDT-144) - A trailing stop order for a 25% drop placed when the price is `50`, followed by a price rise to `60`, then to `50`, then another rise to `57` will: - - Be triggered by a fall to `45`. (0014-ORDT-063). For spot products (0014-ORDT-XXX) - - Not be triggered by a fall to `46`. (0014-ORDT-064). For spot products (0014-ORDT-XXX) + - Be triggered by a fall to `45`. (0014-ORDT-063). For spot products (0014-ORDT-145) + - Not be triggered by a fall to `46`. (0014-ORDT-064). For spot products (0014-ORDT-146) -- A stop order placed during an auction will not execute during an auction, nor will it participate in the uncrossing. (0014-ORDT-065). For spot products (0014-ORDT-XXX) -- A stop order placed during an auction, where the uncrossing price is within the triggering range, will immediately execute following uncrossing. (0014-ORDT-066). For spot products (0014-ORDT-XXX) +- A stop order placed during an auction will not execute during an auction, nor will it participate in the uncrossing. (0014-ORDT-065). For spot products (0014-ORDT-147) +- A stop order placed during an auction, where the uncrossing price is within the triggering range, will immediately execute following uncrossing. (0014-ORDT-066). For spot products (0014-ORDT-148) -- A stop order placed prior to an auction will not execute during an auction, nor will it participate in the uncrossing. (0014-ORDT-134). For spot products (0014-ORDT-XXX) -- A stop order placed prior to an auction, where the uncrossing price is within the triggering range, will immediately execute following uncrossing. (0014-ORDT-135). For spot products (0014-ORDT-XXX) -- An order with a stop is placed during continuous trading. The market goes into auction. The market exits auction, the condition for triggering the stop is not met. The stop order is still present. (0014-ORDT-136). For spot products (0014-ORDT-XXX) +- A stop order placed prior to an auction will not execute during an auction, nor will it participate in the uncrossing. (0014-ORDT-134). For spot products (0014-ORDT-149) +- A stop order placed prior to an auction, where the uncrossing price is within the triggering range, will immediately execute following uncrossing. (0014-ORDT-135). For spot products (0014-ORDT-150) +- An order with a stop is placed during continuous trading. The market goes into auction. The market exits auction, the condition for triggering the stop is not met. The stop order is still present. (0014-ORDT-136). For spot products (0014-ORDT-151) -- A party places a stop order on a market in continuous trading, the market moves to an auction and the party cancels the stop order. When the market exits the auction the party no longer has a stop order. (0014-ORDT-132). For spot products (0014-ORDT-XXX) -- A stop order placed during the opening auction, will be rejected. (0014-ORDT-133). For spot products (0014-ORDT-XXX) +- A party places a stop order on a market in continuous trading, the market moves to an auction and the party cancels the stop order. When the market exits the auction the party no longer has a stop order. (0014-ORDT-132). For spot products (0014-ORDT-152) +- A stop order placed during the opening auction, will be rejected. (0014-ORDT-133). For spot products (0014-ORDT-153) - If a trader has open stop orders and their position moves to zero whilst they still have open limit orders their stop orders will remain active. (0014-ORDT-067) - If a trader has open stop orders and their position moves to zero with no open limit orders their stop orders are cancelled. (0014-ORDT-068) -- A Stop order that hasn't been triggered can be cancelled. (0014-ORDT-071). For spot products (0014-ORDT-XXX) -- All stop orders for a specific party can be cancelled by a single stop order cancellation. (0014-ORDT-072). For spot products (0014-ORDT-XXX) -- All stop orders for a specific party for a specific market can be cancelled by a single stop order cancellation. (0014-ORDT-073). For spot products (0014-ORDT-XXX) +- A Stop order that hasn't been triggered can be cancelled. (0014-ORDT-071). For spot products (0014-ORDT-154) +- All stop orders for a specific party can be cancelled by a single stop order cancellation. (0014-ORDT-072). For spot products (0014-ORDT-155) +- All stop orders for a specific party for a specific market can be cancelled by a single stop order cancellation. (0014-ORDT-073). For spot products (0014-ORDT-156) - If a stop order is placed with a position_fraction equal to 0.5 and the position size is 5 then the rounding should be equal to 3 (0014-ORDT-138) ## Stop Orders - Negative Cases -- Stop orders submitted with post_only=True are rejected. (0014-ORDT-074). For spot products (0014-ORDT-XXX) -- Stop orders submitted with invalid values for trigger price (0, negative values) and trailing percentage (0, negative values) are rejected. (0014-ORDT-075). For spot products (0014-ORDT-XXX) -- Stop orders submitted with expiry in the past are rejected. (0014-ORDT-076). For spot products (0014-ORDT-XXX) -- GFA Stop orders submitted are rejected. (0014-ORDT-077). For spot products (0014-ORDT-XXX) -- Stop orders once triggered can not be cancelled. (0014-ORDT-078). For spot products (0014-ORDT-XXX) +- Stop orders submitted with post_only=True are rejected. (0014-ORDT-074). For spot products (0014-ORDT-157) +- Stop orders submitted with invalid values for trigger price (0, negative values) and trailing percentage (0, negative values) are rejected. (0014-ORDT-075). For spot products (0014-ORDT-158) +- Stop orders submitted with expiry in the past are rejected. (0014-ORDT-076). For spot products (0014-ORDT-159) +- GFA Stop orders submitted are rejected. (0014-ORDT-077). For spot products (0014-ORDT-160) +- Stop orders once triggered can not be cancelled. (0014-ORDT-078). For spot products (0014-ORDT-161) - If a stop order is placed with a position_fraction equal to 0 the order should be rejected. (0014-ORDT-139) - A party with a long position cannot enter a buy stop order, and a party with a short position cannot enter a sell stop order (0014-ORDT-137) @@ -417,7 +417,7 @@ In Spot market, for multiple iceberg orders submitted as a batch of orders with - A stop order with a size override linked to the position of the trader will use the current position as an override of the triggered order size. (0014-ORDT-127) - All stop orders with a position size override should be cancelled if the trader's position flips sides (long->short or short->long). (0014-ORDT-128) - A stop order with a position size override with a position_fraction set to 0.75, for a trader with long position 20, should create a stop order for selling size 15 when triggered (0014-ORDT-129) -- Given a spot market, a stop order with a position size override will be rejected (0014-ORDT-XXX) +- Given a spot market, a stop order with a position size override will be rejected (0014-ORDT-162) ## Perpetuals @@ -429,8 +429,8 @@ In Spot market, for multiple iceberg orders submitted as a batch of orders with ## Spot -- A trader submitting a stop order wrapping a buy limit order will have the funds required to execute that order locked in the relevant holding account for the quote asset. (0014-ORDT-XXX) -- A trader submitting a stop order wrapping a sell limit order will have the funds required to execute that order locked in the relevant holding account for the base asset (0014-ORDT-XXX) +- A trader submitting a stop order wrapping a buy limit order will have the funds required to execute that order locked in the relevant holding account for the quote asset. (0014-ORDT-163) +- A trader submitting a stop order wrapping a sell limit order will have the funds required to execute that order locked in the relevant holding account for the base asset (0014-ORDT-164) ### See also diff --git a/protocol/0041-TSTK-target_stake.md b/protocol/0041-TSTK-target_stake.md index ed75b74c3..c7a5e6c1f 100644 --- a/protocol/0041-TSTK-target_stake.md +++ b/protocol/0041-TSTK-target_stake.md @@ -93,11 +93,11 @@ The above design ensures the `target_stake` of a market is unable to fluctuate d ### Acceptance criteria -- For a spot market, given a `scaling_factor=1` and zero asset decimals. The target stake should be set to the maximum total supplied stake over the previous `time_window`. (0041-TSTK-XXX) -- For a spot market, given a `scaling_factor=1` and non-zero asset decimals. The target stake should be set to the maximum total supplied stake over the previous `time_window`. (0041-TSTK-XXX) -- For a spot market, given a `scaling_factor<1` The target stake should be set to the product of the `scaling_factor` and the maximum total supplied stake over the previous `time_window`. (0041-TSTK-XXX) -- For a spot market, given a LP increases their commitment, the target stake should increase to reflect that change. (0041-TSTK-XXX) -- For a spot market, given a LP decreases their commitment, the target stake will not decrease to reflect that change until end of the epoch when the reduction is processed and the rolling time window no longer includes the total stake prior to the commitment change.(0041-TSTK-XXX) -- For a spot market, change of `market.stake.target.scalingFactor` will immediately change the target stake. (0041-TSTK-XXX) -- For a spot market, an increase of `time_window` will immediately change the length of time window over which total stake is measured however new records will not be added hence the target stake will not immediately change (0041-TSTK-XXX) -- For a spot market, a decrease of `time_window` will immediately change the length of time window over which the total stake is measured and old records will be dropped hence the target stake will immediately change (0041-TSTK-XXX) +- For a spot market, given a `scaling_factor=1` and zero asset decimals. The target stake should be set to the maximum total supplied stake over the previous `time_window`. (0041-TSTK-106) +- For a spot market, given a `scaling_factor=1` and non-zero asset decimals. The target stake should be set to the maximum total supplied stake over the previous `time_window`. (0041-TSTK-107) +- For a spot market, given a `scaling_factor<1` The target stake should be set to the product of the `scaling_factor` and the maximum total supplied stake over the previous `time_window`. (0041-TSTK-108) +- For a spot market, given a LP increases their commitment, the target stake should increase to reflect that change. (0041-TSTK-109) +- For a spot market, given a LP decreases their commitment, the target stake will not decrease to reflect that change until end of the epoch when the reduction is processed and the rolling time window no longer includes the total stake prior to the commitment change.(0041-TSTK-110) +- For a spot market, change of `market.stake.target.scalingFactor` will immediately change the target stake. (0041-TSTK-111) +- For a spot market, an increase of `time_window` will immediately change the length of time window over which total stake is measured however new records will not be added hence the target stake will not immediately change (0041-TSTK-112) +- For a spot market, a decrease of `time_window` will immediately change the length of time window over which the total stake is measured and old records will be dropped hence the target stake will immediately change (0041-TSTK-113) diff --git a/protocol/0042-LIQF-setting_fees_and_rewarding_lps.md b/protocol/0042-LIQF-setting_fees_and_rewarding_lps.md index 39a4324d3..2eeb281b9 100644 --- a/protocol/0042-LIQF-setting_fees_and_rewarding_lps.md +++ b/protocol/0042-LIQF-setting_fees_and_rewarding_lps.md @@ -345,20 +345,20 @@ Each LP further gets a performance bonus: $b_i \times B$ with a transfer type th ### CALCULATING LIQUIDITY FEE FACTOR TESTS - The examples provided result in the given outcomes (0042-LIQF-001) -- The resulting liquidity-fee-factor is always equal to one of the liquidity provider's individually nominated fee factors (0042-LIQF-002) For product spot: (0042-LIQF-XXX). +- The resulting liquidity-fee-factor is always equal to one of the liquidity provider's individually nominated fee factors (0042-LIQF-002) For product spot: (0042-LIQF-063). - The resulting liquidity-fee-factor is never less than zero (0042-LIQF-003) - Liquidity fee factors are recalculated every time a liquidity provider nominates a new fee factor (using the commit liquidity network transaction). (0042-LIQF-004) -- Liquidity fee factors are recalculated every time the liquidity demand estimate changes. (0042-LIQF-005). For product spot: (0042-LIQF-XXX). +- Liquidity fee factors are recalculated every time the liquidity demand estimate changes. (0042-LIQF-005). For product spot: (0042-LIQF-064). - If a change in the open interest causes the liquidity demand estimate to change, then fee factor is correctly recalculated. (0042-LIQF-006) -- If passage of time causes the liquidity demand estimate to change, the fee factor is correctly recalculated. (0042-LIQF-007). For product spot: (0042-LIQF-XXX). +- If passage of time causes the liquidity demand estimate to change, the fee factor is correctly recalculated. (0042-LIQF-007). For product spot: (0042-LIQF-065). - A market can be proposed with a choice of liquidity fee settings. These settings can be updated by a subsequent market update proposal. Moreover, the correct fee value and liquidity fee setting method can be read from the data node APIs. Upon proposal enactment the new liquidity method is applied to recalculate the liquidity fee. The tests should be carried out with the following methods: - - Weighted average (0042-LIQF-056). For product spot: (0042-LIQF-XXX). - - Constant fee (0042-LIQF-061). For product spot: (0042-LIQF-XXX). - - Marginal cost (0042-LIQF-062). For product spot: (0042-LIQF-XXX). -- The above example for the liquidity fee when the method is weighted-average results in a fee-factor of 1.5% (0042-LIQF-057). For product spot: (0042-LIQF-XXX). -- The above example for the liquidity fee when the method is constant-fee results in a fee-factor of 0.8% (0042-LIQF-058). For product spot: (0042-LIQF-XXX). -- The above example for the liquidity fee when the method is marginal cost results in a fee-factor of `3.75%` (0042-LIQF-059). For product spot: (0042-LIQF-XXX). -- For the constant-fee method validate that the fee factor can only be between 0 and 1 inclusive (0042-LIQF-060). For product spot: (0042-LIQF-XXX). + - Weighted average (0042-LIQF-056). For product spot: (0042-LIQF-066). + - Constant fee (0042-LIQF-061). For product spot: (0042-LIQF-067). + - Marginal cost (0042-LIQF-062). For product spot: (0042-LIQF-068). +- The above example for the liquidity fee when the method is weighted-average results in a fee-factor of 1.5% (0042-LIQF-057). For product spot: (0042-LIQF-069). +- The above example for the liquidity fee when the method is constant-fee results in a fee-factor of 0.8% (0042-LIQF-058). For product spot: (0042-LIQF-070). +- The above example for the liquidity fee when the method is marginal cost results in a fee-factor of `3.75%` (0042-LIQF-059). For product spot: (0042-LIQF-071). +- For the constant-fee method validate that the fee factor can only be between 0 and 1 inclusive (0042-LIQF-060). For product spot: (0042-LIQF-072). ### CHANGE OF NETWORK PARAMETERS TESTS @@ -380,23 +380,23 @@ Each LP further gets a performance bonus: $b_i \times B$ with a transfer type th ### LP JOINING AND LEAVING MARKETS - An LP joining a market that is below the target stake with a higher fee bid than the current fee: their fee is used (0042-LIQF-019) -- Given the fee setting method is marginal cost. An LP joining a spot market that is below the target stake with a higher fee bid than the current fee: their fee is used when the fee is next recalculated (0042-LIQF-XXX) +- Given the fee setting method is marginal cost. An LP joining a spot market that is below the target stake with a higher fee bid than the current fee: their fee is used when the fee is next recalculated (0042-LIQF-073) - An LP joining a market that is below the target stake with a lower fee bid than the current fee: fee doesn't change (0042-LIQF-020) -- Given the fee setting method is marginal cost. An LP joining a spot market that is below the target stake with a higher fee bid than the current fee: their fee is used when the fee is next recalculated (0042-LIQF-XXX) +- Given the fee setting method is marginal cost. An LP joining a spot market that is below the target stake with a higher fee bid than the current fee: their fee is used when the fee is next recalculated (0042-LIQF-074) - An LP joining a market that is above the target stake with a sufficiently large commitment to push ALL higher bids above the target stake and a lower fee bid than the current fee: their fee is used (0042-LIQF-029) -- Given the fee setting method is marginal cost. An LP joining a spot market that is above the target stake with a sufficiently large commitment to push ALL higher bids above the target stake and a lower fee bid than the current fee: their fee is used when the fee is next recalculated (0042-LIQF-XXX) +- Given the fee setting method is marginal cost. An LP joining a spot market that is above the target stake with a sufficiently large commitment to push ALL higher bids above the target stake and a lower fee bid than the current fee: their fee is used when the fee is next recalculated (0042-LIQF-075) - An LP joining a market that is above the target stake with a commitment not large enough to push any higher bids above the target stake, and a lower fee bid than the current fee: the fee doesn't change (0042-LIQF-030) -- Given the fee setting method is marginal cost. An LP joining a spot market that is above the target stake with a commitment not large enough to push any higher bids above the target stake, and a lower fee bid than the current fee: the fee doesn't change when the fee is next recalculated (0042-LIQF-XXX) +- Given the fee setting method is marginal cost. An LP joining a spot market that is above the target stake with a commitment not large enough to push any higher bids above the target stake, and a lower fee bid than the current fee: the fee doesn't change when the fee is next recalculated (0042-LIQF-076) - An LP joining a market that is above the target stake with a commitment large enough to push one of two higher bids above the target stake, and a lower fee bid than the current fee: the fee changes to the other lower bid (0042-LIQF-023) -- Given the fee setting method is marginal cost. An LP joining a spot market that is above the target stake with a commitment not large enough to push any higher bids above the target stake, and a lower fee bid than the current fee: the fee doesn't change when the fee is next recalculated (0042-LIQF-XXX) +- Given the fee setting method is marginal cost. An LP joining a spot market that is above the target stake with a commitment not large enough to push any higher bids above the target stake, and a lower fee bid than the current fee: the fee doesn't change when the fee is next recalculated (0042-LIQF-077) - An LP joining a market that is above the target stake with a commitment large enough to push one of two higher bids above the target stake, and a higher fee bid than the current fee: the fee doesn't change (0042-LIQF-024) -- Given the fee setting method is marginal cost. An LP joining a spot market that is above the target stake with a commitment large enough to push one of two higher bids above the target stake, and a higher fee bid than the current fee: the fee doesn't change when the fee is next recalculated (0042-LIQF-XXX) +- Given the fee setting method is marginal cost. An LP joining a spot market that is above the target stake with a commitment large enough to push one of two higher bids above the target stake, and a higher fee bid than the current fee: the fee doesn't change when the fee is next recalculated (0042-LIQF-078) - An LP leaves a market that is above target stake when their fee bid is currently being used: fee changes to fee bid by the LP who takes their place in the bidding order (0042-LIQF-025) -- Given the fee setting method is marginal cost. An LP leaves a market that is above target stake when their fee bid is currently being used: fee changes to fee bid by the LP who takes their place in the bidding order when the fee is next recalculated (0042-LIQF-XXX) +- Given the fee setting method is marginal cost. An LP leaves a market that is above target stake when their fee bid is currently being used: fee changes to fee bid by the LP who takes their place in the bidding order when the fee is next recalculated (0042-LIQF-079) - An LP leaves a market that is above target stake when their fee bid is lower than the one currently being used and their commitment size changes the LP that meets the target stake: fee changes to fee bid by the LP that is now at the place in the bid order to provide the target stake (0042-LIQF-026) -- Given the fee setting method is marginal cost. An LP leaves a market that is above target stake when their fee bid is lower than the one currently being used and their commitment size changes the LP that meets the target stake: fee changes to fee bid by the LP that is now at the place in the bid order to provide the target stake when the fee is next recalculated (0042-LIQF-XXX) +- Given the fee setting method is marginal cost. An LP leaves a market that is above target stake when their fee bid is lower than the one currently being used and their commitment size changes the LP that meets the target stake: fee changes to fee bid by the LP that is now at the place in the bid order to provide the target stake when the fee is next recalculated (0042-LIQF-080) - An LP leaves a market that is above target stake when their fee bid is lower than the one currently being used. The loss of their commitment doesn't change which LP meets the target stake: fee doesn't change (0042-LIQF-027) -- Given the fee setting method is marginal cost. An LP leaves a market that is above target stake when their fee bid is higher than the one currently being used: fee doesn't change when the fee is next recalculated (0042-LIQF-XXX) +- Given the fee setting method is marginal cost. An LP leaves a market that is above target stake when their fee bid is higher than the one currently being used: fee doesn't change when the fee is next recalculated (0042-LIQF-081) - An LP leaves a market that is above target stake when their fee bid is higher than the one currently being used: fee doesn't change (0042-LIQF-028) ### API @@ -421,36 +421,36 @@ Each LP further gets a performance bonus: $b_i \times B$ with a transfer type th - If an LP has an active liquidity provision at the start of an epoch, `market.liquidity.slaCompetitionFactor = 1`, `market.liquidity.commitmentMinTimeFraction = 0.5` and throughout the epoch meets their liquidity provision requirements such that the `fraction_of_time_on_book = 0.75` then their penalty from that epoch will be `0.5`. This will be true whether: - - Their liquidity is all provided at the start of the epoch and then none is provided for the second half (0042-LIQF-037). For spot (0042-LIQF-0XX) - - Their liquidity is provided scattered throughout the epoch (0042-LIQF-038). For spot (0042-LIQF-0XX) + - Their liquidity is all provided at the start of the epoch and then none is provided for the second half (0042-LIQF-037). For spot (0042-LIQF-082) + - Their liquidity is provided scattered throughout the epoch (0042-LIQF-038). For spot (0042-LIQF-083) -- If an LP has an active liquidity provision at the start of an epoch, `market.liquidity.slaCompetitionFactor = 0`, `market.liquidity.commitmentMinTimeFraction = 0.5` and throughout the epoch meets their liquidity provision requirements such that the `fraction_of_time_on_book = 0.75` then their penalty from that epoch will be `0`. (0042-LIQF-041). For spot (0042-LIQF-0XX) -- If an LP has an active liquidity provision at the start of an epoch, `market.liquidity.slaCompetitionFactor = 0.5`, `market.liquidity.commitmentMinTimeFraction = 0.5` and throughout the epoch meets their liquidity provision requirements such that the `fraction_of_time_on_book = 0.75` then their penalty from that epoch will be `0.25`. (0042-LIQF-042). For spot (0042-LIQF-0XX) +- If an LP has an active liquidity provision at the start of an epoch, `market.liquidity.slaCompetitionFactor = 0`, `market.liquidity.commitmentMinTimeFraction = 0.5` and throughout the epoch meets their liquidity provision requirements such that the `fraction_of_time_on_book = 0.75` then their penalty from that epoch will be `0`. (0042-LIQF-041). For spot (0042-LIQF-084) +- If an LP has an active liquidity provision at the start of an epoch, `market.liquidity.slaCompetitionFactor = 0.5`, `market.liquidity.commitmentMinTimeFraction = 0.5` and throughout the epoch meets their liquidity provision requirements such that the `fraction_of_time_on_book = 0.75` then their penalty from that epoch will be `0.25`. (0042-LIQF-042). For spot (0042-LIQF-085) - When `market.liquidity.performanceHysteresisEpochs = 1`: - - If an LP has an active liquidity provision at the start of an epoch and throughout the epoch always meets their liquidity provision requirements then they will have a `fraction_of_time_on_book == 1` and no penalty will be applied to their liquidity fee payments at the end of the epoch (0042-LIQF-035). For spot (0042-LIQF-0XX) - - If an LP has an active liquidity provision at the start of an epoch and throughout the epoch meets their liquidity provision requirements less than `market.liquidity.commitmentMinTimeFraction` fraction of the time then they will have a full penalty and will receive `0` liquidity fee payments at the end of the epoch (0042-LIQF-049). For spot (0042-LIQF-0XX) - - An LP has an active liquidity provision at the start of an epoch. The penalty rate for said LP over the previous `2` epochs is `0.75`. During the epoch `market.liquidity.performanceHysteresisEpochs` is set to `3`. Throughout the current epoch the LP meets their liquidity provision requirements so they will have `fraction_of_time_on_book == 1`. The penalty applied to fee distribution at epoch end will be `0` and will not consider the previous epochs. (0042-LIQF-053). For spot (0042-LIQF-0XX) + - If an LP has an active liquidity provision at the start of an epoch and throughout the epoch always meets their liquidity provision requirements then they will have a `fraction_of_time_on_book == 1` and no penalty will be applied to their liquidity fee payments at the end of the epoch (0042-LIQF-035). For spot (0042-LIQF-086) + - If an LP has an active liquidity provision at the start of an epoch and throughout the epoch meets their liquidity provision requirements less than `market.liquidity.commitmentMinTimeFraction` fraction of the time then they will have a full penalty and will receive `0` liquidity fee payments at the end of the epoch (0042-LIQF-049). For spot (0042-LIQF-087) + - An LP has an active liquidity provision at the start of an epoch. The penalty rate for said LP over the previous `2` epochs is `0.75`. During the epoch `market.liquidity.performanceHysteresisEpochs` is set to `3`. Throughout the current epoch the LP meets their liquidity provision requirements so they will have `fraction_of_time_on_book == 1`. The penalty applied to fee distribution at epoch end will be `0` and will not consider the previous epochs. (0042-LIQF-053). For spot (0042-LIQF-088) - When `market.liquidity.performanceHysteresisEpochs > 1`: - - If an LP has an active liquidity provision at the start of an epoch, the average `penalty rate` over the previous `n-1` epochs is `0.75` and throughout the epoch they always meet their liquidity provision requirements then they will have a `fraction_of_time_on_book == 1` for the latest epoch a penalty rate of `0.75` will be applied to liquidity fee payments at the end of the epoch (0042-LIQF-047). For spot (0042-LIQF-0XX) - - If an LP has an active liquidity provision at the start of an epoch, the average `penalty rate` over the previous `n-1` epochs is `0.5` and throughout the epoch they always meet their liquidity provision requirements then they will have a `fraction_of_time_on_book == 1` for the latest epoch a penalty rate of `0.5` will be applied to liquidity fee payments at the end of the epoch (0042-LIQF-039). For spot (0042-LIQF-0XX) - - If an LP has an active liquidity provision at the start of an epoch, the average `penalty rate` over the previous `n-1` epochs is `0.5` and throughout the epoch they never meet their liquidity provision requirements then they will have a `fraction_of_time_on_book == 0` for the latest epoch a penalty rate of `1` will be applied to liquidity fee payments at the end of the epoch (0042-LIQF-040). For spot (0042-LIQF-0XX) - - If an LP has an active liquidity provision at the start of an epoch and no previous performance penalties and throughout the epoch always meets their liquidity provision requirements then they will have a `fraction_of_time_on_book == 1` then no penalty will be applied to their liquidity fee payments at the end of the epoch. (0042-LIQF-054). For spot (0042-LIQF-0XX) + - If an LP has an active liquidity provision at the start of an epoch, the average `penalty rate` over the previous `n-1` epochs is `0.75` and throughout the epoch they always meet their liquidity provision requirements then they will have a `fraction_of_time_on_book == 1` for the latest epoch a penalty rate of `0.75` will be applied to liquidity fee payments at the end of the epoch (0042-LIQF-047). For spot (0042-LIQF-089) + - If an LP has an active liquidity provision at the start of an epoch, the average `penalty rate` over the previous `n-1` epochs is `0.5` and throughout the epoch they always meet their liquidity provision requirements then they will have a `fraction_of_time_on_book == 1` for the latest epoch a penalty rate of `0.5` will be applied to liquidity fee payments at the end of the epoch (0042-LIQF-039). For spot (0042-LIQF-090) + - If an LP has an active liquidity provision at the start of an epoch, the average `penalty rate` over the previous `n-1` epochs is `0.5` and throughout the epoch they never meet their liquidity provision requirements then they will have a `fraction_of_time_on_book == 0` for the latest epoch a penalty rate of `1` will be applied to liquidity fee payments at the end of the epoch (0042-LIQF-040). For spot (0042-LIQF-090) + - If an LP has an active liquidity provision at the start of an epoch and no previous performance penalties and throughout the epoch always meets their liquidity provision requirements then they will have a `fraction_of_time_on_book == 1` then no penalty will be applied to their liquidity fee payments at the end of the epoch. (0042-LIQF-054). For spot (0042-LIQF-100) ### SLA Performance bonus transfers -- The net inflow and outflow into and out of the market's aggregate LP fee account should be zero as a result of penalty collection and bonus distribution. (0042-LIQF-043). For spot (0042-LIQF-0XX) -- With two liquidity providers, one with an effective penalty rate of `0.5` and earned fees of `n`, and the other with an effective rate of `0.75` and earned fees of `m`, `50% * n` and `25% * m` of the second provider's should be transferred back into market's aggregate LP fee account. Then the total provider bonus score should be `b = (m / (n + m)) * 0.25 + (n / (n + m)) * 0.5` and provider 1 should receive `(0.5 * n + 0.25 * m) * (n / (n + m)) * 0.5 / b` and provider 2 should receive `(0.5 * n + 0.25 * m) * (m / (n + m)) * 0.25 / b` as an additional bonus payment (0042-LIQF-044). For spot (0042-LIQF-0XX) -- With two liquidity providers, one with an effective penalty rate of `1` and earned fees of `n`, and the other with an effective rate of `0` and earned fees of `m`, the entirety of `n` should be transferred to the second liquidity provider as a bonus payment (0042-LIQF-045). For spot (0042-LIQF-0XX) -- With only one liquidity provider, with an effective penalty rate of `0.5`, `50%` of their initially earned fees will be taken initially but will be entirely paid back to them as a bonus payment (0042-LIQF-046). For spot (0042-LIQF-0XX) +- The net inflow and outflow into and out of the market's aggregate LP fee account should be zero as a result of penalty collection and bonus distribution. (0042-LIQF-043). For spot (0042-LIQF-101) +- With two liquidity providers, one with an effective penalty rate of `0.5` and earned fees of `n`, and the other with an effective rate of `0.75` and earned fees of `m`, `50% * n` and `25% * m` of the second provider's should be transferred back into market's aggregate LP fee account. Then the total provider bonus score should be `b = (m / (n + m)) * 0.25 + (n / (n + m)) * 0.5` and provider 1 should receive `(0.5 * n + 0.25 * m) * (n / (n + m)) * 0.5 / b` and provider 2 should receive `(0.5 * n + 0.25 * m) * (m / (n + m)) * 0.25 / b` as an additional bonus payment (0042-LIQF-044). For spot (0042-LIQF-102) +- With two liquidity providers, one with an effective penalty rate of `1` and earned fees of `n`, and the other with an effective rate of `0` and earned fees of `m`, the entirety of `n` should be transferred to the second liquidity provider as a bonus payment (0042-LIQF-045). For spot (0042-LIQF-103) +- With only one liquidity provider, with an effective penalty rate of `0.5`, `50%` of their initially earned fees will be taken initially but will be entirely paid back to them as a bonus payment (0042-LIQF-046). For spot (0042-LIQF-104) ### Transfers example -Example 1, generated with [supplementary worksheet](https://docs.google.com/spreadsheets/d/1PQC2WYv9qRlyjbvvCYpVWCzO5MzwkcEGOR5aS9rWGEY) [internal only]. Values should match up to rounding used by `core` (0042-LIQF-055). For spot (0042-LIQF-0XX): +Example 1, generated with [supplementary worksheet](https://docs.google.com/spreadsheets/d/1PQC2WYv9qRlyjbvvCYpVWCzO5MzwkcEGOR5aS9rWGEY) [internal only]. Values should match up to rounding used by `core` (0042-LIQF-055). For spot (0042-LIQF-105): | LP | penalty fraction | LP-per-market fee accounts balance | 1st transfer amt | 2nd (bonus) transfer amt | | --- | -------------- | -------------- | -------------- | -------------- | | LP1 | 0 | 1000 | 1000 | 24673.94095 | diff --git a/protocol/0044-LIME-lp_mechanics.md b/protocol/0044-LIME-lp_mechanics.md index 42bbf8657..c15e37753 100644 --- a/protocol/0044-LIME-lp_mechanics.md +++ b/protocol/0044-LIME-lp_mechanics.md @@ -308,26 +308,26 @@ Note: - Check that bond slashing works with non-default asset decimals, market decimals, position decimals. This can be done by following a similar story to [bond slashing feature test](https://github.com/vegaprotocol/vega/blob/develop/core/integration/features/verified/liquidity-provision-bond-account.feature). Should test at least three different combinations, each decimal settings different to each other. (0044-LIME-009) - If `market.liquidity.stakeToCcyVolume` is set to `0.0`, there is [target stake](./0041-TSTK-target_stake.md) of `1000` and there are 3 LPs on the market with stake / fee bid submissions of `100, 0.01`, `1000, 0.02` and `200, 0.03` then the liquidity fee is `0.02`. (0044-LIME-012) -- If a liquidity provider has `fraction_of_time_on_book` >= `market.liquidity.commitmentMinTimeFraction`, no penalty will be taken from their bond account (0044-LIME-013). For product spot (0044-LIME-0XX) +- If a liquidity provider has `fraction_of_time_on_book` >= `market.liquidity.commitmentMinTimeFraction`, no penalty will be taken from their bond account (0044-LIME-013). For product spot (0044-LIME-102) - If a liquidity provider has `fraction_of_time_on_book` = `0.3`, `market.liquidity.commitmentMinTimeFraction = 0.6`, `market.liquidity.sla.nonPerformanceBondPenaltySlope = 0.7`, `market.liquidity.sla.nonPerformanceBondPenaltyMax = 0.6` at the end of an epoch then they will forfeit `35%` of their bond stake, which will be transferred into the market's insurance pool (0044-LIME-014) and in the case of spot markets into the network treasury for the asset (0044-LIME-048) -- If a liquidity provider has `fraction_of_time_on_book` = `0.3`, `market.liquidity.commitmentMinTimeFraction = 0.6`, `market.liquidity.sla.nonPerformanceBondPenaltySlope = 0.7`, `market.liquidity.sla.nonPerformanceBondPenaltyMax = 0.6`and the market parameter change `market.liquidity.commitmentMinTimeFraction = 0.3` is enacted during the epoch then at the end of the current epoch LP will have their bond slashed. If the LP has `fraction_of_time_on_book` = `0.3` at the end of the next epoch, they are meeting their commitment and will not forfeit any of their bond stake. (0044-LIME-088). For product spot (0044-LIME-0XX) -- If a liquidity provider has `fraction_of_time_on_book` = `0.3`, `market.liquidity.commitmentMinTimeFraction = 0.0`, `market.liquidity.sla.nonPerformanceBondPenaltySlope = 0.7`, `market.liquidity.sla.nonPerformanceBondPenaltyMax = 0.6`and the market parameter change `market.liquidity.commitmentMinTimeFraction = 0.6` is enacted during the epoch then at the end of the current epoch LP will not forfeit any of their bond stake. If the LP has `fraction_of_time_on_book` = `0.3` at the end of the next epoch at the end of the next epoch, the LP will have their bond slashed. (0044-LIME-089). For product spot (0044-LIME-0XX) +- If a liquidity provider has `fraction_of_time_on_book` = `0.3`, `market.liquidity.commitmentMinTimeFraction = 0.6`, `market.liquidity.sla.nonPerformanceBondPenaltySlope = 0.7`, `market.liquidity.sla.nonPerformanceBondPenaltyMax = 0.6`and the market parameter change `market.liquidity.commitmentMinTimeFraction = 0.3` is enacted during the epoch then at the end of the current epoch LP will have their bond slashed. If the LP has `fraction_of_time_on_book` = `0.3` at the end of the next epoch, they are meeting their commitment and will not forfeit any of their bond stake. (0044-LIME-088). For product spot (0044-LIME-103) +- If a liquidity provider has `fraction_of_time_on_book` = `0.3`, `market.liquidity.commitmentMinTimeFraction = 0.0`, `market.liquidity.sla.nonPerformanceBondPenaltySlope = 0.7`, `market.liquidity.sla.nonPerformanceBondPenaltyMax = 0.6`and the market parameter change `market.liquidity.commitmentMinTimeFraction = 0.6` is enacted during the epoch then at the end of the current epoch LP will not forfeit any of their bond stake. If the LP has `fraction_of_time_on_book` = `0.3` at the end of the next epoch at the end of the next epoch, the LP will have their bond slashed. (0044-LIME-089). For product spot (0044-LIME-104) - If a liquidity provider has `fraction_of_time_on_book` = `0`, `market.liquidity.commitmentMinTimeFraction = 0.6`, `market.liquidity.sla.nonPerformanceBondPenaltySlope = 0.7`, `market.liquidity.sla.nonPerformanceBondPenaltyMax = 0.6` at the end of an epoch then they will forfeit `60%` of their bond stake, which will be transferred into the market's insurance pool (0044-LIME-015) and in the case of spot markets into the network treasury for the asset (0044-LIME-046) - If a liquidity provider has `fraction_of_time_on_book` = `0`, `market.liquidity.commitmentMinTimeFraction = 0.6`, `market.liquidity.sla.nonPerformanceBondPenaltySlope = 0.2`, `market.liquidity.sla.nonPerformanceBondPenaltyMax = 0.6` at the end of an epoch then they will forfeit `20%` of their bond stake, which will be transferred into the market's insurance pool (0044-LIME-016) and in the case of spot markets into the network treasury for the asset (0044-LIME-047) -- If a liquidity provider with an active liquidity provision at the start of an epoch reduces their liquidity provision staked commitment during the epoch the initial committed level at the start of the epoch will remain in effect until the end of the epoch, at which point the protocol will attempt to reduce the bond to the new level. (0044-LIME-018). For product spot (0044-LIME-0XX) -- If a liquidity provider with an active liquidity provision at the start of an epoch reduces their liquidity provision staked commitment during the epoch the initial committed level at the start of the epoch will remain in effect until the end of the epoch, at which point the protocol will attempt to reduce the bond to the new level. If the reduced level has been changed several times during an epoch, only the latest value will take effect (0044-LIME-019). For product spot (0044-LIME-0XX) -- If a liquidity provider with an active liquidity provision at the start of an epoch reduces their liquidity provision staked commitment during the epoch the initial committed level at the start of the epoch will remain in effect until the end of the epoch, at which point the protocol will attempt to reduce the bond to the new level. If the bond stake has been slashed to a level lower than the amendment, this slashed level will be retained (i.e. the protocol will not attempt to now increase the commitment) (0044-LIME-020). For product spot (0044-LIME-0XX) -- If a liquidity provider with an active liquidity provision at the start of an epoch amends the fee level associated to this commitment during the epoch, this change will only take effect at the end of the epoch. (0044-LIME-021). For product spot (0044-LIME-0XX) -- If a liquidity provider with an active liquidity provision at the start of an epoch increases their liquidity provision staked commitment during the epoch, the amended committed level will take affect immediately and the protocol will attempt to increase the bond to the new level, if they do not have sufficient collateral in the settlement asset of the market to meet new commitment amount then the amendment will be rejected and old commitment amount is retained (0044-LIME-030). For product spot (0044-LIME-0XX) +- If a liquidity provider with an active liquidity provision at the start of an epoch reduces their liquidity provision staked commitment during the epoch the initial committed level at the start of the epoch will remain in effect until the end of the epoch, at which point the protocol will attempt to reduce the bond to the new level. (0044-LIME-018). For product spot (0044-LIME-105) +- If a liquidity provider with an active liquidity provision at the start of an epoch reduces their liquidity provision staked commitment during the epoch the initial committed level at the start of the epoch will remain in effect until the end of the epoch, at which point the protocol will attempt to reduce the bond to the new level. If the reduced level has been changed several times during an epoch, only the latest value will take effect (0044-LIME-019). For product spot (0044-LIME-106) +- If a liquidity provider with an active liquidity provision at the start of an epoch reduces their liquidity provision staked commitment during the epoch the initial committed level at the start of the epoch will remain in effect until the end of the epoch, at which point the protocol will attempt to reduce the bond to the new level. If the bond stake has been slashed to a level lower than the amendment, this slashed level will be retained (i.e. the protocol will not attempt to now increase the commitment) (0044-LIME-020). For product spot (0044-LIME-107) +- If a liquidity provider with an active liquidity provision at the start of an epoch amends the fee level associated to this commitment during the epoch, this change will only take effect at the end of the epoch. (0044-LIME-021). For product spot (0044-LIME-108) +- If a liquidity provider with an active liquidity provision at the start of an epoch increases their liquidity provision staked commitment during the epoch, the amended committed level will take affect immediately and the protocol will attempt to increase the bond to the new level, if they do not have sufficient collateral in the settlement asset of the market to meet new commitment amount then the amendment will be rejected and old commitment amount is retained (0044-LIME-030). For product spot (0044-LIME-109) - If a liquidity provider with an active liquidity provision at the start of an epoch increases their liquidity provision staked commitment during the epoch, the amended committed level will take affect immediately and - - the protocol will increase the bond to the new level if they have sufficient collateral in the settlement asset of the market to meet new commitment amount (0044-LIME-031). For product spot (0044-LIME-0XX) - - at the end of the current epoch rewards / penalties are evaluated based on the balance of the bond account at start of epoch (0044-LIME-049). For product spot (0044-LIME-0XX) + - the protocol will increase the bond to the new level if they have sufficient collateral in the settlement asset of the market to meet new commitment amount (0044-LIME-031). For product spot (0044-LIME-110) + - at the end of the current epoch rewards / penalties are evaluated based on the balance of the bond account at start of epoch (0044-LIME-049). For product spot (0044-LIME-111) -- A liquidity provider who reduces their liquidity provision such that the total stake on the market is still above the target stake after reduction will have no penalty applied and will receive their full reduction in stake back at the end of the epoch. (0044-LIME-022). For product spot (0044-LIME-0XX) +- A liquidity provider who reduces their liquidity provision such that the total stake on the market is still above the target stake after reduction will have no penalty applied and will receive their full reduction in stake back at the end of the epoch. (0044-LIME-022). For product spot (0044-LIME-112) - For a market with `market.liquidity.earlyExitPenalty = 0.25` and `target stake > total stake` already, a liquidity provider who reduces their commitment by `100` will only receive `75` back into their general account with `25` transferred into the market's insurance account. (0044-LIME-023) In the case of spot markets it will be transferred into the network treasury for the asset (0044-LIME-045) - For a market with `market.liquidity.earlyExitPenalty = 0.25` and `total stake = target stake + 40` already, a liquidity provider who reduces their commitment by `100` will receive a total of `85` back into their general account with `15` transferred into the market's insurance account (`40` received without penalty, then the remaining `60` receiving a `25%` penalty). (0044-LIME-024). In the case of spot markets it will be transferred into the network treasury for the asset (0044-LIME-044) @@ -362,19 +362,19 @@ In the case of spot markets it will be transferred into the network treasury for - If an LP with a liquidity provision and active orders on a market cancels their liquidity provision (orders remain active), after the cancellation penalty (if it applies at end of epoch) at the end of the next epoch the LP will not accrue any rewards for trades on the market. (0044-LIME-097) - Consider a market where `market.liquidity.priceRange = 0.05 (5%)` and which is in continuous trading with a mid price of 5. There is an LP who's committed to provide liquidity. They place a buy order at a price of 4.75 and a sell order at a price of 5.25 (with sufficient volume). As the epoch progresses, if the market parameter is altered to `market.liquidity.priceRange = 0.01` (1%), then upon the culmination of the current epoch, the LP will still have fulfilled their committed notional volume, rendering them exempt from a bond penalty. (0044-LIME-091) -- Consider a market, where `market.liquidity.priceRange = 0.05`, and which is in continuous trading with a mid price set at 5. There is an LP who's committed to provide liquidity. They place a buy order at a price of 4.74 and a sell order at a price of 5.25 (with sufficient volume). As the epoch progresses, if the market parameter is altered to `market.liquidity.priceRange = 0.01` (1%), then upon the culmination of the ongoing epoch, the LP will not have met their committed notional volume, resulting in the imposition of a bond penalty. (0044-LIME-093). For product spot (0044-LIME-0XX) +- Consider a market, where `market.liquidity.priceRange = 0.05`, and which is in continuous trading with a mid price set at 5. There is an LP who's committed to provide liquidity. They place a buy order at a price of 4.74 and a sell order at a price of 5.25 (with sufficient volume). As the epoch progresses, if the market parameter is altered to `market.liquidity.priceRange = 0.01` (1%), then upon the culmination of the ongoing epoch, the LP will not have met their committed notional volume, resulting in the imposition of a bond penalty. (0044-LIME-093). For product spot (0044-LIME-113) -- Consider a market, where `market.liquidity.priceRange = 0.05`, and which is in monitoring auction with the last trade price set at 5, the indicative uncrossing price is set at 4. There is an LP who's committed to provide liquidity. They place a buy order at a price of 3.79 (which is less than `5%` of `1-0.05 x min(5, 4) = 3.80`), and a sell order at a price of 5.25 (with sufficient volume). At the end of the epoch, the LP has not fulfilled their committed notional volume, resulting in the imposition of a bond penalty. (0044-LIME-094). For product spot (0044-LIME-0XX) +- Consider a market, where `market.liquidity.priceRange = 0.05`, and which is in monitoring auction with the last trade price set at 5, the indicative uncrossing price is set at 4. There is an LP who's committed to provide liquidity. They place a buy order at a price of 3.79 (which is less than `5%` of `1-0.05 x min(5, 4) = 3.80`), and a sell order at a price of 5.25 (with sufficient volume). At the end of the epoch, the LP has not fulfilled their committed notional volume, resulting in the imposition of a bond penalty. (0044-LIME-094). For product spot (0044-LIME-114) -- Consider a market, where `market.liquidity.priceRange = 0.05`, and which is in monitoring auction with `last trade price` set to `5`, `indicative uncrossing price` is set to `4`. There is a LP who's committed to provide liquidity. They place a buy order at price `3.8` and a sell order at price `5.25` (with sufficient volume). At the end of the epoch, the LP is meeting their committed volume of notional rendering them exempt from a bond penalty. (0044-LIME-095). For product spot (0044-LIME-0XX) +- Consider a market, where `market.liquidity.priceRange = 0.05`, and which is in monitoring auction with `last trade price` set to `5`, `indicative uncrossing price` is set to `4`. There is a LP who's committed to provide liquidity. They place a buy order at price `3.8` and a sell order at price `5.25` (with sufficient volume). At the end of the epoch, the LP is meeting their committed volume of notional rendering them exempt from a bond penalty. (0044-LIME-095). For product spot (0044-LIME-115) -- Consider a market, where `market.liquidity.priceRange = 0.05`, and which is in monitoring auction with `last trade price` set to `5`, `indicative uncrossing price` is set to `6`. There is a LP who's committed to provide liquidity. They place a buy orders at price `4.75` and sell order at price `6.31` (which is larger than `5%` of `1+ 0.05 x max (5, 6) = 6.30`). At the end of the epoch, the LP is not meeting their committed volume of notional, resulting in the imposition of a bond penalty. (0044-LIME-096). For product spot (0044-LIME-0XX) +- Consider a market, where `market.liquidity.priceRange = 0.05`, and which is in monitoring auction with `last trade price` set to `5`, `indicative uncrossing price` is set to `6`. There is a LP who's committed to provide liquidity. They place a buy orders at price `4.75` and sell order at price `6.31` (which is larger than `5%` of `1+ 0.05 x max (5, 6) = 6.30`). At the end of the epoch, the LP is not meeting their committed volume of notional, resulting in the imposition of a bond penalty. (0044-LIME-096). For product spot (0044-LIME-116) -- Consider a market, where `market.liquidity.priceRange = 0.05`, and which is in monitoring auction with `last trade price` set to `5` and we do not have `indicative uncrossing price`. There is a LP who's committed to provide liquidity. They place a buy orders at price `4.74` (which is less than `5%` of `1-0.05 x min(5, n/a) = 4.75`) and sell order at price `5.25`. At the end of the epoch, the LP is not meeting their committed volume of notional, resulting in the imposition of a bond penalty. (0044-LIME-098). For product spot (0044-LIME-0XX) +- Consider a market, where `market.liquidity.priceRange = 0.05`, and which is in monitoring auction with `last trade price` set to `5` and we do not have `indicative uncrossing price`. There is a LP who's committed to provide liquidity. They place a buy orders at price `4.74` (which is less than `5%` of `1-0.05 x min(5, n/a) = 4.75`) and sell order at price `5.25`. At the end of the epoch, the LP is not meeting their committed volume of notional, resulting in the imposition of a bond penalty. (0044-LIME-098). For product spot (0044-LIME-117) -- Consider a market, where `market.liquidity.priceRange = 0.05`, and which is in monitoring auction with `last trade price` set to `5` and we do not have `indicative uncrossing price`. There is a LP who's committed to provide liquidity. They place a buy orders at price `4.75` and sell order at price `5.26` (which is is more than `5%` of `1+ 0.05 x max (5, n/a) = 5.25`). At the end of the epoch, the LP is not meeting their committed volume of notional, resulting in the imposition of a bond penalty. (0044-LIME-099). For product spot (0044-LIME-0XX) +- Consider a market, where `market.liquidity.priceRange = 0.05`, and which is in monitoring auction with `last trade price` set to `5` and we do not have `indicative uncrossing price`. There is a LP who's committed to provide liquidity. They place a buy orders at price `4.75` and sell order at price `5.26` (which is is more than `5%` of `1+ 0.05 x max (5, n/a) = 5.25`). At the end of the epoch, the LP is not meeting their committed volume of notional, resulting in the imposition of a bond penalty. (0044-LIME-099). For product spot (0044-LIME-118) -- Consider a market, where `market.liquidity.priceRange = 0.05`, and which is in monitoring auction with `last trade price` set to `5` and we do not have `indicative uncrossing price`. There is a LP who's committed to provide liquidity. They place a buy orders at price `4.75` and sell order at price `5.25`. At the end of the epoch, the LP is meeting their committed volume of notional rendering them exempt from a bond penalty. (0044-LIME-092). For product spot (0044-LIME-0XX) +- Consider a market, where `market.liquidity.priceRange = 0.05`, and which is in monitoring auction with `last trade price` set to `5` and we do not have `indicative uncrossing price`. There is a LP who's committed to provide liquidity. They place a buy orders at price `4.75` and sell order at price `5.25`. At the end of the epoch, the LP is meeting their committed volume of notional rendering them exempt from a bond penalty. (0044-LIME-092). For product spot (0044-LIME-119) - When the LP increases its commitment and the increment is higher than its general account balance, the increments are rejected, and the old provision persists. (0044-LIME-063). For spot (0044-LIME-064) - When LP decreases its commitment so that $\text{commitment-variation}_i <= \text{maximum-penalty-free-reduction-amount}_i$, then the entire amount by which they decreased their commitment is transferred to their general account, their ELS got updated as per the [ELS calculation](0042-LIQF-setting_fees_and_rewarding_lps.md)(0044-LIME-065). For spot (0044-LIME-066) diff --git a/protocol/features.json b/protocol/features.json index 5f4ed956d..3245fd0bd 100644 --- a/protocol/features.json +++ b/protocol/features.json @@ -243,7 +243,76 @@ "0068-MATC-089", "0068-MATC-090", "0068-MATC-091", - "0068-MATC-092" + "0068-MATC-092", + "0041-TSTK-106", + "0041-TSTK-107", + "0041-TSTK-108", + "0041-TSTK-109", + "0041-TSTK-110", + "0041-TSTK-111", + "0041-TSTK-112", + "0041-TSTK-113", + "0042-LIQF-063", + "0042-LIQF-064", + "0042-LIQF-065", + "0042-LIQF-066", + "0042-LIQF-067", + "0042-LIQF-068", + "0042-LIQF-069", + "0042-LIQF-070", + "0042-LIQF-071", + "0042-LIQF-072", + "0042-LIQF-073", + "0042-LIQF-074", + "0042-LIQF-075", + "0042-LIQF-076", + "0042-LIQF-077", + "0042-LIQF-078", + "0042-LIQF-079", + "0042-LIQF-080", + "0042-LIQF-081", + "0042-LIQF-082", + "0042-LIQF-083", + "0042-LIQF-084", + "0042-LIQF-085", + "0042-LIQF-086", + "0042-LIQF-087", + "0042-LIQF-088", + "0042-LIQF-089", + "0042-LIQF-090", + "0042-LIQF-091", + "0042-LIQF-092", + "0042-LIQF-093", + "0042-LIQF-094", + "0042-LIQF-095", + "0042-LIQF-096", + "0042-LIQF-097", + "0042-LIQF-098", + "0042-LIQF-099", + "0042-LIQF-100", + "0042-LIQF-101", + "0042-LIQF-102", + "0042-LIQF-103", + "0042-LIQF-104", + "0042-LIQF-105", + "0044-LIME-102", + "0044-LIME-103", + "0044-LIME-104", + "0044-LIME-105", + "0044-LIME-106", + "0044-LIME-107", + "0044-LIME-108", + "0044-LIME-109", + "0044-LIME-110", + "0044-LIME-111", + "0044-LIME-112", + "0044-LIME-113", + "0044-LIME-114", + "0044-LIME-115", + "0044-LIME-116", + "0044-LIME-117", + "0044-LIME-118", + "0044-LIME-119" ] }, "Spot stretch": { @@ -378,6 +447,87 @@ "milestone": "colosseo", "acs": ["0043-MKTL-011"] }, + "Spot stop orders": { + "milestone": "colosseo", + "acs": [ + "0014-ORDT-124", + "0014-ORDT-125", + "0014-ORDT-126", + "0014-ORDT-127", + "0014-ORDT-128", + "0014-ORDT-129", + "0014-ORDT-130", + "0014-ORDT-131", + "0014-ORDT-132", + "0014-ORDT-133", + "0014-ORDT-134", + "0014-ORDT-135", + "0014-ORDT-136", + "0014-ORDT-137", + "0014-ORDT-138", + "0014-ORDT-139", + "0014-ORDT-140", + "0014-ORDT-141", + "0014-ORDT-142", + "0014-ORDT-143", + "0014-ORDT-144", + "0014-ORDT-145", + "0014-ORDT-146", + "0014-ORDT-147", + "0014-ORDT-148", + "0014-ORDT-149", + "0014-ORDT-150", + "0014-ORDT-151", + "0014-ORDT-152", + "0014-ORDT-153", + "0014-ORDT-154", + "0014-ORDT-155", + "0014-ORDT-156", + "0014-ORDT-157", + "0014-ORDT-158", + "0014-ORDT-159", + "0014-ORDT-160", + "0014-ORDT-161", + "0014-ORDT-162", + "0014-ORDT-163", + "0014-ORDT-164", + ] + }, + "spot ammend": { + "milestone": "colosseo", + "acs": [ + "0037-OPEG-019", + "0004-AMND-030", + "0004-AMND-031", + "0004-AMND-032", + "0004-AMND-033", + "0004-AMND-034", + "0004-AMND-035", + "0004-AMND-036", + "0004-AMND-037", + "0004-AMND-038", + "0004-AMND-039", + "0004-AMND-040", + "0004-AMND-041", + "0004-AMND-042", + "0004-AMND-043", + "0004-AMND-044", + "0004-AMND-045", + "0004-AMND-046", + "0004-AMND-047", + "0004-AMND-048", + "0004-AMND-049", + "0004-AMND-050", + "0004-AMND-051", + "0004-AMND-052", + "0004-AMND-053", + "0004-AMND-054", + "0004-AMND-055", + "0011-MARA-018", + "0011-MARA-019" + ] + } +}, "Unknown": { "milestone": "unknown", "acs": []