2025
  • Trust Me
    fullstackweb3

    Trust Me

    I document the development process for this project in devlogs. Check out blog posts titled “TrustMe - xx”. Like this one, where I go over the genesis of the idea, and what I hope to accomplish with it.

    I pick up new projects to practice something new, and hopefully deliver something interesting or valuable. This is my first original, fullstack, web3 project. It has the potential to bring immense value, but to delivery on its promise it would likely require more marketing effort and resources than I’m willing to scrounge up at the moment. For this reason, I’m mostly focused on the tech aspect, my learnings, and what value people derive from it a small scale. And maybe, someday, this takes off and people love it, who knows?

    The project is structured in a couple of repos:

    1. trust-me-contracts - includes the smart contracts that underpin the believability system
    2. trust-me-dapp - a dapp for interacting with the main use cases supported by the smart contracts: a. checking user stats b. viewing leaderboards for specific topics c. managing feedback: submitting, reviewing, rejecting

    A more granular analysis of the project is (or will be) in the devlogs, check them out if you’re interested! I’ll also include references to the contracts and a link to the app when everything is deployed.

    Key points

    • web3
    • fullstack
    • Solidity / Foundry
  • Ethernaut CTFs
    web3

    Ethernaut CTFs

    CTFs (capture-the-flag) are security-focused exercises that give aspiring security researchers and whitehats hands-on experience on a variety of vulnerability types. They usually work by providing a vulnerable smart contract and inviting the student to act as the malicious user, with a specific goal in mind: becoming the contract admin, draining/locking funds, manipulating storage in some nefarious way, etc.

    Not only is this an extremely valuable exercise, it’s also so much fun!

    I started out with the OpenZeppelin’s Ethernaut CTFs. I documented my thoughts and solutions here. In the future, I want do other CTFs like Capture the Ether and Damn Vulnerable Defi.

    Key points

    • web3 theory fundamentals
    • web3 security
  • Cyfrin coursework
    web3

    Cyfrin coursework

    As part of my participation in Cyfrin’s fantastic Blockchain Basics, Solidity Smart Contract Development, Foundry Fundamentals, and Advanced Foundry courses, I worked on a few projects:

    1. Simple Storage
    2. Fund Me
    3. Smart Contract Lottery
    4. ERC20
    5. NFT
    6. Foundry DeFi Stablecoin
    7. Foundry Cross Chain Rebase Token
    8. Foundry DAO Governance

    I highly recommend these courses if you’re starting out or need a refresher on essential web3 knowledge!

    Key points

    • web3 theory fundamentals
    • Solidity based with Foundry framework
    • mostly focused on backend and security
2023
  • News player
    fintechnltk

    News player

    While I was working on the ‘GapUp short’ strategy, I noticed that often the strong stock movements outside market hours were motivated by news articles. Many traders subscribe to services like Benzinga to react quickly to these events, and hopefully make some money by getting in ahead of the crowd.

    I wondered if there was an edge in this process, and if I could create an automated strategy off of it. Here’s how I went about it:

    1. Analyse stocks that gapped up outside market hours, backtracking ~6 months. What kind of news were linked to the strongest reactions? How to accept only those as trading signals?
    2. Analyse several news sources against the news that may have caused these price swings. I was looking for three essential points: fast to report, doesn’t miss a lot of relevant events, provides automated alerts of some kind
    3. Subscribe to news alerts of my selected source, and redirect them as POST requests
    4. Create web app on an AWS service to listen to and process these requests
    5. Fine tune approach to trading these signals (stop loss, profit target)
    6. Link with a brokerage account and implement order placement and position management

    Key points

    • nltk (tokenizing, n-grams)
    • ib_insync for assynchronous interfacing with Interactive Brokers account
    • lack of liquidity outside market hours was a strong limiting factor for this strategy



2021
  • Reddit tracker
    data analysis

    Reddit tracker

    Following the $GME hysteria which started in early 2021, and the ensuing public discussion on the impact of the activity in certain reddit forums in the stock market, I was curious to research the topic myself.

    I built a small solution to read data from specific subreddits, and analyse various metrics related to public sentiment and activity.

    The project interfaces with the Google Sheets API to produce daily reports on the stocks that stand out. For example, I was curious to look at tickers with:

    • High activity (many posts and/or comments)
    • Polarized sentiment
    • High activity surge/decline from previous day and/or recent days
    • High sentiment switch from previous day and/or recent days

    Disclaimer: I wrote this purely for research purposes, and didn’t share any of this data (despite it being public), or use it to initiate any positions.

    Key points

    • Written in Python
    • praw for reddit crawling
    • gspread for writing to excel sheets
    • spacy/sklearn for custom sentiment analyser


