Compare commits

..

2 Commits

Author SHA1 Message Date
08635da692
Add built files for test 2024-11-21 13:03:30 +00:00
bef587cc1a
Remove broken external oracle and fixed EIP-1559 gasPrice calculation
* Updated 1inch Oracle link and use multicall3 ( because this is the only contract supported on sepolia )
* Simplify EIP-1559 gasPrice calculation ( EIP-1559 removes necessity of using external oracles, just enough premium of basefee will ensure transaction being mined )
* Apply respective premium for fees ( Only applied on V6 Oracle class )
* Removed @tornado/gas-price-oracle oracle
2024-11-21 13:01:45 +00:00
3 changed files with 8 additions and 8 deletions

View File

@ -14,12 +14,12 @@ export declare class TornadoFeeOracleV6 extends TornadoFeeOracle implements ITor
*/ */
getGasLimit(tx?: TransactionData, type?: TxType, bumpPercent?: number): Promise<number>; getGasLimit(tx?: TransactionData, type?: TxType, bumpPercent?: number): Promise<number>;
/** /**
* Apply static 50% gasPrice premium for EIP-1559 enabled networks * Apply static 30% gasPrice premium for EIP-1559 enabled networks
* *
* Because Tornado Transactions are censored from block builders * Because Tornado Transactions are censored from block builders
* it would take some time to be confirmed after when the transaction is broadcasted. * it would take some time to be confirmed after when the transaction is broadcasted.
* *
* We apply 50% premium to combat basefee spike (ethers.js uses 100% premium by default) * We apply 30% premium and 56% overall premium to combat basefee spike
* (Can spike 12.5% per block accoring to the EIP-1559 metrics https://metamask.io/1559/) * (Can spike 12.5% per block accoring to the EIP-1559 metrics https://metamask.io/1559/)
*/ */
getGasPriceParams(speed?: LegacyGasPriceKey, bumpPercent?: number): Promise<GasPriceParams>; getGasPriceParams(speed?: LegacyGasPriceKey, bumpPercent?: number): Promise<GasPriceParams>;

View File

@ -91,12 +91,12 @@ var TornadoFeeOracleV6 = /** @class */ (function (_super) {
}); });
}; };
/** /**
* Apply static 50% gasPrice premium for EIP-1559 enabled networks * Apply static 30% gasPrice premium for EIP-1559 enabled networks
* *
* Because Tornado Transactions are censored from block builders * Because Tornado Transactions are censored from block builders
* it would take some time to be confirmed after when the transaction is broadcasted. * it would take some time to be confirmed after when the transaction is broadcasted.
* *
* We apply 50% premium to combat basefee spike (ethers.js uses 100% premium by default) * We apply 30% premium and 56% overall premium to combat basefee spike
* (Can spike 12.5% per block accoring to the EIP-1559 metrics https://metamask.io/1559/) * (Can spike 12.5% per block accoring to the EIP-1559 metrics https://metamask.io/1559/)
*/ */
TornadoFeeOracleV6.prototype.getGasPriceParams = function (speed, bumpPercent) { TornadoFeeOracleV6.prototype.getGasPriceParams = function (speed, bumpPercent) {
@ -106,7 +106,7 @@ var TornadoFeeOracleV6 = /** @class */ (function (_super) {
return [2 /*return*/, this.overrideGasPrice]; return [2 /*return*/, this.overrideGasPrice];
} }
if (typeof bumpPercent === 'undefined') { if (typeof bumpPercent === 'undefined') {
bumpPercent = this.chainId === config_1.ChainId.BSC ? undefined : 50; bumpPercent = this.chainId === config_1.ChainId.BSC ? undefined : 30;
} }
return [2 /*return*/, _super.prototype.getGasPriceParams.call(this, speed, bumpPercent)]; return [2 /*return*/, _super.prototype.getGasPriceParams.call(this, speed, bumpPercent)];
}); });

View File

@ -40,12 +40,12 @@ export class TornadoFeeOracleV6 extends TornadoFeeOracle implements ITornadoFeeO
} }
/** /**
* Apply static 50% gasPrice premium for EIP-1559 enabled networks * Apply static 30% gasPrice premium for EIP-1559 enabled networks
* *
* Because Tornado Transactions are censored from block builders * Because Tornado Transactions are censored from block builders
* it would take some time to be confirmed after when the transaction is broadcasted. * it would take some time to be confirmed after when the transaction is broadcasted.
* *
* We apply 50% premium to combat basefee spike (ethers.js uses 100% premium by default) * We apply 30% premium and 56% overall premium to combat basefee spike
* (Can spike 12.5% per block accoring to the EIP-1559 metrics https://metamask.io/1559/) * (Can spike 12.5% per block accoring to the EIP-1559 metrics https://metamask.io/1559/)
*/ */
async getGasPriceParams(speed?: LegacyGasPriceKey, bumpPercent?: number): Promise<GasPriceParams> { async getGasPriceParams(speed?: LegacyGasPriceKey, bumpPercent?: number): Promise<GasPriceParams> {
@ -53,7 +53,7 @@ export class TornadoFeeOracleV6 extends TornadoFeeOracle implements ITornadoFeeO
return this.overrideGasPrice; return this.overrideGasPrice;
} }
if (typeof bumpPercent === 'undefined') { if (typeof bumpPercent === 'undefined') {
bumpPercent = this.chainId === ChainId.BSC ? undefined : 50; bumpPercent = this.chainId === ChainId.BSC ? undefined : 30;
} }
return super.getGasPriceParams(speed, bumpPercent); return super.getGasPriceParams(speed, bumpPercent);
} }