Skip to content

Commit 59481b6

Browse files
authored
Bugfix/claim compute (#219)
* fix claims * remove unneeded logic
1 parent 5df3f1e commit 59481b6

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/components/PositionManager/PositionManager.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,9 @@ export const PositionManager: FC<PositionManagerProps> = ({
277277
try {
278278
await claimPositionRewards({
279279
position,
280-
onInstructions: onInstructions(provider),
280+
onInstructions: onInstructions(provider, {
281+
useFirstEstimateForAll: true,
282+
}),
281283
});
282284

283285
toast("Rewards claimed");

src/components/Positions.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ export const Positions: FC = () => {
9898
try {
9999
await claimAllPositionsRewards({
100100
positions: positionsWithRewards,
101-
onInstructions: onInstructions(provider),
101+
onInstructions: onInstructions(provider, {
102+
useFirstEstimateForAll: true,
103+
}),
102104
});
103105

104106
toast("Rewards claimed!");

src/lib/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ export const onInstructions =
302302
) =>
303303
async (instructions: TransactionInstruction[], sigs?: Keypair[]) => {
304304
if (provider) {
305-
const computeScaleUp = useFirstEstimateForAll ? 1.6 : 1.2;
305+
const computeScaleUp = useFirstEstimateForAll ? 1.4 : 1.2;
306306

307307
if (sigs) {
308308
const transactions = await batchInstructionsToTxsWithPriorityFee(

0 commit comments

Comments
 (0)