Skip to content

Instantly share code, notes, and snippets.

View korrio's full-sized avatar
👽

kOrriO korrio

👽
  • Hal Finney Co.,Ltd.
  • mempool
  • X @korrio
View GitHub Profile
@korrio
korrio / arb.rs
Created October 2, 2024 06:52
arb.rs
use web3::types::{H160, U256};
use web3::contract::{Contract, Options};
use std::str::FromStr;
use std::time::Duration;
use tokio::time;
// Define DEX struct
struct DEX {
name: String,
router_address: H160,
@korrio
korrio / comment_tiktok.py
Created September 25, 2024 09:14
comment_tiktok.py
from adbkit import ADBTools
from kthread_sleep import sleep
from mydevice import deviceserial
def get_uiautomator_frame(screenshotfolder='c:\\ttscreenshots'):
if screenshotfolder:
adb.aa_update_screenshot()
df = adb.aa_get_all_displayed_items_from_uiautomator(
screenshotfolder=screenshotfolder, # screenshots will be saved here
max_variation_percent_x=10,
@korrio
korrio / config.py
Created September 11, 2024 01:20
config.py
from web3 import Web3
import os
from dotenv import load_dotenv
from web3.middleware import geth_poa_middleware
# from web3.middleware import (
# async_geth_poa_middleware,
# )
import asyncio
# Load environment variables
@korrio
korrio / fetchPrice.js
Created August 7, 2024 08:35
fetchPrice on-chain from pair
const fetchTokenPrice = async () => {
const tokenAddress = '0xB96D0f29a0aC9AF4a32835e90EC6531389765089';
const tokenAddress2 = '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c';
const data1 = await publicClient.readContract({
address: '0x93accdaf2a9bb95d83d28cd19bc00d08be8741f9',
abi: pancakePairAbi,
functionName: 'getReserves',
});
@korrio
korrio / bot4.py
Created August 7, 2024 04:18
bot4.py
import asyncio
import time
from web3 import Web3
from web3.middleware import geth_poa_middleware
import aiohttp
from colorama import Fore, Style, init
import ssl
import certifi
from decimal import Decimal
@korrio
korrio / bot3.py
Created August 5, 2024 03:34
bot3.py
import asyncio
import aiohttp
from web3 import Web3
from web3.middleware import geth_poa_middleware
from colorama import Fore, Back, Style, init
# Initialize colorama
init(autoreset=True)
# กำหนดค่าการเชื่อมต่อกับ Polygon network
@korrio
korrio / bot.js
Created July 31, 2024 06:33
bot.js
const ethers = require('ethers');
const { ChainId, Token, Fetcher, Route, Trade, TokenAmount, TradeType, Percent } = require('@uniswap/sdk');
const { abi: IUniswapV2PairABI } = require('@uniswap/v2-core/build/IUniswapV2Pair.json');
const { abi: IUniswapV2Router02ABI } = require('@uniswap/v2-periphery/build/IUniswapV2Router02.json');
// Configuration
const ALCHEMY_URL = 'https://eth-mainnet.g.alchemy.com/v2/jssjArgnoSmS2Uv5RMVwQAySLhkBsOnJ';
//const ALCHEMY_URL_TESTNET = 'https://eth-sepolia.g.alchemy.com/v2/jssjArgnoSmS2Uv5RMVwQAySLhkBsOnJ';
const DAI_ADDRESS = '0x6B175474E89094C44Da98b954EedeAC495271d0F';
const WETH_ADDRESS = '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2';
@korrio
korrio / index.js
Created July 8, 2024 02:52
Arbitrage between CEX and DEX
const ccxt = require('ccxt');
const ethers = require('ethers');
const Web3 = require('web3');
// Configuration
const config = {
bybit: {
apiKey: 'YOUR_BYBIT_API_KEY',
secret: 'YOUR_BYBIT_SECRET',
},
@korrio
korrio / ROOT.xml
Created May 22, 2024 10:51
tomcat9 issue
<?xml version="1.0" encoding="UTF-8"?>
<Context>
<!-- database configurations -->
<Parameter name="JDBC.driver" value="org.postgresql.Driver"/>
<Parameter name="JDBC.url" value="jdbc:postgresql://localhost:5432/hmdm"/>
<Parameter name="JDBC.username" value="postgres"/>
<Parameter name="JDBC.password" value="new_password"/>
<!-- This directory is used to as a base directory to store app data -->
<Parameter name="base.directory" value="/var/lib/tomcat9/work"/>
@korrio
korrio / tokenPriceApi.js
Created May 21, 2024 04:43 — forked from Linch1/tokenPriceApi.js
Retrive the price of any bsc token from it's address without using external service like poocoin/dextools
let pancakeSwapAbi = [
{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"name":"getAmountsOut","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"},
];
let tokenAbi = [
{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},
];
const Web3 = require('web3');
/*
Required Node.js