diff --git a/src/chains/solana/solana.config.ts b/src/chains/solana/solana.config.ts index 52beab31d3..9090a23abe 100644 --- a/src/chains/solana/solana.config.ts +++ b/src/chains/solana/solana.config.ts @@ -11,7 +11,7 @@ interface NetworkConfig { export interface Config { network: NetworkConfig; defaultComputeUnits: number; - priorityFeePercentile: number; + basePriorityFeePct: number; priorityFeeMultiplier: number; maxPriorityFee: number; minPriorityFee: number; @@ -42,8 +42,8 @@ export function getSolanaConfig( defaultComputeUnits: ConfigManagerV2.getInstance().get( chainName + '.defaultComputeUnits' ), - priorityFeePercentile: ConfigManagerV2.getInstance().get( - chainName + '.priorityFeePercentile' + basePriorityFeePct: ConfigManagerV2.getInstance().get( + chainName + '.basePriorityFeePct' ), priorityFeeMultiplier: ConfigManagerV2.getInstance().get( chainName + '.priorityFeeMultiplier' diff --git a/src/chains/solana/solana.ts b/src/chains/solana/solana.ts index 9704ef04ff..90032d1077 100644 --- a/src/chains/solana/solana.ts +++ b/src/chains/solana/solana.ts @@ -470,14 +470,14 @@ export class Solana { logger.info(`[SOLANA] Recent priority fees paid: ${minFee.toFixed(4)} - ${maxFee.toFixed(4)} lamports/CU (avg: ${averageFee.toFixed(4)})`); // Calculate index for percentile - const percentileIndex = Math.ceil(fees.length * this.config.priorityFeePercentile); + const percentileIndex = Math.ceil(fees.length * this.config.basePriorityFeePct / 100); let basePriorityFee = fees[percentileIndex - 1] / 1_000_000; // Convert to lamports // Ensure fee is not below minimum (convert SOL to lamports) const minimumFeeLamports = Math.floor(this.config.minPriorityFee * 1e9 / this.config.defaultComputeUnits); basePriorityFee = Math.max(basePriorityFee, minimumFeeLamports); - logger.info(`[SOLANA] Base priority fee: ${basePriorityFee.toFixed(4)} lamports/CU (${basePriorityFee === minimumFeeLamports ? 'minimum' : `${this.config.priorityFeePercentile * 100}th percentile`})`); + logger.info(`[SOLANA] Base priority fee: ${basePriorityFee.toFixed(4)} lamports/CU (${basePriorityFee === minimumFeeLamports ? 'minimum' : `${this.config.basePriorityFeePct}th percentile`})`); // Cache the result Solana.lastPriorityFeeEstimate = { diff --git a/src/services/schema/solana-schema.json b/src/services/schema/solana-schema.json index fede9710c8..887b71addf 100644 --- a/src/services/schema/solana-schema.json +++ b/src/services/schema/solana-schema.json @@ -26,7 +26,7 @@ }, "network": { "type": "string" }, "defaultComputeUnits": { "type": "number" }, - "priorityFeePercentile": { "type": "number" }, + "basePriorityFeePct": { "type": "number" }, "priorityFeeMultiplier": { "type": "number" }, "maxPriorityFee": { "type": "number" }, "minPriorityFee": { "type": "number" }, diff --git a/src/templates/solana.yml b/src/templates/solana.yml index 9c08c2d391..eb57a81fd6 100644 --- a/src/templates/solana.yml +++ b/src/templates/solana.yml @@ -14,7 +14,7 @@ networks: defaultComputeUnits: 200000 # Floor percentile of recent priority fee samples used to estimate gasPrice for a transaction -priorityFeePercentile: 0.75 +basePriorityFeePct: 75 # Multiplier for increasing priority fee on retry priorityFeeMultiplier: 2