Skip to content
View YSCohen's full-sized avatar

Block or report YSCohen

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
YSCohen/README.md

Yehuda Cohen

Computer science student at Yeshiva University.
I mostly write Rust and Python, though I usually have to use Java for schoolwork.

Some stuff I've worked on (and, in some cases, still working on)

rust-zmanim - solar-position astronomy in Rust

crates.io · docs.rs

Calculates the position of the sun anywhere on Earth and the Jewish religious times (zmanim) derived from it - about 4,700 lines, ported from KosherJava and extended. Three API layers so callers aren't forced into a stateful object, 174 named accessors over lazily cached solar events, and a compile-time registry that lets a frontend look times up by name at runtime.

rust-zmanim-test-generator - how I know the port is right

The correctness question for any port is "does it agree with the original, everywhere?" - and for floating-point astronomy across a globe of time zones, that isn't answerable by hand.

This is a Java harness that builds KosherJava from source, runs it across nine deliberately hostile locations × seven edge-case dates, and emits ~1,500 Rust test cases into the library's test suite. Each location is a hypothesis about where a solar algorithm breaks: Arctic Nunavut (events that never occur), the Chatham Islands (a 45-minute UTC offset), Samoa and Niue and Fiji (the antimeridian), Tokyo and Los Angeles (DST and none).

It worked. The commit log records at least six numerical defects the generated suite caught and the hand-written tests hadn't: the antimeridian date adjustment, a boundary bug in time normalization, event day-anchoring, elevation applied to the wrong sunrise, and more. As I wrote in the README there, "Yeah, it may be ugly, but it does the job", which I stand by.

rust-zmanim-cli - CLI frontend for rust-zmanim

Published to crates.io, installable with cargo install rust-zmanim-cli or as a prebuilt binary. Four-level configuration (flags > environment > TOML file > defaults) that rejects unknown keys so a typo fails loudly, saved named locations with per-run overrides, table/CSV/JSON output across independent precision and rounding axes, and completions for six shells.

I specified this one in a design dialogue and had Claude Code write the implementation. The design decisions are mine, the typing wasn't.

spread-arb - options arbitrage bot (2022–2023, archived)

Ran live for 15 months and realized roughly $5,000. In far-OTM options the order book occasionally inverts across adjacent strikes, so you can buy a vertical spread for net zero and then sell covered spreads against it. The strategy was my trading partner's - he's written it up here - and I built and operated everything that executed it. Robinhood started passing through the 3¢ regulatory fee in October 2023, the edge disappeared, and we shut it down.

Most of the engineering went into surviving a broker API with terrible fills: partial-fill reconciliation across up to 25 cancel-and-replace cycles, a fallback search for an alternate covering spread, and a retry decorator with quadratic backoff that escalates to replacing the running process with a fresh copy of itself, so an unattended bot doesn't lose the trading day to a poisoned session.

The whole thing ran on a Raspberry Pi 3B+: cron-launched every morning, seven strategy variants going at once, each appending to its own dated log file. The second brokerage account ran as a separate Unix user, so a wedged session or a stale login on one account couldn't take the other one down with it. Failures emailed me. I pointed Apache at the log directory the bot was already writing to and put three buttons on the page - kill, disable, enable - which wrote a single word into a status file that the bot re-read on every pass. Crude, but effective.

Read the commit log before reading the code. The first commit is the actual 2022-23 source. Everything after it is a 2026 readability rewrite by Claude Code - packaging, tests, and structure.

SPEND - Kubernetes-native trading platform

A four-person, six-week university project: Redis as the hot path, PostgreSQL for durable storage, FastAPI and Streamlit on top, all on K3s with Flux, Loki, and Grafana.

What I owned:

  • The Rust worker fleet - four async Tokio binaries syncing Redis and Postgres. The most interesting one consumes booked trades off a Redis Stream consumer group, reclaims messages abandoned by crashed workers with XAUTOCLAIM, bulk-loads through a per-connection staging table with COPY, and upserts idempotently with DISTINCT ON so duplicate redeliveries can't abort the batch.
  • Container builds and CI - multi-arch musl cross-compilation with cargo-chef dependency-layer caching, FROM scratch final images, fork-safe publishing to GHCR.

Smaller things

  • alt-cli - swaps .git directories in and out of a working tree, so one set of files can be tracked by several independent repos. My first Rust project, and not actually useful; orphan branches cover the same ground.
  • sn-mail - dependency-free Python: polls a podcast feed and mails new episodes as attachments.

Pinned Loading

  1. rust-zmanim rust-zmanim Public

    Fast, reliable Rust APIs for solar position and Jewish Zmanim calculations from any date and location.

    Rust 8

  2. rust-zmanim-cli rust-zmanim-cli Public

    A command-line tool for computing Jewish zmanim, powered by rust-zmanim

    Rust 1