File tree Expand file tree Collapse file tree 5 files changed +17
-18
lines changed Expand file tree Collapse file tree 5 files changed +17
-18
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ It then pushes a price update to an on-chain Pyth contract if any of the followi
27
27
- Price deviation: The latest Pyth price feed has changed more than ` price_deviation ` percent
28
28
from the on-chain price feed price.
29
29
- Confidence ratio: The latest Pyth price feed has confidence to price ratio of more than
30
- ` confidence_ratio ` .
30
+ ` confidence_ratio ` . * We discourage using low values for this because it triggers push for every update in high confidence periods. *
31
31
32
32
The parameters above are configured per price feed in a price configuration YAML file. The structure looks like this:
33
33
@@ -36,7 +36,7 @@ The parameters above are configured per price feed in a price configuration YAML
36
36
id : 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef # id of a price feed, a 32-byte hex string.
37
37
time_difference : 60 # Time difference threshold (in seconds) to push a newer price feed.
38
38
price_deviation : 0.5 # The price deviation (%) threshold to push a newer price feed.
39
- confidence_ratio : 1 # The confidence/price (%) threshold to push a newer price feed.
39
+ confidence_ratio : 50 # The confidence/price (%) threshold to push a newer price feed.
40
40
41
41
# Optional block to configure whether this feed can be early updated. If at least one feed meets the
42
42
# triggering conditions above, all other feeds who meet the early update conditions will be included in
@@ -46,7 +46,7 @@ The parameters above are configured per price feed in a price configuration YAML
46
46
early_update :
47
47
time_difference : 30
48
48
price_deviation : 0.1
49
- confidence_ratio : 0. 5
49
+ confidence_ratio : 5
50
50
- ...
51
51
` ` `
52
52
@@ -65,7 +65,7 @@ the feed.
65
65
early_update:
66
66
time_difference: 30
67
67
price_deviation: 0.1
68
- confidence_ratio: 0. 5
68
+ confidence_ratio: 5
69
69
` ` `
70
70
71
71
Two sample YAML configuration files are available in the root of this repo.
Original file line number Diff line number Diff line change 2
2
id : f9c0172ba10dfa4d19088d94f5bf61d3b54d5bd7483a322a982e1373ee8ea31b
3
3
time_difference : 60
4
4
price_deviation : 0.5
5
- confidence_ratio : 1
5
+ confidence_ratio : 100
6
6
- alias : BNB/USD
7
7
id : ecf553770d9b10965f8fb64771e93f5690a182edc32be4a3236e0caaa6e0581a
8
8
time_difference : 60
9
9
price_deviation : 1
10
- confidence_ratio : 1
10
+ confidence_ratio : 100
11
11
early_update :
12
12
time_difference : 30
13
13
price_deviation : 0.5
14
- confidence_ratio : 0.1
14
+ confidence_ratio : 10
Original file line number Diff line number Diff line change 2
2
id : e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43
3
3
time_difference : 60
4
4
price_deviation : 0.5
5
- confidence_ratio : 1
5
+ confidence_ratio : 100
6
6
- alias : BNB/USD
7
7
id : 2f95862b045670cd22bee3114c39763a4a08beeb663b145d283c31d7d1101c4f
8
8
time_difference : 60
9
9
price_deviation : 1
10
- confidence_ratio : 1
10
+ confidence_ratio : 100
11
11
early_update :
12
12
time_difference : 30
13
13
price_deviation : 0.5
14
- confidence_ratio : 0.1
14
+ confidence_ratio : 10
15
15
- alias : PYTH/USD
16
16
id : 0bbf28e9a841a1cc788f6a361b17ca072d0ea3098a1e5df1c3922d06719579ff
17
17
time_difference : 60
18
18
price_deviation : 0.5
19
- confidence_ratio : 1
19
+ confidence_ratio : 100
Original file line number Diff line number Diff line change @@ -110,7 +110,6 @@ export default {
110
110
enableMetrics,
111
111
metricsPort,
112
112
} = argv ;
113
- console . log ( "***** priceServiceEndpoint *****" , priceServiceEndpoint ) ;
114
113
115
114
const logger = pino ( {
116
115
level : logLevel ,
Original file line number Diff line number Diff line change @@ -235,6 +235,12 @@ export class EvmPricePusher implements IPricePusher {
235
235
236
236
const priceIdsWith0x = priceIds . map ( ( priceId ) => addLeading0x ( priceId ) ) ;
237
237
238
+ // Update lastAttempt
239
+ this . lastPushAttempt = {
240
+ nonce : txNonce ,
241
+ gasPrice : gasPrice ,
242
+ } ;
243
+
238
244
try {
239
245
const { request } =
240
246
await this . pythContract . simulate . updatePriceFeedsIfNecessary (
@@ -383,12 +389,6 @@ export class EvmPricePusher implements IPricePusher {
383
389
) ;
384
390
throw err ;
385
391
}
386
-
387
- // Update lastAttempt
388
- this . lastPushAttempt = {
389
- nonce : txNonce ,
390
- gasPrice : gasPrice ,
391
- } ;
392
392
}
393
393
394
394
private async waitForTransactionReceipt ( hash : `0x${string } `) : Promise < void > {
You can’t perform that action at this time.
0 commit comments