{"slug":"spy-etf-price-in-krw","qid":"budget_grid","label":"budget_grid","post_title":"spy-etf-price-in-krw","post_url":"/blog/spy-etf-price-in-krw#q-budget_grid","columns":["budget_man_won","whole_shares","fractional_shares","unused_won_pct"],"rows":[{"budget_man_won":"50","whole_shares":0,"fractional_shares":0.47,"unused_won_pct":100},{"budget_man_won":"100","whole_shares":0,"fractional_shares":0.93,"unused_won_pct":100},{"budget_man_won":"200","whole_shares":1,"fractional_shares":1.87,"unused_won_pct":46.5},{"budget_man_won":"300","whole_shares":2,"fractional_shares":2.8,"unused_won_pct":28.6},{"budget_man_won":"500","whole_shares":4,"fractional_shares":4.67,"unused_won_pct":14.4}],"shape":"ranking","sql":"SELECT\n    toString(toUInt32(budget))                                                            AS budget_man_won,\n    toUInt32(floor(budget_won / price_krw))                                               AS whole_shares,\n    round(budget_won / price_krw, 2)                                                      AS fractional_shares,\n    round(100 * (budget_won - floor(budget_won / price_krw) * price_krw) / budget_won, 1) AS unused_won_pct\nFROM\n(\n    SELECT\n        arrayJoin([50., 100., 200., 300., 500.]) AS budget,\n        budget * 10000                           AS budget_won,\n        (\n            SELECT round(toFloat64(argMax(close, date)), 2)\n            FROM global_markets.stocks_daily_aggs\n            WHERE ticker = 'SPY'\n              AND date >= today() - 45\n        ) * 1400.                                AS price_krw\n)\nORDER BY fractional_shares","computed_at":"2026-09-30T15:41:12.584381+00:00","elapsed":0.036125749}