{"id":42414872,"url":"https://github.com/gopartyparrot/jup-twap","last_synced_at":"2026-01-28T01:58:00.187Z","repository":{"id":42681403,"uuid":"430628175","full_name":"gopartyparrot/jup-twap","owner":"gopartyparrot","description":"twap on jup.ag","archived":false,"fork":false,"pushed_at":"2022-03-28T21:30:44.000Z","size":115,"stargazers_count":8,"open_issues_count":4,"forks_count":8,"subscribers_count":0,"default_branch":"master","last_synced_at":"2023-03-05T21:52:00.374Z","etag":null,"topics":["solana","twap"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gopartyparrot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-22T08:45:06.000Z","updated_at":"2022-05-25T11:52:18.000Z","dependencies_parsed_at":"2022-09-21T02:02:41.779Z","dependency_job_id":null,"html_url":"https://github.com/gopartyparrot/jup-twap","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/gopartyparrot/jup-twap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gopartyparrot%2Fjup-twap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gopartyparrot%2Fjup-twap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gopartyparrot%2Fjup-twap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gopartyparrot%2Fjup-twap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gopartyparrot","download_url":"https://codeload.github.com/gopartyparrot/jup-twap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gopartyparrot%2Fjup-twap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28833156,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T23:29:49.665Z","status":"ssl_error","status_checked_at":"2026-01-27T23:25:58.379Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["solana","twap"],"created_at":"2026-01-28T01:57:59.475Z","updated_at":"2026-01-28T01:58:00.169Z","avatar_url":"https://github.com/gopartyparrot.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Jup Twap\n\nTwap swap using [Jupiter aggregator](https://jup.ag/)\n\nBuilt using:\n\n- [@jup-ag/core](https://www.npmjs.com/package/@jup-ag/core)\n- [@icholy/duration](https://www.npmjs.com/package/@icholy/duration)\n\n## Getting Started\n\nFirst you need to copy the `.env.example` to `.env` and set the `RPC_URL` and `WALLET_PK` respectively.\n\n\u003e `WALLET_PK` is a Base58 private key and it can be exported from `Phantom Wallet`\n\n## Building and Running\n\n```sh\nyarn build\n```\n\nand then \n\n```sh\nyarn start\n```\n\n#### Twap Swap\n\nThe required arguments are `From`, `To`, `Amount` and `Interval`. \n\n- From and To: are the direction of the trading pair we want to swap.\n- Amount: is the `From token` amount we want to swap for the `To token`.\n- Interval: is the duration (like 10s, 10m, 10h) interval to execute a swap.\n\nExample:\n\n```sh\nyarn start twap --from USDC --to PRT --amount 100 --interval 10m\n```\n\n\u003e It will buy 100 USDC worth of PRT every 10 minutes\n\n### Transfer amount\n\nOptional you can specify a `TransferAddress` and `TransferThreshold` with the arguments  `--transferAddress` and `--transferThreshold` respectively. \n\nWhen the balance of the buying asset reach the `TransferThreshold`, all it's balance will be transfer to the `TransferAddress` associated token account.\n\nExample:\n\n```sh\nyarn start twap --from USDC --to PRT --amount 100 --interval 10m --transferThreshold 100000 --transferAddress FRnCC8dBCcRabRv8xNbR5WHiGPGxdphjiRhE2qJZvwpm\n```\n\n\u003e It will buy 100 USDC worth of PRT every 10 minutes and it will transfer all the PRT balance to the Parrot Protocol address once greater than 100,000 PRT\n\n### Price Threshold\n\nOptional you can specify a swap `PriceThreshold` with the argument `--priceThreshold`.\n\nWhen CoinGecko price for the `To token` goes below the `PriceThreshold`, the swap will be execute otherwise it will skip and wait for the next interval.\n\nExample:\n\n```sh\nyarn start twap --from USDC --to PRT --amount 100 --interval 10m --priceThreshold 0.015\n```\n\n\u003e It will buy 100 USDC worth of PRT every 10 minutes only if PRT price on CoinGecko goes below 0.015.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgopartyparrot%2Fjup-twap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgopartyparrot%2Fjup-twap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgopartyparrot%2Fjup-twap/lists"}