{"id":15490695,"url":"https://github.com/sammarks/stockfighter-solution-php","last_synced_at":"2025-08-17T13:17:43.340Z","repository":{"id":147095188,"uuid":"48337603","full_name":"sammarks/stockfighter-solution-php","owner":"sammarks","description":"Stockfighter solutions, written in PHP. SPOILER ALERT.","archived":false,"fork":false,"pushed_at":"2016-01-24T00:03:38.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-19T09:19:55.576Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sammarks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-20T21:21:04.000Z","updated_at":"2016-01-24T00:03:39.000Z","dependencies_parsed_at":"2023-04-19T13:16:57.781Z","dependency_job_id":null,"html_url":"https://github.com/sammarks/stockfighter-solution-php","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sammarks/stockfighter-solution-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammarks%2Fstockfighter-solution-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammarks%2Fstockfighter-solution-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammarks%2Fstockfighter-solution-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammarks%2Fstockfighter-solution-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sammarks","download_url":"https://codeload.github.com/sammarks/stockfighter-solution-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammarks%2Fstockfighter-solution-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270852723,"owners_count":24656948,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T07:23:23.972Z","updated_at":"2025-08-17T13:17:43.277Z","avatar_url":"https://github.com/sammarks.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# StockFighter PHP Solutions\n\n**SPOILER ALERT** These are my **solutions** for StockFighter. Feel free to take a look at them and offer\ncritique/suggestions/advice/whatever, but just be aware that **if you do not want to see spoilers for\nStockFighter, do not look at this code.**\n\nI wrote a nifty PHP library that I use in this code, and that can be found (with no spoilers!) \n[here.](https://github.com/sammarks/stockfighter-php)\n\n## Installation\n\nTo install my solution set (and use them toward your own StockFighter account), you'll need to follow\nthese steps:\n\n```\ncomposer install # Install composer dependencies.\ncp config/api.json config/api.local.json # Create your configuration file.\n```\n\nThen, add your API key to `config/api.local.json`. Once you've done that, you should be ready to\nlaunch the application:\n\n```\nchmod a+x ./stockfighter\n./stockfighter\n```\n\nThe help screen will show you how to use each level command. Each level has arguments for the items that\nchange (account number, stock, venue, etc).\n\n## Level Comments\n\nMy solutions for each level certainly aren't the best (no one is perfect, of course!), so here are my\ncomments on my implementation for each level:\n\n### Chock a Block\n\nOn this level, I tried to first brute-force it and order 1000 shares at a time, spreading them apart\nby 10 seconds or something like that. Of course, that didn't work because I had no idea what the price\nwas when I was making the purchase.\n\nI ended up adopting an approach that monitored the WebSocket connection for the current quote for the\nstock in question, and then bought once it went below a specific threshold (the last purchase price\nof the stock at the beginning of execution plus $1.00 padding). That seemed to work for my case,\nthough it failed the first time around (I was initially using the ask price instead of the last price,\nso that might have something to do with it). If it doesn't work for you the first time, try, try again!\n\nI'll also clean up the code for this level once I use it in some other levels :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsammarks%2Fstockfighter-solution-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsammarks%2Fstockfighter-solution-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsammarks%2Fstockfighter-solution-php/lists"}