Skip to content

Commit 174817a

Browse files
authored
Scaled UI Jettons (#526)
Scaled UI Jettons Supported by Tonkeeper (as well as tonviewer and tonapi), tg@wallet, and stonfi. * Scaled UI Jettons * chore: describe edge cases * Remove the calculation get methods, describe the calculation in the standard. Add an external-out message to report supply data changes. * Add a clarification about decimals. * Add `comment` to external-out message * feat: make the multiplier an abstract number, instead of a total displayed supply * chore: clarifty get method return values * chore: add reference implementation link chore: update external-out schema chore: replace TBDs * chore: add init event requirement * chore: remove section for already existing contracts * chore: rename file and mention in README
1 parent f10a373 commit 174817a

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Proposal management is done using GitHub pull requests, the process is described
2929
| [89](./text/0089-jetton-wallet-discovery.md) | Discoverable Jettons Wallets | Contract Interface | 08.09.2022 |
3030
| [115](./text/0115-ton-connect.md) | TON Connect | Core | 20.10.2022 |
3131
| [160](./text/0160-dispatch-queue.md) | Dispatch Queue | Core | 13.06.2024 |
32+
| [526](./text/0526-scaled-ui-jettons.md) | Scaled UI Jettons | Contract Interface | 19.09.2025 |
3233

3334

3435
## WIP

text/0526-scaled-ui-jettons.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
- **TEP**: [526](https://github.com/ton-blockchain/TEPs/pull/526)
2+
- **title**: Scaled UI Jettons
3+
- **status**: Draft
4+
- **type**: Contract Interface
5+
- **authors**: [Maxim Gromov](https://github.com/krigga)
6+
- **created**: 19.09.2025
7+
- **replaces**: -
8+
- **replaced by**: -
9+
10+
# Summary
11+
12+
A standard interface for Jettons ([TEP-74](https://github.com/ton-blockchain/TEPs/blob/master/text/0074-jettons-standard.md)) that allows for arbitrary scaling of the displayed balances.
13+
14+
# Motivation
15+
16+
Currently, it is not viable to implement jetton rebasing in any way, since updating the balances of all jetton wallets is not feasible due to TON's architecture. The alternative is scaled UI amounts, which this TEP proposes.
17+
18+
# Guide
19+
20+
## Useful links
21+
22+
1. [Reference implementation](https://github.com/the-ton-tech/scaled-ui-jetton)
23+
24+
# Specification
25+
26+
> The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119.
27+
28+
## Jetton Master contract extension
29+
30+
The jetton master contracts following this TEP are extended versions of [TEP-74](https://github.com/ton-blockchain/TEPs/blob/master/text/0074-jettons-standard.md) jetton masters.
31+
32+
They MUST additionally (w.r.t. TEP-74) support the following get method:
33+
1. `get_display_multiplier()` returns `(int numerator, int denominator)`
34+
35+
`numerator` - (integer) - the numerator to be used when calculating displayed amounts from onchain amounts. MUST NOT be `0`.
36+
37+
`denominator` - (integer) - the denominator to be used when calculating displayed amounts from onchain amounts. MUST NOT be `0`.
38+
39+
The displayed (that is, the value presented to users in UIs supporting this TEP) balance of a jetton wallet MUST be calculated as `muldiv(onchain_balance, numerator, denominator)`, where `onchain_balance` is the balance of the jetton wallet as reported by `get_wallet_data()`, and `numerator` and `denominator` are the values returned by `get_display_multiplier()`. The displayed balance calculated in such a way and presented to the user MUST still respect the `decimals` reported by jetton's metadata. Similarly, the total displayed supply MUST be calculated as `muldiv(total_onchain_supply, numerator, denominator)`.
40+
41+
Values inputted by users in UIs supporting this TEP have to be converted to onchain balance (the value used for sending jettons) as follows: `muldiv(displayed_or_inputted_balance, denominator, numerator)`, where `displayed_or_inputted_balance` is the value inputted by the user, and `numerator` and `denominator` are the values returned by `get_display_multiplier()`.
42+
43+
Jetton master contracts supporting this TEP MUST send the following external-out message (TL-B structure) whenever the values returned by `get_display_multiplier()`:
44+
```
45+
display_multiplier_changed#ac392598 numerator:(VarUInteger 32) denominator:(VarUInteger 32) comment:(Maybe SnakeString) = ExternalOutMsgBody;
46+
```
47+
48+
`numerator` and `denominator` in the external-out message MUST be the same values as returned by `get_display_multiplier()` after the transaction that sent the message.
49+
50+
`numerator` and `denominator` reported by `get_display_multiplier()` MUST NOT be changed between transactions that send the `display_multiplier_changed` message.
51+
52+
`comment` is an optional field that may be used to describe the reason for the change of `numerator` and `denominator`. `SnakeString` is described as `SnakeData` in [TEP-64](https://github.com/ton-blockchain/TEPs/blob/master/text/0064-token-data-standard.md#data-serialization).
53+
54+
Jetton master contracts supporting this TEP MUST emit the `display_multiplier_changed` external-out message upon initialization.
55+
56+
# Drawbacks
57+
58+
1. It is not possible to make a mechanism for calculating the displayed balance in a way that is different from the `muldiv` calculation using this TEP.
59+
60+
# Rationale and alternatives
61+
62+
## Why restrict the calculation to `muldiv` and why send the external-out message?
63+
64+
Both of these points significantly simplify the indexing of jettons that support this TEP by allowing indexers to:
65+
66+
1. Only store the multiplier reported by the jetton master contract and use it for displayed balance calculation for both present and historical data, on any reasonable number of jetton wallets.
67+
2. Not have to call `get_display_multiplier()` after each transaction in order to obtain the new multiplier and instead rely on the external-out message.
68+
69+
# Prior art
70+
71+
[Scaled UI Amount](https://solana.com/docs/tokens/extensions/scaled-ui-amount)
72+
73+
# Unresolved questions
74+
75+
\-
76+
77+
# Future possibilities
78+
79+
\-

0 commit comments

Comments
 (0)