├── Bots └── Typescript │ ├── Solana-trading-bot │ ├── .gitignore │ ├── LICENSE │ ├── README.md │ ├── config.ts │ ├── index.ts │ ├── jito_bundle │ │ ├── build_bundle.ts │ │ └── send_bundle.ts │ ├── package-lock.json │ ├── package.json │ ├── swapAmm.ts │ └── tsconfig.json │ └── grpc-copytrade │ ├── .gitignore │ ├── index.ts │ ├── package.json │ ├── parsers │ └── logs-parser │ │ ├── index.ts │ │ └── raydium-amm-logs-parser.ts │ ├── tsconfig.json │ └── utils │ ├── bn-layout-formatter.ts │ ├── raydium-amm-parser.ts │ └── transaction-formatter.ts ├── Defi-API └── Typescript │ ├── grpc-defiapi-arbitrage │ ├── .gitignore │ ├── index.ts │ ├── package.json │ ├── tools │ │ ├── getBalance.ts │ │ ├── getPooldetails.ts │ │ └── getPrice.ts │ ├── tsconfig.json │ └── utils │ │ ├── decodeTransaction.ts │ │ └── transactionOutput.ts │ └── grpc-defiapi-liquidityDetails │ ├── .gitignore │ ├── index.ts │ ├── package.json │ ├── tools │ └── getPooldetails.ts │ ├── tsconfig.json │ ├── txn.ts │ └── utils │ ├── decodeTransaction.ts │ └── transactionOutput.ts ├── Fluxbeam └── Typescript │ ├── grpc-newpool-fluxbeam │ ├── .gitignore │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── decodeTransaction.ts │ │ ├── logTXN.ts │ │ └── transactionOutput.ts │ └── grpc-txn-fluxbeam │ ├── .gitignore │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ ├── calculatePrice.ts │ ├── decodeTransaction.ts │ ├── maths.ts │ ├── tokenInfo.ts │ └── transactionOutput.ts ├── JupApi └── Typescript │ └── SwapQuote │ ├── index.ts │ ├── package.json │ └── tsconfig.json ├── Meteora ├── Rust │ ├── stream_and_parse_meteora_dlmm_accounts │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── assets │ │ │ └── usage-screenshot.png │ │ ├── idls │ │ │ └── meteora_dlmm.json │ │ ├── parsers │ │ │ └── meteora_dlmm_interface │ │ │ │ ├── .gitignore │ │ │ │ ├── Cargo.toml │ │ │ │ └── src │ │ │ │ ├── accounts.rs │ │ │ │ ├── errors.rs │ │ │ │ ├── events.rs │ │ │ │ ├── instructions.rs │ │ │ │ ├── lib.rs │ │ │ │ └── typedefs.rs │ │ └── src │ │ │ └── main.rs │ ├── stream_and_parse_meteora_dlmm_instructions │ │ ├── .gitignore │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── assets │ │ │ └── usage-screenshot.png │ │ ├── idls │ │ │ ├── meteora_dlmm.json │ │ │ └── token_program_idl.json │ │ ├── parsers │ │ │ └── meteora_dlmm_interface │ │ │ │ ├── .gitignore │ │ │ │ ├── Cargo.toml │ │ │ │ └── src │ │ │ │ ├── accounts.rs │ │ │ │ ├── errors.rs │ │ │ │ ├── events.rs │ │ │ │ ├── instructions.rs │ │ │ │ ├── lib.rs │ │ │ │ └── typedefs.rs │ │ └── src │ │ │ ├── instruction_account_mapper.rs │ │ │ ├── main.rs │ │ │ ├── serialization.rs │ │ │ └── token_serializable.rs │ ├── stream_and_parse_meteora_pools_accounts │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── assets │ │ │ └── usage-screenshot.png │ │ ├── idls │ │ │ ├── meteora_dlmm.json │ │ │ └── meteora_pools.json │ │ ├── parsers │ │ │ └── meteora_pools_interface │ │ │ │ ├── .gitignore │ │ │ │ ├── Cargo.toml │ │ │ │ └── src │ │ │ │ ├── accounts.rs │ │ │ │ ├── errors.rs │ │ │ │ ├── events.rs │ │ │ │ ├── instructions.rs │ │ │ │ ├── lib.rs │ │ │ │ └── typedefs.rs │ │ └── src │ │ │ └── main.rs │ └── stream_and_parse_meteora_pools_instructions │ │ ├── .gitignore │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── assets │ │ └── usage-screenshot.png │ │ ├── idls │ │ ├── meteora_dlmm.json │ │ ├── meteora_pools.json │ │ └── token_program_idl.json │ │ ├── parsers │ │ └── meteora_pools_interface │ │ │ ├── .gitignore │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ ├── accounts.rs │ │ │ ├── errors.rs │ │ │ ├── events.rs │ │ │ ├── instructions.rs │ │ │ ├── lib.rs │ │ │ └── typedefs.rs │ │ └── src │ │ ├── instruction_account_mapper.rs │ │ ├── main.rs │ │ ├── serialization.rs │ │ └── token_serializable.rs └── Typescript │ ├── stream_and_parse_meteora_dlmm_accounts │ ├── .env │ ├── .gitignore │ ├── README.md │ ├── assets │ │ └── meteora-usage.png │ ├── idls │ │ └── meteora_dlmm.json │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── bn-layout-formatter.ts │ │ └── meteora-dlmm-parsed-account.ts │ ├── stream_and_parse_meteora_dlmm_transactions │ ├── .env │ ├── .gitignore │ ├── README.md │ ├── assets │ │ └── meteora_dlmm_screenshot.png │ ├── idls │ │ └── meteora_dlmm.json │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── bn-layout-formatter.ts │ │ ├── event-parser.ts │ │ ├── transaction-formatter.ts │ │ └── transactionOutput.ts │ ├── stream_and_parse_meteora_pools_account │ ├── .env │ ├── .gitignore │ ├── README.md │ ├── assets │ │ └── meteora-screenshot.png │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── decodeTransaction.ts │ │ └── transactionOutput.ts │ └── stream_and_parse_meteora_pools_transactions │ ├── .env │ ├── .gitignore │ ├── README.md │ ├── assets │ └── meteora_pool_screenshot.png │ ├── idl │ └── meteora_dlmm.json │ ├── idls │ ├── meteora_pools.json │ └── token_program.json │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ ├── bn-layout-formatter.ts │ ├── event-parser.ts │ ├── transaction-formatter.ts │ └── transactionOutput.ts ├── Moonshot └── Typescript │ └── grpc-moonshot │ ├── .gitignore │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ ├── decodeTransaction.ts │ └── transactionOutput.ts ├── Orca ├── Rust │ ├── stream_and_parse_whirlpool_account_updates │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── assets │ │ │ └── usage-screenshot.png │ │ ├── idls │ │ │ └── whirlpool_idl.json │ │ ├── parsers │ │ │ └── whirlpool_interface │ │ │ │ ├── .gitignore │ │ │ │ ├── Cargo.toml │ │ │ │ ├── README.md │ │ │ │ └── src │ │ │ │ ├── accounts.rs │ │ │ │ ├── errors.rs │ │ │ │ ├── instructions.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── serializer.rs │ │ │ │ └── typedefs.rs │ │ └── src │ │ │ └── main.rs │ └── stream_and_parse_whirlpool_transactions │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── assets │ │ └── usage-screenshot.png │ │ ├── idls │ │ ├── token_program_idl.json │ │ └── whirlpool_idl.json │ │ ├── parsers │ │ └── whirlpool_interface │ │ │ ├── .gitignore │ │ │ ├── Cargo.toml │ │ │ ├── README.md │ │ │ └── src │ │ │ ├── accounts.rs │ │ │ ├── errors.rs │ │ │ ├── instructions.rs │ │ │ ├── lib.rs │ │ │ ├── serializer.rs │ │ │ └── typedefs.rs │ │ └── src │ │ ├── instruction_account_mapper.rs │ │ ├── main.rs │ │ ├── serialization.rs │ │ └── token_serializable.rs └── Typescript │ ├── grpc-orca-txn-liquidity_added │ ├── .gitignore │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── decodeTransaction.ts │ │ ├── logTXN.ts │ │ └── transactionOutput.ts │ ├── grpc-orca-txn_memcmp │ ├── .gitignore │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── calculatePrice.ts │ │ ├── decodeTransaction.ts │ │ ├── maths.ts │ │ ├── tokenInfo.ts │ │ └── transactionOutput.ts │ ├── stream_and_parse_all_whirlpool_accounts │ ├── .env.sample │ ├── .gitignore │ ├── Idl │ │ └── whirlpool_idl.json │ ├── README.md │ ├── assets │ │ └── stream_whirlpool_accounts.jpg │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ └── bn-layout-formatter.ts │ └── stream_and_parse_whirlpool_transactions │ ├── .env.sample │ ├── .gitignore │ ├── README.md │ ├── assets │ └── stream_parsed_raydium_txns.jpg │ ├── idls │ ├── token_program.json │ └── whirlpool_idl.json │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ ├── bn-layout-formatter.ts │ ├── event-parser.ts │ ├── transaction-formatter.ts │ └── transactionOutput.ts ├── PumpFun ├── Rust │ ├── Stream_migrated_pumpfun_tokens │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ └── main.rs │ ├── bonding_curve_progress │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── assets │ │ │ └── usage-screenshot.png │ │ ├── idls │ │ │ ├── pump_0.1.0.json │ │ │ ├── token_program_idl.json │ │ │ └── whirlpool_idl.json │ │ ├── parsers │ │ │ └── pump_interface │ │ │ │ ├── Cargo.toml │ │ │ │ └── src │ │ │ │ ├── accounts.rs │ │ │ │ ├── errors.rs │ │ │ │ ├── events.rs │ │ │ │ ├── instructions.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── serializer.rs │ │ │ │ └── typedefs.rs │ │ └── src │ │ │ ├── get_balance.rs │ │ │ ├── instruction_account_mapper.rs │ │ │ ├── main.rs │ │ │ ├── serialization.rs │ │ │ └── token_serializable.rs │ ├── grpc-stream-and-parse-pump-fun-amm-account │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── assets │ │ │ └── pumpfun_amm.png │ │ ├── parsers │ │ │ └── pump_interface │ │ │ │ ├── Cargo.toml │ │ │ │ └── src │ │ │ │ ├── accounts.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── serializer.rs │ │ │ │ └── typedefs.rs │ │ └── src │ │ │ └── main.rs │ ├── grpc-stream-and-parse-pump-fun-amm-transaction │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── assets │ │ │ └── pump-amm.png │ │ ├── idls │ │ │ ├── pump_amm_0.1.0.json │ │ │ └── token_program_idl.json │ │ ├── parsers │ │ │ └── pumpfun_amm_interface │ │ │ │ ├── .gitignore │ │ │ │ ├── Cargo.toml │ │ │ │ └── src │ │ │ │ ├── accounts.rs │ │ │ │ ├── errors.rs │ │ │ │ ├── events.rs │ │ │ │ ├── instructions.rs │ │ │ │ ├── lib.rs │ │ │ │ └── typedefs.rs │ │ └── src │ │ │ ├── instruction_account_mapper.rs │ │ │ ├── main.rs │ │ │ ├── serialization.rs │ │ │ └── token_serializable.rs │ ├── pumpfun_indexer │ │ ├── .dockerignore │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── docker-compose.yml │ │ ├── idls │ │ │ ├── pump_0.1.0.json │ │ │ ├── token_program_idl.json │ │ │ └── whirlpool_idl.json │ │ ├── parsers │ │ │ └── pump_interface │ │ │ │ ├── Cargo.toml │ │ │ │ └── src │ │ │ │ ├── accounts.rs │ │ │ │ ├── errors.rs │ │ │ │ ├── events.rs │ │ │ │ ├── instructions.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── serializer.rs │ │ │ │ └── typedefs.rs │ │ └── src │ │ │ ├── db.rs │ │ │ ├── instruction_account_mapper.rs │ │ │ ├── latency_test.rs │ │ │ ├── latest_block.rs │ │ │ ├── main.rs │ │ │ ├── serialization.rs │ │ │ └── token_serializable.rs │ ├── stream_and_parse_pump_transactions │ │ ├── .gitignore │ │ ├── .gitignore copy │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── assets │ │ │ └── usage-screenshot.png │ │ ├── idls │ │ │ ├── pump_0.1.0.json │ │ │ ├── token_program_idl.json │ │ │ └── whirlpool_idl.json │ │ ├── parsers │ │ │ └── pump_interface │ │ │ │ ├── Cargo.toml │ │ │ │ └── src │ │ │ │ ├── accounts.rs │ │ │ │ ├── errors.rs │ │ │ │ ├── events.rs │ │ │ │ ├── instructions.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── serializer.rs │ │ │ │ └── typedefs.rs │ │ └── src │ │ │ ├── instruction_account_mapper.rs │ │ │ ├── main.rs │ │ │ ├── serialization.rs │ │ │ └── token_serializable.rs │ ├── stream_and_parse_pumpfun_account_updates │ │ ├── .gitignore │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── assets │ │ │ └── usage-screenshot.png │ │ ├── idls │ │ │ └── pump_0.1.0.json │ │ ├── parsers │ │ │ └── pump_interface │ │ │ │ ├── Cargo.toml │ │ │ │ └── src │ │ │ │ ├── accounts.rs │ │ │ │ ├── errors.rs │ │ │ │ ├── events.rs │ │ │ │ ├── instructions.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── serializer.rs │ │ │ │ └── typedefs.rs │ │ └── src │ │ │ └── main.rs │ ├── stream_newly_added_token │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── instruction_account_mapper.rs │ │ │ ├── main.rs │ │ │ ├── serialization.rs │ │ │ └── token_serializable.rs │ ├── stream_pump_fun_amm_transactions_and_detect_buy_sell_events │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── assets │ │ │ └── pump-amm-event.png │ │ ├── idls │ │ │ ├── pump_amm_0.1.0.json │ │ │ └── token_program_idl.json │ │ ├── parsers │ │ │ └── pumpfun_amm_interface │ │ │ │ ├── .gitignore │ │ │ │ ├── Cargo.toml │ │ │ │ └── src │ │ │ │ ├── accounts.rs │ │ │ │ ├── errors.rs │ │ │ │ ├── events.rs │ │ │ │ ├── instructions.rs │ │ │ │ ├── lib.rs │ │ │ │ └── typedefs.rs │ │ └── src │ │ │ ├── instruction_account_mapper.rs │ │ │ ├── main.rs │ │ │ ├── serialization.rs │ │ │ └── token_serializable.rs │ ├── stream_pump_fun_new_minted_tokens │ │ ├── .gitignore │ │ ├── .gitignore copy │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── assets │ │ │ └── usage-screenshot.png │ │ ├── idls │ │ │ ├── pump_0.1.0.json │ │ │ └── token_program_idl.json │ │ ├── parsers │ │ │ └── pump_interface │ │ │ │ ├── Cargo.toml │ │ │ │ └── src │ │ │ │ ├── accounts.rs │ │ │ │ ├── errors.rs │ │ │ │ ├── events.rs │ │ │ │ ├── instructions.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── serializer.rs │ │ │ │ └── typedefs.rs │ │ └── src │ │ │ ├── instruction_account_mapper.rs │ │ │ ├── main.rs │ │ │ ├── serialization.rs │ │ │ └── token_serializable.rs │ ├── stream_transaction_detect_buy_sell_event │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── assets │ │ │ └── usage-screenshot.png │ │ ├── idls │ │ │ ├── pump_0.1.0.json │ │ │ └── token_program_idl.json │ │ ├── parsers │ │ │ └── pump_interface │ │ │ │ ├── Cargo.toml │ │ │ │ └── src │ │ │ │ ├── accounts.rs │ │ │ │ ├── errors.rs │ │ │ │ ├── events.rs │ │ │ │ ├── instructions.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── serializer.rs │ │ │ │ └── typedefs.rs │ │ └── src │ │ │ ├── instruction_account_mapper.rs │ │ │ ├── main.rs │ │ │ ├── serialization.rs │ │ │ └── token_serializable.rs │ ├── token_migration_using_account_updates │ │ ├── .gitignore │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── assets │ │ │ └── usage-screenshot.png │ │ ├── idls │ │ │ ├── pump_0.1.0.json │ │ │ └── token_program_idl.json │ │ ├── parsers │ │ │ └── pump_interface │ │ │ │ ├── Cargo.toml │ │ │ │ └── src │ │ │ │ ├── accounts.rs │ │ │ │ ├── errors.rs │ │ │ │ ├── events.rs │ │ │ │ ├── instructions.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── serializer.rs │ │ │ │ └── typedefs.rs │ │ └── src │ │ │ ├── instruction_account_mapper.rs │ │ │ ├── main.rs │ │ │ ├── serialization.rs │ │ │ └── token_serializable.rs │ └── token_migration_using_txnupdates │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── assets │ │ └── usage-screenshot.png │ │ ├── idls │ │ ├── pump_0.1.0.json │ │ ├── token_program_idl.json │ │ └── whirlpool_idl.json │ │ ├── parsers │ │ └── pump_interface │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ ├── accounts.rs │ │ │ ├── errors.rs │ │ │ ├── events.rs │ │ │ ├── instructions.rs │ │ │ ├── lib.rs │ │ │ ├── serializer.rs │ │ │ └── typedefs.rs │ │ └── src │ │ ├── instruction_account_mapper.rs │ │ ├── main.rs │ │ ├── serialization.rs │ │ └── token_serializable.rs └── Typescript │ ├── grpc-stream-and-parse-pump-fun-amm-account │ ├── .env │ ├── .gitignore │ ├── README.md │ ├── assets │ │ └── PumpfunAmm.png │ ├── idls │ │ └── pump_amm_0.1.0.json │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── accountStateParser.ts │ │ └── base-encoding.ts │ ├── grpc-stream-and-parse-pump-fun-amm-transaction-instructions │ ├── .env.example │ ├── .gitignore │ ├── README.md │ ├── idls │ │ └── pump_amm_0.1.0.json │ ├── index.ts │ ├── package-lock.json │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── bn-layout-formatter.ts │ │ ├── event-parser.ts │ │ └── transaction-formatter.ts │ ├── stream_all_bonding_curve_account │ ├── .env │ ├── .gitignore │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── decodeTransaction.ts │ │ ├── defiApi.ts │ │ ├── token.ts │ │ └── transactionOutput.ts │ ├── stream_and_parse_all_pump_fun_accounts │ ├── .env │ ├── .gitignore │ ├── Idl │ │ └── pump_0.1.0.json │ ├── README.md │ ├── assets │ │ └── streaming_pump_fun_accounts_parsed.jpg │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ └── bn-layout-formatter.ts │ ├── stream_and_parse_pump_fun_transactions │ ├── .env.sample │ ├── .gitignore │ ├── README.md │ ├── assets │ │ └── usage_screenshot.png │ ├── idls │ │ ├── pump_0.1.0.json │ │ └── token_program.json │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── bn-layout-formatter.ts │ │ ├── event-parser.ts │ │ ├── pump-fun-parsed-transaction.ts │ │ └── transaction-formatter.ts │ ├── stream_bonding_curve_progress │ ├── .env │ ├── .gitignore │ ├── README.md │ ├── idls │ │ └── pump_0.1.0.json │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── bn-layout-formatter.ts │ │ ├── decodeTransaction.ts │ │ ├── event-parser.ts │ │ ├── getBonding.ts │ │ ├── token.ts │ │ ├── transaction-formatter.ts │ │ └── transactionOutput.ts │ ├── stream_completed_bonding_curve │ ├── .env │ ├── .gitignore │ ├── README.md │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── decodeTransaction.ts │ │ ├── token.ts │ │ └── transactionOutput.ts │ ├── stream_new_pool_pumpfun_amm_transactions │ ├── .env.example │ ├── .gitignore │ ├── README.md │ ├── assets │ │ └── new-pool.png │ ├── idls │ │ └── pump_amm_0.1.0.json │ ├── index.ts │ ├── package-lock.json │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── bn-layout-formatter.ts │ │ ├── event-parser.ts │ │ ├── pumpfun-amm-txn-formatter.ts │ │ └── transaction-formatter.ts │ ├── stream_pump_fun_amm_transactions_and_detect_buy_sell_events │ ├── .env.example │ ├── .gitignore │ ├── README.md │ ├── assets │ │ └── amm-buy-sell.png │ ├── idls │ │ └── pump_amm_0.1.0.json │ ├── index.ts │ ├── package-lock.json │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── bn-layout-formatter.ts │ │ ├── event-parser.ts │ │ ├── swapTransactionParser.ts │ │ └── transaction-formatter.ts │ ├── stream_pump_fun_new_minted_tokens │ ├── .env.sample │ ├── .gitignore │ ├── README.md │ ├── assets │ │ ├── new-pump.png │ │ └── screenshot-grpc.jpg │ ├── idls │ │ ├── pump_0.1.0.json │ │ └── token_program.json │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── bn-layout-formatter.ts │ │ ├── decodeTransaction.ts │ │ ├── event-parser.ts │ │ ├── pump-fun-parsed-transaction.ts │ │ ├── transaction-formatter.ts │ │ └── transactionOutput.ts │ ├── stream_pump_fun_transactions_and_detect_buy_sell_events │ ├── .env.sample │ ├── .gitignore │ ├── README.md │ ├── assets │ │ └── run-project.jpg │ ├── idls │ │ └── pump_0.1.0.json │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── bn-layout-formatter.ts │ │ ├── event-parser.ts │ │ ├── transaction-formatter.ts │ │ └── transactionOutput.ts │ ├── stream_pumpfun_to_pumpfunAmm_migration_transactions │ ├── .env │ ├── .gitignore │ ├── README.md │ ├── assets │ │ └── usage_screenshot.png │ ├── idls │ │ ├── pump_0.1.0.json │ │ └── token_program.json │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── bn-layout-formatter.ts │ │ ├── event-parser.ts │ │ ├── pump-fun-parsed-transaction.ts │ │ └── transaction-formatter.ts │ ├── stream_pumpfun_to_raydium_migration_transactions │ ├── .env │ ├── .gitignore │ ├── README.md │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── decodeTransaction.ts │ │ ├── logTXN.ts │ │ └── transactionOutput.ts │ ├── stream_pumpfun_token_price │ ├── .env │ ├── .env.sample │ ├── .gitignore │ ├── README.md │ ├── assets │ │ ├── screenshot-grpc.png │ │ └── usage-screenshot-pumpfun.png │ ├── idls │ │ └── pump_0.1.0.json │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── bn-layout-formatter.ts │ │ ├── event-parser.ts │ │ ├── pumpfun_formatted_txn.ts │ │ └── transaction-formatter.ts │ └── stream_pumpfun_txns_fetch_bonding_pool_liquidity │ ├── .env │ ├── .gitignore │ ├── README.md │ ├── idls │ └── pump_0.1.0.json │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ ├── bn-layout-formatter.ts │ ├── decodeTransaction.ts │ ├── event-parser.ts │ ├── query.ts │ ├── token.ts │ ├── transaction-formatter.ts │ └── transactionOutput.ts ├── README.md ├── Raydium ├── Rust │ ├── Stream_Raydium_Pool_Address-acct-rust │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ └── main.rs │ ├── Stream_and_parse_raydium_transactions │ │ ├── .gitignore │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── assets │ │ │ └── usage-screenshot.png │ │ ├── idls │ │ │ ├── raydium_amm.json │ │ │ └── token_program_idl.json │ │ ├── parsers │ │ │ └── raydium_amm_interface │ │ │ │ ├── .gitignore │ │ │ │ ├── Cargo.toml │ │ │ │ └── src │ │ │ │ ├── accounts.rs │ │ │ │ ├── errors.rs │ │ │ │ ├── instructions.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── serializer.rs │ │ │ │ └── typedefs.rs │ │ └── src │ │ │ ├── instruction_account_mapper.rs │ │ │ ├── main.rs │ │ │ ├── serialization.rs │ │ │ └── token_serializable.rs │ ├── Streaming_realtime_pool_activity │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ └── main.rs │ ├── stream_and_parse_raydium_accounts │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── assets │ │ │ └── usage-screenshot.png │ │ ├── idls │ │ │ ├── raydium_amm.json │ │ │ └── token_program_idl.json │ │ ├── parsers │ │ │ └── raydium_amm_interface │ │ │ │ ├── .gitignore │ │ │ │ ├── Cargo.toml │ │ │ │ └── src │ │ │ │ ├── accounts.rs │ │ │ │ ├── errors.rs │ │ │ │ ├── instructions.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── serializer.rs │ │ │ │ └── typedefs.rs │ │ └── src │ │ │ ├── instruction_account_mapper.rs │ │ │ ├── main.rs │ │ │ ├── serialization.rs │ │ │ └── token_serializable.rs │ ├── stream_and_parse_raydium_clmm_accounts │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── assets │ │ │ └── clmm-account.png │ │ ├── parsers │ │ │ └── raydium_clmm_swap_interface │ │ │ │ ├── .gitignore │ │ │ │ ├── Cargo.toml │ │ │ │ └── src │ │ │ │ ├── accounts.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── serializer.rs │ │ │ │ └── typedefs.rs │ │ └── src │ │ │ └── main.rs │ ├── stream_and_parse_raydium_clmm_transactions │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── assets │ │ │ └── usage_screenshot.png │ │ ├── idls │ │ │ ├── raydium_clmm.json │ │ │ └── token_program_idl.json │ │ ├── parsers │ │ │ └── raydium_clmm_swap_interface │ │ │ │ ├── .gitignore │ │ │ │ ├── Cargo.toml │ │ │ │ └── src │ │ │ │ ├── accounts.rs │ │ │ │ ├── errors.rs │ │ │ │ ├── events.rs │ │ │ │ ├── instructions.rs │ │ │ │ ├── lib.rs │ │ │ │ └── typedefs.rs │ │ └── src │ │ │ ├── instruction_account_mapper.rs │ │ │ ├── main.rs │ │ │ ├── serialization.rs │ │ │ └── token_serializable.rs │ ├── stream_and_parse_raydium_cp_accounts │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── assets │ │ │ └── cp-account.PNG │ │ ├── parsers │ │ │ └── raydium_cp_swap_interface │ │ │ │ ├── .gitignore │ │ │ │ ├── Cargo.toml │ │ │ │ └── src │ │ │ │ ├── accounts.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── serializer.rs │ │ │ │ └── typedefs.rs │ │ └── src │ │ │ └── main.rs │ ├── stream_and_parse_raydium_cp_transactions │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── assets │ │ │ └── usage_screenshot.PNG │ │ ├── idls │ │ │ ├── cpmm_idl.json │ │ │ └── token_program_idl.json │ │ ├── parsers │ │ │ └── raydium_cp_swap_interface │ │ │ │ ├── .gitignore │ │ │ │ ├── Cargo.toml │ │ │ │ └── src │ │ │ │ ├── accounts.rs │ │ │ │ ├── errors.rs │ │ │ │ ├── events.rs │ │ │ │ ├── instructions.rs │ │ │ │ ├── lib.rs │ │ │ │ └── typedefs.rs │ │ └── src │ │ │ ├── instruction_account_mapper.rs │ │ │ ├── main.rs │ │ │ ├── serialization.rs │ │ │ └── token_serializable.rs │ └── stream_new_pools │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ └── main.rs └── Typescript │ ├── monitor_new_pools_telegram_bot │ ├── .gitignore │ ├── README.md │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── raydium-amm-parser.ts │ │ └── transaction-formatter.ts │ ├── real_time_token_price_marketcap_streaming │ ├── .gitignore │ ├── README.md │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── decodeTransaction.ts │ │ ├── marketInfo.ts │ │ ├── tokenInfo.ts │ │ ├── transactionOutput.ts │ │ └── walletInfo.ts │ ├── stream_and_parse_all_raydium_accounts │ ├── .gitignore │ ├── Idl │ │ └── raydium_amm.json │ ├── README.md │ ├── assets │ │ └── streaming_raydium_account_updates.jpg │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── bn-layout-formatter.ts │ │ └── decode_utils │ │ ├── buffer-layout.ts │ │ ├── layouts-decoder.ts │ │ └── marshmallow.ts │ ├── stream_and_parse_all_raydium_transctions │ ├── .gitignore │ ├── README.md │ ├── assets │ │ └── stream_parsed_raydium_txns.jpg │ ├── index.ts │ ├── package.json │ ├── parsers │ │ ├── logs-parser │ │ │ ├── index.ts │ │ │ └── raydium-amm-logs-parser.ts │ │ └── raydium-amm-parser.ts │ ├── tsconfig.json │ └── utils │ │ ├── bn-layout-formatter.ts │ │ ├── raydium-amm-parser.ts │ │ └── transaction-formatter.ts │ ├── stream_and_parse_clmm_accounts │ ├── .env │ ├── .gitignore │ ├── README.md │ ├── assets │ │ └── RaydiumCLMM_Screenshot.png │ ├── index.ts │ ├── marshmallow │ │ ├── buffer-layout.ts │ │ └── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── bn-layout-formatter.ts │ │ ├── decodePoolData.ts │ │ └── decodeRaydiumCLMM.ts │ ├── stream_and_parse_clmm_new_pool │ ├── .env │ ├── .gitignore │ ├── README.md │ ├── assets │ │ └── clmm-new-pool.png │ ├── idls │ │ └── raydium_clmm.json │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── bn-layout-formatter.ts │ │ ├── event-parser.ts │ │ ├── parsedTransactionOutput.ts │ │ └── transaction-formatter.ts │ ├── stream_and_parse_cpmm_accounts │ ├── .gitignore │ ├── README.md │ ├── assets │ │ └── raydium_cpAccount.png │ ├── index.ts │ ├── layout-type │ │ ├── buffer-layout.ts │ │ └── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── bn-layout-formatter.ts │ │ ├── raydium-cp-pool-utils.ts │ │ └── raydium-cp-transaction-processor.ts │ ├── stream_and_parse_cpmm_new_pool │ ├── .gitignore │ ├── README.md │ ├── assets │ │ └── cpmm-new-pool.png │ ├── idls │ │ ├── cpmm_idl.json │ │ └── token_program.json │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── bn-layout-formatter.ts │ │ ├── event-parser.ts │ │ ├── parsedTransaction.ts │ │ └── transaction-formatter.ts │ ├── stream_and_parse_raydium_clmm_transactions │ ├── .env │ ├── .gitignore │ ├── README.md │ ├── assets │ │ └── RaydiumCLMM_Screenshot.png │ ├── idls │ │ └── raydium_clmm.json │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── bn-layout-formatter.ts │ │ ├── event-parser.ts │ │ ├── parsedTransactionOutput.ts │ │ └── transaction-formatter.ts │ ├── stream_and_parse_raydium_clmm_transactions_and_detect_buy_sell_events │ ├── .gitignore │ ├── README.md │ ├── assets │ │ └── buy-sell-events.png │ ├── idls │ │ └── raydium_clmm.json │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── bn-layout-formatter.ts │ │ ├── event-parser.ts │ │ ├── parsedTransactionOutput.ts │ │ └── transaction-formatter.ts │ ├── stream_and_parse_raydium_cpmm_transactions │ ├── .env.sample │ ├── .gitignore │ ├── README.md │ ├── assets │ │ └── stream_parsed_raydium_txns.jpg │ ├── idls │ │ ├── cpmm_idl.json │ │ └── token_program.json │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── bn-layout-formatter.ts │ │ ├── event-parser.ts │ │ ├── transaction-formatter.ts │ │ └── transactionOutput.ts │ ├── stream_and_parse_raydium_cpmm_transactions_and_detect_buy_sell_events │ ├── .gitignore │ ├── README.md │ ├── assets │ │ └── cpmm-screenshot.png │ ├── idls │ │ ├── cpmm_idl.json │ │ └── token_program.json │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── bn-layout-formatter.ts │ │ ├── event-parser.ts │ │ ├── parsedTransactionOutput.ts │ │ └── transaction-formatter.ts │ ├── stream_and_parse_raydium_launchpad_account │ ├── .gitignore │ ├── README.md │ ├── assets │ │ └── raydium-launchpad.png │ ├── idls │ │ └── raydium_launchpad.json │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── bn-layout-formatter.ts │ │ └── raydium-launchpad-transaction-processor.ts │ ├── stream_and_parse_raydium_launchpad_transactions │ ├── .env.example │ ├── .gitignore │ ├── README.md │ ├── assets │ │ └── raydium-launchpad.png │ ├── idls │ │ └── raydium_launchpad.json │ ├── index.ts │ ├── package-lock.json │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── bn-layout-formatter.ts │ │ ├── event-parser.ts │ │ ├── rl-transaction-formatter.ts │ │ └── transaction-formatter.ts │ ├── stream_new_pool_raydium_launchpad │ ├── .env.example │ ├── .gitignore │ ├── README.md │ ├── assets │ │ ├── raydium-launchpad.png │ │ └── raydium-new-pool.png │ ├── idls │ │ └── raydium_launchpad.json │ ├── index.ts │ ├── package-lock.json │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── bn-layout-formatter.ts │ │ ├── event-parser.ts │ │ ├── rl-transaction-formatter.ts │ │ └── transaction-formatter.ts │ ├── stream_raydium_amm_transactions_and_detect_buy_sell_events │ ├── .env │ ├── .gitignore │ ├── README.md │ ├── assets │ │ ├── raydium-event.png │ │ └── stream_parsed_raydium_txns.jpg │ ├── index.ts │ ├── package.json │ ├── parsers │ │ ├── logs-parser │ │ │ ├── index.ts │ │ │ └── raydium-amm-logs-parser.ts │ │ └── raydium-amm-parser.ts │ ├── tsconfig.json │ └── utils │ │ ├── bn-layout-formatter.ts │ │ ├── raydium-amm-parser.ts │ │ ├── transaction-event-parser.ts │ │ └── transaction-formatter.ts │ ├── stream_raydium_launchpad_and_detect_buy_sell_events │ ├── .env.example │ ├── .gitignore │ ├── README.md │ ├── assets │ │ └── rl-screenshot.png │ ├── idls │ │ └── raydium_launchpad.json │ ├── index.ts │ ├── package-lock.json │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── bn-layout-formatter.ts │ │ ├── event-parser.ts │ │ ├── rl-transaction-formatter.ts │ │ └── transaction-formatter.ts │ ├── stream_raydium_launchpad_new_minted_tokens │ ├── .env.example │ ├── .gitignore │ ├── README.md │ ├── assets │ │ ├── raydium-launchpad.png │ │ └── raydium-new-pool.png │ ├── idls │ │ └── raydium_launchpad.json │ ├── index.ts │ ├── package-lock.json │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── bn-layout-formatter.ts │ │ ├── event-parser.ts │ │ ├── rl-transaction-formatter.ts │ │ └── transaction-formatter.ts │ ├── streaming_multiple_token_market_activities │ ├── .gitignore │ ├── README.md │ ├── index.ts │ ├── package.json │ ├── parsers │ │ └── logs-parser │ │ │ ├── index.ts │ │ │ └── raydium-amm-logs-parser.ts │ ├── tsconfig.json │ └── utils │ │ ├── bn-layout-formatter.ts │ │ ├── marketInfo.ts │ │ ├── raydium-amm-parser.ts │ │ ├── tokenInfo.ts │ │ ├── transaction-formatter.ts │ │ └── walletInfo.ts │ ├── streaming_newly_added_pool_accounts │ ├── .gitignore │ ├── README.md │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── decodeTransaction.ts │ │ └── transactionOutput.ts │ ├── streaming_newly_added_pool_transactions │ ├── .gitignore │ ├── README.md │ ├── index.ts │ ├── package.json │ ├── parsers │ │ └── logs-parser │ │ │ ├── index.ts │ │ │ └── raydium-amm-logs-parser.ts │ ├── tsconfig.json │ └── utils │ │ ├── bn-layout-formatter.ts │ │ ├── raydium-amm-parser.ts │ │ └── transaction-formatter.ts │ └── streaming_pool_transactions_for_token_pairs │ ├── .gitignore │ ├── README.md │ ├── index.ts │ ├── package.json │ ├── parsers │ └── logs-parser │ │ ├── index.ts │ │ └── raydium-amm-logs-parser.ts │ ├── tsconfig.json │ └── utils │ ├── bn-layout-formatter.ts │ ├── getPool.ts │ ├── raydium-amm-parser.ts │ └── transaction-formatter.ts ├── general-grpc-examples ├── Rust │ ├── adding_a_reconnection_mechanism │ │ ├── .gitignore │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── assets │ │ │ └── usage-screenshot.png │ │ └── src │ │ │ ├── instruction_account_mapper.rs │ │ │ ├── main.rs │ │ │ └── serialization.rs │ ├── making_a_grpc_connection │ │ ├── .gitignore │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── assets │ │ │ └── usage-screenshot.png │ │ └── src │ │ │ ├── instruction_account_mapper.rs │ │ │ ├── main.rs │ │ │ └── serialization.rs │ └── modifying_subscribe_request │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── assets │ │ └── usage_screenshot.png │ │ └── src │ │ └── main.rs └── Typescript │ ├── [GRPC]Streaming_Token_TXN │ ├── .gitignore │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── decodeTransaction.ts │ │ ├── logTXN.ts │ │ └── transactionOutput.ts │ ├── add_a_reconnect_mechanism │ ├── .env.sample │ ├── .gitignore │ ├── README.md │ ├── assets │ │ └── stream_parsed_raydium_txns.jpg │ ├── idls │ │ ├── pump_0.1.0.json │ │ └── token_program.json │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── test │ │ └── transaction-formatter.ts │ ├── closing_a_grpc_connection │ ├── .gitignore │ ├── README.md │ ├── index.ts │ ├── package-lock.json │ ├── package.json │ └── tsconfig.json │ ├── making_a_grpc_connection │ ├── .env.sample │ ├── .gitignore │ ├── README.md │ ├── assets │ │ └── stream_parsed_raydium_txns.jpg │ ├── index.ts │ ├── package.json │ ├── tsconfig.json │ └── utils │ │ ├── test │ │ └── transaction-formatter.ts │ └── modifying_subscribe_request │ ├── .env │ ├── .gitignore │ ├── README.md │ ├── assets │ └── usage-screenshot.png │ ├── index.ts │ ├── package.json │ └── tsconfig.json └── grpc-latency-checker ├── README.md ├── Rust ├── grpc-latency-checker-rust │ ├── .gitignore │ ├── Cargo.lock │ ├── Cargo.toml │ ├── README.md │ ├── assets │ │ └── screenshot.png │ └── src │ │ └── main.rs └── grpc-latency-compare-rust │ ├── .env.example │ ├── .gitignore │ ├── Cargo.lock │ ├── Cargo.toml │ ├── README.md │ ├── jito_protos │ ├── Cargo.toml │ ├── build.rs │ ├── protos │ │ ├── LICENSE │ │ ├── README.md │ │ ├── auth.proto │ │ ├── block.proto │ │ ├── block_engine.proto │ │ ├── bundle.proto │ │ ├── json_rpc │ │ │ └── http.md │ │ ├── packet.proto │ │ ├── relayer.proto │ │ ├── searcher.proto │ │ ├── shared.proto │ │ └── shredstream.proto │ └── src │ │ └── lib.rs │ └── src │ └── compare.rs └── Typescript ├── grpc-latency-checker-ts ├── .DS_Store ├── .env-sample ├── .gitignore ├── README.md ├── index.ts ├── package-lock.json ├── package.json ├── tsconfig.json └── utils │ ├── bn-layout-formatter.ts │ ├── report-generator.ts │ └── transaction-formatter.ts └── grpc-slot-based-latency-checker ├── .DS_Store ├── .env-sample ├── .gitignore ├── README.md ├── index.ts ├── package-lock.json ├── package.json ├── tsconfig.json └── utils ├── bn-layout-formatter.ts ├── report-generator.ts ├── slot-mapper.ts └── transaction-formatter.ts /Bots/Typescript/Solana-trading-bot/README.md: -------------------------------------------------------------------------------- 1 | # solana-defi 2 | Useful defi projects for Solana summer 3 | -------------------------------------------------------------------------------- /Bots/Typescript/grpc-copytrade/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /Bots/Typescript/grpc-copytrade/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Bots/Typescript/grpc-copytrade/utils/bn-layout-formatter.ts: -------------------------------------------------------------------------------- 1 | import { PublicKey } from "@solana/web3.js"; 2 | import { isObject } from "lodash"; 3 | 4 | export function bnLayoutFormatter(obj: any) { 5 | for (const key in obj) { 6 | if (obj[key]?.constructor?.name === "PublicKey") { 7 | obj[key] = (obj[key] as PublicKey).toBase58(); 8 | } else if (obj[key]?.constructor?.name === "BN") { 9 | obj[key] = Number(obj[key].toString()); 10 | } else if (obj[key]?.constructor?.name === "BigInt") { 11 | obj[key] = Number(obj[key].toString()); 12 | } else if (obj[key]?.constructor?.name === "Buffer") { 13 | obj[key] = (obj[key] as Buffer).toString("base64"); 14 | } else if (isObject(obj[key])) { 15 | bnLayoutFormatter(obj[key]); 16 | } else { 17 | obj[key] = obj[key]; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Defi-API/Typescript/grpc-defiapi-arbitrage/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /Defi-API/Typescript/grpc-defiapi-arbitrage/tools/getBalance.ts: -------------------------------------------------------------------------------- 1 | import { Connection, PublicKey } from "@solana/web3.js"; 2 | 3 | 4 | export const api = "" 5 | const connection = new Connection(`https://rpc.shyft.to?api_key=${api}`, 'confirmed'); 6 | 7 | export async function getSolBalance(address){ 8 | if (!address) { 9 | throw new Error('Vault address is undefined'); 10 | } 11 | const account = await connection.getBalance(new PublicKey(address)); 12 | const balance = account/1000000000; 13 | 14 | return balance; 15 | } 16 | export async function getTokenBalance(address){ 17 | const account = await connection.getTokenAccountBalance(new PublicKey(address)) 18 | const balance = Number(account.value.amount); 19 | return balance; 20 | } 21 | 22 | -------------------------------------------------------------------------------- /Defi-API/Typescript/grpc-defiapi-arbitrage/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Defi-API/Typescript/grpc-defiapi-arbitrage/utils/decodeTransaction.ts: -------------------------------------------------------------------------------- 1 | import base58 from "bs58"; 2 | 3 | export function decodeTransact(data){ 4 | const output = base58.encode(Buffer.from(data,'base64')) 5 | return output; 6 | } -------------------------------------------------------------------------------- /Defi-API/Typescript/grpc-defiapi-liquidityDetails/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /Defi-API/Typescript/grpc-defiapi-liquidityDetails/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Defi-API/Typescript/grpc-defiapi-liquidityDetails/utils/decodeTransaction.ts: -------------------------------------------------------------------------------- 1 | import base58 from "bs58"; 2 | 3 | export function decodeTransact(data){ 4 | const output = base58.encode(Buffer.from(data,'base64')) 5 | return output; 6 | } -------------------------------------------------------------------------------- /Fluxbeam/Typescript/grpc-newpool-fluxbeam/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /Fluxbeam/Typescript/grpc-newpool-fluxbeam/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shyft", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.ts", 6 | "scripts": { 7 | "start": "npx ts-node index.ts", 8 | "build": "npx tsc" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "@triton-one/yellowstone-grpc": "^0.4.0", 14 | "@solana/web3.js": "^1.90.0", 15 | "@project-serum/anchor": "^0.26.0", 16 | "@shyft-to/solana-transaction-parser": "^1.1.17", 17 | "@solana/buffer-layout": "^4.0.1", 18 | "@solana/buffer-layout-utils": "^0.2.0", 19 | "dotenv": "^16.4.5", 20 | "lodash": "^4.17.21", 21 | "node-telegram-bot-api": "^0.64.0", 22 | "bs58": "^5.0.0" 23 | }, 24 | "devDependencies": { 25 | "ts-node": "^10.9.2", 26 | "typescript": "^4.9.3" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Fluxbeam/Typescript/grpc-newpool-fluxbeam/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Fluxbeam/Typescript/grpc-newpool-fluxbeam/utils/decodeTransaction.ts: -------------------------------------------------------------------------------- 1 | import base58 from "bs58"; 2 | 3 | export function decodeTransact(data){ 4 | const output = data?base58.encode(Buffer.from(data,'base64')):""; 5 | return output; 6 | } -------------------------------------------------------------------------------- /Fluxbeam/Typescript/grpc-newpool-fluxbeam/utils/logTXN.ts: -------------------------------------------------------------------------------- 1 | export function searchForInitialize2(transaction) { 2 | const logMessages = transaction.meta?.logMessages || []; 3 | if (logMessages.some(log => log.includes(''))) { 4 | return transaction; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Fluxbeam/Typescript/grpc-txn-fluxbeam/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /Fluxbeam/Typescript/grpc-txn-fluxbeam/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Fluxbeam/Typescript/grpc-txn-fluxbeam/utils/calculatePrice.ts: -------------------------------------------------------------------------------- 1 | import { BN } from "@project-serum/anchor"; 2 | import { MathUtil } from "./maths"; 3 | import Decimal from "decimal.js"; 4 | 5 | export function sqrtPriceX64ToPrice( 6 | sqrtPriceX64: BN, 7 | decimalsA: number, 8 | decimalsB: number, 9 | ) { 10 | return MathUtil.fromX64(sqrtPriceX64) 11 | .pow(2) 12 | .mul(Decimal.pow(10, decimalsA - decimalsB)); 13 | } 14 | -------------------------------------------------------------------------------- /Fluxbeam/Typescript/grpc-txn-fluxbeam/utils/decodeTransaction.ts: -------------------------------------------------------------------------------- 1 | import base58 from "bs58"; 2 | 3 | export function decodeTransact(data){ 4 | const output = data?base58.encode(Buffer.from(data,'base64')):""; 5 | return output; 6 | } -------------------------------------------------------------------------------- /Fluxbeam/Typescript/grpc-txn-fluxbeam/utils/tokenInfo.ts: -------------------------------------------------------------------------------- 1 | const api = "api" 2 | var myHeaders = new Headers(); 3 | myHeaders.append("x-api-key", api); 4 | 5 | var requestOptions:any = { 6 | method: 'GET', 7 | headers: myHeaders, 8 | redirect: 'follow' 9 | }; 10 | 11 | export async function getTokenInfo(address){ 12 | const info = await fetch(`https://api.shyft.to/sol/v1/token/get_info?network=mainnet-beta&token_address=${address}`, requestOptions) 13 | const infoJson = await info.json(); 14 | const result = infoJson.result; 15 | const decimal = result?.decimals; 16 | return decimal 17 | } 18 | -------------------------------------------------------------------------------- /JupApi/Typescript/SwapQuote/index.ts: -------------------------------------------------------------------------------- 1 | async function getQoute(){ 2 | const quoteResponse = await ( 3 | await fetch(`https://jup.ny.shyft.to/quote?inputMint=So11111111111111111111111111111111111111112&outputMint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount=100000000` 4 | ,{ 5 | // method: 'POST', 6 | headers: { 7 | 'Content-Type': 'application/json', 8 | 'x-api-key' : 'api' 9 | }, 10 | } 11 | ) 12 | ).json(); 13 | console.log(quoteResponse) 14 | } 15 | getQoute(); -------------------------------------------------------------------------------- /JupApi/Typescript/SwapQuote/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shyft", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.ts", 6 | "scripts": { 7 | "start": "npx ts-node index.ts", 8 | "build": "npx tsc" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "@triton-one/yellowstone-grpc": "^0.4.0", 14 | "@solana/web3.js": "^1.90.0", 15 | "@project-serum/anchor": "^0.26.0", 16 | "@shyft-to/solana-transaction-parser": "^1.1.17", 17 | "@solana/buffer-layout": "^4.0.1", 18 | "@solana/buffer-layout-utils": "^0.2.0", 19 | "dotenv": "^16.4.5" 20 | }, 21 | "devDependencies": { 22 | "ts-node": "^10.9.2", 23 | "typescript": "^4.9.3" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /JupApi/Typescript/SwapQuote/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Meteora/Rust/stream_and_parse_meteora_dlmm_accounts/.gitignore: -------------------------------------------------------------------------------- 1 | Cargo.lock 2 | target/ -------------------------------------------------------------------------------- /Meteora/Rust/stream_and_parse_meteora_dlmm_accounts/README.md: -------------------------------------------------------------------------------- 1 | # Streaming and parsing Meteora DLMM accounts using gRPC 2 | 3 | This project leverages Solana's gRPC streaming capabilities to efficiently monitor Meteora DLMM account data. By utilizing the IDL for parsing, it enables real-time analysis and insights into DLMM activities on the Solana blockchain. 4 | 5 | ``` 6 | $ cargo run -- --endpoint --x-token 7 | ``` 8 | 9 | ![screenshot](assets/usage-screenshot.png?raw=true "Screenshot") 10 | 11 | ## Docs 12 | Shyft Website: [https://shyft.to/#solana-grpc-streaming-service] 13 | Shyft gRPC Docs: [https://docs.shyft.to/solana-fast-grpc/grpc-docs] 14 | -------------------------------------------------------------------------------- /Meteora/Rust/stream_and_parse_meteora_dlmm_accounts/assets/usage-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Meteora/Rust/stream_and_parse_meteora_dlmm_accounts/assets/usage-screenshot.png -------------------------------------------------------------------------------- /Meteora/Rust/stream_and_parse_meteora_dlmm_accounts/parsers/meteora_dlmm_interface/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | Cargo.lock -------------------------------------------------------------------------------- /Meteora/Rust/stream_and_parse_meteora_dlmm_accounts/parsers/meteora_dlmm_interface/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "meteora_dlmm_interface" 3 | version = "0.8.2" 4 | edition = "2021" 5 | 6 | [dependencies.borsh] 7 | version = "^0.10" 8 | 9 | [dependencies.num-derive] 10 | version = "^0.3" 11 | 12 | [dependencies.num-traits] 13 | version = "^0.2" 14 | 15 | [dependencies.serde] 16 | optional = true 17 | version = "^1.0" 18 | 19 | [dependencies.solana-program] 20 | version = "^2.1.7" 21 | 22 | [dependencies.thiserror] 23 | version = "^1.0" 24 | 25 | [dependencies.strum] 26 | version = "0.26.3" 27 | 28 | [dependencies.strum_macros] 29 | version = "0.26.4" 30 | 31 | [dependencies.Inflector] 32 | version = "=0.11.4" 33 | -------------------------------------------------------------------------------- /Meteora/Rust/stream_and_parse_meteora_dlmm_accounts/parsers/meteora_dlmm_interface/src/lib.rs: -------------------------------------------------------------------------------- 1 | solana_program::declare_id!("LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo"); 2 | pub mod accounts; 3 | pub use accounts::*; 4 | pub mod typedefs; 5 | pub use typedefs::*; 6 | pub mod instructions; 7 | pub use instructions::*; 8 | pub mod errors; 9 | pub use errors::*; 10 | pub mod events; 11 | pub use events::*; 12 | -------------------------------------------------------------------------------- /Meteora/Rust/stream_and_parse_meteora_dlmm_instructions/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock -------------------------------------------------------------------------------- /Meteora/Rust/stream_and_parse_meteora_dlmm_instructions/assets/usage-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Meteora/Rust/stream_and_parse_meteora_dlmm_instructions/assets/usage-screenshot.png -------------------------------------------------------------------------------- /Meteora/Rust/stream_and_parse_meteora_dlmm_instructions/parsers/meteora_dlmm_interface/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | Cargo.lock -------------------------------------------------------------------------------- /Meteora/Rust/stream_and_parse_meteora_dlmm_instructions/parsers/meteora_dlmm_interface/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "meteora_dlmm_interface" 3 | version = "0.8.2" 4 | edition = "2021" 5 | 6 | [dependencies.borsh] 7 | version = "^0.10" 8 | 9 | [dependencies.num-derive] 10 | version = "^0.3" 11 | 12 | [dependencies.num-traits] 13 | version = "^0.2" 14 | 15 | [dependencies.serde] 16 | optional = true 17 | version = "^1.0" 18 | 19 | [dependencies.solana-program] 20 | version = "^2.1.7" 21 | 22 | [dependencies.thiserror] 23 | version = "^1.0" 24 | 25 | [dependencies.strum] 26 | version = "0.26.3" 27 | 28 | [dependencies.strum_macros] 29 | version = "0.26.4" 30 | 31 | [dependencies.Inflector] 32 | version = "=0.11.4" 33 | -------------------------------------------------------------------------------- /Meteora/Rust/stream_and_parse_meteora_dlmm_instructions/parsers/meteora_dlmm_interface/src/lib.rs: -------------------------------------------------------------------------------- 1 | solana_program::declare_id!("LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo"); 2 | pub mod accounts; 3 | pub use accounts::*; 4 | pub mod typedefs; 5 | pub use typedefs::*; 6 | pub mod instructions; 7 | pub use instructions::*; 8 | pub mod errors; 9 | pub use errors::*; 10 | pub mod events; 11 | pub use events::*; 12 | -------------------------------------------------------------------------------- /Meteora/Rust/stream_and_parse_meteora_dlmm_instructions/src/serialization.rs: -------------------------------------------------------------------------------- 1 | use solana_sdk::pubkey::Pubkey; 2 | 3 | pub fn serialize_pubkey(value: &Pubkey, serializer: S) -> Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | serializer.serialize_str(&value.to_string()) 8 | } 9 | 10 | pub fn serialize_option_pubkey(value: &Option, serializer: S) -> Result 11 | where 12 | S: serde::Serializer, 13 | { 14 | match value { 15 | Some(pubkey) => serializer.serialize_str(&pubkey.to_string()), 16 | None => serializer.serialize_none(), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Meteora/Rust/stream_and_parse_meteora_pools_accounts/.gitignore: -------------------------------------------------------------------------------- 1 | Cargo.lock 2 | target/ -------------------------------------------------------------------------------- /Meteora/Rust/stream_and_parse_meteora_pools_accounts/README.md: -------------------------------------------------------------------------------- 1 | # Streaming and parsing Meteora Pools accounts using gRPC 2 | 3 | This project streams Meteora Pools account updates in real-time using the using gRPC, and then decodes the received account updates using the associated program IDL. By utilizing the IDL for parsing, it enables real-time analysis and insights into DLMM activities on the Solana blockchain. 4 | 5 | 6 | ``` 7 | $ cargo run -- --endpoint --x-token 8 | ``` 9 | 10 | ![screenshot](assets/usage-screenshot.png?raw=true "Screenshot") 11 | 12 | ## Docs 13 | Shyft Website: [https://shyft.to/#solana-grpc-streaming-service] 14 | Shyft gRPC Docs: [https://docs.shyft.to/solana-fast-grpc/grpc-docs] 15 | -------------------------------------------------------------------------------- /Meteora/Rust/stream_and_parse_meteora_pools_accounts/assets/usage-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Meteora/Rust/stream_and_parse_meteora_pools_accounts/assets/usage-screenshot.png -------------------------------------------------------------------------------- /Meteora/Rust/stream_and_parse_meteora_pools_accounts/parsers/meteora_pools_interface/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | Cargo.lock -------------------------------------------------------------------------------- /Meteora/Rust/stream_and_parse_meteora_pools_accounts/parsers/meteora_pools_interface/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "meteora_pools_interface" 3 | version = "0.5.2" 4 | edition = "2021" 5 | 6 | [dependencies.borsh] 7 | version = "^0.10" 8 | 9 | [dependencies.num-derive] 10 | version = "^0.3" 11 | 12 | [dependencies.num-traits] 13 | version = "^0.2" 14 | 15 | [dependencies.serde] 16 | optional = true 17 | version = "^1.0" 18 | 19 | [dependencies.solana-program] 20 | version = "^2.1.7" 21 | 22 | [dependencies.thiserror] 23 | version = "^1.0" 24 | 25 | [dependencies.strum] 26 | version = "0.26.3" 27 | 28 | [dependencies.strum_macros] 29 | version = "0.26.4" 30 | 31 | [dependencies.Inflector] 32 | version = "=0.11.4" 33 | -------------------------------------------------------------------------------- /Meteora/Rust/stream_and_parse_meteora_pools_accounts/parsers/meteora_pools_interface/src/lib.rs: -------------------------------------------------------------------------------- 1 | solana_program::declare_id!("Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB"); 2 | pub mod accounts; 3 | pub use accounts::*; 4 | pub mod typedefs; 5 | pub use typedefs::*; 6 | pub mod instructions; 7 | pub use instructions::*; 8 | pub mod errors; 9 | pub use errors::*; 10 | pub mod events; 11 | pub use events::*; 12 | -------------------------------------------------------------------------------- /Meteora/Rust/stream_and_parse_meteora_pools_instructions/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock -------------------------------------------------------------------------------- /Meteora/Rust/stream_and_parse_meteora_pools_instructions/assets/usage-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Meteora/Rust/stream_and_parse_meteora_pools_instructions/assets/usage-screenshot.png -------------------------------------------------------------------------------- /Meteora/Rust/stream_and_parse_meteora_pools_instructions/parsers/meteora_pools_interface/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | Cargo.lock -------------------------------------------------------------------------------- /Meteora/Rust/stream_and_parse_meteora_pools_instructions/parsers/meteora_pools_interface/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "meteora_pools_interface" 3 | version = "0.5.2" 4 | edition = "2021" 5 | 6 | [dependencies.borsh] 7 | version = "^0.10" 8 | 9 | [dependencies.num-derive] 10 | version = "^0.3" 11 | 12 | [dependencies.num-traits] 13 | version = "^0.2" 14 | 15 | [dependencies.serde] 16 | optional = true 17 | version = "^1.0" 18 | 19 | [dependencies.solana-program] 20 | version = "^2.1.7" 21 | 22 | [dependencies.thiserror] 23 | version = "^1.0" 24 | 25 | [dependencies.strum] 26 | version = "0.26.3" 27 | 28 | [dependencies.strum_macros] 29 | version = "0.26.4" 30 | 31 | [dependencies.Inflector] 32 | version = "=0.11.4" 33 | -------------------------------------------------------------------------------- /Meteora/Rust/stream_and_parse_meteora_pools_instructions/parsers/meteora_pools_interface/src/lib.rs: -------------------------------------------------------------------------------- 1 | solana_program::declare_id!("Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB"); 2 | pub mod accounts; 3 | pub use accounts::*; 4 | pub mod typedefs; 5 | pub use typedefs::*; 6 | pub mod instructions; 7 | pub use instructions::*; 8 | pub mod errors; 9 | pub use errors::*; 10 | pub mod events; 11 | pub use events::*; 12 | -------------------------------------------------------------------------------- /Meteora/Rust/stream_and_parse_meteora_pools_instructions/src/serialization.rs: -------------------------------------------------------------------------------- 1 | use solana_sdk::pubkey::Pubkey; 2 | 3 | pub fn serialize_pubkey(value: &Pubkey, serializer: S) -> Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | serializer.serialize_str(&value.to_string()) 8 | } 9 | 10 | pub fn serialize_option_pubkey(value: &Option, serializer: S) -> Result 11 | where 12 | S: serde::Serializer, 13 | { 14 | match value { 15 | Some(pubkey) => serializer.serialize_str(&pubkey.to_string()), 16 | None => serializer.serialize_none(), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Meteora/Typescript/stream_and_parse_meteora_dlmm_accounts/.env: -------------------------------------------------------------------------------- 1 | GRPC_URL= 2 | X_TOKEN= -------------------------------------------------------------------------------- /Meteora/Typescript/stream_and_parse_meteora_dlmm_accounts/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /Meteora/Typescript/stream_and_parse_meteora_dlmm_accounts/assets/meteora-usage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Meteora/Typescript/stream_and_parse_meteora_dlmm_accounts/assets/meteora-usage.png -------------------------------------------------------------------------------- /Meteora/Typescript/stream_and_parse_meteora_dlmm_accounts/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shyft", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.ts", 6 | "scripts": { 7 | "start": "npx ts-node index.ts", 8 | "build": "npx tsc" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "@project-serum/anchor": "^0.26.0", 14 | "decimal.js": "^10.4.3", 15 | "@shyft-to/solana-transaction-parser": "^1.1.17", 16 | "@solana/buffer-layout": "^4.0.1", 17 | "@solana/buffer-layout-utils": "^0.2.0", 18 | "@solana/web3.js": "^1.90.0", 19 | "@triton-one/yellowstone-grpc": "^0.4.0", 20 | "bs58": "^5.0.0", 21 | "dotenv": "^16.4.5", 22 | "lodash": "^4.17.21" 23 | }, 24 | "devDependencies": { 25 | "ts-node": "^10.9.2", 26 | "typescript": "^4.9.3" 27 | } 28 | } -------------------------------------------------------------------------------- /Meteora/Typescript/stream_and_parse_meteora_dlmm_accounts/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Meteora/Typescript/stream_and_parse_meteora_dlmm_transactions/.env: -------------------------------------------------------------------------------- 1 | #Add your environment details, and rename this file to .env to run yoru project 2 | GRPC_URL= 3 | X_TOKEN= -------------------------------------------------------------------------------- /Meteora/Typescript/stream_and_parse_meteora_dlmm_transactions/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /Meteora/Typescript/stream_and_parse_meteora_dlmm_transactions/assets/meteora_dlmm_screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Meteora/Typescript/stream_and_parse_meteora_dlmm_transactions/assets/meteora_dlmm_screenshot.png -------------------------------------------------------------------------------- /Meteora/Typescript/stream_and_parse_meteora_dlmm_transactions/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shyft", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.ts", 6 | "scripts": { 7 | "start": "npx ts-node index.ts", 8 | "build": "npx tsc" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "@triton-one/yellowstone-grpc": "^0.4.0", 14 | "@solana/web3.js": "^1.90.0", 15 | "@project-serum/anchor": "^0.26.0", 16 | "@shyft-to/solana-transaction-parser": "^1.1.17", 17 | "@solana/buffer-layout": "^4.0.1", 18 | "@solana/buffer-layout-utils": "^0.2.0", 19 | "lodash": "^4.17.21", 20 | "dotenv": "^16.4.5" 21 | }, 22 | "devDependencies": { 23 | "ts-node": "^10.9.2", 24 | "typescript": "^4.9.3" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Meteora/Typescript/stream_and_parse_meteora_dlmm_transactions/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Meteora/Typescript/stream_and_parse_meteora_pools_account/.env: -------------------------------------------------------------------------------- 1 | GRPC_URL= 2 | X_TOKEN= -------------------------------------------------------------------------------- /Meteora/Typescript/stream_and_parse_meteora_pools_account/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /Meteora/Typescript/stream_and_parse_meteora_pools_account/assets/meteora-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Meteora/Typescript/stream_and_parse_meteora_pools_account/assets/meteora-screenshot.png -------------------------------------------------------------------------------- /Meteora/Typescript/stream_and_parse_meteora_pools_account/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Meteora/Typescript/stream_and_parse_meteora_pools_transactions/.env: -------------------------------------------------------------------------------- 1 | #Add your environment details, and rename this file to .env to run yoru project 2 | GRPC_URL= 3 | X_TOKEN= -------------------------------------------------------------------------------- /Meteora/Typescript/stream_and_parse_meteora_pools_transactions/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /Meteora/Typescript/stream_and_parse_meteora_pools_transactions/assets/meteora_pool_screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Meteora/Typescript/stream_and_parse_meteora_pools_transactions/assets/meteora_pool_screenshot.png -------------------------------------------------------------------------------- /Meteora/Typescript/stream_and_parse_meteora_pools_transactions/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shyft", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.ts", 6 | "scripts": { 7 | "start": "npx ts-node index.ts", 8 | "build": "npx tsc" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "@triton-one/yellowstone-grpc": "^0.4.0", 14 | "@solana/web3.js": "^1.90.0", 15 | "@project-serum/anchor": "^0.26.0", 16 | "@shyft-to/solana-transaction-parser": "^1.1.17", 17 | "@solana/buffer-layout": "^4.0.1", 18 | "@solana/buffer-layout-utils": "^0.2.0", 19 | "lodash": "^4.17.21", 20 | "dotenv": "^16.4.5" 21 | }, 22 | "devDependencies": { 23 | "ts-node": "^10.9.2", 24 | "typescript": "^4.9.3" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Meteora/Typescript/stream_and_parse_meteora_pools_transactions/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Moonshot/Typescript/grpc-moonshot/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /Moonshot/Typescript/grpc-moonshot/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shyft", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.ts", 6 | "scripts": { 7 | "start": "npx ts-node index.ts", 8 | "build": "npx tsc" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "@triton-one/yellowstone-grpc": "^0.4.0", 14 | "@solana/web3.js": "^1.90.0", 15 | "@project-serum/anchor": "^0.26.0", 16 | "@shyft-to/solana-transaction-parser": "^1.1.17", 17 | "@solana/buffer-layout": "^4.0.1", 18 | "@solana/buffer-layout-utils": "^0.2.0", 19 | "dotenv": "^16.4.5", 20 | "lodash": "^4.17.21", 21 | "node-telegram-bot-api": "^0.64.0", 22 | "bs58": "^5.0.0" 23 | }, 24 | "devDependencies": { 25 | "ts-node": "^10.9.2", 26 | "typescript": "^4.9.3" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Moonshot/Typescript/grpc-moonshot/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Moonshot/Typescript/grpc-moonshot/utils/decodeTransaction.ts: -------------------------------------------------------------------------------- 1 | import base58 from "bs58"; 2 | 3 | export function decodeTransact(data){ 4 | const output = data?base58.encode(Buffer.from(data,'base64')):""; 5 | return output; 6 | } -------------------------------------------------------------------------------- /Orca/Rust/stream_and_parse_whirlpool_account_updates/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock -------------------------------------------------------------------------------- /Orca/Rust/stream_and_parse_whirlpool_account_updates/README.md: -------------------------------------------------------------------------------- 1 | # Streaming and parsing Whirlpool accounts using gRPC 2 | 3 | This project leverages Solana's gRPC streaming capabilities to efficiently monitor Whirlpool account data. By utilizing the IDL for parsing, it enables real-time analysis and insights into Orca Whirlpool activities on the Solana blockchain. 4 | 5 | ``` 6 | $ cargo run -- --endpoint --x-token 7 | ``` 8 | 9 | ![screenshot](assets/usage-screenshot.png?raw=true "Screenshot") 10 | 11 | ## Docs 12 | Shyft Website: [https://shyft.to/#solana-grpc-streaming-service] 13 | Shyft gRPC Docs: [https://docs.shyft.to/solana-fast-grpc/grpc-docs] 14 | -------------------------------------------------------------------------------- /Orca/Rust/stream_and_parse_whirlpool_account_updates/assets/usage-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Orca/Rust/stream_and_parse_whirlpool_account_updates/assets/usage-screenshot.png -------------------------------------------------------------------------------- /Orca/Rust/stream_and_parse_whirlpool_account_updates/parsers/whirlpool_interface/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | Cargo.lock -------------------------------------------------------------------------------- /Orca/Rust/stream_and_parse_whirlpool_account_updates/parsers/whirlpool_interface/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "whirlpool_interface" 3 | version = "0.3.0" 4 | edition = "2021" 5 | 6 | [dependencies.borsh] 7 | version = "^0.10" 8 | 9 | [dependencies.num-derive] 10 | version = "^0.3" 11 | 12 | [dependencies.num-traits] 13 | version = "^0.2" 14 | 15 | [dependencies.serde] 16 | optional = true 17 | version = "^1.0" 18 | 19 | [dependencies.solana-program] 20 | version = "^2.1.7" 21 | 22 | [dependencies.thiserror] 23 | version = "^1.0" 24 | 25 | [dependencies.strum] 26 | version = "0.26.3" 27 | 28 | [dependencies.strum_macros] 29 | version = "0.26.4" 30 | 31 | [dependencies.Inflector] 32 | version = "=0.11.4" 33 | -------------------------------------------------------------------------------- /Orca/Rust/stream_and_parse_whirlpool_account_updates/parsers/whirlpool_interface/README.md: -------------------------------------------------------------------------------- 1 | # Generated using [solores](https://github.com/igneous-labs/solores) 2 | Solana IDL to Rust client / CPI interface generator. 3 | 4 | # Installation 5 | `cargo install solores` to install the CLI binary. -------------------------------------------------------------------------------- /Orca/Rust/stream_and_parse_whirlpool_account_updates/parsers/whirlpool_interface/src/lib.rs: -------------------------------------------------------------------------------- 1 | solana_program::declare_id!("whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc"); 2 | pub mod accounts; 3 | pub use accounts::*; 4 | pub mod typedefs; 5 | pub use typedefs::*; 6 | pub mod instructions; 7 | pub use instructions::*; 8 | pub mod errors; 9 | pub use errors::*; 10 | pub mod serializer; 11 | -------------------------------------------------------------------------------- /Orca/Rust/stream_and_parse_whirlpool_transactions/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock -------------------------------------------------------------------------------- /Orca/Rust/stream_and_parse_whirlpool_transactions/README.md: -------------------------------------------------------------------------------- 1 | # Whirlpool gRPC transaction stream and parse instruction in Rust 2 | 3 | ``` 4 | $ cargo run -- --endpoint --x-token 5 | ``` 6 | 7 | ![screenshot](assets/usage-screenshot.png?raw=true "Screenshot") 8 | 9 | ## Notes 10 | 11 | gRPC client example in rust: [https://github.com/rpcpool/yellowstone-grpc/tree/master/examples/rust] -------------------------------------------------------------------------------- /Orca/Rust/stream_and_parse_whirlpool_transactions/assets/usage-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Orca/Rust/stream_and_parse_whirlpool_transactions/assets/usage-screenshot.png -------------------------------------------------------------------------------- /Orca/Rust/stream_and_parse_whirlpool_transactions/parsers/whirlpool_interface/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | Cargo.lock -------------------------------------------------------------------------------- /Orca/Rust/stream_and_parse_whirlpool_transactions/parsers/whirlpool_interface/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "whirlpool_interface" 3 | version = "0.3.0" 4 | edition = "2021" 5 | 6 | [dependencies.borsh] 7 | version = "^0.10" 8 | 9 | [dependencies.num-derive] 10 | version = "^0.3" 11 | 12 | [dependencies.num-traits] 13 | version = "^0.2" 14 | 15 | [dependencies.serde] 16 | optional = true 17 | version = "^1.0" 18 | 19 | [dependencies.solana-program] 20 | version = "^2.1.7" 21 | 22 | [dependencies.thiserror] 23 | version = "^1.0" 24 | 25 | [dependencies.strum] 26 | version = "0.26.3" 27 | 28 | [dependencies.strum_macros] 29 | version = "0.26.4" 30 | 31 | [dependencies.Inflector] 32 | version = "=0.11.4" 33 | -------------------------------------------------------------------------------- /Orca/Rust/stream_and_parse_whirlpool_transactions/parsers/whirlpool_interface/README.md: -------------------------------------------------------------------------------- 1 | # Generated using [solores](https://github.com/igneous-labs/solores) 2 | Solana IDL to Rust client / CPI interface generator. 3 | 4 | # Installation 5 | `cargo install solores` to install the CLI binary. -------------------------------------------------------------------------------- /Orca/Rust/stream_and_parse_whirlpool_transactions/parsers/whirlpool_interface/src/lib.rs: -------------------------------------------------------------------------------- 1 | solana_program::declare_id!("whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc"); 2 | pub mod accounts; 3 | pub use accounts::*; 4 | pub mod typedefs; 5 | pub use typedefs::*; 6 | pub mod instructions; 7 | pub use instructions::*; 8 | pub mod errors; 9 | pub use errors::*; 10 | pub mod serializer; 11 | -------------------------------------------------------------------------------- /Orca/Rust/stream_and_parse_whirlpool_transactions/src/serialization.rs: -------------------------------------------------------------------------------- 1 | use solana_sdk::pubkey::Pubkey; 2 | 3 | pub fn serialize_pubkey(value: &Pubkey, serializer: S) -> Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | serializer.serialize_str(&value.to_string()) 8 | } 9 | 10 | pub fn serialize_option_pubkey(value: &Option, serializer: S) -> Result 11 | where 12 | S: serde::Serializer, 13 | { 14 | match value { 15 | Some(pubkey) => serializer.serialize_str(&pubkey.to_string()), 16 | None => serializer.serialize_none(), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Orca/Typescript/grpc-orca-txn-liquidity_added/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /Orca/Typescript/grpc-orca-txn-liquidity_added/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shyft", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.ts", 6 | "scripts": { 7 | "start": "npx ts-node index.ts", 8 | "build": "npx tsc" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "@triton-one/yellowstone-grpc": "^0.4.0", 14 | "@solana/web3.js": "^1.90.0", 15 | "@project-serum/anchor": "^0.26.0", 16 | "@shyft-to/solana-transaction-parser": "^1.1.17", 17 | "@solana/buffer-layout": "^4.0.1", 18 | "@solana/buffer-layout-utils": "^0.2.0", 19 | "dotenv": "^16.4.5", 20 | "lodash": "^4.17.21", 21 | "node-telegram-bot-api": "^0.64.0", 22 | "bs58": "^5.0.0" 23 | }, 24 | "devDependencies": { 25 | "ts-node": "^10.9.2", 26 | "typescript": "^4.9.3" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Orca/Typescript/grpc-orca-txn-liquidity_added/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Orca/Typescript/grpc-orca-txn-liquidity_added/utils/decodeTransaction.ts: -------------------------------------------------------------------------------- 1 | import base58 from "bs58"; 2 | 3 | export function decodeTransact(data){ 4 | const output = data?base58.encode(Buffer.from(data,'base64')):""; 5 | return output; 6 | } -------------------------------------------------------------------------------- /Orca/Typescript/grpc-orca-txn-liquidity_added/utils/logTXN.ts: -------------------------------------------------------------------------------- 1 | export function searchForInitialize2(transaction) { 2 | const logMessages = transaction.meta?.logMessages || []; 3 | if (logMessages.some(log => log.includes('IncreaseLiquidity'))) { 4 | return transaction; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Orca/Typescript/grpc-orca-txn_memcmp/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /Orca/Typescript/grpc-orca-txn_memcmp/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Orca/Typescript/grpc-orca-txn_memcmp/utils/calculatePrice.ts: -------------------------------------------------------------------------------- 1 | import { BN } from "@project-serum/anchor"; 2 | import { MathUtil } from "./maths"; 3 | import Decimal from "decimal.js"; 4 | 5 | export function sqrtPriceX64ToPrice( 6 | sqrtPriceX64: BN, 7 | decimalsA: number, 8 | decimalsB: number, 9 | ) { 10 | return MathUtil.fromX64(sqrtPriceX64) 11 | .pow(2) 12 | .mul(Decimal.pow(10, decimalsA - decimalsB)); 13 | } 14 | -------------------------------------------------------------------------------- /Orca/Typescript/grpc-orca-txn_memcmp/utils/decodeTransaction.ts: -------------------------------------------------------------------------------- 1 | import base58 from "bs58"; 2 | 3 | export function decodeTransact(data){ 4 | const output = data?base58.encode(Buffer.from(data,'base64')):""; 5 | return output; 6 | } -------------------------------------------------------------------------------- /Orca/Typescript/grpc-orca-txn_memcmp/utils/tokenInfo.ts: -------------------------------------------------------------------------------- 1 | const api = "api" 2 | var myHeaders = new Headers(); 3 | myHeaders.append("x-api-key", api); 4 | 5 | var requestOptions:any = { 6 | method: 'GET', 7 | headers: myHeaders, 8 | redirect: 'follow' 9 | }; 10 | 11 | export async function getTokenInfo(address){ 12 | const info = await fetch(`https://api.shyft.to/sol/v1/token/get_info?network=mainnet-beta&token_address=${address}`, requestOptions) 13 | const infoJson = await info.json(); 14 | const result = infoJson.result; 15 | const decimal = result?.decimals; 16 | return decimal 17 | } 18 | -------------------------------------------------------------------------------- /Orca/Typescript/stream_and_parse_all_whirlpool_accounts/.env.sample: -------------------------------------------------------------------------------- 1 | #Add your environment details, and rename this file to .env to run your project 2 | GRPC_URL= 3 | X_TOKEN= -------------------------------------------------------------------------------- /Orca/Typescript/stream_and_parse_all_whirlpool_accounts/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | .env -------------------------------------------------------------------------------- /Orca/Typescript/stream_and_parse_all_whirlpool_accounts/assets/stream_whirlpool_accounts.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Orca/Typescript/stream_and_parse_all_whirlpool_accounts/assets/stream_whirlpool_accounts.jpg -------------------------------------------------------------------------------- /Orca/Typescript/stream_and_parse_all_whirlpool_accounts/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shyft", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.ts", 6 | "scripts": { 7 | "start": "npx ts-node index.ts", 8 | "build": "npx tsc" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "@project-serum/anchor": "^0.26.0", 14 | "@project-serum/borsh": "^0.2.5", 15 | "@solana/buffer-layout": "^4.0.1", 16 | "@solana/buffer-layout-utils": "^0.2.0", 17 | "@solana/web3.js": "^1.90.0", 18 | "@triton-one/yellowstone-grpc": "^0.4.0", 19 | "bs58": "^5.0.0", 20 | "dotenv": "^16.4.5", 21 | "lodash": "^4.17.21" 22 | }, 23 | "devDependencies": { 24 | "ts-node": "^10.9.2", 25 | "typescript": "^4.9.3" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Orca/Typescript/stream_and_parse_all_whirlpool_accounts/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Orca/Typescript/stream_and_parse_whirlpool_transactions/.env.sample: -------------------------------------------------------------------------------- 1 | #Add your environment details, and rename this file to .env to run yoru project 2 | GRPC_URL= 3 | X_TOKEN= -------------------------------------------------------------------------------- /Orca/Typescript/stream_and_parse_whirlpool_transactions/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | .env 4 | -------------------------------------------------------------------------------- /Orca/Typescript/stream_and_parse_whirlpool_transactions/assets/stream_parsed_raydium_txns.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Orca/Typescript/stream_and_parse_whirlpool_transactions/assets/stream_parsed_raydium_txns.jpg -------------------------------------------------------------------------------- /Orca/Typescript/stream_and_parse_whirlpool_transactions/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shyft", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.ts", 6 | "scripts": { 7 | "start": "npx ts-node index.ts", 8 | "build": "npx tsc" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "@triton-one/yellowstone-grpc": "^0.4.0", 14 | "@solana/web3.js": "^1.90.0", 15 | "@project-serum/anchor": "^0.26.0", 16 | "@shyft-to/solana-transaction-parser": "^1.1.17", 17 | "@solana/buffer-layout": "^4.0.1", 18 | "@solana/buffer-layout-utils": "^0.2.0", 19 | "dotenv": "^16.4.5", 20 | "lodash": "^4.17.21", 21 | "bs58": "^5.0.0" 22 | }, 23 | "devDependencies": { 24 | "ts-node": "^10.9.2", 25 | "typescript": "^4.9.3" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Orca/Typescript/stream_and_parse_whirlpool_transactions/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Orca/Typescript/stream_and_parse_whirlpool_transactions/utils/transactionOutput.ts: -------------------------------------------------------------------------------- 1 | export function transactionOutput(txn){ 2 | const type = txn.instructions[0].name === "sell"?"SELL":"BUY"; 3 | const events = txn.events[0].data; 4 | //console.log(txn.instructions[0]); 5 | const mint = events?.mint; 6 | const solAmount = events?.solAmount/1000000000 7 | const tokenAmount = events?.tokenAmount; 8 | const user = events?.user 9 | return{ 10 | type, 11 | mint, 12 | solAmount, 13 | tokenAmount, 14 | user 15 | } 16 | } -------------------------------------------------------------------------------- /PumpFun/Rust/Stream_migrated_pumpfun_tokens/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock -------------------------------------------------------------------------------- /PumpFun/Rust/bonding_curve_progress/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock -------------------------------------------------------------------------------- /PumpFun/Rust/bonding_curve_progress/README.md: -------------------------------------------------------------------------------- 1 | # Monitoring Bonding Curve Progress 2 | 3 | This project is designed to stream and monitor the progress of bonding curves on Pumpfun—a platform that enables the tracking and analysis of token dynamics. By leveraging the power of gRPC, this tool allows users to get real-time updates on the bonding curve progress of tokens listed on Pumpfun, providing insights into token behavior, pricing mechanisms, and market liquidity. 4 | ``` 5 | $ cargo run -- --endpoint --x-token 6 | ``` 7 | 8 | ![screenshot](assets/usage-screenshot.png?raw=true "Screenshot") 9 | 10 | ## Notes 11 | Please input your API_KEY at get_balance.rs 12 | 13 | gRPC client example in rust: [https://github.com/rpcpool/yellowstone-grpc/tree/master/examples/rust] -------------------------------------------------------------------------------- /PumpFun/Rust/bonding_curve_progress/assets/usage-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/PumpFun/Rust/bonding_curve_progress/assets/usage-screenshot.png -------------------------------------------------------------------------------- /PumpFun/Rust/bonding_curve_progress/parsers/pump_interface/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pump_interface" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies.borsh] 7 | version = "^0.10" 8 | 9 | [dependencies.num-derive] 10 | version = "^0.3" 11 | 12 | [dependencies.num-traits] 13 | version = "^0.2" 14 | 15 | [dependencies.serde] 16 | optional = true 17 | version = "^1.0" 18 | 19 | [dependencies.solana-program] 20 | version = "^2.1.7" 21 | 22 | [dependencies.thiserror] 23 | version = "^1.0" 24 | 25 | [dependencies.strum] 26 | version = "0.26.3" 27 | 28 | [dependencies.strum_macros] 29 | version = "0.26.4" 30 | 31 | [dependencies.Inflector] 32 | version = "=0.11.4" -------------------------------------------------------------------------------- /PumpFun/Rust/bonding_curve_progress/parsers/pump_interface/src/lib.rs: -------------------------------------------------------------------------------- 1 | solana_program::declare_id!("6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"); 2 | pub mod accounts; 3 | pub use accounts::*; 4 | pub mod instructions; 5 | pub use instructions::*; 6 | pub mod errors; 7 | pub use errors::*; 8 | pub mod events; 9 | pub use events::*; 10 | -------------------------------------------------------------------------------- /PumpFun/Rust/bonding_curve_progress/src/get_balance.rs: -------------------------------------------------------------------------------- 1 | use solana_client::rpc_client::RpcClient; 2 | use solana_client::client_error::ClientError; 3 | use anyhow::Context; 4 | use solana_program::pubkey::Pubkey; 5 | use std::str::FromStr; 6 | 7 | const API_KEY: &str = "API_KEY"; 8 | 9 | pub fn get_sol_balance(token: &str) -> u64{ 10 | let rpc_url = format!("https://rpc.shyft.to?api_key={}",API_KEY); 11 | let client = RpcClient::new(rpc_url); 12 | client.get_account(&Pubkey::from_str(token).unwrap()).unwrap().lamports / 1000000000 13 | } 14 | -------------------------------------------------------------------------------- /PumpFun/Rust/bonding_curve_progress/src/serialization.rs: -------------------------------------------------------------------------------- 1 | use solana_sdk::pubkey::Pubkey; 2 | 3 | pub fn serialize_pubkey(value: &Pubkey, serializer: S) -> Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | serializer.serialize_str(&value.to_string()) 8 | } 9 | 10 | pub fn serialize_option_pubkey(value: &Option, serializer: S) -> Result 11 | where 12 | S: serde::Serializer, 13 | { 14 | match value { 15 | Some(pubkey) => serializer.serialize_str(&pubkey.to_string()), 16 | None => serializer.serialize_none(), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /PumpFun/Rust/bonding_curve_progress/src/token_serializable.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/PumpFun/Rust/bonding_curve_progress/src/token_serializable.rs -------------------------------------------------------------------------------- /PumpFun/Rust/grpc-stream-and-parse-pump-fun-amm-account/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock -------------------------------------------------------------------------------- /PumpFun/Rust/grpc-stream-and-parse-pump-fun-amm-account/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/PumpFun/Rust/grpc-stream-and-parse-pump-fun-amm-account/README.md -------------------------------------------------------------------------------- /PumpFun/Rust/grpc-stream-and-parse-pump-fun-amm-account/assets/pumpfun_amm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/PumpFun/Rust/grpc-stream-and-parse-pump-fun-amm-account/assets/pumpfun_amm.png -------------------------------------------------------------------------------- /PumpFun/Rust/grpc-stream-and-parse-pump-fun-amm-account/parsers/pump_interface/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pump_interface" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies.borsh] 7 | version = "^0.10" 8 | 9 | [dependencies.num-derive] 10 | version = "^0.3" 11 | 12 | [dependencies.num-traits] 13 | version = "^0.2" 14 | 15 | [dependencies.serde] 16 | optional = true 17 | version = "^1.0" 18 | 19 | [dependencies.solana-program] 20 | version = "^2.1.7" 21 | 22 | [dependencies.thiserror] 23 | version = "^1.0" 24 | 25 | [dependencies.strum] 26 | version = "0.26.3" 27 | 28 | [dependencies.strum_macros] 29 | version = "0.26.4" 30 | 31 | [dependencies.Inflector] 32 | version = "=0.11.4" -------------------------------------------------------------------------------- /PumpFun/Rust/grpc-stream-and-parse-pump-fun-amm-account/parsers/pump_interface/src/lib.rs: -------------------------------------------------------------------------------- 1 | solana_program::declare_id!("pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"); 2 | pub mod accounts; 3 | pub use accounts::*; 4 | -------------------------------------------------------------------------------- /PumpFun/Rust/grpc-stream-and-parse-pump-fun-amm-transaction/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock -------------------------------------------------------------------------------- /PumpFun/Rust/grpc-stream-and-parse-pump-fun-amm-transaction/assets/pump-amm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/PumpFun/Rust/grpc-stream-and-parse-pump-fun-amm-transaction/assets/pump-amm.png -------------------------------------------------------------------------------- /PumpFun/Rust/grpc-stream-and-parse-pump-fun-amm-transaction/parsers/pumpfun_amm_interface/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | Cargo.lock -------------------------------------------------------------------------------- /PumpFun/Rust/grpc-stream-and-parse-pump-fun-amm-transaction/parsers/pumpfun_amm_interface/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pumpfun_amm_interface" 3 | version = "0.8.2" 4 | edition = "2021" 5 | 6 | [dependencies.borsh] 7 | version = "^0.10" 8 | 9 | [dependencies.num-derive] 10 | version = "^0.3" 11 | 12 | [dependencies.num-traits] 13 | version = "^0.2" 14 | 15 | [dependencies.serde] 16 | optional = true 17 | version = "^1.0" 18 | 19 | [dependencies.solana-program] 20 | version = "^2.1.7" 21 | 22 | [dependencies.thiserror] 23 | version = "^1.0" 24 | 25 | [dependencies.strum] 26 | version = "0.26.3" 27 | 28 | [dependencies.strum_macros] 29 | version = "0.26.4" 30 | 31 | [dependencies.Inflector] 32 | version = "=0.11.4" -------------------------------------------------------------------------------- /PumpFun/Rust/grpc-stream-and-parse-pump-fun-amm-transaction/parsers/pumpfun_amm_interface/src/lib.rs: -------------------------------------------------------------------------------- 1 | solana_program::declare_id!("CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C"); 2 | pub mod typedefs; 3 | pub use typedefs::*; 4 | pub mod instructions; 5 | pub use instructions::*; 6 | pub mod errors; 7 | pub use errors::*; 8 | pub mod events; 9 | pub use events::*; 10 | -------------------------------------------------------------------------------- /PumpFun/Rust/grpc-stream-and-parse-pump-fun-amm-transaction/src/serialization.rs: -------------------------------------------------------------------------------- 1 | use solana_sdk::pubkey::Pubkey; 2 | 3 | pub fn serialize_pubkey(value: &Pubkey, serializer: S) -> Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | serializer.serialize_str(&value.to_string()) 8 | } 9 | 10 | pub fn serialize_option_pubkey(value: &Option, serializer: S) -> Result 11 | where 12 | S: serde::Serializer, 13 | { 14 | match value { 15 | Some(pubkey) => serializer.serialize_str(&pubkey.to_string()), 16 | None => serializer.serialize_none(), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /PumpFun/Rust/pumpfun_indexer/.dockerignore: -------------------------------------------------------------------------------- 1 | **/target -------------------------------------------------------------------------------- /PumpFun/Rust/pumpfun_indexer/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock -------------------------------------------------------------------------------- /PumpFun/Rust/pumpfun_indexer/Dockerfile: -------------------------------------------------------------------------------- 1 | # Build stage 2 | FROM rust:1.69-buster as builder 3 | 4 | WORKDIR /app 5 | 6 | # accept the build argument 7 | ARG DATABASE_URL 8 | 9 | ENV DATABASE_URL=$DATABASE_URL 10 | 11 | COPY . . 12 | 13 | RUN cargo build --release 14 | 15 | # Production stage 16 | FROM debian:buster-slim 17 | 18 | WORKDIR /usr/local/bin 19 | 20 | COPY --from=builder /app/target/release/rust-crud-api . 21 | 22 | CMD ["./rust-crud-api"] -------------------------------------------------------------------------------- /PumpFun/Rust/pumpfun_indexer/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.9' 2 | 3 | services: 4 | rustapp: 5 | container_name: rustapp 6 | image: francescoxx/rustapp:1.0.0 7 | build: 8 | context: . 9 | dockerfile: Dockerfile 10 | args: 11 | DATABASE_URL: postgres://postgres:postgres@db:5432/postgres 12 | ports: 13 | - '8080:8080' 14 | depends_on: 15 | - db 16 | db: 17 | container_name: db 18 | image: postgres:12 19 | environment: 20 | POSTGRES_USER: postgres 21 | POSTGRES_PASSWORD: postgres 22 | POSTGRES_DB: postgres 23 | ports: 24 | - '5432:5432' 25 | volumes: 26 | - pgdata:/var/lib/postgresql/data 27 | 28 | volumes: 29 | pgdata: {} 30 | -------------------------------------------------------------------------------- /PumpFun/Rust/pumpfun_indexer/parsers/pump_interface/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pump_interface" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies.borsh] 7 | version = "^0.10" 8 | 9 | [dependencies.num-derive] 10 | version = "^0.3" 11 | 12 | [dependencies.num-traits] 13 | version = "^0.2" 14 | 15 | [dependencies.serde] 16 | optional = true 17 | version = "^1.0" 18 | 19 | [dependencies.solana-program] 20 | version = "^2.1.7" 21 | 22 | [dependencies.thiserror] 23 | version = "^1.0" 24 | 25 | [dependencies.strum] 26 | version = "0.26.3" 27 | 28 | [dependencies.strum_macros] 29 | version = "0.26.4" 30 | 31 | [dependencies.Inflector] 32 | version = "=0.11.4" -------------------------------------------------------------------------------- /PumpFun/Rust/pumpfun_indexer/parsers/pump_interface/src/lib.rs: -------------------------------------------------------------------------------- 1 | solana_program::declare_id!("6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"); 2 | pub mod accounts; 3 | pub use accounts::*; 4 | pub mod instructions; 5 | pub use instructions::*; 6 | pub mod errors; 7 | pub use errors::*; 8 | pub mod events; 9 | pub use events::*; 10 | -------------------------------------------------------------------------------- /PumpFun/Rust/pumpfun_indexer/src/latency_test.rs: -------------------------------------------------------------------------------- 1 | pub fn run_latency(block_time_a : i64, block_time_b: i64) -> i64 { 2 | block_time_a - block_time_b 3 | } -------------------------------------------------------------------------------- /PumpFun/Rust/pumpfun_indexer/src/latest_block.rs: -------------------------------------------------------------------------------- 1 | use solana_client::rpc_client::RpcClient; 2 | use solana_client::client_error::ClientError; 3 | use anyhow::Context; 4 | 5 | 6 | const API_KEY: &str = "api_key"; 7 | 8 | pub fn get_latest_slot() -> anyhow::Result { 9 | let rpc_url = format!("https://rpc.va.shyft.to?api_key={}", API_KEY); 10 | 11 | let client = RpcClient::new(rpc_url); 12 | 13 | client.get_slot().context("Failed to fetch latest slot") 14 | } 15 | -------------------------------------------------------------------------------- /PumpFun/Rust/pumpfun_indexer/src/serialization.rs: -------------------------------------------------------------------------------- 1 | use solana_sdk::pubkey::Pubkey; 2 | 3 | pub fn serialize_pubkey(value: &Pubkey, serializer: S) -> Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | serializer.serialize_str(&value.to_string()) 8 | } 9 | 10 | pub fn serialize_option_pubkey(value: &Option, serializer: S) -> Result 11 | where 12 | S: serde::Serializer, 13 | { 14 | match value { 15 | Some(pubkey) => serializer.serialize_str(&pubkey.to_string()), 16 | None => serializer.serialize_none(), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /PumpFun/Rust/stream_and_parse_pump_transactions/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock -------------------------------------------------------------------------------- /PumpFun/Rust/stream_and_parse_pump_transactions/.gitignore copy: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock -------------------------------------------------------------------------------- /PumpFun/Rust/stream_and_parse_pump_transactions/assets/usage-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/PumpFun/Rust/stream_and_parse_pump_transactions/assets/usage-screenshot.png -------------------------------------------------------------------------------- /PumpFun/Rust/stream_and_parse_pump_transactions/parsers/pump_interface/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pump_interface" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies.borsh] 7 | version = "^0.10" 8 | 9 | [dependencies.num-derive] 10 | version = "^0.3" 11 | 12 | [dependencies.num-traits] 13 | version = "^0.2" 14 | 15 | [dependencies.serde] 16 | optional = true 17 | version = "^1.0" 18 | 19 | [dependencies.solana-program] 20 | version = "^2.1.7" 21 | 22 | [dependencies.thiserror] 23 | version = "^1.0" 24 | 25 | [dependencies.strum] 26 | version = "0.26.3" 27 | 28 | [dependencies.strum_macros] 29 | version = "0.26.4" 30 | 31 | [dependencies.Inflector] 32 | version = "=0.11.4" -------------------------------------------------------------------------------- /PumpFun/Rust/stream_and_parse_pump_transactions/parsers/pump_interface/src/lib.rs: -------------------------------------------------------------------------------- 1 | solana_program::declare_id!("6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"); 2 | pub mod accounts; 3 | pub use accounts::*; 4 | pub mod instructions; 5 | pub use instructions::*; 6 | pub mod errors; 7 | pub use errors::*; 8 | pub mod events; 9 | pub use events::*; 10 | -------------------------------------------------------------------------------- /PumpFun/Rust/stream_and_parse_pump_transactions/src/serialization.rs: -------------------------------------------------------------------------------- 1 | use solana_sdk::pubkey::Pubkey; 2 | 3 | pub fn serialize_pubkey(value: &Pubkey, serializer: S) -> Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | serializer.serialize_str(&value.to_string()) 8 | } 9 | 10 | pub fn serialize_option_pubkey(value: &Option, serializer: S) -> Result 11 | where 12 | S: serde::Serializer, 13 | { 14 | match value { 15 | Some(pubkey) => serializer.serialize_str(&pubkey.to_string()), 16 | None => serializer.serialize_none(), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /PumpFun/Rust/stream_and_parse_pumpfun_account_updates/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock -------------------------------------------------------------------------------- /PumpFun/Rust/stream_and_parse_pumpfun_account_updates/README.md: -------------------------------------------------------------------------------- 1 | # Streaming and parsing Pumpfun accounts using gRPC 2 | 3 | This project leverages Solana's gRPC streaming capabilities to efficiently monitor pump fun account data. By utilizing the IDL for parsing, it enables real-time analysis and insights into pump fun activities on the Solana blockchain. 4 | 5 | ``` 6 | $ cargo run -- --endpoint --x-token 7 | ``` 8 | 9 | ![screenshot](assets/usage-screenshot.png?raw=true "Screenshot") 10 | 11 | ## Docs 12 | Shyft Website: [https://shyft.to/#solana-grpc-streaming-service] 13 | Shyft gRPC Docs: [https://docs.shyft.to/solana-fast-grpc/grpc-docs] 14 | -------------------------------------------------------------------------------- /PumpFun/Rust/stream_and_parse_pumpfun_account_updates/assets/usage-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/PumpFun/Rust/stream_and_parse_pumpfun_account_updates/assets/usage-screenshot.png -------------------------------------------------------------------------------- /PumpFun/Rust/stream_and_parse_pumpfun_account_updates/parsers/pump_interface/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pump_interface" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies.borsh] 7 | version = "^0.10" 8 | 9 | [dependencies.num-derive] 10 | version = "^0.3" 11 | 12 | [dependencies.num-traits] 13 | version = "^0.2" 14 | 15 | [dependencies.serde] 16 | optional = true 17 | version = "^1.0" 18 | 19 | [dependencies.solana-program] 20 | version = "^2.1.7" 21 | 22 | [dependencies.thiserror] 23 | version = "^1.0" 24 | 25 | [dependencies.strum] 26 | version = "0.26.3" 27 | 28 | [dependencies.strum_macros] 29 | version = "0.26.4" 30 | 31 | [dependencies.Inflector] 32 | version = "=0.11.4" -------------------------------------------------------------------------------- /PumpFun/Rust/stream_and_parse_pumpfun_account_updates/parsers/pump_interface/src/lib.rs: -------------------------------------------------------------------------------- 1 | solana_program::declare_id!("6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"); 2 | pub mod accounts; 3 | pub use accounts::*; 4 | pub mod instructions; 5 | pub use instructions::*; 6 | pub mod errors; 7 | pub use errors::*; 8 | pub mod events; 9 | pub use events::*; 10 | -------------------------------------------------------------------------------- /PumpFun/Rust/stream_newly_added_token/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock -------------------------------------------------------------------------------- /PumpFun/Rust/stream_newly_added_token/src/serialization.rs: -------------------------------------------------------------------------------- 1 | // use solana_sdk::pubkey::Pubkey; 2 | 3 | // pub fn serialize_pubkey(value: &Pubkey, serializer: S) -> Result 4 | // where 5 | // S: serde::Serializer, 6 | // { 7 | // serializer.serialize_str(&value.to_string()) 8 | // } 9 | 10 | // pub fn serialize_option_pubkey(value: &Option, serializer: S) -> Result 11 | // where 12 | // S: serde::Serializer, 13 | // { 14 | // match value { 15 | // Some(pubkey) => serializer.serialize_str(&pubkey.to_string()), 16 | // None => serializer.serialize_none(), 17 | // } 18 | // } 19 | -------------------------------------------------------------------------------- /PumpFun/Rust/stream_pump_fun_amm_transactions_and_detect_buy_sell_events/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock -------------------------------------------------------------------------------- /PumpFun/Rust/stream_pump_fun_amm_transactions_and_detect_buy_sell_events/assets/pump-amm-event.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/PumpFun/Rust/stream_pump_fun_amm_transactions_and_detect_buy_sell_events/assets/pump-amm-event.png -------------------------------------------------------------------------------- /PumpFun/Rust/stream_pump_fun_amm_transactions_and_detect_buy_sell_events/parsers/pumpfun_amm_interface/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | Cargo.lock -------------------------------------------------------------------------------- /PumpFun/Rust/stream_pump_fun_amm_transactions_and_detect_buy_sell_events/parsers/pumpfun_amm_interface/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pumpfun_amm_interface" 3 | version = "0.8.2" 4 | edition = "2021" 5 | 6 | [dependencies.borsh] 7 | version = "^0.10" 8 | 9 | [dependencies.num-derive] 10 | version = "^0.3" 11 | 12 | [dependencies.num-traits] 13 | version = "^0.2" 14 | 15 | [dependencies.serde] 16 | optional = true 17 | version = "^1.0" 18 | 19 | [dependencies.solana-program] 20 | version = "^2.1.7" 21 | 22 | [dependencies.thiserror] 23 | version = "^1.0" 24 | 25 | [dependencies.strum] 26 | version = "0.26.3" 27 | 28 | [dependencies.strum_macros] 29 | version = "0.26.4" 30 | 31 | [dependencies.Inflector] 32 | version = "=0.11.4" -------------------------------------------------------------------------------- /PumpFun/Rust/stream_pump_fun_amm_transactions_and_detect_buy_sell_events/parsers/pumpfun_amm_interface/src/lib.rs: -------------------------------------------------------------------------------- 1 | solana_program::declare_id!("CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C"); 2 | pub mod typedefs; 3 | pub use typedefs::*; 4 | pub mod instructions; 5 | pub use instructions::*; 6 | pub mod errors; 7 | pub use errors::*; 8 | pub mod events; 9 | pub use events::*; 10 | -------------------------------------------------------------------------------- /PumpFun/Rust/stream_pump_fun_amm_transactions_and_detect_buy_sell_events/src/serialization.rs: -------------------------------------------------------------------------------- 1 | use solana_sdk::pubkey::Pubkey; 2 | 3 | pub fn serialize_pubkey(value: &Pubkey, serializer: S) -> Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | serializer.serialize_str(&value.to_string()) 8 | } 9 | 10 | pub fn serialize_option_pubkey(value: &Option, serializer: S) -> Result 11 | where 12 | S: serde::Serializer, 13 | { 14 | match value { 15 | Some(pubkey) => serializer.serialize_str(&pubkey.to_string()), 16 | None => serializer.serialize_none(), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /PumpFun/Rust/stream_pump_fun_new_minted_tokens/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock -------------------------------------------------------------------------------- /PumpFun/Rust/stream_pump_fun_new_minted_tokens/.gitignore copy: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock -------------------------------------------------------------------------------- /PumpFun/Rust/stream_pump_fun_new_minted_tokens/assets/usage-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/PumpFun/Rust/stream_pump_fun_new_minted_tokens/assets/usage-screenshot.png -------------------------------------------------------------------------------- /PumpFun/Rust/stream_pump_fun_new_minted_tokens/parsers/pump_interface/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pump_interface" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies.borsh] 7 | version = "^0.10" 8 | 9 | [dependencies.num-derive] 10 | version = "^0.3" 11 | 12 | [dependencies.num-traits] 13 | version = "^0.2" 14 | 15 | [dependencies.serde] 16 | optional = true 17 | version = "^1.0" 18 | 19 | [dependencies.solana-program] 20 | version = "^2.1.7" 21 | 22 | [dependencies.thiserror] 23 | version = "^1.0" 24 | 25 | [dependencies.strum] 26 | version = "0.26.3" 27 | 28 | [dependencies.strum_macros] 29 | version = "0.26.4" 30 | 31 | [dependencies.Inflector] 32 | version = "=0.11.4" -------------------------------------------------------------------------------- /PumpFun/Rust/stream_pump_fun_new_minted_tokens/parsers/pump_interface/src/lib.rs: -------------------------------------------------------------------------------- 1 | solana_program::declare_id!("6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"); 2 | pub mod accounts; 3 | pub use accounts::*; 4 | pub mod instructions; 5 | pub use instructions::*; 6 | pub mod errors; 7 | pub use errors::*; 8 | pub mod events; 9 | pub use events::*; 10 | -------------------------------------------------------------------------------- /PumpFun/Rust/stream_pump_fun_new_minted_tokens/src/serialization.rs: -------------------------------------------------------------------------------- 1 | use solana_sdk::pubkey::Pubkey; 2 | 3 | pub fn serialize_pubkey(value: &Pubkey, serializer: S) -> Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | serializer.serialize_str(&value.to_string()) 8 | } 9 | 10 | pub fn serialize_option_pubkey(value: &Option, serializer: S) -> Result 11 | where 12 | S: serde::Serializer, 13 | { 14 | match value { 15 | Some(pubkey) => serializer.serialize_str(&pubkey.to_string()), 16 | None => serializer.serialize_none(), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /PumpFun/Rust/stream_transaction_detect_buy_sell_event/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock -------------------------------------------------------------------------------- /PumpFun/Rust/stream_transaction_detect_buy_sell_event/assets/usage-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/PumpFun/Rust/stream_transaction_detect_buy_sell_event/assets/usage-screenshot.png -------------------------------------------------------------------------------- /PumpFun/Rust/stream_transaction_detect_buy_sell_event/parsers/pump_interface/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pump_interface" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies.borsh] 7 | version = "^0.10" 8 | 9 | [dependencies.num-derive] 10 | version = "^0.3" 11 | 12 | [dependencies.num-traits] 13 | version = "^0.2" 14 | 15 | [dependencies.serde] 16 | optional = true 17 | version = "^1.0" 18 | 19 | [dependencies.solana-program] 20 | version = "^2.1.7" 21 | 22 | [dependencies.thiserror] 23 | version = "^1.0" 24 | 25 | [dependencies.strum] 26 | version = "0.26.3" 27 | 28 | [dependencies.strum_macros] 29 | version = "0.26.4" 30 | 31 | [dependencies.Inflector] 32 | version = "=0.11.4" -------------------------------------------------------------------------------- /PumpFun/Rust/stream_transaction_detect_buy_sell_event/parsers/pump_interface/src/lib.rs: -------------------------------------------------------------------------------- 1 | solana_program::declare_id!("6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"); 2 | pub mod accounts; 3 | pub use accounts::*; 4 | pub mod instructions; 5 | pub use instructions::*; 6 | pub mod errors; 7 | pub use errors::*; 8 | pub mod events; 9 | pub use events::*; 10 | -------------------------------------------------------------------------------- /PumpFun/Rust/stream_transaction_detect_buy_sell_event/src/serialization.rs: -------------------------------------------------------------------------------- 1 | use solana_sdk::pubkey::Pubkey; 2 | 3 | pub fn serialize_pubkey(value: &Pubkey, serializer: S) -> Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | serializer.serialize_str(&value.to_string()) 8 | } 9 | 10 | pub fn serialize_option_pubkey(value: &Option, serializer: S) -> Result 11 | where 12 | S: serde::Serializer, 13 | { 14 | match value { 15 | Some(pubkey) => serializer.serialize_str(&pubkey.to_string()), 16 | None => serializer.serialize_none(), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /PumpFun/Rust/stream_transaction_detect_buy_sell_event/src/token_serializable.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/PumpFun/Rust/stream_transaction_detect_buy_sell_event/src/token_serializable.rs -------------------------------------------------------------------------------- /PumpFun/Rust/token_migration_using_account_updates/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/PumpFun/Rust/token_migration_using_account_updates/.gitignore -------------------------------------------------------------------------------- /PumpFun/Rust/token_migration_using_account_updates/assets/usage-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/PumpFun/Rust/token_migration_using_account_updates/assets/usage-screenshot.png -------------------------------------------------------------------------------- /PumpFun/Rust/token_migration_using_account_updates/parsers/pump_interface/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pump_interface" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies.borsh] 7 | version = "^0.10" 8 | 9 | [dependencies.num-derive] 10 | version = "^0.3" 11 | 12 | [dependencies.num-traits] 13 | version = "^0.2" 14 | 15 | [dependencies.serde] 16 | optional = true 17 | version = "^1.0" 18 | 19 | [dependencies.solana-program] 20 | version = "^2.1.7" 21 | 22 | [dependencies.thiserror] 23 | version = "^1.0" 24 | 25 | [dependencies.strum] 26 | version = "0.26.3" 27 | 28 | [dependencies.strum_macros] 29 | version = "0.26.4" 30 | 31 | [dependencies.Inflector] 32 | version = "=0.11.4" -------------------------------------------------------------------------------- /PumpFun/Rust/token_migration_using_account_updates/parsers/pump_interface/src/lib.rs: -------------------------------------------------------------------------------- 1 | solana_program::declare_id!("6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"); 2 | pub mod accounts; 3 | pub use accounts::*; 4 | pub mod instructions; 5 | pub use instructions::*; 6 | pub mod errors; 7 | pub use errors::*; 8 | pub mod events; 9 | pub use events::*; 10 | -------------------------------------------------------------------------------- /PumpFun/Rust/token_migration_using_account_updates/src/serialization.rs: -------------------------------------------------------------------------------- 1 | use solana_sdk::pubkey::Pubkey; 2 | 3 | pub fn serialize_pubkey(value: &Pubkey, serializer: S) -> Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | serializer.serialize_str(&value.to_string()) 8 | } 9 | 10 | pub fn serialize_option_pubkey(value: &Option, serializer: S) -> Result 11 | where 12 | S: serde::Serializer, 13 | { 14 | match value { 15 | Some(pubkey) => serializer.serialize_str(&pubkey.to_string()), 16 | None => serializer.serialize_none(), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /PumpFun/Rust/token_migration_using_txnupdates/assets/usage-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/PumpFun/Rust/token_migration_using_txnupdates/assets/usage-screenshot.png -------------------------------------------------------------------------------- /PumpFun/Rust/token_migration_using_txnupdates/parsers/pump_interface/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pump_interface" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies.borsh] 7 | version = "^0.10" 8 | 9 | [dependencies.num-derive] 10 | version = "^0.3" 11 | 12 | [dependencies.num-traits] 13 | version = "^0.2" 14 | 15 | [dependencies.serde] 16 | optional = true 17 | version = "^1.0" 18 | 19 | [dependencies.solana-program] 20 | version = "^2.1.7" 21 | 22 | [dependencies.thiserror] 23 | version = "^1.0" 24 | 25 | [dependencies.strum] 26 | version = "0.26.3" 27 | 28 | [dependencies.strum_macros] 29 | version = "0.26.4" 30 | 31 | [dependencies.Inflector] 32 | version = "=0.11.4" -------------------------------------------------------------------------------- /PumpFun/Rust/token_migration_using_txnupdates/parsers/pump_interface/src/lib.rs: -------------------------------------------------------------------------------- 1 | solana_program::declare_id!("6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"); 2 | pub mod accounts; 3 | pub use accounts::*; 4 | pub mod instructions; 5 | pub use instructions::*; 6 | pub mod errors; 7 | pub use errors::*; 8 | pub mod events; 9 | pub use events::*; 10 | -------------------------------------------------------------------------------- /PumpFun/Rust/token_migration_using_txnupdates/src/serialization.rs: -------------------------------------------------------------------------------- 1 | use solana_sdk::pubkey::Pubkey; 2 | 3 | pub fn serialize_pubkey(value: &Pubkey, serializer: S) -> Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | serializer.serialize_str(&value.to_string()) 8 | } 9 | 10 | pub fn serialize_option_pubkey(value: &Option, serializer: S) -> Result 11 | where 12 | S: serde::Serializer, 13 | { 14 | match value { 15 | Some(pubkey) => serializer.serialize_str(&pubkey.to_string()), 16 | None => serializer.serialize_none(), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /PumpFun/Typescript/grpc-stream-and-parse-pump-fun-amm-account/.env: -------------------------------------------------------------------------------- 1 | GRPC_URL= 2 | X_TOKEN= 3 | -------------------------------------------------------------------------------- /PumpFun/Typescript/grpc-stream-and-parse-pump-fun-amm-account/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /PumpFun/Typescript/grpc-stream-and-parse-pump-fun-amm-account/assets/PumpfunAmm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/PumpFun/Typescript/grpc-stream-and-parse-pump-fun-amm-account/assets/PumpfunAmm.png -------------------------------------------------------------------------------- /PumpFun/Typescript/grpc-stream-and-parse-pump-fun-amm-account/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shyft", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.ts", 6 | "scripts": { 7 | "start": "npx ts-node index.ts", 8 | "build": "npx tsc" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "@coral-xyz/anchor": "^0.31.0", 14 | "@solana/web3.js": "^1.90.0", 15 | "@triton-one/yellowstone-grpc": "^0.4.0", 16 | "bs58": "^5.0.0", 17 | "dotenv": "^16.4.5", 18 | "lodash": "^4.17.21" 19 | }, 20 | "devDependencies": { 21 | "eslint": "^9.23.0", 22 | "ts-node": "^10.9.2", 23 | "typescript": "^4.9.5" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /PumpFun/Typescript/grpc-stream-and-parse-pump-fun-amm-account/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /PumpFun/Typescript/grpc-stream-and-parse-pump-fun-amm-transaction-instructions/.env.example: -------------------------------------------------------------------------------- 1 | ENDPOINT=https://grpc.ams.shyft.to 2 | X_TOKEN=ENDPOINT_AUTH_TOKEN -------------------------------------------------------------------------------- /PumpFun/Typescript/grpc-stream-and-parse-pump-fun-amm-transaction-instructions/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "es2017", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_all_bonding_curve_account/.env: -------------------------------------------------------------------------------- 1 | GRPC_URL= 2 | X_TOKEN= -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_all_bonding_curve_account/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_all_bonding_curve_account/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_all_bonding_curve_account/utils/token.ts: -------------------------------------------------------------------------------- 1 | var myHeaders = new Headers(); 2 | export const api = "api" 3 | myHeaders.append("x-api-key", api); 4 | 5 | var requestOptions:any = { 6 | method: 'GET', 7 | headers: myHeaders, 8 | redirect: 'follow' 9 | }; 10 | export async function getTokenBalance(address){ 11 | try { 12 | const info = await fetch(`https://api.shyft.to/sol/v1/wallet/all_tokens?network=mainnet-beta&wallet=${address}`, requestOptions) 13 | const infoJson = await info.json(); 14 | const result = infoJson?.result[0]; 15 | const ca = result?.address 16 | const name = result?.info?.name 17 | const symbol = result?.info.symbol 18 | const balance = result?.balance; 19 | return { 20 | name, 21 | symbol, 22 | ca, 23 | balance 24 | }; 25 | }catch(error){ 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_and_parse_all_pump_fun_accounts/.env: -------------------------------------------------------------------------------- 1 | GRPC_URL= 2 | X_TOKEN= -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_and_parse_all_pump_fun_accounts/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | .env -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_and_parse_all_pump_fun_accounts/assets/streaming_pump_fun_accounts_parsed.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/PumpFun/Typescript/stream_and_parse_all_pump_fun_accounts/assets/streaming_pump_fun_accounts_parsed.jpg -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_and_parse_all_pump_fun_accounts/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shyft", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.ts", 6 | "scripts": { 7 | "start": "npx ts-node index.ts", 8 | "build": "npx tsc" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "@coral-xyz/anchor": "^0.31.0", 14 | "@project-serum/borsh": "^0.2.5", 15 | "@solana/buffer-layout": "^4.0.1", 16 | "@solana/buffer-layout-utils": "^0.2.0", 17 | "@solana/web3.js": "^1.90.0", 18 | "@triton-one/yellowstone-grpc": "^0.4.0", 19 | "bs58": "^5.0.0", 20 | "dotenv": "^16.4.5", 21 | "lodash": "^4.17.21" 22 | }, 23 | "devDependencies": { 24 | "ts-node": "^10.9.2", 25 | "typescript": "^4.9.3" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_and_parse_all_pump_fun_accounts/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_and_parse_pump_fun_transactions/.env.sample: -------------------------------------------------------------------------------- 1 | #Add your environment details, and rename this file to .env to run yoru project 2 | GRPC_URL= "" 3 | X_TOKEN= "" -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_and_parse_pump_fun_transactions/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | .env 4 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_and_parse_pump_fun_transactions/assets/usage_screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/PumpFun/Typescript/stream_and_parse_pump_fun_transactions/assets/usage_screenshot.png -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_and_parse_pump_fun_transactions/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_and_parse_pump_fun_transactions/utils/pump-fun-parsed-transaction.ts: -------------------------------------------------------------------------------- 1 | export function pumpFunParsedTransaction(parsedInstruction,txn){ 2 | let output = {}; 3 | 4 | output = { 5 | ...txn, 6 | meta: { 7 | ...txn.meta, 8 | innerInstructions: parsedInstruction.inner_ixs, 9 | }, 10 | transaction: { 11 | ...txn.transaction, 12 | message: { 13 | ...txn.transaction.message, 14 | instructions : parsedInstruction.instructions, 15 | compiledInstructions: parsedInstruction.instructions, 16 | }, 17 | } 18 | } 19 | 20 | 21 | return output; 22 | } -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_bonding_curve_progress/.env: -------------------------------------------------------------------------------- 1 | GRPC_URL= 2 | X_TOKEN= -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_bonding_curve_progress/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_bonding_curve_progress/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shyft", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.ts", 6 | "scripts": { 7 | "start": "npx ts-node index.ts", 8 | "build": "npx tsc" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "@triton-one/yellowstone-grpc": "^0.4.0", 14 | "@solana/web3.js": "^1.90.0", 15 | "@project-serum/anchor": "^0.26.0", 16 | "@shyft-to/solana-transaction-parser": "^1.1.17", 17 | "@solana/buffer-layout": "^4.0.1", 18 | "@solana/buffer-layout-utils": "^0.2.0", 19 | "dotenv": "^16.4.5", 20 | "lodash": "^4.17.21", 21 | "node-telegram-bot-api": "^0.64.0", 22 | "bs58": "^5.0.0" 23 | }, 24 | "devDependencies": { 25 | "ts-node": "^10.9.2", 26 | "typescript": "^4.9.3" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_bonding_curve_progress/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_bonding_curve_progress/utils/decodeTransaction.ts: -------------------------------------------------------------------------------- 1 | import base58 from "bs58"; 2 | 3 | export function decodeTransact(data){ 4 | const output = data?base58.encode(Buffer.from(data,'base64')):""; 5 | return output; 6 | } -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_bonding_curve_progress/utils/getBonding.ts: -------------------------------------------------------------------------------- 1 | import { Connection, PublicKey } from "@solana/web3.js"; 2 | export const api = "" 3 | 4 | const shyft = `https://rpc.ny.shyft.to?api_key=${api}`; 5 | const connection = new Connection(shyft,'confirmed') 6 | export async function getBondingCurveAddress(bondingCurve){ 7 | let solBalance; 8 | const address = new PublicKey(bondingCurve) 9 | const systemOwner = await connection.getAccountInfo(address); 10 | solBalance = systemOwner.lamports; 11 | return Number(solBalance/1000000000).toFixed(2); 12 | } -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_bonding_curve_progress/utils/token.ts: -------------------------------------------------------------------------------- 1 | var myHeaders = new Headers(); 2 | export const api = "api" 3 | myHeaders.append("x-api-key", api); 4 | 5 | var requestOptions:any = { 6 | method: 'GET', 7 | headers: myHeaders, 8 | redirect: 'follow' 9 | }; 10 | export async function getTokenBalance(address){ 11 | 12 | const info = await fetch(`https://api.shyft.to/sol/v1/wallet/all_tokens?network=mainnet-beta&wallet=${address}`, requestOptions) 13 | const infoJson = await info.json(); 14 | const result = infoJson?.result[0]; 15 | const ca = result?.address 16 | const name = result?.info?.name 17 | const symbol = result?.info.symbol 18 | const balance = result?.balance; 19 | return { 20 | name, 21 | symbol, 22 | ca, 23 | balance 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_bonding_curve_progress/utils/transactionOutput.ts: -------------------------------------------------------------------------------- 1 | export function transactionOutput(txn){ 2 | const type = txn.instructions[0].name === "sell"?"SELL":"BUY"; 3 | const events = txn.events[0].data; 4 | const bondingCurve = txn.instructions[0].accounts[3].pubkey; 5 | const mint = events?.mint; 6 | const solAmount = events?.solAmount/1000000000 7 | const tokenAmount = events?.tokenAmount; 8 | const user = events?.user 9 | return{ 10 | type, 11 | mint, 12 | solAmount, 13 | tokenAmount, 14 | user, 15 | bondingCurve 16 | } 17 | } -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_completed_bonding_curve/.env: -------------------------------------------------------------------------------- 1 | GRPC_URL= 2 | X_TOKEN= 3 | API= -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_completed_bonding_curve/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_completed_bonding_curve/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_completed_bonding_curve/utils/token.ts: -------------------------------------------------------------------------------- 1 | var myHeaders = new Headers(); 2 | export const api = process.env.API; 3 | myHeaders.append("x-api-key", api); 4 | 5 | var requestOptions:any = { 6 | method: 'GET', 7 | headers: myHeaders, 8 | redirect: 'follow' 9 | }; 10 | export async function getTokenBalance(address){ 11 | 12 | const info = await fetch(`https://api.shyft.to/sol/v1/wallet/all_tokens?network=mainnet-beta&wallet=${address}`, requestOptions) 13 | const infoJson = await info.json(); 14 | const result = infoJson?.result[0]; 15 | const ca = result?.address 16 | const name = result?.info?.name 17 | const symbol = result?.info.symbol 18 | const balance = result?.balance; 19 | return { 20 | name, 21 | symbol, 22 | ca, 23 | balance 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_new_pool_pumpfun_amm_transactions/.env.example: -------------------------------------------------------------------------------- 1 | GRPC_URL=https://grpc.ams.shyft.to 2 | X_TOKEN=ENDPOINT_AUTH_TOKEN 3 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_new_pool_pumpfun_amm_transactions/assets/new-pool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/PumpFun/Typescript/stream_new_pool_pumpfun_amm_transactions/assets/new-pool.png -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_new_pool_pumpfun_amm_transactions/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "es2017", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pump_fun_amm_transactions_and_detect_buy_sell_events/.env.example: -------------------------------------------------------------------------------- 1 | GRPC_URL=https://grpc.ams.shyft.to 2 | X_TOKEN=ENDPOINT_AUTH_TOKEN 3 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pump_fun_amm_transactions_and_detect_buy_sell_events/assets/amm-buy-sell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/PumpFun/Typescript/stream_pump_fun_amm_transactions_and_detect_buy_sell_events/assets/amm-buy-sell.png -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pump_fun_amm_transactions_and_detect_buy_sell_events/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "es2017", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pump_fun_new_minted_tokens/.env.sample: -------------------------------------------------------------------------------- 1 | GRPC_URL= 2 | X_TOKEN= -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pump_fun_new_minted_tokens/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | .env -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pump_fun_new_minted_tokens/assets/new-pump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/PumpFun/Typescript/stream_pump_fun_new_minted_tokens/assets/new-pump.png -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pump_fun_new_minted_tokens/assets/screenshot-grpc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/PumpFun/Typescript/stream_pump_fun_new_minted_tokens/assets/screenshot-grpc.jpg -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pump_fun_new_minted_tokens/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pump_fun_new_minted_tokens/utils/decodeTransaction.ts: -------------------------------------------------------------------------------- 1 | import base58 from "bs58"; 2 | 3 | export function decodeTransact(data){ 4 | const output = base58.encode(Buffer.from(data,'base64')) 5 | return output; 6 | } -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pump_fun_new_minted_tokens/utils/pump-fun-parsed-transaction.ts: -------------------------------------------------------------------------------- 1 | export function pumpFunParsedTransaction(parsedInstruction,txn){ 2 | const instructions = parsedInstruction.instructions.find((x)=> x.name === "create"); 3 | if(!instructions) return; 4 | let output = {}; 5 | 6 | output = { 7 | ...txn, 8 | meta: { 9 | ...txn.meta, 10 | innerInstructions: parsedInstruction.inner_ixs, 11 | }, 12 | transaction: { 13 | ...txn.transaction, 14 | message: { 15 | ...txn.transaction.message, 16 | instructions : parsedInstruction.instructions, 17 | compiledInstructions: parsedInstruction.instructions, 18 | }, 19 | } 20 | } 21 | 22 | 23 | return output; 24 | } -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pump_fun_transactions_and_detect_buy_sell_events/.env.sample: -------------------------------------------------------------------------------- 1 | #Add your environment details, and rename this file to .env to run yoru project 2 | GRPC_URL= "" 3 | X_TOKEN= "" -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pump_fun_transactions_and_detect_buy_sell_events/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | .env 4 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pump_fun_transactions_and_detect_buy_sell_events/assets/run-project.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/PumpFun/Typescript/stream_pump_fun_transactions_and_detect_buy_sell_events/assets/run-project.jpg -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pump_fun_transactions_and_detect_buy_sell_events/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pump_fun_transactions_and_detect_buy_sell_events/utils/transactionOutput.ts: -------------------------------------------------------------------------------- 1 | export function transactionOutput(txn){ 2 | const type = txn.instructions[0].name === "sell"?"SELL":"BUY"; 3 | const events = txn.events[0].data; 4 | //console.log(txn.instructions[0]); 5 | const mint = events?.mint; 6 | const solAmount = events?.solAmount/1000000000 7 | const tokenAmount = events?.tokenAmount; 8 | const user = events?.user 9 | return{ 10 | type, 11 | mint, 12 | solAmount, 13 | tokenAmount, 14 | user 15 | } 16 | } -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pumpfun_to_pumpfunAmm_migration_transactions/.env: -------------------------------------------------------------------------------- 1 | GRPC_URL= 2 | X_TOKEN= -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pumpfun_to_pumpfunAmm_migration_transactions/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | .env -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pumpfun_to_pumpfunAmm_migration_transactions/assets/usage_screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/PumpFun/Typescript/stream_pumpfun_to_pumpfunAmm_migration_transactions/assets/usage_screenshot.png -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pumpfun_to_pumpfunAmm_migration_transactions/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pumpfun_to_pumpfunAmm_migration_transactions/utils/pump-fun-parsed-transaction.ts: -------------------------------------------------------------------------------- 1 | export function pumpFunParsedTransaction(parsedInstruction,txn){ 2 | const instructions = parsedInstruction.instructions.find((x)=> x.name === "migrate"); 3 | if(!instructions) return; 4 | let output = {}; 5 | 6 | output = { 7 | ...txn, 8 | meta: { 9 | ...txn.meta, 10 | innerInstructions: parsedInstruction.inner_ixs, 11 | }, 12 | transaction: { 13 | ...txn.transaction, 14 | message: { 15 | ...txn.transaction.message, 16 | instructions : parsedInstruction.instructions, 17 | compiledInstructions: parsedInstruction.instructions, 18 | }, 19 | } 20 | } 21 | 22 | 23 | return output; 24 | } -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pumpfun_to_raydium_migration_transactions/.env: -------------------------------------------------------------------------------- 1 | GRPC_URL= 2 | X_TOKEN= -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pumpfun_to_raydium_migration_transactions/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pumpfun_to_raydium_migration_transactions/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pumpfun_to_raydium_migration_transactions/utils/decodeTransaction.ts: -------------------------------------------------------------------------------- 1 | import base58 from "bs58"; 2 | 3 | export function decodeTransact(data){ 4 | const output = data?base58.encode(Buffer.from(data,'base64')):""; 5 | return output; 6 | } -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pumpfun_to_raydium_migration_transactions/utils/logTXN.ts: -------------------------------------------------------------------------------- 1 | export function searchForInitialize2(transaction) { 2 | const logMessages = transaction.meta?.logMessages || []; 3 | if (logMessages.some(log => log.includes('initialize2'))) { 4 | return transaction; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pumpfun_token_price/.env: -------------------------------------------------------------------------------- 1 | GRPC_URL= 2 | X_TOKEN= 3 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pumpfun_token_price/.env.sample: -------------------------------------------------------------------------------- 1 | #Add your environment details, and rename this file to .env to run yoru project 2 | GRPC_URL= "" 3 | X_TOKEN= "" -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pumpfun_token_price/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | .env 4 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pumpfun_token_price/assets/screenshot-grpc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/PumpFun/Typescript/stream_pumpfun_token_price/assets/screenshot-grpc.png -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pumpfun_token_price/assets/usage-screenshot-pumpfun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/PumpFun/Typescript/stream_pumpfun_token_price/assets/usage-screenshot-pumpfun.png -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pumpfun_token_price/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pumpfun_txns_fetch_bonding_pool_liquidity/.env: -------------------------------------------------------------------------------- 1 | GRPC_URL= 2 | X_TOKEN= -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pumpfun_txns_fetch_bonding_pool_liquidity/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pumpfun_txns_fetch_bonding_pool_liquidity/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pumpfun_txns_fetch_bonding_pool_liquidity/utils/token.ts: -------------------------------------------------------------------------------- 1 | var myHeaders = new Headers(); 2 | export const api = "api" 3 | myHeaders.append("x-api-key", api); 4 | 5 | var requestOptions:any = { 6 | method: 'GET', 7 | headers: myHeaders, 8 | redirect: 'follow' 9 | }; 10 | export async function getTokenBalance(address){ 11 | try{ 12 | const info = await fetch(`https://api.shyft.to/sol/v1/wallet/all_tokens?network=mainnet-beta&wallet=${address}`, requestOptions) 13 | const infoJson = await info.json(); 14 | const result = infoJson?.result[0]; 15 | const ca = result?.address 16 | const name = result?.info?.name 17 | const symbol = result?.info.symbol 18 | const balance = result?.balance; 19 | return { 20 | name, 21 | symbol, 22 | ca, 23 | balance 24 | }; 25 | }catch(err){ 26 | console.log('Error'); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /PumpFun/Typescript/stream_pumpfun_txns_fetch_bonding_pool_liquidity/utils/transactionOutput.ts: -------------------------------------------------------------------------------- 1 | export function transactionOutput(txn){ 2 | const type = txn.instructions[0].name === "sell"?"SELL":"BUY"; 3 | const events = txn.events[0].data; 4 | const mint = events?.mint; 5 | const solAmount = events?.solAmount/1000000000 6 | const tokenAmount = events?.tokenAmount; 7 | const user = events?.user 8 | return{ 9 | type, 10 | mint, 11 | solAmount, 12 | tokenAmount, 13 | user 14 | } 15 | } -------------------------------------------------------------------------------- /Raydium/Rust/Stream_Raydium_Pool_Address-acct-rust/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock -------------------------------------------------------------------------------- /Raydium/Rust/Stream_and_parse_raydium_transactions/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock -------------------------------------------------------------------------------- /Raydium/Rust/Stream_and_parse_raydium_transactions/assets/usage-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Raydium/Rust/Stream_and_parse_raydium_transactions/assets/usage-screenshot.png -------------------------------------------------------------------------------- /Raydium/Rust/Stream_and_parse_raydium_transactions/parsers/raydium_amm_interface/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | Cargo.lock -------------------------------------------------------------------------------- /Raydium/Rust/Stream_and_parse_raydium_transactions/parsers/raydium_amm_interface/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "raydium_amm_interface" 3 | version = "0.3.0" 4 | edition = "2021" 5 | 6 | [dependencies.borsh] 7 | version = "^0.10" 8 | 9 | [dependencies.num-derive] 10 | version = "^0.3" 11 | 12 | [dependencies.num-traits] 13 | version = "^0.2" 14 | 15 | [dependencies.serde] 16 | optional = true 17 | version = "^1.0" 18 | 19 | [dependencies.solana-program] 20 | version = "^2.1.7" 21 | 22 | [dependencies.thiserror] 23 | version = "^1.0" 24 | 25 | [dependencies.strum] 26 | version = "0.26.3" 27 | 28 | [dependencies.strum_macros] 29 | version = "0.26.4" 30 | 31 | [dependencies.Inflector] 32 | version = "=0.11.4" 33 | -------------------------------------------------------------------------------- /Raydium/Rust/Stream_and_parse_raydium_transactions/parsers/raydium_amm_interface/src/lib.rs: -------------------------------------------------------------------------------- 1 | solana_program::declare_id!("675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"); 2 | pub mod accounts; 3 | pub use accounts::*; 4 | pub mod typedefs; 5 | pub use typedefs::*; 6 | pub mod instructions; 7 | pub use instructions::*; 8 | pub mod errors; 9 | pub use errors::*; 10 | -------------------------------------------------------------------------------- /Raydium/Rust/Stream_and_parse_raydium_transactions/src/serialization.rs: -------------------------------------------------------------------------------- 1 | use solana_sdk::pubkey::Pubkey; 2 | 3 | pub fn serialize_pubkey(value: &Pubkey, serializer: S) -> Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | serializer.serialize_str(&value.to_string()) 8 | } 9 | 10 | pub fn serialize_option_pubkey(value: &Option, serializer: S) -> Result 11 | where 12 | S: serde::Serializer, 13 | { 14 | match value { 15 | Some(pubkey) => serializer.serialize_str(&pubkey.to_string()), 16 | None => serializer.serialize_none(), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Raydium/Rust/Streaming_realtime_pool_activity/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock -------------------------------------------------------------------------------- /Raydium/Rust/stream_and_parse_raydium_accounts/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock -------------------------------------------------------------------------------- /Raydium/Rust/stream_and_parse_raydium_accounts/README.md: -------------------------------------------------------------------------------- 1 | # Streaming and parsing Raydium accounts using gRPC 2 | 3 | This project leverages Solana's gRPC streaming capabilities to efficiently monitor Raydium AmmInfo account data. By utilizing the IDL for parsing, it enables real-time analysis and insights into Raydium activities on the Solana blockchain. 4 | 5 | ### [This is still work in progress] 6 | 7 | ``` 8 | $ cargo run -- --endpoint --x-token 9 | ``` 10 | 11 | ![screenshot](assets/usage-screenshot.png?raw=true "Screenshot") 12 | 13 | ## Docs 14 | Shyft Website: [https://shyft.to/#solana-grpc-streaming-service] 15 | Shyft gRPC Docs: [https://docs.shyft.to/solana-fast-grpc/grpc-docs] 16 | -------------------------------------------------------------------------------- /Raydium/Rust/stream_and_parse_raydium_accounts/assets/usage-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Raydium/Rust/stream_and_parse_raydium_accounts/assets/usage-screenshot.png -------------------------------------------------------------------------------- /Raydium/Rust/stream_and_parse_raydium_accounts/parsers/raydium_amm_interface/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | Cargo.lock -------------------------------------------------------------------------------- /Raydium/Rust/stream_and_parse_raydium_accounts/parsers/raydium_amm_interface/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "raydium_amm_interface" 3 | version = "0.3.0" 4 | edition = "2021" 5 | 6 | [dependencies.borsh] 7 | version = "^0.10" 8 | 9 | [dependencies.num-derive] 10 | version = "^0.3" 11 | 12 | [dependencies.num-traits] 13 | version = "^0.2" 14 | 15 | [dependencies.serde] 16 | optional = true 17 | version = "^1.0" 18 | 19 | [dependencies.solana-program] 20 | version = "^2.1.7" 21 | 22 | [dependencies.thiserror] 23 | version = "^1.0" 24 | 25 | [dependencies.strum] 26 | version = "0.26.3" 27 | 28 | [dependencies.strum_macros] 29 | version = "0.26.4" 30 | 31 | [dependencies.Inflector] 32 | version = "=0.11.4" 33 | -------------------------------------------------------------------------------- /Raydium/Rust/stream_and_parse_raydium_accounts/parsers/raydium_amm_interface/src/lib.rs: -------------------------------------------------------------------------------- 1 | solana_program::declare_id!("675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"); 2 | pub mod accounts; 3 | pub use accounts::*; 4 | pub mod typedefs; 5 | pub use typedefs::*; 6 | pub mod instructions; 7 | pub use instructions::*; 8 | pub mod errors; 9 | pub use errors::*; 10 | -------------------------------------------------------------------------------- /Raydium/Rust/stream_and_parse_raydium_accounts/src/serialization.rs: -------------------------------------------------------------------------------- 1 | use solana_sdk::pubkey::Pubkey; 2 | 3 | pub fn serialize_pubkey(value: &Pubkey, serializer: S) -> Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | serializer.serialize_str(&value.to_string()) 8 | } 9 | 10 | pub fn serialize_option_pubkey(value: &Option, serializer: S) -> Result 11 | where 12 | S: serde::Serializer, 13 | { 14 | match value { 15 | Some(pubkey) => serializer.serialize_str(&pubkey.to_string()), 16 | None => serializer.serialize_none(), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Raydium/Rust/stream_and_parse_raydium_clmm_accounts/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock -------------------------------------------------------------------------------- /Raydium/Rust/stream_and_parse_raydium_clmm_accounts/assets/clmm-account.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Raydium/Rust/stream_and_parse_raydium_clmm_accounts/assets/clmm-account.png -------------------------------------------------------------------------------- /Raydium/Rust/stream_and_parse_raydium_clmm_accounts/parsers/raydium_clmm_swap_interface/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | Cargo.lock -------------------------------------------------------------------------------- /Raydium/Rust/stream_and_parse_raydium_clmm_accounts/parsers/raydium_clmm_swap_interface/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "raydium_clmm_swap_interface" 3 | version = "0.3.0" 4 | edition = "2021" 5 | 6 | [dependencies.borsh] 7 | version = "^0.10" 8 | 9 | [dependencies.num-derive] 10 | version = "^0.3" 11 | 12 | [dependencies.num-traits] 13 | version = "^0.2" 14 | 15 | [dependencies.serde] 16 | optional = true 17 | version = "^1.0" 18 | 19 | [dependencies.solana-program] 20 | version = "^2.1.7" 21 | 22 | [dependencies.thiserror] 23 | version = "^1.0" 24 | 25 | [dependencies.strum] 26 | version = "0.26.3" 27 | 28 | [dependencies.strum_macros] 29 | version = "0.26.4" 30 | 31 | [dependencies.Inflector] 32 | version = "=0.11.4" 33 | 34 | [dependencies] 35 | serde_with = "3.2" 36 | 37 | 38 | -------------------------------------------------------------------------------- /Raydium/Rust/stream_and_parse_raydium_clmm_accounts/parsers/raydium_clmm_swap_interface/src/lib.rs: -------------------------------------------------------------------------------- 1 | solana_program::declare_id!("CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C"); 2 | pub mod accounts; 3 | pub mod typedefs; 4 | pub use accounts::*; -------------------------------------------------------------------------------- /Raydium/Rust/stream_and_parse_raydium_clmm_transactions/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock -------------------------------------------------------------------------------- /Raydium/Rust/stream_and_parse_raydium_clmm_transactions/assets/usage_screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Raydium/Rust/stream_and_parse_raydium_clmm_transactions/assets/usage_screenshot.png -------------------------------------------------------------------------------- /Raydium/Rust/stream_and_parse_raydium_clmm_transactions/parsers/raydium_clmm_swap_interface/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | Cargo.lock -------------------------------------------------------------------------------- /Raydium/Rust/stream_and_parse_raydium_clmm_transactions/parsers/raydium_clmm_swap_interface/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "raydium_clmm_swap_interface" 3 | version = "0.8.2" 4 | edition = "2021" 5 | 6 | [dependencies.borsh] 7 | version = "^0.10" 8 | 9 | [dependencies.num-derive] 10 | version = "^0.3" 11 | 12 | [dependencies.num-traits] 13 | version = "^0.2" 14 | 15 | [dependencies.serde] 16 | optional = true 17 | version = "^1.0" 18 | 19 | [dependencies.solana-program] 20 | version = "^2.1.7" 21 | 22 | [dependencies.thiserror] 23 | version = "^1.0" 24 | 25 | [dependencies.strum] 26 | version = "0.26.3" 27 | 28 | [dependencies.strum_macros] 29 | version = "0.26.4" 30 | 31 | [dependencies.Inflector] 32 | version = "=0.11.4" -------------------------------------------------------------------------------- /Raydium/Rust/stream_and_parse_raydium_clmm_transactions/parsers/raydium_clmm_swap_interface/src/lib.rs: -------------------------------------------------------------------------------- 1 | solana_program::declare_id!("CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK"); 2 | pub mod typedefs; 3 | pub use typedefs::*; 4 | pub mod instructions; 5 | pub use instructions::*; 6 | pub mod errors; 7 | pub use errors::*; 8 | pub mod events; 9 | pub use events::*; 10 | -------------------------------------------------------------------------------- /Raydium/Rust/stream_and_parse_raydium_clmm_transactions/src/serialization.rs: -------------------------------------------------------------------------------- 1 | use solana_sdk::pubkey::Pubkey; 2 | 3 | pub fn serialize_pubkey(value: &Pubkey, serializer: S) -> Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | serializer.serialize_str(&value.to_string()) 8 | } 9 | 10 | pub fn serialize_option_pubkey(value: &Option, serializer: S) -> Result 11 | where 12 | S: serde::Serializer, 13 | { 14 | match value { 15 | Some(pubkey) => serializer.serialize_str(&pubkey.to_string()), 16 | None => serializer.serialize_none(), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Raydium/Rust/stream_and_parse_raydium_cp_accounts/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock -------------------------------------------------------------------------------- /Raydium/Rust/stream_and_parse_raydium_cp_accounts/assets/cp-account.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Raydium/Rust/stream_and_parse_raydium_cp_accounts/assets/cp-account.PNG -------------------------------------------------------------------------------- /Raydium/Rust/stream_and_parse_raydium_cp_accounts/parsers/raydium_cp_swap_interface/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | Cargo.lock -------------------------------------------------------------------------------- /Raydium/Rust/stream_and_parse_raydium_cp_accounts/parsers/raydium_cp_swap_interface/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "raydium_cp_swap_interface" 3 | version = "0.3.0" 4 | edition = "2021" 5 | 6 | [dependencies.borsh] 7 | version = "^0.10" 8 | 9 | [dependencies.num-derive] 10 | version = "^0.3" 11 | 12 | [dependencies.num-traits] 13 | version = "^0.2" 14 | 15 | [dependencies.serde] 16 | optional = true 17 | version = "^1.0" 18 | 19 | [dependencies.solana-program] 20 | version = "^2.1.7" 21 | 22 | [dependencies.thiserror] 23 | version = "^1.0" 24 | 25 | [dependencies.strum] 26 | version = "0.26.3" 27 | 28 | [dependencies.strum_macros] 29 | version = "0.26.4" 30 | 31 | [dependencies.Inflector] 32 | version = "=0.11.4" 33 | 34 | -------------------------------------------------------------------------------- /Raydium/Rust/stream_and_parse_raydium_cp_accounts/parsers/raydium_cp_swap_interface/src/lib.rs: -------------------------------------------------------------------------------- 1 | solana_program::declare_id!("CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C"); 2 | pub mod accounts; 3 | pub mod typedefs; 4 | pub use accounts::*; -------------------------------------------------------------------------------- /Raydium/Rust/stream_and_parse_raydium_cp_transactions/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock -------------------------------------------------------------------------------- /Raydium/Rust/stream_and_parse_raydium_cp_transactions/assets/usage_screenshot.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Raydium/Rust/stream_and_parse_raydium_cp_transactions/assets/usage_screenshot.PNG -------------------------------------------------------------------------------- /Raydium/Rust/stream_and_parse_raydium_cp_transactions/parsers/raydium_cp_swap_interface/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | Cargo.lock -------------------------------------------------------------------------------- /Raydium/Rust/stream_and_parse_raydium_cp_transactions/parsers/raydium_cp_swap_interface/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "raydium_cp_swap_interface" 3 | version = "0.8.2" 4 | edition = "2021" 5 | 6 | [dependencies.borsh] 7 | version = "^0.10" 8 | 9 | [dependencies.num-derive] 10 | version = "^0.3" 11 | 12 | [dependencies.num-traits] 13 | version = "^0.2" 14 | 15 | [dependencies.serde] 16 | optional = true 17 | version = "^1.0" 18 | 19 | [dependencies.solana-program] 20 | version = "^2.1.7" 21 | 22 | [dependencies.thiserror] 23 | version = "^1.0" 24 | 25 | [dependencies.strum] 26 | version = "0.26.3" 27 | 28 | [dependencies.strum_macros] 29 | version = "0.26.4" 30 | 31 | [dependencies.Inflector] 32 | version = "=0.11.4" -------------------------------------------------------------------------------- /Raydium/Rust/stream_and_parse_raydium_cp_transactions/parsers/raydium_cp_swap_interface/src/lib.rs: -------------------------------------------------------------------------------- 1 | solana_program::declare_id!("CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C"); 2 | pub mod typedefs; 3 | pub use typedefs::*; 4 | pub mod instructions; 5 | pub use instructions::*; 6 | pub mod errors; 7 | pub use errors::*; 8 | pub mod events; 9 | pub use events::*; 10 | -------------------------------------------------------------------------------- /Raydium/Rust/stream_and_parse_raydium_cp_transactions/src/serialization.rs: -------------------------------------------------------------------------------- 1 | use solana_sdk::pubkey::Pubkey; 2 | 3 | pub fn serialize_pubkey(value: &Pubkey, serializer: S) -> Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | serializer.serialize_str(&value.to_string()) 8 | } 9 | 10 | pub fn serialize_option_pubkey(value: &Option, serializer: S) -> Result 11 | where 12 | S: serde::Serializer, 13 | { 14 | match value { 15 | Some(pubkey) => serializer.serialize_str(&pubkey.to_string()), 16 | None => serializer.serialize_none(), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Raydium/Rust/stream_new_pools/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock -------------------------------------------------------------------------------- /Raydium/Typescript/monitor_new_pools_telegram_bot/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /Raydium/Typescript/monitor_new_pools_telegram_bot/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shyft", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.ts", 6 | "scripts": { 7 | "start": "npx ts-node index.ts", 8 | "build": "npx tsc" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "@triton-one/yellowstone-grpc": "^0.4.0", 14 | "@solana/web3.js": "^1.90.0", 15 | "@project-serum/anchor": "^0.26.0", 16 | "@shyft-to/solana-transaction-parser": "^1.1.17", 17 | "@solana/buffer-layout": "^4.0.1", 18 | "@solana/buffer-layout-utils": "^0.2.0", 19 | "dotenv": "^16.4.5", 20 | "lodash": "^4.17.21", 21 | "node-telegram-bot-api": "^0.64.0", 22 | "bs58": "^5.0.0" 23 | }, 24 | "devDependencies": { 25 | "ts-node": "^10.9.2", 26 | "typescript": "^4.9.3" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Raydium/Typescript/monitor_new_pools_telegram_bot/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Raydium/Typescript/real_time_token_price_marketcap_streaming/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /Raydium/Typescript/real_time_token_price_marketcap_streaming/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Raydium/Typescript/real_time_token_price_marketcap_streaming/utils/decodeTransaction.ts: -------------------------------------------------------------------------------- 1 | import base58 from "bs58"; 2 | 3 | export function decodeTransact(data){ 4 | const output = base58.encode(Buffer.from(data,'base64')) 5 | return output; 6 | } -------------------------------------------------------------------------------- /Raydium/Typescript/real_time_token_price_marketcap_streaming/utils/marketInfo.ts: -------------------------------------------------------------------------------- 1 | import { getTokenInfo } from "./tokenInfo"; 2 | import { getSolBalance, getTokenBalance } from "./walletInfo"; 3 | 4 | export async function getMarketInfo(baseBal, quoteBal, currentSupply) { 5 | try { 6 | const quote$ = quoteBal//quoteBal * sol value in $$ use any api to fetch sol price; 7 | const price = quote$ / baseBal; 8 | const marketcap = currentSupply * price; 9 | 10 | return { 11 | price, 12 | marketcap, 13 | currentSupply, 14 | quote$, 15 | }; 16 | } catch (error) { 17 | console.error('Error getting market info:', error); 18 | throw error; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Raydium/Typescript/real_time_token_price_marketcap_streaming/utils/tokenInfo.ts: -------------------------------------------------------------------------------- 1 | const api = "your api" 2 | var myHeaders = new Headers(); 3 | myHeaders.append("x-api-key", api); 4 | 5 | var requestOptions:any = { 6 | method: 'GET', 7 | headers: myHeaders, 8 | redirect: 'follow' 9 | }; 10 | 11 | export async function getTokenInfo(address){ 12 | const info = await fetch(`https://api.shyft.to/sol/v1/token/get_info?network=mainnet-beta&token_address=${address}`, requestOptions) 13 | const infoJson = await info.json(); 14 | const result = infoJson.result; 15 | const currentSupply = result?.current_supply; 16 | const decimal = result?.decimals; 17 | return {currentSupply,decimal} 18 | } 19 | -------------------------------------------------------------------------------- /Raydium/Typescript/real_time_token_price_marketcap_streaming/utils/walletInfo.ts: -------------------------------------------------------------------------------- 1 | import { Connection, PublicKey } from "@solana/web3.js"; 2 | 3 | 4 | export const api = "your api" 5 | const connection = new Connection(`https://rpc.shyft.to?api_key=${api}`, 'confirmed'); 6 | 7 | export async function getTokenBalance(address){ 8 | const account = await connection.getTokenAccountBalance(new PublicKey(address)) 9 | const balance = Number(account.value.amount); 10 | return balance; 11 | } 12 | export async function getSolBalance(address){ 13 | const account = await connection.getBalance(new PublicKey(address)); 14 | const balance = account/1000000000; 15 | return balance; 16 | } 17 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_all_raydium_accounts/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | .env -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_all_raydium_accounts/assets/streaming_raydium_account_updates.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Raydium/Typescript/stream_and_parse_all_raydium_accounts/assets/streaming_raydium_account_updates.jpg -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_all_raydium_accounts/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shyft", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.ts", 6 | "scripts": { 7 | "start": "npx ts-node index.ts", 8 | "build": "npx tsc" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "@project-serum/anchor": "^0.26.0", 14 | "@project-serum/borsh": "^0.2.5", 15 | "@solana/buffer-layout": "^4.0.1", 16 | "@solana/buffer-layout-utils": "^0.2.0", 17 | "@solana/web3.js": "^1.90.0", 18 | "@triton-one/yellowstone-grpc": "^0.4.0", 19 | "bs58": "^5.0.0", 20 | "dotenv": "^16.4.5", 21 | "lodash": "^4.17.21" 22 | }, 23 | "devDependencies": { 24 | "ts-node": "^10.9.2", 25 | "typescript": "^4.9.3" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_all_raydium_accounts/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_all_raydium_transctions/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_all_raydium_transctions/assets/stream_parsed_raydium_txns.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Raydium/Typescript/stream_and_parse_all_raydium_transctions/assets/stream_parsed_raydium_txns.jpg -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_all_raydium_transctions/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_clmm_accounts/.env: -------------------------------------------------------------------------------- 1 | GRPC_URL= 2 | X_TOKEN= -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_clmm_accounts/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | ./vs -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_clmm_accounts/assets/RaydiumCLMM_Screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Raydium/Typescript/stream_and_parse_clmm_accounts/assets/RaydiumCLMM_Screenshot.png -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_clmm_accounts/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shyft", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.ts", 6 | "scripts": { 7 | "start": "npx ts-node index.ts", 8 | "build": "npx tsc" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "@project-serum/anchor": "^0.26.0", 14 | "@shyft-to/solana-transaction-parser": "^1.1.17", 15 | "@solana/web3.js": "^1.90.0", 16 | "@triton-one/yellowstone-grpc": "^0.4.0", 17 | "bs58": "^5.0.0", 18 | "dotenv": "^16.4.5", 19 | "lodash": "^4.17.21" 20 | }, 21 | "devDependencies": { 22 | "ts-node": "^10.9.2", 23 | "typescript": "^4.9.3" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_clmm_accounts/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_clmm_new_pool/.env: -------------------------------------------------------------------------------- 1 | GRPC_URL= 2 | X_TOKEN= -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_clmm_new_pool/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | ./vs -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_clmm_new_pool/assets/clmm-new-pool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Raydium/Typescript/stream_and_parse_clmm_new_pool/assets/clmm-new-pool.png -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_clmm_new_pool/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shyft", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.ts", 6 | "scripts": { 7 | "start": "npx ts-node index.ts", 8 | "build": "npx tsc" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "@project-serum/anchor": "^0.26.0", 14 | "@shyft-to/solana-transaction-parser": "^1.1.17", 15 | "@solana/web3.js": "^1.90.0", 16 | "@triton-one/yellowstone-grpc": "^0.4.0", 17 | "bs58": "^5.0.0", 18 | "dotenv": "^16.4.5", 19 | "lodash": "^4.17.21" 20 | }, 21 | "devDependencies": { 22 | "ts-node": "^10.9.2", 23 | "typescript": "^4.9.3" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_clmm_new_pool/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_clmm_new_pool/utils/parsedTransactionOutput.ts: -------------------------------------------------------------------------------- 1 | export function parsedTransactionOutput(parsedInstruction,txn){ 2 | let output = {}; 3 | const name = parsedInstruction.instructions.find( 4 | (instruction) => instruction.name === 'createPool' 5 | ); 6 | if(!name) return; 7 | output = { 8 | ...txn, 9 | meta: { 10 | ...txn.meta, 11 | innerInstructions: parsedInstruction.inner_ixs, 12 | }, 13 | transaction: { 14 | ...txn.transaction, 15 | message: { 16 | ...txn.transaction.message, 17 | compiledInstructions: parsedInstruction.instructions, 18 | }, 19 | } 20 | } 21 | console.log("parsedInstruction", name); 22 | 23 | return output; 24 | } -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_cpmm_accounts/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | .env -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_cpmm_accounts/assets/raydium_cpAccount.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Raydium/Typescript/stream_and_parse_cpmm_accounts/assets/raydium_cpAccount.png -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_cpmm_accounts/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shyft", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.ts", 6 | "scripts": { 7 | "start": "npx ts-node index.ts", 8 | "build": "npx tsc" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "@solana/buffer-layout": "^4.0.1", 14 | "@solana/web3.js": "^1.90.0", 15 | "@triton-one/yellowstone-grpc": "^0.4.0", 16 | "bs58": "^5.0.0", 17 | "dotenv": "^16.4.5", 18 | "lodash": "^4.17.21" 19 | }, 20 | "devDependencies": { 21 | "@types/node": "^22.14.0", 22 | "ts-node": "^10.9.2", 23 | "typescript": "^4.9.3" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_cpmm_accounts/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_cpmm_new_pool/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | .env 4 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_cpmm_new_pool/assets/cpmm-new-pool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Raydium/Typescript/stream_and_parse_cpmm_new_pool/assets/cpmm-new-pool.png -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_cpmm_new_pool/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shyft", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.ts", 6 | "scripts": { 7 | "start": "npx ts-node index.ts", 8 | "build": "npx tsc" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "@triton-one/yellowstone-grpc": "^0.4.0", 14 | "@solana/web3.js": "^1.90.0", 15 | "@project-serum/anchor": "^0.26.0", 16 | "@shyft-to/solana-transaction-parser": "^1.1.17", 17 | "@solana/buffer-layout": "^4.0.1", 18 | "@solana/buffer-layout-utils": "^0.2.0", 19 | "dotenv": "^16.4.5", 20 | "lodash": "^4.17.21", 21 | "bs58": "^5.0.0" 22 | }, 23 | "devDependencies": { 24 | "ts-node": "^10.9.2", 25 | "typescript": "^4.9.3" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_cpmm_new_pool/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_cpmm_new_pool/utils/parsedTransaction.ts: -------------------------------------------------------------------------------- 1 | export function parsedTransactionOutput(parsedInstruction,txn){ 2 | let output = {}; 3 | const name = parsedInstruction.instructions.find( 4 | (instruction) => instruction.name === 'initialize' 5 | ); 6 | if(!name) return; 7 | output = { 8 | ...txn, 9 | meta: { 10 | ...txn.meta, 11 | innerInstructions: parsedInstruction.inner_ixs, 12 | }, 13 | transaction: { 14 | ...txn.transaction, 15 | message: { 16 | ...txn.transaction.message, 17 | compiledInstructions: parsedInstruction.instructions, 18 | }, 19 | } 20 | } 21 | console.log("parsedInstruction", name); 22 | 23 | return output; 24 | } -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_raydium_clmm_transactions/.env: -------------------------------------------------------------------------------- 1 | GRPC_URL= 2 | X_TOKEN= -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_raydium_clmm_transactions/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | ./vs -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_raydium_clmm_transactions/assets/RaydiumCLMM_Screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Raydium/Typescript/stream_and_parse_raydium_clmm_transactions/assets/RaydiumCLMM_Screenshot.png -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_raydium_clmm_transactions/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shyft", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.ts", 6 | "scripts": { 7 | "start": "npx ts-node index.ts", 8 | "build": "npx tsc" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "@project-serum/anchor": "^0.26.0", 14 | "@shyft-to/solana-transaction-parser": "^1.1.17", 15 | "@solana/web3.js": "^1.90.0", 16 | "@triton-one/yellowstone-grpc": "^0.4.0", 17 | "bs58": "^5.0.0", 18 | "dotenv": "^16.4.5", 19 | "lodash": "^4.17.21" 20 | }, 21 | "devDependencies": { 22 | "ts-node": "^10.9.2", 23 | "typescript": "^4.9.3" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_raydium_clmm_transactions/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_raydium_clmm_transactions/utils/parsedTransactionOutput.ts: -------------------------------------------------------------------------------- 1 | export function parsedTransactionOutput(parsedInstruction,txn){ 2 | let output = {}; 3 | 4 | output = { 5 | ...txn, 6 | meta: { 7 | ...txn.meta, 8 | innerInstructions: parsedInstruction.inner_ixs, 9 | }, 10 | transaction: { 11 | ...txn.transaction, 12 | message: { 13 | ...txn.transaction.message, 14 | compiledInstructions: parsedInstruction.instructions, 15 | }, 16 | } 17 | } 18 | 19 | 20 | return output; 21 | } -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_raydium_clmm_transactions_and_detect_buy_sell_events/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | .env -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_raydium_clmm_transactions_and_detect_buy_sell_events/assets/buy-sell-events.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Raydium/Typescript/stream_and_parse_raydium_clmm_transactions_and_detect_buy_sell_events/assets/buy-sell-events.png -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_raydium_clmm_transactions_and_detect_buy_sell_events/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shyft", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.ts", 6 | "scripts": { 7 | "start": "npx ts-node index.ts", 8 | "build": "npx tsc" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "@project-serum/anchor": "^0.26.0", 14 | "@shyft-to/solana-transaction-parser": "^1.1.17", 15 | "@solana/web3.js": "^1.90.0", 16 | "@triton-one/yellowstone-grpc": "^0.4.0", 17 | "bs58": "^5.0.0", 18 | "dotenv": "^16.4.5", 19 | "lodash": "^4.17.21" 20 | }, 21 | "devDependencies": { 22 | "ts-node": "^10.9.2", 23 | "typescript": "^4.9.3" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_raydium_clmm_transactions_and_detect_buy_sell_events/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_raydium_cpmm_transactions/.env.sample: -------------------------------------------------------------------------------- 1 | #Add your environment details, and rename this file to .env to run yoru project 2 | GRPC_URL= 3 | X_TOKEN= -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_raydium_cpmm_transactions/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | .env 4 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_raydium_cpmm_transactions/assets/stream_parsed_raydium_txns.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Raydium/Typescript/stream_and_parse_raydium_cpmm_transactions/assets/stream_parsed_raydium_txns.jpg -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_raydium_cpmm_transactions/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shyft", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.ts", 6 | "scripts": { 7 | "start": "npx ts-node index.ts", 8 | "build": "npx tsc" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "@triton-one/yellowstone-grpc": "^0.4.0", 14 | "@solana/web3.js": "^1.90.0", 15 | "@project-serum/anchor": "^0.26.0", 16 | "@shyft-to/solana-transaction-parser": "^1.1.17", 17 | "@solana/buffer-layout": "^4.0.1", 18 | "@solana/buffer-layout-utils": "^0.2.0", 19 | "dotenv": "^16.4.5", 20 | "lodash": "^4.17.21", 21 | "bs58": "^5.0.0" 22 | }, 23 | "devDependencies": { 24 | "ts-node": "^10.9.2", 25 | "typescript": "^4.9.3" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_raydium_cpmm_transactions/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_raydium_cpmm_transactions/utils/transactionOutput.ts: -------------------------------------------------------------------------------- 1 | export function transactionOutput(txn){ 2 | const type = txn.instructions[0].name === "sell"?"SELL":"BUY"; 3 | const events = txn.events[0].data; 4 | //console.log(txn.instructions[0]); 5 | const mint = events?.mint; 6 | const solAmount = events?.solAmount/1000000000 7 | const tokenAmount = events?.tokenAmount; 8 | const user = events?.user 9 | return{ 10 | type, 11 | mint, 12 | solAmount, 13 | tokenAmount, 14 | user 15 | } 16 | } -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_raydium_cpmm_transactions_and_detect_buy_sell_events/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | .env 4 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_raydium_cpmm_transactions_and_detect_buy_sell_events/assets/cpmm-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Raydium/Typescript/stream_and_parse_raydium_cpmm_transactions_and_detect_buy_sell_events/assets/cpmm-screenshot.png -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_raydium_cpmm_transactions_and_detect_buy_sell_events/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shyft", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.ts", 6 | "scripts": { 7 | "start": "npx ts-node index.ts", 8 | "build": "npx tsc" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "@triton-one/yellowstone-grpc": "^0.4.0", 14 | "@solana/web3.js": "^1.90.0", 15 | "@project-serum/anchor": "^0.26.0", 16 | "@shyft-to/solana-transaction-parser": "^1.1.17", 17 | "@solana/buffer-layout": "^4.0.1", 18 | "@solana/buffer-layout-utils": "^0.2.0", 19 | "dotenv": "^16.4.5", 20 | "lodash": "^4.17.21", 21 | "bs58": "^5.0.0" 22 | }, 23 | "devDependencies": { 24 | "ts-node": "^10.9.2", 25 | "typescript": "^4.9.3" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_raydium_cpmm_transactions_and_detect_buy_sell_events/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_raydium_launchpad_account/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | .env -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_raydium_launchpad_account/assets/raydium-launchpad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Raydium/Typescript/stream_and_parse_raydium_launchpad_account/assets/raydium-launchpad.png -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_raydium_launchpad_account/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shyft", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.ts", 6 | "scripts": { 7 | "start": "npx ts-node index.ts", 8 | "build": "npx tsc" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "@solana/buffer-layout": "^4.0.1", 14 | "@coral-xyz/anchor": "^0.31.0", 15 | "@solana/web3.js": "^1.90.0", 16 | "@triton-one/yellowstone-grpc": "^0.4.0", 17 | "bs58": "^5.0.0", 18 | "dotenv": "^16.4.5", 19 | "lodash": "^4.17.21" 20 | }, 21 | "devDependencies": { 22 | "@types/node": "^22.14.0", 23 | "ts-node": "^10.9.2", 24 | "typescript": "^4.9.3" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_raydium_launchpad_account/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_raydium_launchpad_transactions/.env.example: -------------------------------------------------------------------------------- 1 | GRPC_URL= 2 | X_TOKEN= -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_raydium_launchpad_transactions/assets/raydium-launchpad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Raydium/Typescript/stream_and_parse_raydium_launchpad_transactions/assets/raydium-launchpad.png -------------------------------------------------------------------------------- /Raydium/Typescript/stream_and_parse_raydium_launchpad_transactions/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "es2017", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_new_pool_raydium_launchpad/.env.example: -------------------------------------------------------------------------------- 1 | GRPC_URL= 2 | X_TOKEN= -------------------------------------------------------------------------------- /Raydium/Typescript/stream_new_pool_raydium_launchpad/assets/raydium-launchpad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Raydium/Typescript/stream_new_pool_raydium_launchpad/assets/raydium-launchpad.png -------------------------------------------------------------------------------- /Raydium/Typescript/stream_new_pool_raydium_launchpad/assets/raydium-new-pool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Raydium/Typescript/stream_new_pool_raydium_launchpad/assets/raydium-new-pool.png -------------------------------------------------------------------------------- /Raydium/Typescript/stream_new_pool_raydium_launchpad/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "es2017", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_raydium_amm_transactions_and_detect_buy_sell_events/.env: -------------------------------------------------------------------------------- 1 | GRPC_URL= 2 | X_TOKEN= 3 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_raydium_amm_transactions_and_detect_buy_sell_events/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | .env 4 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_raydium_amm_transactions_and_detect_buy_sell_events/assets/raydium-event.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Raydium/Typescript/stream_raydium_amm_transactions_and_detect_buy_sell_events/assets/raydium-event.png -------------------------------------------------------------------------------- /Raydium/Typescript/stream_raydium_amm_transactions_and_detect_buy_sell_events/assets/stream_parsed_raydium_txns.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Raydium/Typescript/stream_raydium_amm_transactions_and_detect_buy_sell_events/assets/stream_parsed_raydium_txns.jpg -------------------------------------------------------------------------------- /Raydium/Typescript/stream_raydium_amm_transactions_and_detect_buy_sell_events/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shyft", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.ts", 6 | "scripts": { 7 | "start": "npx ts-node index.ts", 8 | "build": "npx tsc" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "@project-serum/anchor": "^0.26.0", 14 | "@shyft-to/solana-transaction-parser": "^1.1.17", 15 | "@solana/buffer-layout": "^4.0.1", 16 | "@solana/buffer-layout-utils": "^0.2.0", 17 | "@solana/web3.js": "^1.90.0", 18 | "@triton-one/yellowstone-grpc": "^0.4.0", 19 | "bs58": "^5.0.0", 20 | "dotenv": "^16.4.5", 21 | "lodash": "^4.17.21" 22 | }, 23 | "devDependencies": { 24 | "ts-node": "^10.9.2", 25 | "typescript": "^4.9.3" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_raydium_amm_transactions_and_detect_buy_sell_events/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_raydium_launchpad_and_detect_buy_sell_events/.env.example: -------------------------------------------------------------------------------- 1 | GRPC_URL= 2 | X_TOKEN= -------------------------------------------------------------------------------- /Raydium/Typescript/stream_raydium_launchpad_and_detect_buy_sell_events/assets/rl-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Raydium/Typescript/stream_raydium_launchpad_and_detect_buy_sell_events/assets/rl-screenshot.png -------------------------------------------------------------------------------- /Raydium/Typescript/stream_raydium_launchpad_and_detect_buy_sell_events/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "es2017", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Raydium/Typescript/stream_raydium_launchpad_new_minted_tokens/.env.example: -------------------------------------------------------------------------------- 1 | GRPC_URL= 2 | X_TOKEN= -------------------------------------------------------------------------------- /Raydium/Typescript/stream_raydium_launchpad_new_minted_tokens/assets/raydium-launchpad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Raydium/Typescript/stream_raydium_launchpad_new_minted_tokens/assets/raydium-launchpad.png -------------------------------------------------------------------------------- /Raydium/Typescript/stream_raydium_launchpad_new_minted_tokens/assets/raydium-new-pool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/Raydium/Typescript/stream_raydium_launchpad_new_minted_tokens/assets/raydium-new-pool.png -------------------------------------------------------------------------------- /Raydium/Typescript/stream_raydium_launchpad_new_minted_tokens/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "es2017", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Raydium/Typescript/streaming_multiple_token_market_activities/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /Raydium/Typescript/streaming_multiple_token_market_activities/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Raydium/Typescript/streaming_multiple_token_market_activities/utils/marketInfo.ts: -------------------------------------------------------------------------------- 1 | import { getTokenInfo } from "./tokenInfo"; 2 | import { getSolBalance, getTokenBalance } from "./walletInfo"; 3 | 4 | export async function getMarketInfo(baseBal, quoteBal, currentSupply) { 5 | try { 6 | const quote$ = quoteBal * 225.85//quoteBal * sol value in $$; 7 | const price = quote$ / baseBal; 8 | const marketcap = currentSupply * price; 9 | 10 | return { 11 | price, 12 | marketcap, 13 | currentSupply, 14 | quote$, 15 | }; 16 | } catch (error) { 17 | console.error('Error getting market info:', error); 18 | throw error; 19 | } 20 | } -------------------------------------------------------------------------------- /Raydium/Typescript/streaming_multiple_token_market_activities/utils/tokenInfo.ts: -------------------------------------------------------------------------------- 1 | const api = "api" 2 | var myHeaders = new Headers(); 3 | myHeaders.append("x-api-key", api); 4 | 5 | var requestOptions:any = { 6 | method: 'GET', 7 | headers: myHeaders, 8 | redirect: 'follow' 9 | }; 10 | 11 | export async function getTokenInfo(address){ 12 | const info = await fetch(`https://api.shyft.to/sol/v1/token/get_info?network=mainnet-beta&token_address=${address}`, requestOptions) 13 | const infoJson = await info.json(); 14 | const result = infoJson.result; 15 | const currentSupply = result?.current_supply; 16 | const decimal = result?.decimals; 17 | return {currentSupply,decimal} 18 | } 19 | -------------------------------------------------------------------------------- /Raydium/Typescript/streaming_multiple_token_market_activities/utils/walletInfo.ts: -------------------------------------------------------------------------------- 1 | import { Connection, PublicKey } from "@solana/web3.js"; 2 | 3 | 4 | export const api = "api" 5 | const connection = new Connection(`https://rpc.shyft.to?api_key=${api}`, 'confirmed'); 6 | 7 | export async function getTokenBalance(address){ 8 | try{ 9 | const account = await connection.getTokenAccountBalance(new PublicKey(address)) 10 | const balance = Number(account?.value?.amount); 11 | if(!balance)return; 12 | return balance; 13 | }catch(err){ 14 | } 15 | } 16 | export async function getSolBalance(address){ 17 | const account = await connection.getBalance(new PublicKey(address)); 18 | const balance = account/1000000000; 19 | return balance; 20 | } 21 | -------------------------------------------------------------------------------- /Raydium/Typescript/streaming_newly_added_pool_accounts/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /Raydium/Typescript/streaming_newly_added_pool_accounts/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "../grpc-new-pool-streaming-account/dist", 12 | "baseUrl": "../grpc-new-pool-streaming-account", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Raydium/Typescript/streaming_newly_added_pool_accounts/utils/decodeTransaction.ts: -------------------------------------------------------------------------------- 1 | import base58 from "bs58"; 2 | 3 | export function decodeTransact(data){ 4 | const output = data?base58.encode(Buffer.from(data,'base64')):""; 5 | return output; 6 | } -------------------------------------------------------------------------------- /Raydium/Typescript/streaming_newly_added_pool_accounts/utils/transactionOutput.ts: -------------------------------------------------------------------------------- 1 | import { LIQUIDITY_STATE_LAYOUT_V4 } from "@raydium-io/raydium-sdk"; 2 | import { decodeTransact } from "./decodeTransaction"; 3 | 4 | export function tOutPut(data){ 5 | const dataTx = data?.account?.account; 6 | const signature = decodeTransact(dataTx?.txnSignature); 7 | const pubKey = decodeTransact(dataTx?.pubkey) 8 | const owner = decodeTransact(dataTx?.owner); 9 | const poolstate = LIQUIDITY_STATE_LAYOUT_V4.decode(dataTx.data); 10 | const slot = data?.account.slot 11 | return { 12 | signature, 13 | pubKey, 14 | owner, 15 | poolstate, 16 | slot 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Raydium/Typescript/streaming_newly_added_pool_transactions/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /Raydium/Typescript/streaming_newly_added_pool_transactions/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Raydium/Typescript/streaming_pool_transactions_for_token_pairs/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /Raydium/Typescript/streaming_pool_transactions_for_token_pairs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /general-grpc-examples/Rust/adding_a_reconnection_mechanism/.gitignore: -------------------------------------------------------------------------------- 1 | target/ -------------------------------------------------------------------------------- /general-grpc-examples/Rust/adding_a_reconnection_mechanism/assets/usage-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/general-grpc-examples/Rust/adding_a_reconnection_mechanism/assets/usage-screenshot.png -------------------------------------------------------------------------------- /general-grpc-examples/Rust/adding_a_reconnection_mechanism/src/serialization.rs: -------------------------------------------------------------------------------- 1 | use solana_sdk::pubkey::Pubkey; 2 | 3 | pub fn serialize_pubkey(value: &Pubkey, serializer: S) -> Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | serializer.serialize_str(&value.to_string()) 8 | } 9 | 10 | pub fn serialize_option_pubkey(value: &Option, serializer: S) -> Result 11 | where 12 | S: serde::Serializer, 13 | { 14 | match value { 15 | Some(pubkey) => serializer.serialize_str(&pubkey.to_string()), 16 | None => serializer.serialize_none(), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /general-grpc-examples/Rust/making_a_grpc_connection/.gitignore: -------------------------------------------------------------------------------- 1 | target/ -------------------------------------------------------------------------------- /general-grpc-examples/Rust/making_a_grpc_connection/README.md: -------------------------------------------------------------------------------- 1 | # Making a gRPC Connection with the Yellowstone Client on Solana in Rust 2 | 3 | This project illustrates how to establish a real-time data stream from the Solana blockchain using Rust and the Yellowstone gRPC client. It covers the essential steps to connect and begin receiving live updates via gRPC. 4 | ``` 5 | $ cargo run -- --endpoint --x-token 6 | ``` 7 | 8 | ![screenshot](assets/usage-screenshot.png?raw=true "Screenshot") 9 | 10 | ## Notes 11 | 12 | gRPC client example in rust: [https://github.com/rpcpool/yellowstone-grpc/tree/master/examples/rust] -------------------------------------------------------------------------------- /general-grpc-examples/Rust/making_a_grpc_connection/assets/usage-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/general-grpc-examples/Rust/making_a_grpc_connection/assets/usage-screenshot.png -------------------------------------------------------------------------------- /general-grpc-examples/Rust/making_a_grpc_connection/src/serialization.rs: -------------------------------------------------------------------------------- 1 | use solana_sdk::pubkey::Pubkey; 2 | 3 | pub fn serialize_pubkey(value: &Pubkey, serializer: S) -> Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | serializer.serialize_str(&value.to_string()) 8 | } 9 | 10 | pub fn serialize_option_pubkey(value: &Option, serializer: S) -> Result 11 | where 12 | S: serde::Serializer, 13 | { 14 | match value { 15 | Some(pubkey) => serializer.serialize_str(&pubkey.to_string()), 16 | None => serializer.serialize_none(), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /general-grpc-examples/Rust/modifying_subscribe_request/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock -------------------------------------------------------------------------------- /general-grpc-examples/Rust/modifying_subscribe_request/assets/usage_screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/general-grpc-examples/Rust/modifying_subscribe_request/assets/usage_screenshot.png -------------------------------------------------------------------------------- /general-grpc-examples/Typescript/[GRPC]Streaming_Token_TXN/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /general-grpc-examples/Typescript/[GRPC]Streaming_Token_TXN/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /general-grpc-examples/Typescript/[GRPC]Streaming_Token_TXN/utils/decodeTransaction.ts: -------------------------------------------------------------------------------- 1 | import base58 from "bs58"; 2 | 3 | export function decodeTransact(data){ 4 | const output = data?base58.encode(Buffer.from(data,'base64')):""; 5 | return output; 6 | } -------------------------------------------------------------------------------- /general-grpc-examples/Typescript/[GRPC]Streaming_Token_TXN/utils/logTXN.ts: -------------------------------------------------------------------------------- 1 | export function searchForInitialize2(transaction) { 2 | const logMessages = transaction.meta?.logMessages || []; 3 | if (logMessages.some(log => log.includes(''))) { 4 | return transaction; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /general-grpc-examples/Typescript/add_a_reconnect_mechanism/.env.sample: -------------------------------------------------------------------------------- 1 | #Add your environment details, and rename this file to .env to run yoru project 2 | GRPC_URL= "" 3 | X_TOKEN= "" -------------------------------------------------------------------------------- /general-grpc-examples/Typescript/add_a_reconnect_mechanism/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | .env 4 | -------------------------------------------------------------------------------- /general-grpc-examples/Typescript/add_a_reconnect_mechanism/assets/stream_parsed_raydium_txns.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/general-grpc-examples/Typescript/add_a_reconnect_mechanism/assets/stream_parsed_raydium_txns.jpg -------------------------------------------------------------------------------- /general-grpc-examples/Typescript/add_a_reconnect_mechanism/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shyft", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.ts", 6 | "scripts": { 7 | "start": "npx ts-node index.ts", 8 | "build": "npx tsc" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "@triton-one/yellowstone-grpc": "^4.0.2", 14 | "@solana/web3.js": "^1.90.0", 15 | "@project-serum/anchor": "^0.26.0", 16 | "@shyft-to/solana-transaction-parser": "^1.1.17", 17 | "@solana/buffer-layout": "^4.0.1", 18 | "@solana/buffer-layout-utils": "^0.2.0", 19 | "dotenv": "^16.4.5", 20 | "lodash": "^4.17.21", 21 | "bs58": "^5.0.0" 22 | }, 23 | "devDependencies": { 24 | "ts-node": "^10.9.2", 25 | "typescript": "^4.9.3" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /general-grpc-examples/Typescript/add_a_reconnect_mechanism/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /general-grpc-examples/Typescript/closing_a_grpc_connection/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /general-grpc-examples/Typescript/making_a_grpc_connection/.env.sample: -------------------------------------------------------------------------------- 1 | #Add your environment details, and rename this file to .env to run yoru project 2 | GRPC_URL= "" 3 | X_TOKEN= "" -------------------------------------------------------------------------------- /general-grpc-examples/Typescript/making_a_grpc_connection/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | .env 4 | -------------------------------------------------------------------------------- /general-grpc-examples/Typescript/making_a_grpc_connection/assets/stream_parsed_raydium_txns.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/general-grpc-examples/Typescript/making_a_grpc_connection/assets/stream_parsed_raydium_txns.jpg -------------------------------------------------------------------------------- /general-grpc-examples/Typescript/making_a_grpc_connection/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shyft", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.ts", 6 | "scripts": { 7 | "start": "npx ts-node index.ts", 8 | "build": "npx tsc" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "@triton-one/yellowstone-grpc": "^0.4.0", 14 | "@solana/web3.js": "^1.90.0", 15 | "@project-serum/anchor": "^0.26.0", 16 | "@shyft-to/solana-transaction-parser": "^1.1.17", 17 | "@solana/buffer-layout": "^4.0.1", 18 | "@solana/buffer-layout-utils": "^0.2.0", 19 | "dotenv": "^16.4.5", 20 | "lodash": "^4.17.21", 21 | "bs58": "^5.0.0" 22 | }, 23 | "devDependencies": { 24 | "ts-node": "^10.9.2", 25 | "typescript": "^4.9.3" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /general-grpc-examples/Typescript/making_a_grpc_connection/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /general-grpc-examples/Typescript/modifying_subscribe_request/.env: -------------------------------------------------------------------------------- 1 | GRPC_URL= 2 | X_TOKEN= -------------------------------------------------------------------------------- /general-grpc-examples/Typescript/modifying_subscribe_request/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /general-grpc-examples/Typescript/modifying_subscribe_request/assets/usage-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/general-grpc-examples/Typescript/modifying_subscribe_request/assets/usage-screenshot.png -------------------------------------------------------------------------------- /general-grpc-examples/Typescript/modifying_subscribe_request/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /grpc-latency-checker/Rust/grpc-latency-checker-rust/.gitignore: -------------------------------------------------------------------------------- 1 | /target -------------------------------------------------------------------------------- /grpc-latency-checker/Rust/grpc-latency-checker-rust/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "solana_grpc_txn_stream" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | anyhow = "1.0.62" 8 | backoff = { version = "0.4.0", features = ["tokio"] } 9 | bincode = "1.3.3" 10 | bs58 = "0.5.1" 11 | chrono = "0.4.26" 12 | clap = { version = "4.3.0", features = ["derive"] } 13 | env_logger = "0.11.3" 14 | futures = "0.3.24" 15 | hex = "0.4.3" 16 | indicatif = "0.17.9" 17 | log = "0.4.17" 18 | maplit = "1.0.2" 19 | serde_json = "1.0.86" 20 | solana-sdk = "~2.1.1" 21 | solana-transaction-status = "~2.1.1" 22 | tokio = { version = "1.21.2", features = ["rt-multi-thread", "fs"] } 23 | tonic = "0.12.1" 24 | yellowstone-grpc-client = { version = "4.1.0" } 25 | yellowstone-grpc-proto = { version = "4.1.1", default-features = false, features = ["plugin"] } 26 | -------------------------------------------------------------------------------- /grpc-latency-checker/Rust/grpc-latency-checker-rust/assets/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/grpc-latency-checker/Rust/grpc-latency-checker-rust/assets/screenshot.png -------------------------------------------------------------------------------- /grpc-latency-checker/Rust/grpc-latency-compare-rust/.env.example: -------------------------------------------------------------------------------- 1 | YELLOWSTONE_STREAM_CONFIGS='[{"uri":"yellowstone_grpc_uri_1","x_token":"yellowstone_x_token_1"},{"uri":"yellowstone_grpc_uri_2","x_token":"yellowstone_x_token_2"}]' 2 | SHRED_STREAM_CONFIGS='[{"uri":"shred_grpc_uri_1","x_token":"shred_x_token_1"},{"uri":"shred_grpc_uri_2","x_token":"shred_x_token_2"}]' 3 | TIMEOUT_DUR=30 # seconds -------------------------------------------------------------------------------- /grpc-latency-checker/Rust/grpc-latency-compare-rust/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | .env -------------------------------------------------------------------------------- /grpc-latency-checker/Rust/grpc-latency-compare-rust/jito_protos/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "jito-protos" 3 | version = { workspace = true } 4 | description = "Protobufs for working with block engine" 5 | authors = { workspace = true } 6 | homepage = { workspace = true } 7 | edition = { workspace = true } 8 | publish = false 9 | 10 | [dependencies] 11 | prost = "0.12" 12 | prost-types = "0.12" 13 | tonic = { workspace = true } 14 | 15 | [build-dependencies] 16 | protobuf-src = "1" 17 | tonic-build = "0.10" -------------------------------------------------------------------------------- /grpc-latency-checker/Rust/grpc-latency-compare-rust/jito_protos/build.rs: -------------------------------------------------------------------------------- 1 | use tonic_build::configure; 2 | 3 | fn main() { 4 | const PROTOC_ENVAR: &str = "PROTOC"; 5 | if std::env::var(PROTOC_ENVAR).is_err() { 6 | #[cfg(not(windows))] 7 | std::env::set_var(PROTOC_ENVAR, protobuf_src::protoc()); 8 | } 9 | 10 | configure() 11 | .compile( 12 | &[ 13 | "protos/auth.proto", 14 | "protos/shared.proto", 15 | "protos/shredstream.proto", 16 | ], 17 | &["protos"], 18 | ) 19 | .unwrap(); 20 | } 21 | -------------------------------------------------------------------------------- /grpc-latency-checker/Rust/grpc-latency-compare-rust/jito_protos/protos/block.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package block; 4 | import "shared.proto"; 5 | 6 | // Condensed block helpful for getting data around efficiently internal to our system. 7 | message CondensedBlock { 8 | shared.Header header = 1; 9 | string previous_blockhash = 2; 10 | string blockhash = 3; 11 | uint64 parent_slot = 4; 12 | repeated bytes versioned_transactions = 5; 13 | uint64 slot = 6; 14 | string commitment = 7; 15 | } 16 | -------------------------------------------------------------------------------- /grpc-latency-checker/Rust/grpc-latency-compare-rust/jito_protos/protos/packet.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package packet; 4 | 5 | message PacketBatch { 6 | repeated Packet packets = 1; 7 | } 8 | 9 | message Packet { 10 | bytes data = 1; 11 | Meta meta = 2; 12 | } 13 | 14 | message Meta { 15 | uint64 size = 1; 16 | string addr = 2; 17 | uint32 port = 3; 18 | PacketFlags flags = 4; 19 | uint64 sender_stake = 5; 20 | } 21 | 22 | message PacketFlags { 23 | bool discard = 1; 24 | bool forwarded = 2; 25 | bool repair = 3; 26 | bool simple_vote_tx = 4; 27 | bool tracer_packet = 5; 28 | bool from_staked_node = 6; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /grpc-latency-checker/Rust/grpc-latency-compare-rust/jito_protos/protos/shared.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "google/protobuf/timestamp.proto"; 4 | 5 | package shared; 6 | 7 | message Header { 8 | google.protobuf.Timestamp ts = 1; 9 | } 10 | 11 | message Heartbeat { 12 | uint64 count = 1; 13 | } 14 | 15 | message Socket { 16 | string ip = 1; 17 | int64 port = 2; 18 | } 19 | -------------------------------------------------------------------------------- /grpc-latency-checker/Rust/grpc-latency-compare-rust/jito_protos/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod shared { 2 | tonic::include_proto!("shared"); 3 | } 4 | 5 | pub mod auth { 6 | tonic::include_proto!("auth"); 7 | } 8 | 9 | pub mod shredstream { 10 | tonic::include_proto!("shredstream"); 11 | } 12 | -------------------------------------------------------------------------------- /grpc-latency-checker/Typescript/grpc-latency-checker-ts/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/grpc-latency-checker/Typescript/grpc-latency-checker-ts/.DS_Store -------------------------------------------------------------------------------- /grpc-latency-checker/Typescript/grpc-latency-checker-ts/.env-sample: -------------------------------------------------------------------------------- 1 | COMMITMENT_LEVEL=processed 2 | # This can be confirmed or finalized as well 3 | 4 | ENDPOINT=https://grpc.us.shyft.to 5 | # It can be connected to any yellowstone gRPC endpoint 6 | 7 | X_TOKEN= 8 | # your x-token, if shyft user, you can find this in grpc section 9 | 10 | CONCURRENCY=100 11 | # no of items to be processed at a time by fastq 12 | 13 | RPC_URL=https://rpc.ny.shyft.to?api_key= 14 | # your Solana RPC url 15 | 16 | PUBLIC_KEY_TO_LISTEN=675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8 17 | # address of the program you are receiving txns for 18 | 19 | RUN_TIME=2 20 | # how long you want to run the test, in minutes -------------------------------------------------------------------------------- /grpc-latency-checker/Typescript/grpc-latency-checker-ts/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /grpc-latency-checker/Typescript/grpc-slot-based-latency-checker/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shyft-to/solana-defi/3d91ea31db961884d3da01040c8aabc8b41da0a2/grpc-latency-checker/Typescript/grpc-slot-based-latency-checker/.DS_Store -------------------------------------------------------------------------------- /grpc-latency-checker/Typescript/grpc-slot-based-latency-checker/.env-sample: -------------------------------------------------------------------------------- 1 | COMMITMENT_LEVEL=processed 2 | # This can be confirmed or finalized as well 3 | 4 | ENDPOINT=https://grpc.us.shyft.to 5 | # It can be connected to any yellowstone gRPC endpoint 6 | 7 | X_TOKEN= 8 | # your x-token, if shyft user, you can find this in grpc section 9 | 10 | CONCURRENCY=100 11 | # no of items to be processed at a time by fastq 12 | 13 | PUBLIC_KEY_TO_LISTEN=675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8 14 | # address of the program you are receiving txns for 15 | 16 | RUN_TIME=2 17 | # how long you want to run the test, in minutes -------------------------------------------------------------------------------- /grpc-latency-checker/Typescript/grpc-slot-based-latency-checker/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2022", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false, 20 | "resolveJsonModule": true, 21 | "esModuleInterop": true 22 | } 23 | } 24 | --------------------------------------------------------------------------------