feat(api): flag QTC on NEAR that exceeds what exists outside the vesting pot
qtc.omft.near is minted only against QTC locked on Quantus by the bridge, so its supply can never legitimately exceed issuance outside the vesting pot — 221,838 QTC today. The listing poll now reads that ceiling every five minutes through one helper, issuance_outside_pot, using the same storage reads and the same subtraction the network page uses, rescales it to the NEAR token's decimals (rounding down, so the check can only get stricter), and compares it with ft_total_supply. A breach is a logged warning and, on the market page, a sentence before any figure: unbacked, or one of the two misread. Either read failing gives no verdict rather than a false all-clear. The panel also shows the ceiling itself as "most there could be". Checked live: QTC at 0 against 221,837.97 with no breach, and the breach path forced by pointing the dev config at wNEAR (35.4M on NEAR), which logged and rendered the warning as intended. In place before QTC's announced NEAR Intents launch on 2026-10-05. Closes #36 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015pkwBsR54NRmZyU4QVhvfj
This commit is contained in:
@@ -24,4 +24,16 @@ in_intents: BigUintDec | null,
|
||||
* Whether 1Click's public token list names the asset. Off-chain, and only
|
||||
* a listing — it says swaps can be *requested*, not that any settled.
|
||||
*/
|
||||
oneclick_listed: boolean | null, };
|
||||
oneclick_listed: boolean | null,
|
||||
/**
|
||||
* The most of the asset that can exist on NEAR, in its base units: the
|
||||
* chain's issuance outside the vesting pot, scaled to the NEAR token's
|
||||
* decimals. The bridge mints only against QTC locked on Quantus, so supply
|
||||
* above this is unbacked or a misread. blackbeard/observer#36.
|
||||
*/
|
||||
backing_ceiling: BigUintDec | null,
|
||||
/**
|
||||
* `total_supply` is above `backing_ceiling`. Absent when either could not
|
||||
* be read — no verdict rather than a false all-clear.
|
||||
*/
|
||||
exceeds_backing: boolean | null, };
|
||||
|
||||
@@ -149,13 +149,34 @@ export function IntentsPanel({
|
||||
}
|
||||
note="a listing, not a trade"
|
||||
/>
|
||||
<Field
|
||||
label="Most there could be"
|
||||
value={amount(listing?.backing_ceiling)}
|
||||
note={`all the ${asset} outside the vesting pot`}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
|
||||
// The bridge mints only against QTC locked on the chain, so supply on NEAR
|
||||
// above everything outside the vesting pot is unbacked or a misread — said
|
||||
// in words, first, in every state of the panel (blackbeard/observer#36).
|
||||
const breach = listing?.exceeds_backing === true && (
|
||||
<p className="panel-note" role="alert">
|
||||
<strong>
|
||||
{asset} on NEAR exceeds all the {asset} that exists outside the vesting pot.
|
||||
</strong>{' '}
|
||||
{amount(listing?.total_supply)} is bridged against a most of{' '}
|
||||
{amount(listing?.backing_ceiling)}. The bridge mints only against {asset} locked on the chain,
|
||||
so either some of it is unbacked or one of the two figures was misread. Prices below are what
|
||||
settled, but read them with that in mind.
|
||||
</p>
|
||||
)
|
||||
|
||||
if (data.counters.length === 0)
|
||||
return (
|
||||
<section className="panel" style={{ marginBottom: 26 }}>
|
||||
{head(`NEAR Intents · ${range}`)}
|
||||
{breach}
|
||||
<div className="node-grid">
|
||||
{listingFields}
|
||||
<Field label="Settled swaps" value="0" note="in the NEAR blocks read" />
|
||||
@@ -175,6 +196,7 @@ export function IntentsPanel({
|
||||
return (
|
||||
<section className="panel" style={{ marginBottom: 26 }}>
|
||||
{head(`NEAR Intents · ${range}`)}
|
||||
{breach}
|
||||
<div className="node-grid">
|
||||
{shown.map((c) => {
|
||||
const unit = tokenLabel(c.counter_token, c.symbol)
|
||||
|
||||
Reference in New Issue
Block a user