Skip to content

Instantly share code, notes, and snippets.

View p69's full-sized avatar

Pavel Shilyagov p69

View GitHub Profile
@p69
p69 / raydium_pool_info.ts
Created February 25, 2024 22:21
Raydium - get all pool info by pool id
async function getPoolInfo(connection: Connection, poolId: PublicKey): Promise<ApiPoolInfoV4> {
const info = await connection.getAccountInfo(poolId);
if (!info) {
throw error('No Pool Info')
}
let amAccountData = { id: poolId, programId: info.owner, ...LIQUIDITY_STATE_LAYOUT_V4.decode(info.data) }
const marketProgramId = amAccountData.marketProgramId
const allMarketInfo = await connection.getAccountInfo(marketProgramId)
if (!allMarketInfo) {
@p69
p69 / raydium_new_pool.ts
Created February 21, 2024 21:17
Listening to new pools on Raydium and parse data to make LiquidityPoolKeysV4
// solana/web3js Connection
const connection = new Connection(config.rpcHttpURL, {
wsEndpoint: config.rpcWsURL
})
// Raydium program address
const raydium = new PublicKey('675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8')
// Subscribe to all logs for Raydium program
seenTransactions = new Set() // Some tx come multiple times
import Cocoa
precedencegroup PipeOperatorPrecedence {
associativity: left
higherThan: LogicalConjunctionPrecedence
}
infix operator |>: PipeOperatorPrecedence
public func |> <A, B>(arg: A,
@p69
p69 / main.dart
Created August 5, 2018 21:42
Stateful widget with globalkey
import 'dart:math';
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(