2020
  • Orderbook trader
    data analysisfintechML

    Orderbook trader

    A deep learning based strategy, still in early stages of development. The goal is train a model to detect good entries/exits for short-term positions (long or short) based on fluctuations in the orderbook for a ticker. It may also use ohlc data and orderbook data from correlated symbols. These are the main project steps:

    1. gather orderbook data for a set of correlated symbols (I chose cryptocurrency symbols to start, since they’re 24h/day liquid markets, and it’s relatively easy to read orderbook data via the BitMex API)
    2. normalize and segment data
    3. train and evaluate LSTM models
    4. integrate as a signal generator for the bitmex trader to manage holdings for this strategy
    OrderBook for BTC/USD
    example OrderBook for BTC/USD

    Key points

    • data reader deployed on AWS instance
    • data read from BitMex API
    • tensorflow/keras (with CUDA) for training the LSTM models


  • Bitmex trader
    fintech

    Bitmex trader

    An automated portfolio manager integrated with the Bitmex crypto exchange for trade execution and with TradingView for signal generation.

    Signals are received assynchronously via a web app, and processed according to a json config file for the portfolio. The portfolio manager:

    • decides whether to act on the signal received based on current exposure
    • determines position size and order types to use
    • sets stop loss and profit target orders, if applicable to the strategy

    Bitmex Trader Sequence Diagram

    Key points

    • Written in Python
    • Quart for REST API
    • rpyc for communication between services

    For more information on the trading signal generation, see the TradingView strats project


  • TradingView strats
    fintechPinescript

    TradingView strats

    TradingView is a fantastic resource for traders. It’s one of my default tools for my market research.

    I implemented a set of utils for my own research:

    • an indicator based on the TTM squeeze
    • a VWAP trading strategy
    • a strategy based on catching bull flags
    • a strategy based on the MACD and some EMAs
    • a strategy based on the TTM squeeze and the MACD

    I backtested these strategies against various tickers (I was primarily interested in cryptocurrencies), with some good results. The TTM/MACD strat, for example, yielded a 63.45% profit after commissions with a 10.46% max drawdown when applied to a XBTUSD 30min chart over a 10-month period. The Sharpe ratio was slightly low, at 0.602.

    Simply holding XBTUSD long for the same period whould have yielded returns of 78.25%, with a 62.84% max drawdown. In comparison, the TTM/MACD strat had:

    • 1.23x smaller returns
    • 6x smaller drawdown
    • 2.19x larger holding period return (TTM/MACD strat only held a position ~37% of the time)

    Note: this strat works best for consolidation markets, without a clear trend. Since the Bitcoin breakout in late October 2020, a simple buy-and-hold approach massively outperformed this strategy.

    Key points

    • Implemented in Pine Script, TradingView’s own scripting language
    • Fully parameterized
    • Automatic alerts are issued via a webhook URL, and can be consumed by a web app interfacing with a broker/exchange



2019
  • Pump n' Dump
    MLsentiment analysis

    Pump n’ Dump

    My most ambitious project yet. Prompted by an article on the potential correlation between reddit activity and stock price movements, I wondered if a similar relationship could exist in the fintwit community. These were the main steps:

    1. gather stock daily price, volume, and twitter data for 2016-2020
    2. train a scikit model for stock sentiment analysis on a rather small but representative set of tweets reflecting various opinions on the outlook of certain stocks.
    3. set model targets based on stock performance after a short period of time.
    4. create various features based on olhc data and twitter activity, and select a subset of those with low correlation and high relevance, to reduce system complexity.
    5. preprocess the data into normalized input sequences, avoiding bias
    6. use smote oversampling to get a more even distribution of targets.
    7. test several variations of the model against a separate dataset, and rank them by their F-score, based on the confusion matrix.
    8. integrate with brokerage account for automatic order placement
    9. automate entire workflow to run continuously

    Key points

    • Text sentiment analysis for stock tweets
    • twint for tweet scraping
    • ib_insync for assynchronous interfacing with Interactive Brokers account
    • preliminary analysis: logistic regression, pca, factor analysis
    • tensorflow/keras (with CUDA) for training the LSTM model
    • efficiency is an important consideration for this project, as reading and processing price, volume, and twitter data for thousands of stocks before feeding the data into the model for projections could take long enough that one wouldn’t be able to act on the output.


  • GapUp short
    data analysisfintech

    GapUp short

    A few years ago, I was introduced to low-cap stocks. Retail traders in this space seem to design strategies based on superficial statistical analysis and little to no backtesting.

    I picked a basic strategy, the ‘Gap Fail’ - screening low-cap stocks that gap significantly in pre-market, and short them at or near market open - and set out to analyse it.

    I used QuantConnect to quickly code this strategy. Early results were encouraging, and were iteratively improved upon by fine tuning stock screening parameters such as sector, premarket volume, and min/max stock price, entry point, max loss, profit target.

    I set out to automate live execution of the strategy after fine-tuning it. This proved difficult, due to the nature of the pattern: since I was shorting low-cap stocks, it was often necessary to preemptively locate the shares to short. I couldn’t find a broker with an API that allowed this process to be automated.

    Eventually, I opened an account with TradeStation, and worked through their scripting language (EasyLanguage) to implement the strategy. Unfortunately, trading strategies had to be applied directly on a single stock chart, so stock selection had to be done manually.

    Key points

    • Great backtesting results in a vacuum
    • The need to locate shares to short hurt the strategy, by:
      • eliminating many promising plays: locates often failed for good shorts
      • increasing costs: share locates are often costly
      • requiring manual intervention
    • In the end, I abandoned the strategy, as I wasn’t interested in manual trading



2017
  • Platformer
    C#UnityVideo Game Dev

    Platformer

    Once in a while, I like to spend some time playing with Unity. I grew up playing the likes of Sonic, Super Mario, and Rayman 2, so it’s no surprise that platformers are one of my favourite video game genres.

    Recently, games like Super Meat Boy, Spelunky, and Celeste have reinvigorated the genre.

    This project is strictly recreational, so progress is slow and sparse. I’ve programmed the physics system, which feels nice, apart from a couple of glitches. Whenever I pick up the project again, I’ll focus on the procedural level generation. My ambition would be to create a new way to experience platformers, by combining my favourite elements from different games:

    • Tight physics system (Super Meat Boy)
    • Unique auto-generated levels and challenges (Spelunky)
    • Unique ways of experiencing the game each run (The Binding of Isaac)

    Platformer game screenshot

    Key points

    • Written in C#
    • Powered by Unity
    • Fully scripted physics
    • Procedurally generated levels