File tree Expand file tree Collapse file tree 4 files changed +21
-4
lines changed Expand file tree Collapse file tree 4 files changed +21
-4
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @pythnetwork/price-pusher" ,
3
- "version" : " 5.4.11 " ,
3
+ "version" : " 5.5.0 " ,
4
4
"description" : " Pyth Price Pusher" ,
5
5
"homepage" : " https://pyth.network" ,
6
6
"main" : " lib/index.js" ,
Original file line number Diff line number Diff line change @@ -36,11 +36,22 @@ export default {
36
36
} as Options ,
37
37
"override-gas-price-multiplier" : {
38
38
description :
39
- "Multiply the gas price by this number if the transaction is not landing to override it. Default to 1.1" ,
39
+ "Multiply the previous gas price by this number if the transaction is not landing to override. " +
40
+ "Please note that the gas price can grow exponentially on consecutive failures; " +
41
+ "to set a cap on the multiplier, use the `override-gas-price-multiplier-cap` option." +
42
+ "Default to 1.1" ,
40
43
type : "number" ,
41
44
required : false ,
42
45
default : 1.1 ,
43
46
} as Options ,
47
+ "override-gas-price-multiplier-cap" : {
48
+ description :
49
+ "Maximum gas price multiplier to use in override compared to the RPC returned " +
50
+ "gas price. Default to 5" ,
51
+ type : "number" ,
52
+ required : false ,
53
+ default : 5 ,
54
+ } as Options ,
44
55
...options . priceConfigFile ,
45
56
...options . priceServiceEndpoint ,
46
57
...options . mnemonicFile ,
@@ -61,6 +72,7 @@ export default {
61
72
customGasStation,
62
73
txSpeed,
63
74
overrideGasPriceMultiplier,
75
+ overrideGasPriceMultiplierCap,
64
76
} = argv ;
65
77
66
78
const priceConfigs = readPriceConfigFile ( priceConfigFile ) ;
@@ -106,6 +118,7 @@ export default {
106
118
priceServiceConnection ,
107
119
pythContractFactory ,
108
120
overrideGasPriceMultiplier ,
121
+ overrideGasPriceMultiplierCap ,
109
122
gasStation
110
123
) ;
111
124
Original file line number Diff line number Diff line change @@ -129,6 +129,7 @@ export class EvmPricePusher implements IPricePusher {
129
129
private connection : PriceServiceConnection ,
130
130
pythContractFactory : PythContractFactory ,
131
131
private overrideGasPriceMultiplier : number ,
132
+ private overrideGasPriceMultiplierCap : number ,
132
133
customGasStation ?: CustomGasStation
133
134
) {
134
135
this . customGasStation = customGasStation ;
@@ -200,7 +201,10 @@ export class EvmPricePusher implements IPricePusher {
200
201
}
201
202
202
203
if ( gasPriceToOverride !== undefined && gasPriceToOverride > gasPrice ) {
203
- gasPrice = gasPriceToOverride ;
204
+ gasPrice = Math . min (
205
+ gasPriceToOverride ,
206
+ gasPrice * this . overrideGasPriceMultiplierCap
207
+ ) ;
204
208
}
205
209
206
210
const txNonce = lastExecutedNonce + 1 ;
You can’t perform that action at this time.
0 commit comments