Skip to content

Instantly share code, notes, and snippets.

View codewithgun's full-sized avatar
💭
meow?

kampung-tech codewithgun

💭
meow?
  • Littleroot Town
View GitHub Profile
import AmmImpl, { MAINNET_POOL } from "@mercurial-finance/dynamic-amm-sdk";
import { Connection, Keypair, PublicKey } from "@solana/web3.js";
import { Wallet, AnchorProvider } from "@project-serum/anchor";
import { TokenListProvider } from "@solana/spl-token-registry";
import Decimal from "decimal.js";
interface JupPriceResponse {
data: {
[address: string]: {
id: String;
@codewithgun
codewithgun / vault_details.ts
Last active August 1, 2025 16:09
Fetch meteora vault details
import VaultImpl from "@meteora-ag/vault-sdk";
import { Mint, unpackMint } from "@solana/spl-token";
import { clusterApiUrl, Connection, PublicKey } from "@solana/web3.js";
const connection = new Connection(clusterApiUrl("mainnet-beta"), "confirmed");
const keeperBaseUrl = "https://merv2-api.meteora.ag";
const lendingProgramIdsToName = new Map<string, string>([
["MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA", "MarginFi"],
import DLMM, { StrategyType } from "@meteora-ag/dlmm";
import { clusterApiUrl, Connection, Keypair, PublicKey } from "@solana/web3.js";
import BN from "bn.js";
import fs from "fs";
import os from "os";
const privateKeyFilepath = `${os.homedir()}/.config/solana/mainnet.json`;
const rawPrivateKey = fs.readFileSync(privateKeyFilepath, "utf-8");
const payer = Keypair.fromSecretKey(new Uint8Array(JSON.parse(rawPrivateKey)));