{"owner":"pcmarts","slug":"crypto-balanced-portolio-builder","channel":"pcmarts/crypto-balanced-portolio-builder","version":"1.0.1","artifact_sha256":"edddc8869c4f25ff5cf62438d92142513a2f23635421ee23219835e2afb7f04a","published_at":"2026-09-16T12:44:10.208Z","price_micro":"20000","update_price_micro":"5000","resource_endpoint":"https://x402git.com/api/r/pcmarts/crypto-balanced-portolio-builder","version_url":"https://x402git.com/api/v/pcmarts/crypto-balanced-portolio-builder","computed":{"artifact_class":"Pack","component_inventory":[{"kind":"docs","count":4},{"kind":"assets","count":3},{"kind":"other","count":3}],"file_count":10,"dir_depth":1,"bytes_text":62809,"bytes_binary":2524310,"languages":{"HTML":51771},"tree":[{"path":".gitignore","size":72,"binary":false},{"path":"LICENSE","size":1068,"binary":false},{"path":"README.md","size":7239,"binary":false},{"path":"crypto_portfolio_capped_v4.html","size":51771,"binary":false},{"path":"docs/coinstats-export-mobile.jpg","size":572454,"binary":true},{"path":"docs/coinstats-export-web.png","size":1104694,"binary":true},{"path":"docs/release-v1.0.0.md","size":1002,"binary":false},{"path":"docs/release-v1.0.1.md","size":1318,"binary":false},{"path":"docs/sample-coinstats-balances.csv","size":339,"binary":false},{"path":"docs/screenshot.png","size":847162,"binary":true}],"readme_html":"<h2>Crypto Portfolio by Market Cap</h2>\n<p><strong>Build a market-cap-weighted crypto portfolio with per-asset caps, then get an exact buy/sell list to rebalance. Built with CoinStats users in mind, but any holdings CSV works.</strong></p>\n<p><img src=\"/api/label/pcmarts/crypto-balanced-portolio-builder/asset/docs/screenshot.png\" alt=\"Crypto Portfolio by Market Cap: inputs on the left, target allocation table and donut chart top right, and the buy/sell rebalancing table generated from a holdings export below\" loading=\"lazy\" decoding=\"async\" /></p>\n<p><img src=\"https://img.shields.io/badge/License-MIT-2dd4bf.svg\" alt=\"License: MIT\" loading=\"lazy\" decoding=\"async\" /> <img src=\"https://img.shields.io/badge/version-1.0.1-14b8a6.svg\" alt=\"Version\" loading=\"lazy\" decoding=\"async\" /> <img src=\"https://img.shields.io/badge/single%20file-HTML-9fb0c3.svg\" alt=\"Single file\" loading=\"lazy\" decoding=\"async\" /> <img src=\"https://img.shields.io/badge/dependencies-none-9fb0c3.svg\" alt=\"No dependencies\" loading=\"lazy\" decoding=\"async\" /></p>\n<hr />\n<h3>Who this is for</h3>\n<p><strong>CoinStats users who want to rebalance quickly.</strong> CoinStats tells you what you own, but not what to buy or sell to reach a target allocation. Export your Balances CSV, set a target, upload the file, and you get a per-coin BUY / SELL / HOLD list with exact units and dollar amounts. The export steps are documented below with screenshots.</p>\n<p><strong>Anyone who wants a market-cap-weighted portfolio.</strong> You don&#39;t need CoinStats, or any holdings file at all. Set a portfolio size, a number of coins and a maximum weight per coin, and the tool builds the allocation from live market data. If you track holdings somewhere else, any CSV with a Symbol column and an Amount column gives you the same rebalancing list.</p>\n<p>Either way, the whole thing is one HTML file that runs in your browser. No accounts, no servers, no API keys, no install. Your holdings never leave your machine.</p>\n<h3>Quick start</h3>\n<ol><li>Download <code>crypto_portfolio_capped_v4.html</code>.</li><li>Open it in any modern browser (double-click it).</li><li>Set your inputs and click <strong>Build Portfolio</strong>. This fetches live market caps from CoinGecko and builds your target allocation.</li><li>Optional: under <strong>Rebalance from CoinStats</strong>, upload your holdings CSV and click <strong>Compare Holdings</strong>.</li><li>Read the <strong>Portfolio Adjustments Needed</strong> table, or click <strong>Download Adjustments CSV</strong>.</li></ol>\n<p>Want to try step 4 before exporting anything? Upload docs/sample-coinstats-balances.csv.</p>\n<hr />\n<h3>Exporting your balances from CoinStats</h3>\n<p>If you use CoinStats, this is the file to upload in step 4. CoinStats currently marks CSV export as a Premium feature.</p>\n<h4>Web (coinstats.app)</h4>\n<ol><li>Go to the <strong>Portfolio Tracker</strong> page and select the portfolio you want to rebalance.</li><li>Open the <strong>Assets</strong> tab.</li><li>Click the <strong>Export</strong> button (the download icon at the top right of the assets table).</li><li>Choose <strong>Balances</strong>. Save the CSV file.</li></ol>\n<p><img src=\"/api/label/pcmarts/crypto-balanced-portolio-builder/asset/docs/coinstats-export-web.png\" alt=\"CoinStats web app: Assets tab selected in the left sidebar, Export button highlighted at the top right of the assets table, with a dropdown showing Transaction History and Balances\" loading=\"lazy\" decoding=\"async\" /></p>\n<h4>Mobile app (iOS / Android)</h4>\n<ol><li>Open the <strong>Portfolio</strong> tab and pick the portfolio you want to rebalance.</li><li>Tap the <strong>three-dot</strong> button below the chart.</li><li>Tap <strong>Portfolio Settings</strong>.</li><li>Scroll down and tap <strong>Export Data</strong>.</li><li>Choose <strong>Balances</strong> and save or share the CSV file, then get it onto the computer where you&#39;ll open the tool.</li></ol>\n<p><img src=\"/api/label/pcmarts/crypto-balanced-portolio-builder/asset/docs/coinstats-export-mobile.jpg\" alt=\"CoinStats mobile app: the three-dot menu below the portfolio chart opens a sheet with Portfolio Settings; the Portfolio Settings screen has Export Data at the bottom\" loading=\"lazy\" decoding=\"async\" /></p>\n<p>Steps and screenshots are from the CoinStats help article <a href=\"https://help.coinstats.app/en/articles/4366199-how-to-export-transactions-to-csv\" rel=\"nofollow noopener ugc\" target=\"_blank\">How to Export Transactions to CSV</a>. If the CoinStats interface changes, that article is the source of truth.</p>\n<p>Export <strong>Balances</strong> rather than <strong>Transaction History</strong>. The transaction export lists individual trades, not what you currently hold.</p>\n<h4>Using a CSV from somewhere else</h4>\n<p>The tool only needs two columns: <strong>Symbol</strong> and <strong>Amount</strong> (column names are matched case-insensitively, and an <strong>Amount</strong> or <strong>Total</strong> column both work). Extra columns are ignored. Multiple rows for the same symbol are summed, so a coin held on several exchanges or wallets is treated as one position. Exports from most other trackers and exchanges will work as-is or after renaming a header.</p>\n<hr />\n<h3>What the tool does</h3>\n<p><strong>Builds a target allocation</strong></p>\n<ul><li>Pulls the top N coins by market cap from CoinGecko (live, paginated, deduplicated by symbol).</li><li>Weights each coin by market cap, clips anything over your per-coin cap, and redistributes the excess proportionally until every dollar is allocated.</li><li>Lets you pin specific coins to exact percentages with custom targets. Whatever remains is spread across the market-cap-weighted coins.</li><li>Excludes stablecoins by default, plus a default exclusion list you can edit.</li></ul>\n<p><strong>Compares it against your current holdings</strong></p>\n<ul><li>Every coin you hold or should hold gets an action: BUY, SELL or HOLD.</li><li>Shows current units, target units, the delta, and the same in USD.</li><li>Coins you hold that are not in the target get a SELL row so nothing is silently ignored.</li><li>Summary chips: current value, target value, number of buys and sells, net adjustment.</li></ul>\n<p><strong>Exports</strong></p>\n<ul><li>Target allocation as CSV or JSON, respecting the current sort order.</li><li>Adjustments list as a separate CSV once you&#39;ve compared holdings.</li></ul>\n<p><strong>Interface</strong></p>\n<ul><li>Sortable results table with inline weight bars showing the cap and any clipped portion.</li><li>Donut chart with hover highlighting synced to the legend.</li><li>Dark, responsive, keyboard accessible. Coin names link to CoinGecko.</li></ul>\n<hr />\n<h3>How the allocation maths works</h3>\n<ol><li>Fetch the top N coins by market cap from CoinGecko.</li><li>Compute baseline weights as <code>coin market cap / total market cap</code>.</li><li>Apply the per-coin cap and redistribute clipped weight proportionally until fully allocated.</li><li>Subtract any custom targets first; the rest of the portfolio is allocated by market cap.</li><li>Convert weights to target USD and target units using your portfolio value.</li><li>If you uploaded holdings, compare target units against what you hold to produce the buy/sell list.</li></ol>\n<hr />\n<h3>Development</h3>\n<ul><li><strong>Stack:</strong> HTML + CSS + vanilla JS, no dependencies</li><li><strong>Single file:</strong> edit crypto_portfolio_capped_v4.html directly</li><li><strong>Testing:</strong> open the file in a browser; there is no build</li></ul>\n<hr />\n<h3>Notes &amp; limitations</h3>\n<ul><li>Uses CoinGecko&#39;s free public API for market data. Rate limits (HTTP 429) are handled with retry/backoff, but heavy refreshing will still get throttled.</li><li>Prices come from CoinGecko, not from your holdings export, so values can differ slightly from what your tracker shows.</li><li>All calculations are client-side. Verify the numbers before you trade on them.</li><li><strong>Not financial advice.</strong></li></ul>\n<h3>Privacy</h3>\n<p>100% client-side. The only network request the page makes is to CoinGecko&#39;s public API for market data. Your portfolio size, holdings CSV, and allocations never leave your machine.</p>\n<hr />\n<h3>Attribution</h3>\n<ul><li>Market data from the <a href=\"https://coingecko.com/\" rel=\"nofollow noopener ugc\" target=\"_blank\">CoinGecko Public API</a></li><li>CoinStats export screenshots from the <a href=\"https://help.coinstats.app/\" rel=\"nofollow noopener ugc\" target=\"_blank\">CoinStats Help Center</a>. CoinStats is a trademark of its owner; this project is not affiliated with or endorsed by CoinStats.</li></ul>\n<h3>License</h3>\n<p>MIT — free to use, modify, and distribute, including commercially.</p>","readme_assets":{"docs/screenshot.png":"6ad670bc-f6cd-4f11-b420-32027250227b/7741a4a3-b26f-4324-989b-5f21648a5c88/docs/screenshot.png","docs/coinstats-export-web.png":"6ad670bc-f6cd-4f11-b420-32027250227b/7741a4a3-b26f-4324-989b-5f21648a5c88/docs/coinstats-export-web.png","docs/coinstats-export-mobile.jpg":"6ad670bc-f6cd-4f11-b420-32027250227b/7741a4a3-b26f-4324-989b-5f21648a5c88/docs/coinstats-export-mobile.jpg"},"dependencies":[],"licence":{"spdx":"MIT","verdict":"pass"},"scan":{"verdict":"pass","scanner_version":"2026.09.1","at":"2026-09-16T12:44:17.134Z","checks":[{"id":"secrets","tool":"x402git/secrets","tool_version":"2026.09.1","status":"pass","at":"2026-09-16T12:44:17.134Z","findings":0},{"id":"limits","tool":"x402git/limits","tool_version":"2026.09.1","status":"pass","at":"2026-09-16T12:44:17.134Z","findings":0},{"id":"known_vulns","tool":"osv.dev","tool_version":"2026-09-16","status":"pass","at":"2026-09-16T12:44:17.134Z","findings":0,"packages":0},{"id":"known_malware","tool":"osv.dev/MAL","tool_version":"2026-09-16","status":"pass","at":"2026-09-16T12:44:17.134Z","findings":0,"packages":0},{"id":"dep_behaviour","tool":"socket.dev","tool_version":"2026-09-16","status":"pass","at":"2026-09-16T12:44:17.134Z","findings":0,"packages":0,"reason":"no dependency manifests"},{"id":"capabilities","tool":"x402git/caps","tool_version":"2026.09.1","status":"findings","at":"2026-09-16T12:44:17.134Z","findings":2},{"id":"injection","tool":"x402git/inject","tool_version":"2026.09.1","status":"pass","at":"2026-09-16T12:44:17.134Z","findings":0}],"findings":[{"kind":"capability","check":"capabilities","tier":"disclosed","rule_id":"host","severity":"LOW","description":"Talks to api.coingecko.com","path":"crypto_portfolio_capped_v4.html"},{"kind":"capability","check":"capabilities","tier":"disclosed","rule_id":"host","severity":"LOW","description":"Talks to www.coingecko.com","path":"crypto_portfolio_capped_v4.html"}],"capabilities":{"tools":[],"runs":[],"hosts":[{"host":"api.coingecko.com","local":false,"from":"code","paths":["crypto_portfolio_capped_v4.html"]},{"host":"www.coingecko.com","local":false,"from":"code","paths":["crypto_portfolio_capped_v4.html"]},{"host":"coingecko.com","local":false,"from":"docs","paths":["README.md"]},{"host":"help.coinstats.app","local":false,"from":"docs","paths":["README.md"]},{"host":"img.shields.io","local":false,"from":"docs","paths":["README.md"]}],"env":[],"install_runs":false,"summary":"talks to 2 hosts · links to 3 hosts in its docs · nothing runs at install"},"counts":{"blocking":0,"disclosed":2,"review":0}},"cadence_sentence":"Ships every ~8 days, hits that 100% of the time. Last release today.","originality":{"blob_overlap_ratio":0.1,"blobs_seen_elsewhere":1,"blobs_total":10,"nearest_listing":"examples/humanizer","derivative_of":null},"engineering":{"unique_5gram_ratio":1,"type_token_ratio":0.326,"effective_code_lines":0,"effective_doc_words":1259,"code_files":0,"test_files":0,"padding_suspected":false},"cadence":{"releases":3,"median_days_between_releases":7.5,"on_time_fraction":1,"days_since_last":0,"score":100,"finished":false},"inventory_sentence":"4 docs · 3 assets · 3 other files","extensions":{"md":3,"csv":1,"jpg":1,"png":2,"html":1,"(none)":2},"lines_of_code":0,"warnings":["sbom_unavailable"],"repo_meta":{"repo_id":1035464840,"name":"Crypto-Balanced-Portolio-Builder","full_name":"pcmarts/Crypto-Balanced-Portolio-Builder","description":null,"homepage":null,"topics":[],"language":"HTML","default_branch":"main","size_kb":269,"created_at":"2025-08-10T13:10:05Z","pushed_at":"2026-09-16T12:44:07Z","licence_spdx":"MIT","open_issues":null,"stars":null,"forks":null,"watchers":null,"archived":false,"private":true,"html_url":null},"owner":{"login":"pcmarts","name":"Paul Martin","avatar_url":"https://avatars.githubusercontent.com/u/53514319?v=4","bio":"GTM, Marketing and Growth by day\r\nVibe Coding by night","blog":"https://paulmartin.link/","company":null,"location":null,"twitter_username":"pcmarts","followers":null,"public_repos":4,"created_at":"2019-07-31T09:12:36Z","html_url":"https://github.com/pcmarts"},"computed_at":"2026-09-16T12:44:19.061Z","analyzer_version":"0.1.0"},"self_reported":{"description":"Balances your crypto portfolio using coinstats export","trigger_hint":"you need a coinstats export balancer interface"}}