Skip to content

Instantly share code, notes, and snippets.

@hajoscher
hajoscher / liquid.md
Last active June 21, 2023 13:52
Liquidity Pool

How to Derive the Constant Product Formula for Liquidity Pools

The basic formula for liquidity pools

$$x y = k$$

is well-known. But how to derive it?

TLDR

@hajoscher
hajoscher / rotate_mp4.py
Created March 21, 2019 20:38
rotate mp4 files by changing rotation metadata
#! /usr/bin/env python3
import sys
import mmap
if len(sys.argv) < 2 :
print("""
change rotation metadata in mp4 files
see: https://superuser.com/a/1307206/1010278
usage: %s file.mp4 0-3