This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use clap::{ | |
builder::{StringValueParser, TypedValueParser}, | |
Args, | |
}; | |
use rand::Rng; | |
use sanctum_associated_token_lib::FindAtaAddressArgs; | |
use sanctum_solana_cli_utils::{ | |
PubkeySrc, TokenAmt, TokenAmtOrAll, TokenAmtOrAllParser, TxSendMode, | |
}; | |
use sanctum_spl_stake_pool_lib::account_resolvers::WithdrawStakeWithSlippage; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cocoa | |
precedencegroup PipeOperatorPrecedence { | |
associativity: left | |
higherThan: LogicalConjunctionPrecedence | |
} | |
infix operator |>: PipeOperatorPrecedence | |
public func |> <A, B>(arg: A, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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( |