Skip to content

Commit

Permalink
Merge pull request #1137 from oraidex/hot_fix/increase_compute_price
Browse files Browse the repository at this point in the history
Hot fix/increase compute price
  • Loading branch information
perfogic authored Jan 18, 2025
2 parents 1fc027e + 4ebdb2c commit c71f1cd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/program/web3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class Web3SolanaProgramInteraction {
const parsedAmount = toAmount(tokenAmountRaw, token.decimals);

const updateCpIx = ComputeBudgetProgram.setComputeUnitPrice({
microLamports: 1_000_000
microLamports: 10_000_000
});
const updateCuIx = ComputeBudgetProgram.setComputeUnitLimit({
units: 500_000
Expand Down Expand Up @@ -98,6 +98,13 @@ export class Web3SolanaProgramInteraction {
);
} else {
const lamportsToSend = tokenAmountRaw * LAMPORTS_PER_SOL;
const updateCpIx = ComputeBudgetProgram.setComputeUnitPrice({
microLamports: 10_000_000
});
const updateCuIx = ComputeBudgetProgram.setComputeUnitLimit({
units: 500_000
});
transaction.add(updateCpIx, updateCuIx);
const transferTransaction = transaction.add(
SystemProgram.transfer({
fromPubkey: wallet.publicKey,
Expand Down

0 comments on commit c71f1cd

Please sign in to comment.