Commit e60355b
authored
Bump deps and improve getRecentPriorityFee for Orca (#68)
* Add Jito tip support and priority fee tweaks
Introduce Jito tipping utilities and wire them into Solana swap flow, plus improve priority-fee retrieval.
- Add packages/swapper/src/chain/solana/jito.ts: new JITO_TIP_ACCOUNTS, fetchTipFloorLamports(), getJitoBudget(), and createJitoTipInstruction() to compute/construct Jito tips (with a minimum tip fallback and recommended split logic).
- Add tests packages/swapper/src/mayan/solana.test.ts covering getJitoBudget() behavior and createJitoTipInstruction() correctness.
- Update tx_builder.ts: let getRecentPriorityFee accept lockedWritableAccounts when calling connection.getRecentPrioritizationFees(), and use the desired percentile index (with bounds) when computing a recommended fee.
- Wire Jito into swap construction (mayan/solana.ts): fetch tip floor earlier, append a Jito tip transfer when applicable, then fetch recent blockhash and build the MessageV0 with the swapper as fee payer. Adjust imports accordingly.
- Update orca/provider.ts to pass the Whirlpool program address as a locked writable account when querying recent priority fees.
These changes enable optional on-chain tipping to Jito, make priority-fee estimation respect locked accounts and percentile selection, and include unit tests for the new Jito helpers.
* bump packages
* Cache Jito tip PublicKeys and use randomInt
Cache JITO tip account PublicKey instances and use node:crypto.randomInt for selection instead of recreating PublicKey objects on each call. Add a JitoTipFloorEntry interface and cast the fetched JSON to improve typing for fetchTipFloorLamports. Also add the required randomInt import. These changes reduce allocations and improve type safety when creating Jito tip transfer instructions.
* Update AGENTS.md
* remove jito support1 parent 66194f1 commit e60355b
File tree
7 files changed
+134
-132
lines changed- packages/swapper
- src
- chain/solana
- mayan
- orca
7 files changed
+134
-132
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
| 27 | + | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
| 32 | + | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | | - | |
| 18 | + | |
18 | 19 | | |
19 | | - | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
34 | | - | |
35 | | - | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | | - | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | 45 | | |
47 | 46 | | |
48 | 47 | | |
| |||
52 | 51 | | |
53 | 52 | | |
54 | 53 | | |
55 | | - | |
56 | | - | |
57 | 54 | | |
58 | 55 | | |
59 | 56 | | |
60 | 57 | | |
| 58 | + | |
| 59 | + | |
61 | 60 | | |
62 | | - | |
63 | 61 | | |
64 | | - | |
65 | 62 | | |
66 | 63 | | |
67 | | - | |
| 64 | + | |
68 | 65 | | |
69 | 66 | | |
70 | 67 | | |
| |||
79 | 76 | | |
80 | 77 | | |
81 | 78 | | |
82 | | - | |
| 79 | + | |
83 | 80 | | |
84 | 81 | | |
85 | 82 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
236 | 237 | | |
237 | 238 | | |
238 | 239 | | |
239 | | - | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
240 | 243 | | |
241 | 244 | | |
242 | 245 | | |
| |||
0 commit comments