Skip to content

Instantly share code, notes, and snippets.

@mteam88
mteam88 / blocks-analysis.ipynb
Last active April 9, 2024 16:08
Cryo Ethereum Blocks Analysis Notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@junha1
junha1 / rust_study.md
Last active December 20, 2025 11:11
Rust 공부하는법

Rust 공부하는법

2022년 9월 5일 양준하

왜 Rust를 배워야 하는가?

  • 2021년 4분기 기준 Github 점유율 15위 언어
  • C++ 암살자 포지션 (개인적으로 10년안에 C++ 넘어설 듯)
  • 블록체인, 임베디드, 시스템프로그래밍, 서버, 분산처리, WASM 등에서 활발히 사용되는 고성능 언어
  • 모던하고 깔끔한 언어 디자인, 훌륭한 개발툴과 패키지 매니저
  • 수준높은 사용자들과 커뮤니티, 독보적인 UX를 기반으로 한 철옹성 같은 팬덤들
@igotit-anything
igotit-anything / bybit_websocket_execution_example.py
Last active July 5, 2022 14:10
bybit_websocket_execution_example.py
def processing_execution(data_dic_one):
leaves_qty = dic_json.get('leaves_qty')
if leaves_qty > 0 :
return
## 여기 이하 전량체결 이벤트일 때 수행됨.
## 봇에서 주문 낸 지정가 주문(지정가 의도했으나 시장가 체결된것 포함) 이 전량체결 시점임.
_symbol = dic_json.get('symbol')
@webmodularity
webmodularity / sweepDust.js
Created April 29, 2022 01:27
DustSweeper V2 taker sweepDust implementation
const { ethers } = require("ethers");
const axios = require('axios').default;
require('dotenv').config();
/////////////////////////
// EDIT THESE VALUES //
/////////////////////////
const makers = [
"0xFA62E6eFEc39b4Dc5E3f37D676F18B560f7dD458"
];
@igotit-anything
igotit-anything / bybit USDT perpetual real time execution data.py
Last active July 5, 2022 14:10
bybit USDT perpetual real time execution data.py
################ bybit WebSocket example. USDT perpetual ETHUSDT
import asyncio
import websockets
import json
@hrkrshnn
hrkrshnn / generic.org
Last active February 15, 2026 20:33
Some generic writeup about common gas optimizations, etc.

Upgrade to at least 0.8.4

Using newer compiler versions and the optimizer gives gas optimizations and additional safety checks for free!

The advantages of versions 0.8.* over <0.8.0 are:

  • Safemath by default from 0.8.0 (can be more gas efficient than some library based safemath).
  • Low level inliner from 0.8.2, leads to cheaper runtime gas. Especially relevant when the contract has small functions. For
@zemse
zemse / README.md
Last active December 14, 2023 10:17
Calldata Optimisation

Calldata Optimisation

Reducing gas costs for L2 users by optimising calldata.

Motivation

Transaction fees on L2s like Optimism and Arbitrum involve paying the calldata gas costs for the batch submission on L1. And it accounts for good amount of gas fees.

For example, breakup of $4.19 Uniswap Trade on Arbitrum (explorer):

@pgrandinetti
pgrandinetti / automatic_websocket_reconnect.py
Last active January 9, 2025 20:48
Automatic reconnect from websockets
import socket
import asyncio
import websockets
import time
import logging
import argparse
import threading
import sys
@ewancook
ewancook / bellman_ford.go
Last active March 9, 2024 08:14
Arbitrage with Bellman Ford
package bellmanford
import (
"math"
)
// Graph represents a graph consisting of edges and vertices
type Graph struct {
edges []*Edge
vertices []uint
@halfelf
halfelf / how_to_build_a_fast_limit_order_book.md
Created February 11, 2019 02:18
How to Build a Fast Limit Order Book

https://web.archive.org/web/20110219163448/http://howtohft.wordpress.com/2011/02/15/how-to-build-a-fast-limit-order-book/

The response to my first few posts has been much larger than I’d imagined and I’d like to thank everyone for the encouragement.

If you’re interested in building a trading system I recommend first reading my previous post on general ideas to keep in mind.

My first really technical post will be on how to build a limit order book, probably the single most important component of a trading system. Because the data structure chosen to represent the limit order book will be the primary source of market information for trading models, it is important to make it both absolutely correct and extremely fast.

To give some idea of the data volumes, the Nasdaq TotalView ITCH feed, which is every event in every instrument traded on the Nasdaq, can have data rates of 20+ gigabytes/day with spikes of 3 megabytes/second or more. The individual messages average about 20 bytes each so this means handling