{"id":28070062,"url":"https://github.com/rpcpool/solana-prioritization-fees-api","last_synced_at":"2025-05-12T19:36:11.033Z","repository":{"id":224698294,"uuid":"762172338","full_name":"rpcpool/solana-prioritization-fees-api","owner":"rpcpool","description":"Solana prioritization fees API client examples.","archived":false,"fork":false,"pushed_at":"2024-03-04T06:40:50.000Z","size":17,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-03-04T07:49:53.875Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rpcpool.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-23T08:24:19.000Z","updated_at":"2024-02-27T08:01:20.000Z","dependencies_parsed_at":"2024-03-04T07:50:29.793Z","dependency_job_id":null,"html_url":"https://github.com/rpcpool/solana-prioritization-fees-api","commit_stats":null,"previous_names":["rpcpool/solana-prioritization-fees-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpcpool%2Fsolana-prioritization-fees-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpcpool%2Fsolana-prioritization-fees-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpcpool%2Fsolana-prioritization-fees-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpcpool%2Fsolana-prioritization-fees-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rpcpool","download_url":"https://codeload.github.com/rpcpool/solana-prioritization-fees-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253808715,"owners_count":21967586,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-12T19:36:06.319Z","updated_at":"2025-05-12T19:36:11.020Z","avatar_url":"https://github.com/rpcpool.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `getRecentPrioritizationFees` Trition Example\n\nRef: [JSON RPC getrecentprioritizationfees](https://solana.com/docs/rpc/http/getrecentprioritizationfees)\n\nThis repo contains example usage of the `percentile` flag in the `getRecentPrioritizationFees` JSON RPC call to Triton's Solana RPC endpoints.\n\n**This functionality is currently in beta testing. It requires a patch applied to the Solana validator source for proper operation. Details on the patches are available here: https://docs.triton.one/chains/solana/improved-priority-fees-api/for-rpc-providers**\n\n### How to use it?\nThis repo contains a function `getRecentPrioritizationFeesByPercentile` in `src/grpf.ts` that you can directly copy paste in your code and start using it. See the example usage in `/tests/grpf2.test.ts`\n\nFunction Details:\n`getRecentPrioritizationFeesByPercentile`\nParams:\n```\nconnection: @solana/web3.js.Connection;\nconfig: GetRecentPrioritizationFeesByPercentileConfig {\n      lockedWritableAccounts?: PublicKey[];\n      percentile?: number | PriotitizationFeeLevels, allowed range: 1 - 10_000;\n      fallback?: boolean, default: true;\n}\nslotsToReturn?: n number of slots will returned. By default RPC returns 150\n```  \n\n`PriotitizationFeeLevels` is an enum for user convenience which has numeric values. It is intended to keep the percentile values less confusing for the users\n\nReturns: `RecentPrioritizationFees[]` same as `Connection.getRecentPrioritizationFees`\n\nTo maintain compatibility with other RPC providers who might not support the `percentile` parameter, this function takes in a `fallback` parameter which defaults to `true`. The function makes 2 JSON RPC calls in parallel with and without the `percentile` parameter. If your RPC is Triton, you'll get the result returned by it. If not, you'll get the result returned by your other RPC provider.\n\n### Helper Functions\nThere are the following helper functions that return `Promise\u003cnumber\u003e`\n- `getMinPrioritizationFeeByPercentile`\n- `getMaxPrioritizationFeeByPercentile`\n- `getMeanPrioritizationFeeByPercentile`\n- `getMedianPrioritizationFeeByPercentile`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frpcpool%2Fsolana-prioritization-fees-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frpcpool%2Fsolana-prioritization-fees-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frpcpool%2Fsolana-prioritization-fees-api/lists"}