Skip to content

Instantly share code, notes, and snippets.

View jongan69's full-sized avatar
🎯
WEB3D

Jonathan Gan jongan69

🎯
WEB3D
View GitHub Profile
@jongan69
jongan69 / Main.py
Created July 27, 2024 16:17
This script reads the rsi of the lockin token from ox.fun using candles and then generates ai text and tweet based on the sentiment of the rsi and also places buy orders
import os
import schedule
import time
import tweepy
import textwrap
from dotenv import load_dotenv
from random import randint
from openai import OpenAI
import requests
@jongan69
jongan69 / .env
Last active October 30, 2024 01:07
Lockin Bot??? RSI??? someone plz shoot me
OX_API_KEY=
OX_API_SECRET=
import os
import schedule
import time
import tweepy
import textwrap
from dotenv import load_dotenv
from random import randint
from openai import OpenAI
@jongan69
jongan69 / .env
Created July 8, 2024 05:27
/lock_in buy bot
TELEGRAM_BOT_TOKEN=your-telegram-bot-token
PRIVATE_KEY=your-wallet-private-key
SOLANA_RPC_ENDPOINT=https://api.mainnet-beta.solana.com
FIXED_AMOUNT=1 # Replace with the fixed amount you want to buy every time
@jongan69
jongan69 / SOL_TO_SPL.rs
Created June 29, 2024 18:32
hOW MUCH LOCKIN IS ONE SOL WORTH
// SOL to SPL token price
use anyhow::{format_err, Result};
use reqwest::Client;
use serde::{Deserialize, Serialize};
use serde_json::Value;
use std::collections::HashMap;
use std::error::Error as StdError;
use std::time::{SystemTime, UNIX_EPOCH};
// Constants
@jongan69
jongan69 / get_address_from_txid.rs
Created June 29, 2024 18:28
Bc I needed to filter kraken transactions by who deposited
// get_address_from_txid.rs
use bdk::bitcoin::{Txid, Network};
use bdk::bitcoin::util::address::Address;
use bdk::electrum_client::Client as ElectrumClient;
use bdk::bitcoin::consensus::encode::deserialize;
use bdk::bitcoin::Transaction as BitcoinTransaction;
use bdk::electrum_client::ElectrumApi;
use bdk::bitcoin::psbt::serialize::Serialize;
use std::str::FromStr;
@jongan69
jongan69 / Cargo.toml
Created June 29, 2024 18:21
lockmaxxing
[package]
name = "juptest"
version = "0.1.0"
edition = "2021"
[dependencies]
tokio = { version = "1", features = ["full"] }
solana-sdk = "1.16"
jupiter-swap-api-client = "0.1.0"
reqwest = "0.11.10" # Use a compatible version of reqwest
@jongan69
jongan69 / Cargo.toml
Created June 29, 2024 15:45
Get the USD price of lockin
[package]
name = "raytest"
version = "0.1.0"
edition = "2021"
[dependencies]
anyhow = "1.0"
reqwest = { version = "0.11", features = ["blocking", "json"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
@jongan69
jongan69 / wallet.rs
Created June 29, 2024 07:49
Solana Wallet generation and base58 string output
use solana_sdk::{signature::Keypair, signer::Signer};
use bs58;
fn main() {
let wallet = Keypair::new();
let public_key_base58 = bs58::encode(wallet.pubkey().to_bytes()).into_string();
let secret_key_base58 = bs58::encode(wallet.to_bytes()).into_string();
println!("Public Key (Base58): {}\nSecret Key (Base58): {}\n", public_key_base58, secret_key_base58);
}
@jongan69
jongan69 / load_env.sh
Created June 26, 2024 03:42
To use this script: Make the script executable: bash Copy code chmod +x load_env.sh Run the script: bash Copy code source ./load_env.sh This script will read the .env file, export each variable to the current shell environment, and keep the shell open if running interactively. The source command is used to run the script in the current shell ses…
#!/bin/bash
# Function to export variables from .env file
export_env_vars() {
local env_file=$1
if [ ! -f "$env_file" ]; then
echo "The file $env_file does not exist."
return 1
fi