From 1470c97a6e13b658e9b3e0302873c70e2aec98ff Mon Sep 17 00:00:00 2001 From: Charlie <99198652+cdummett@users.noreply.github.com> Date: Mon, 29 Jul 2024 11:00:48 +0100 Subject: [PATCH] Revert "feat: average notional position" (#2320) --- protocol/0056-REWA-rewards_overview.md | 35 ++++++++++++-------------- protocol/features.json | 9 +------ 2 files changed, 17 insertions(+), 27 deletions(-) diff --git a/protocol/0056-REWA-rewards_overview.md b/protocol/0056-REWA-rewards_overview.md index e8d2ef2cc..be16e7a87 100644 --- a/protocol/0056-REWA-rewards_overview.md +++ b/protocol/0056-REWA-rewards_overview.md @@ -73,36 +73,35 @@ If the reward account balance is `0` at the end of the epoch for a given recurri Note, trading fees paid or received on Spot markets will contribute to fee-based reward metrics. -### Average notional position metric +### Average position metric -The average notional position metric, $m_{ap}$, measures each parties time-weighted average notional position over a number of epochs. +The average position metric, $m_{ap}$, measures each parties time-weighted average position over a number of epochs. -At the start of each epoch, the network must reset each parties time weighted average notional position for the epoch ($\bar{P}$) to `0`. Whenever a parties position changes during an epoch, **and** at the end of the epoch, this value should be updated as follows. Note, to reduce computation the tracker is not updated on every mark price update, only on trades involving the relevant party. +At the start of each epoch, the network must reset each parties time weighted average position for the epoch ($\bar{P}$) to `0`. Whenever a parties position changes during an epoch, **and** at the end of the epoch, this value should be updated as follows. Let: -- $\bar{P}$ be the parties time weighted average notional position in the epoch so far -- $P_{n}$ be the parties notional position before their position changed +- $\bar{P}$ be the parties time weighted average position in the epoch so far +- $P_{n}$ be the parties position before their position changed - $t_{n}$ be the time the party held the previous position in seconds - $t$ be the amount of time elapsed in the current epoch so far -- $S$ be the current mark price. -$$\bar{P} \leftarrow \bar{P} \cdot \left(1 - \frac{t_{n}}{t}\right) + S \cdot \frac{|P_{n}| \cdot t_{n}}{t}$$ +$$\bar{P} \leftarrow \bar{P} \cdot \left(1 - \frac{t_{n}}{t}\right) + \frac{|P_{n}| \cdot t_{n}}{t}$$ -At the end of the epoch, the network must store the parties time weighted average notional position and then calculate their average position reward metric as follows. +At the end of the epoch, the network must store the parties time weighted average position and then calculate their average position reward metric as follows. Let: -- $m_{ap}$ be the parties average notional position reward metric -- $\bar{P_{i}}$ be the parties time weighted average notional position in the $i$-th epoch +- $m_{ap}$ be the parties average position reward metric +- $\bar{P_{i}}$ be the parties time weighted average position in the $i$-th epoch - $N$ be the window length specified in the recurring transfer. $$m_{ap} = \frac{\sum_{i}^{n}\bar{P_{i}}}{N}$$ ### Relative return metric -The relative return metric, $m_{rr}$, measures each parties average relative return, weighted by their time-weighted average position, over a number of epochs. +The relative return metric, $m_{rr}$, measures each parties average relative return, weighted by their [time-weighted average position](#average-position-metric), over a number of epochs. At the end of each epoch, the network must calculate and store the parties relative returns as follows. @@ -1043,14 +1042,12 @@ At the end of epoch 2, 10000 VEGA rewards should be distributed to the `ETHUSDT` ### Average Position -- If an eligible party opens a position at the beginning of the epoch, and the mark price does **not** change during the epoch, their average notional position reward metric should be equal to the notional value of the position at the end of the epoch (0056-REWA-171). -- If an eligible party opens a position at the beginning of the epoch, and the price changes during the epoch, their average notional position reward metric should be set equal to the notional value of the position at the end of the epoch (0056-REWA-172). -- If an eligible party held an open position at the start of the epoch, and the mark price does **not** change during the epoch, their average notional position reward metric should be equal to the notional value of the position at the end of the epoch (0056-REWA-173). -- If an eligible party held an open position at the start of the epoch, and the mark price does change during the epoch, their average notional position reward metric should be equal to the notional value of the position at the end of the epoch (0056-REWA-174). -- If an eligible party opens a position half way through the epoch, their average notional position reward metric should be half the notional value of the position at the end of the epoch (0056-REWA-175). -- If an eligible party held an open position at the start of the epoch and closes it half-way through the epoch, their average notional position reward metric should be equal to half the notional value of the position at the point they closed their position (0056-REWA-176). -- If an eligible party held positions in multiple in-scope markets, their average notional position reward metric should be the sum of their time-weighted-average-notional-position in each market (0056-REWA-177). -- If a `window_length>1` is specified in the recurring transfer, an eligible parties average notional position reward metric should be the average of their reward metrics over the last `window_length` epochs (0056-REWA-178). +- If an eligible party opens a position at the beginning of the epoch, their average position reward metric should be equal to the size of the position at the end of the epoch (0056-REWA-078). +- If an eligible party held an open position at the start of the epoch, their average position reward metric should be equal to the size of the position at the end of the epoch (0056-REWA-079). +- If an eligible party opens a position half way through the epoch, their average position reward metric should be half the size of the position at the end of the epoch (0056-REWA-080). +- If an eligible party held an open position at the start of the epoch and closes it half-way through the epoch, their average position reward metric should be equal to the size of that position at the end of the epoch (0056-REWA-081). +- If an eligible party held positions in multiple in-scope markets, their average position reward metric should be the sum of the size of their time-weighted-average-position in each market (0056-REWA-082). +- If a `window_length>1` is specified in the recurring transfer, an eligible parties average position reward metric should be the average of their reward metrics over the last `window_length` epochs (0056-REWA-083). ### Relative returns diff --git a/protocol/features.json b/protocol/features.json index 5dfb0239a..1919df01e 100644 --- a/protocol/features.json +++ b/protocol/features.json @@ -270,14 +270,7 @@ "0057-TRAN-076", "0057-TRAN-077", "0057-TRAN-078", - "0056-REWA-171", - "0056-REWA-172", - "0056-REWA-173", - "0056-REWA-174", - "0056-REWA-175", - "0056-REWA-176", - "0056-REWA-177", - "0056-REWA-178" + "0057-TRAN-079" ] }, "Capped Futures": {