Skip to content

Instantly share code, notes, and snippets.

@gherkins
gherkins / index.ts
Created March 11, 2024 16:28 — forked from endrsmar/index.ts
Raydium new pool listener
import { LiquidityPoolKeysV4, MARKET_STATE_LAYOUT_V3, Market, TOKEN_PROGRAM_ID } from "@raydium-io/raydium-sdk";
import { Connection, Logs, ParsedInnerInstruction, ParsedInstruction, ParsedTransactionWithMeta, PartiallyDecodedInstruction, PublicKey } from "@solana/web3.js";
const RPC_ENDPOINT = 'https://api.mainnet-beta.solana.com';
const RAYDIUM_POOL_V4_PROGRAM_ID = '675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8';
const SERUM_OPENBOOK_PROGRAM_ID = 'srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX';
const SOL_MINT = 'So11111111111111111111111111111111111111112';
const SOL_DECIMALS = 9;
const connection = new Connection(RPC_ENDPOINT);
@gherkins
gherkins / scrollToViewPort.js
Created June 10, 2011 13:41 — forked from dejoe/scrollToViewPort.js
Jquery Scroll To View Port
jQuery.fn.scrollToViewPort = function(options) {
var animTimeInterval = (typeof options.interval == "undefined")?"slow":animTimeInterval;
return this.each(function(){
var offSet = (typeof options.offset == "undefined")? $(this).offset().top : options.offset;
if( $(this).offset().top <= $(window).scrollTop() || ( $(this).offset().top + $(this).height() ) >= ( $(window).scrollTop() + $(window).height() ) ){
$('html,body').animate( { scrollTop: offSet }, animTimeInterval );
}
});
}