You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A side-car process that Juno validators must run in order to provide Juno's on-chain price oracle with price information.
4
+
5
+
A side-car process that Juno validators must run in order to provide Juno's on-chain price oracle with price information.
5
6
6
7
The ```price-feeder``` tool are based on Terra's [x/oracle](https://github.com/terra-money/classic-core/tree/main/x/oracle) module and [oracle-feeder](https://github.com/terra-money/oracle-feeder).
7
8
8
-
## Overview:
9
+
## Overview
9
10
10
11
Juno ```price-feeder``` includes 2 components:
12
+
11
13
- PriceFeeder: responsible for obtaining price information from various reliable data sources, e.g. exchanges, and exposing this data via an API.
12
14
- PriceOracle: consumes this data and periodically submits vote and prevote messages following the oracle voting procedure.
13
15
14
-
When ``PriceOracle`` start, it loops a process called ``Tick`` with 1000 milisecond interval.
16
+
When ``PriceOracle`` start, it loops a process called ``Tick`` with 1000 milisecond interval.
17
+
18
+
## ```Tick``` process in detail
15
19
16
-
## ```Tick``` process in detail:
17
20
1. GetParamCache: Get the latest parameters in x/oracle
18
-
2. SetPrices: Retrieve all the prices and candles from our set of providers as determined in the config. Calculate TVWAP or VWAP prices, warns missing prices, and filters out any faulty providers.
21
+
2. SetPrices: Retrieve all the prices and candles from our set of providers as determined in the config. Calculate TVWAP or VWAP prices, warns missing prices, and filters out any faulty providers.
19
22
3. Vote/Prevote exchangeRate.
20
23
21
-
## ```SetPrices``` in detail:
24
+
## ```SetPrices``` in detail
25
+
22
26
1. Get all price providers
23
27
2. Collect prices from providers and set prices to local var.
24
28
3. Compute the prices and save it to ``oracle.prices``.
25
29
- Convert any non-USD denominated candles into USD
26
30
- Filter out any erroneous candles
27
31
28
-
- ComputeTvwapsByProvider and ComputeTVWAP.
29
-
- Check if tvwapPrices available, else use recent prices & VWAP instead.
30
-
- ConvertTickersToUSD and FilterTickerDeviations.
31
-
- ComputeVWAP.
32
+
- ComputeTvwapsByProvider and ComputeTVWAP.
33
+
- Check if tvwapPrices available, else use recent prices & VWAP instead.
TWAP is the average price of a financial asset over a certain period of time. The time period is chosen by the trader based on the market analysis and trading strategy adopted. TWAPs are normally used to execute large-volume trades in smaller chunks without disturbing the market. Large-scale institutional traders track TWAP values and trade by dividing their orders into smaller parts to try and keep their orders as close to TWAP values as possible.
66
71
67
-
TWAP benefits:
72
+
TWAP benefits:
73
+
68
74
- Lower likelihood of causing asset price volatility when placing large orders
69
75
- Ability to hide your market strategy from other large-volume traders
70
76
- Good strategy for those who prefer trading by placing frequent daily orders
71
77
- Applicability to algorithmic trading strategies
72
78
73
-
TWAP limitations:
79
+
TWAP limitations:
80
+
74
81
- The TWAP formula concentrates on asset prices only and fails to take into account trading volumes.
75
82
- Limited applicability to the needs of smaller-scale traders
76
83
77
-
VWAP is a mechanism used to calculate the price of an asset by taking price data from multiple trading environments and weighting each price by the amount of volume on each liquid market an asset is trading on. The VWAP calculation methodology is also used more broadly across finance as a technical indicator for traders, an order option offered by brokers or exchanges, and a benchmark.
84
+
VWAP is a mechanism used to calculate the price of an asset by taking price data from multiple trading environments and weighting each price by the amount of volume on each liquid market an asset is trading on. The VWAP calculation methodology is also used more broadly across finance as a technical indicator for traders, an order option offered by brokers or exchanges, and a benchmark.
78
85
79
86
VWAP benefits:
87
+
80
88
- Market Coverage.
81
89
- Highly Accurate and Fresh Data
82
90
- Manipulation-Resistant
83
91
84
-
VWAP limitations:
92
+
VWAP limitations:
93
+
85
94
- inaccurate or misleading for large orders that require many days to fill.
86
95
- can be used to manipulate trading by placing trades only when market prices are at levels favorable with VWAP
87
96
- not account for opportunity cost.
88
97
89
-
TVWAP formula is a new mechanism used to weight volume based on timestamp within the 5 min period. It's a variant of VWAP formula. The main difference between TVWAP and VWAP is that TVWAP shrinks the volume based on candle's timestamp, the further the timestamp count, the more volume will be shrink. VWAP is a measurement that shows the average price of an asset in a period of time, while TVWAP is a measurement that shows the average price of an asset in a period of time with a favor based on timestamp of data.
98
+
TVWAP formula is a new mechanism used to weight volume based on timestamp within the 5 min period. It's a variant of VWAP formula. The main difference between TVWAP and VWAP is that TVWAP shrinks the volume based on candle's timestamp, the further the timestamp count, the more volume will be shrink. VWAP is a measurement that shows the average price of an asset in a period of time, while TVWAP is a measurement that shows the average price of an asset in a period of time with a favor based on timestamp of data.
0 commit comments