Skip to content

Commit

Permalink
Merge pull request #2219 from vegaprotocol/feat/updates_for_spot
Browse files Browse the repository at this point in the history
feat: update spot spec with palazzo and colosseo features
  • Loading branch information
Jiajia-Cui authored Mar 25, 2024
2 parents a54eef3 + f409bc1 commit a954635
Show file tree
Hide file tree
Showing 6 changed files with 255 additions and 93 deletions.
89 changes: 49 additions & 40 deletions protocol/0014-ORDT-order_types.md

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions protocol/0041-TSTK-target_stake.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Example 3: if `market.stake.target.scalingFactor = 10`, `rf = 0.004` and `max_oi

## Target stake for spot markets

See [spot market spec](0080-SPOT-product_builtin_spot.md).3600s
See [spot market spec](0080-SPOT-product_builtin_spot.md).

The target stake of a market is calculated as a fraction of the maximum `total_stake` over a rolling time window. The fraction is controlled by the parameter `scaling_factor` and the length of the window is controlled by the parameter `time_window`.

Expand All @@ -93,4 +93,11 @@ The above design ensures the `target_stake` of a market is unable to fluctuate d

### Acceptance criteria

Too be decided.
- 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`. (<a name="0041-TSTK-106" href="#0041-TSTK-106">0041-TSTK-106</a>)
- 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`. (<a name="0041-TSTK-107" href="#0041-TSTK-107">0041-TSTK-107</a>)
- 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`. (<a name="0041-TSTK-108" href="#0041-TSTK-108">0041-TSTK-108</a>)
- For a spot market, given a LP increases their commitment, the target stake should increase to reflect that change. (<a name="0041-TSTK-109" href="#0041-TSTK-109">0041-TSTK-109</a>)
- 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.(<a name="0041-TSTK-110" href="#0041-TSTK-110">0041-TSTK-110</a>)
- For a spot market, change of `market.stake.target.scalingFactor` will immediately change the target stake. (<a name="0041-TSTK-111" href="#0041-TSTK-111">0041-TSTK-111</a>)
- 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 (<a name="0041-TSTK-112" href="#0041-TSTK-112">0041-TSTK-112</a>)
- 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 (<a name="0041-TSTK-113" href="#0041-TSTK-113">0041-TSTK-113</a>)
Loading

0 comments on commit a954635

Please sign in to comment.