Skip to content

Analysis & roadmap: TON-Bridge V2 (53 issues + Phase 6 affiliate program, closes #1)#2

Merged
xlabtg merged 4 commits into
mainfrom
issue-1-dd9ce602942a
Apr 29, 2026
Merged

Analysis & roadmap: TON-Bridge V2 (53 issues + Phase 6 affiliate program, closes #1)#2
xlabtg merged 4 commits into
mainfrom
issue-1-dd9ce602942a

Conversation

@konard
Copy link
Copy Markdown
Collaborator

@konard konard commented Apr 29, 2026

Summary

Closes #1.

This PR delivers two things requested by the owner:

  1. An analysis & roadmap document β€” IMPROVEMENTS.md: observed structure of the project, gaps, and 53 step-by-step proposed tasks across 6 phases.
  2. 53 GitHub issues β€” one per task, opened against this repo ([Phase 0] 0.1 Add .gitignore, package.json, and a Sass build scriptΒ #3 through [Phase 6] 6.12 Configurable rate knobsΒ #55), each with context, acceptance criteria, implementation notes, dependencies, and an estimate. Every roadmap line in IMPROVEMENTS.md cross-links to its tracking issue.

The application code is not modified β€” issue #1 explicitly asked for an analysis-only PR. All implementation work happens in the 53 follow-up issues.

What's new in this revision

  • Phase 6 β€” Affiliate program (TBC points & single-level referrals) added to IMPROVEMENTS.md with the full arithmetic worked through (Β§6.0):
    • Point award formula: floor(turnover_usd Γ— bps / 10_000 / 0.00003)
    • Rule of thumb: every $1 of swap turnover at the recommended 0.10 % rate β‰ˆ 33 points β‰ˆ 3.3 TBC β‰ˆ $0.001 cashback
    • House economics table for every (cashback, referral) pair in the 0.10–0.20 % range
    • Recommended default: 0.10 % cashback + 0.10 % referral, leaving the house with 0.20 % gross margin (half of the 0.40 % service commission)
    • Worked examples at $10 / $100 / $1 k / $10 k / $1 M (OTC) turnover
    • Redemption math: tbc_to_credit = floor(points / 10), minimum 100 points
  • 12 affiliate-program implementation tasks ([Phase 6] 6.1 Define the affiliate-program data modelΒ #44–[Phase 6] 6.12 Configurable rate knobsΒ #55) with append-only ledger design, idempotency keys, anti-fraud guardrails, TonConnect 2 wallet linking, admin surface, T&C page, and runtime-configurable rate knobs.
  • "Multi-level (MLM-style) referrals" and "Issuing TBC tokens" added to out of scope β€” Phase 6 stays single-level by design and only credits TBC, never mints.

Index of created issues

Phase 0 β€” Hygiene & foundations

Phase 1 β€” Telegram Mini App best-practices

Phase 2 β€” Performance, PWA, offline

Phase 3 β€” Product surface beyond the iframe

Phase 4 β€” Virality & growth loops

Phase 5 β€” Trust, security, accessibility, polish

Phase 6 β€” Affiliate program

Test plan

This PR is documentation only β€” there is nothing to execute. Reviewer checklist:

  • Read IMPROVEMENTS.md Β§ 1 (observed structure) β€” does it match what's actually in the repo?
  • Read Β§ 2 phase tables β€” every roadmap line carries an issue link; click through and skim a few to confirm the issue bodies match the line in the doc
  • Read Β§ Phase 6.0 (Economic model & arithmetic) β€” verify the maths against the owner's spec: 0.40 % service commission, 0.10–0.20 % single-level referral split, 10 points = 1 TBC, $0.0003/TBC, $0.00003/point
  • Read Β§ 4 (Out of scope) β€” confirm MLM-style referrals and TBC issuance are explicitly excluded
  • Spot-check 2 issues from each phase to verify they have an acceptance-criteria checklist and a dependency note

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #1
@konard konard self-assigned this Apr 29, 2026
Per issue #1, analyze the TON-Bridge mini-app structure (Finapp-based
static TMA wrapping ChangeNOW iframes) and propose a step-by-step
improvement roadmap across 5 phases: foundations, Telegram-native UX,
performance/PWA, product surface, virality, and trust. No application
code is touched in this change.
@konard konard changed the title [WIP] Improvements Analysis & roadmap: TON-Bridge improvements (closes #1) Apr 29, 2026
@konard konard marked this pull request as ready for review April 29, 2026 21:51
@konard
Copy link
Copy Markdown
Collaborator Author

konard commented Apr 29, 2026

Solution summary

Done. The issue explicitly asked for analysis and proposals only β€” no code changes β€” so I:

  • Mapped the repo: Finapp-based static TMA wrapping three ChangeNOW iframes, EN/RU page duplication, generic PWA shell, Telegram + Yandex analytics, half-finished index4.html stats tab.
  • Wrote IMPROVEMENTS.md with observations and a 38-task roadmap across 5 phases (foundations, Telegram-native UX, performance/PWA, product surface, virality, trust/polish), plus a first-week execution plan and explicit out-of-scope items.
  • Linked it from README.md, retitled and rewrote the PR body, and moved PR Analysis & roadmap: TON-Bridge V2 (53 issues + Phase 6 affiliate program, closes #1)Β #2 from draft to ready.

PR: #2


This summary was automatically extracted from the AI working session output.

@konard
Copy link
Copy Markdown
Collaborator Author

konard commented Apr 29, 2026

πŸ€– Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

πŸ’° Cost: $1.016924

πŸ“Š Context and tokens usage:

  • 55.9K / 1M (6%) input tokens, 10.8K / 128K (8%) output tokens

Total: (70.9K + 623.1K cached) input tokens, 10.8K output tokens, $1.016924 cost

πŸ€– Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus
  • Model: Claude Opus 4.7 (claude-opus-4-7)

πŸ“Ž Log file uploaded as Gist (539KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Copy Markdown
Collaborator Author

konard commented Apr 29, 2026

βœ… Ready to merge

This pull request is now ready to be merged:

  • No CI/CD checks are configured for this repository
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@xlabtg
Copy link
Copy Markdown
Owner

xlabtg commented Apr 29, 2026

Well, now we are doing the following. Based on this analysis and suggestions, in 38 step-by-step tasks in 5 phases, you will create a separate complete professional and detailed issue for each task in this repository, so that we can implement all these tasks to get a new mini V2 application, you can also think about using an affiliate program for working in a mini Telegram application (earn internal points that can then be exchanged for a TBC token from TONBANKCARD) look, our arithmetic is such that we receive a commission from each exchange as a service of 0.4% and we can share as once within the framework of the single-level ref system from 0.1 to 0.2%, that is, we need to calculate the turnover in USD during exchanges and add internal points to the balance of the user who makes the exchange, they will then change 10 points for 1 TBC token. (the token rate is now $ 0.0003) think through all the arithmetic and logic of this proposal.

@konard
Copy link
Copy Markdown
Collaborator Author

konard commented Apr 29, 2026

πŸ€– AI Work Session Started

Starting automated work session at 2026-04-29T22:04:41.348Z

The PR has been converted to draft mode while work is in progress.

This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback.

- IMPROVEMENTS.md: add Phase 6 (TBC points + single-level referrals)
  with Β§6.0 Economic model & arithmetic (point award formula, house
  economics, worked examples, redemption math) and Β§6.1 roadmap items
  6.1–6.12. Cross-link every Phase 0–6 task to its tracking issue
  (#3 through #55) and extend Β§4 Out of scope to exclude MLM-style
  referrals and TBC token issuance.
- .gitignore: ignore .issue-bodies/ workspace and node_modules.
@konard konard changed the title Analysis & roadmap: TON-Bridge improvements (closes #1) Analysis & roadmap: TON-Bridge V2 (53 issues + Phase 6 affiliate program, closes #1) Apr 29, 2026
@konard konard marked this pull request as ready for review April 29, 2026 22:26
@konard
Copy link
Copy Markdown
Collaborator Author

konard commented Apr 29, 2026

Done β€” analysis is complete and the roadmap is now actionable as 53 trackable issues (#3 through #55) covering 6 phases.

What was added since the last review

  1. Phase 6 β€” Affiliate program (TBC points & single-level referrals) in IMPROVEMENTS.md, with the full arithmetic worked out per your spec (0.40 % service commission, 0.10–0.20 % single-level referral split, 10 pts = 1 TBC at $0.0003 β‡’ $0.00003/pt). The recommended default is 0.10 % cashback + 0.10 % referral, leaving the house with 0.20 % (half of the original commission).

    Rule of thumb: every $1 of swap turnover β‰ˆ 33 points β‰ˆ 3.3 TBC β‰ˆ $0.001 cashback.

    Worked examples and house-economics tables are in IMPROVEMENTS.md Β§ 6.0.

  2. 53 GitHub issues, one per task, each with: context Β· goal Β· acceptance-criteria checklist Β· implementation notes Β· dependencies Β· estimate. Phase 6 issues include schema DDL, idempotency keys, anti-fraud guardrails, and TonConnect 2 wallet-linking flow.

  3. Every roadmap line in IMPROVEMENTS.md is cross-linked to its tracking issue.

  4. Out of scope explicitly extended: multi-level / MLM referrals are excluded (Phase 6 stays single-level by design to avoid pyramid-scheme regulation), and issuing TBC is excluded (we credit, never mint).

Issue index by phase

PR is back from draft and ready for review.

@konard
Copy link
Copy Markdown
Collaborator Author

konard commented Apr 29, 2026

πŸ€– Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

πŸ’° Cost: $5.092420

πŸ“Š Context and tokens usage:

Claude Opus 4.7: (2 session segments)

  1. 117.8K / 1M (12%) input tokens, 64.3K / 128K (50%) output tokens
  2. 72.7K / 1M (7%) input tokens, 18.8K / 128K (15%) output tokens

Total: (256.2K + 2.5M cached) input tokens, 89.7K output tokens, $5.092420 cost

πŸ€– Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus
  • Model: Claude Opus 4.7 (claude-opus-4-7)

πŸ“Ž Log file uploaded as Gist (1850KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Copy Markdown
Collaborator Author

konard commented Apr 29, 2026

βœ… Ready to merge

This pull request is now ready to be merged:

  • No CI/CD checks are configured for this repository
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

konard added a commit that referenced this pull request May 19, 2026
Three modules called Telegram.WebApp.CloudStorage methods without
catching synchronous throws, which crashed the page on Telegram WebApp
< 6.1 (CloudStorage object exists but methods raise
WebAppMethodUnsupported). Gate behind isVersionAtLeast('6.1') and wrap
calls in try/catch so unsupported clients fall back to localStorage:

  * assets/js/prefs.js β€” migrate() now always resolves; csGet/csSet/
    csRemove catch synchronous throws and reject cleanly.
  * assets/js/achievements.js β€” loadStats/saveStats fall back via a
    shared cloudStorage() probe + localStorage fallback.
  * assets/js/address-book.js β€” loadEntries/saveEntries probe the API
    and catch throws around getItem/setItem.

AUDIT.md documents the audit done against issues #1, #2, and the
in-flight #115 work, plus the 6 follow-up GitHub issues it spawned
(#117–#122).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improvements

2 participants