Skip to content

Instantly share code, notes, and snippets.

View tubackkhoa's full-sized avatar
💭
buidl

Pham Thanh Tu tubackkhoa

💭
buidl
View GitHub Profile
import "dotenv/config";
import { VersionedTransaction, Keypair } from "@solana/web3.js";
import nacl from "tweetnacl";
import { z } from "zod";
import bs58 from "bs58";
export const TriggerPriceOrderSchema = z.object({
id: z.string(),
user: z.string(),
inToken: z.string(),
"""
Paradex Volume Generator Bot - Fully Configurable via .env
Target: Customizable volume in configurable timeframe
Strategy: Ultra-tight spread with all parameters in .env file
Features: Zero-fee trading, High-frequency execution, Real-time monitoring
"""
import asyncio
import os
import signal
import threading
@tubackkhoa
tubackkhoa / Cargo.toml
Last active November 17, 2025 07:31
Volume farming
[package]
name = "lighter_as_mm"
version = "0.1.0"
edition = "2021"
[dependencies]
tokio = { version = "1.0", features = ["full"] }
reqwest = { version = "0.11", features = ["json"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
"""
TrendFollowingStrategy Trading Strategy
A sophisticated momentum-based trading strategy optimized for 5-minute timeframes.
Features dynamic position sizing, market correlation analysis, and advanced risk management.
NOTE: This strategy is under development, and some functions may be disabled or incomplete. Parameters like ROI
targets and advanced stoploss logic are subject to future optimization. Test thoroughly before using it in live trading.
Telegram Profile: https://t.me/bustillo
@tubackkhoa
tubackkhoa / market-maker.md
Created October 30, 2025 08:54
Trading Notes

Chương 1: Quản Lý Tiền Bạc Để Thành Công Trong Giao Dịch Ngày (Managing Money to Succeed as a Day Trader)

  • Kiểm soát rủi ro là nền tảng: Kết quả giao dịch không kiểm soát được, nhưng mức lỗ thì có; sống sót qua kỷ luật để học hỏi.
  • Vị thế quá lớn gây hại: Gây mất lớn, cảm xúc mạnh (tham lam/sợ hãi); cắt lợi nhuận sớm, giữ lỗ lâu; rủi ro 50-100% vốn một lệnh = cờ bạc, không phải giao dịch.
  • Chỉ giao dịch tiền có thể mất: Không phụ thuộc vào thắng để sống; mất hết = không sao; giảm gắn bó cảm xúc, tăng khách quan.
  • Nhỏ hơn = lớn hơn: Vị thế nhỏ giúp cắt lỗ nhanh, phục hồi dễ; vị thế lớn cần lợi nhuận cao hơn để bù phí, thời gian.
  • Điều chỉnh vị thế cân bằng: Dựa giá cổ phiếu (ví dụ: 1 điểm ở $10 = 10%, ở $100 = 1%); vị thế tỷ lệ nghịch với giá để rủi ro % bằng nhau.
  • Quy tắc 2%: Mất tối đa 2% vốn/lệnh (bao gồm phí); lỗ 6-8% tháng = dừng, đánh giá; dùng để bảo hiểm, tăng cơ hội chơi lâu dài.
  • Biên (margin): Tăng đòn bẩy nhưng rủi ro cao (ví dụ: LTCM phá sản 1997 do 20:
/**
* DuckDB HTTPServer wrapper (NDJSON parser)
* Supports Basic Auth + API Key
*
* Example server:
* curl -u user:pass -H "X-API-Key: secretkey" \
* "http://localhost:9999?query=select * from transactions limit 2"
*/
export type RowData = Record<string, any>;
// save as extract-urls.ts
// Usage: node extract-urls.ts <extension_id> <version>
import fs from 'fs';
import path from 'path';
import AdmZip from 'adm-zip';
// Known genesis hashes
const clusters = {
mainnet: '5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp',
testnet: '4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z',
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
interface IUniswapV2Factory {
function createPair(
address tokenA,
address tokenB
import http from 'http';
import httpProxy from 'http-proxy';
const items = Object.values({
'jup.ag': 'https://jupiter-frontend.rpcpool.com',
'pump.fun':
'https://pump-fe.helius-rpc.com/?api-key=1b8db865-a5a1-4535-9aec-01061440523b',
'raydium.io': 'https://raydium-raydium-5ad5.mainnet.rpcpool.com',
});
let currentInd = 0;