design(dex): research BSC bStocks dividends, rebase risk, and DEX volume if bridged #1223
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-dex-terraclassic#1223
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Research / decision only — do not implement bridge token mappings, factory whitelist entries,
CreatePair, tokenlist rows, wrap-mapper legs, LP, or retail chrome for tokenized equities.Bundle into one investigation (do not split dividends vs risks vs volume ranking):
Related, not duplicates:
docs/listings/— aggregator/wallet catalog for the six permanent economic CW20s. Do not add bStocks to that pack here.Not in scope: shipping a bStock CW20, wrapping BEP-20 balances 1:1 without the multiplier, advertising stock tickers on Swap, or treating “bridged from BSC” as a product commitment.
Current codebase
CL8Y DEX is a Terra Classic hybrid venue: constant-product AMM pairs plus a FIFO limit book, CW20 (+ selected natives) via factory whitelist. Liquidity providers mint LP CW20 shares. Pair commission goes to the CMM treasury, not to LPs (#1207). There is no listed tokenized-equity asset today.
CreatePair/ empty-pool provide reject either CW20 withdecimals > 18. Permanent economic set indocs/listings/README.mdis six CW20s (CL8Y, UST1, USTR, cLUNC, cUSTC, vFDUSD) plus wrap/window products — not US equity wrappers./protocolUSD stats assume transferablebalanceOfamounts. A display multiplier that is not in the CW20balancewould make volume, TVL, and candles lie.Public issuer materials (dated in the memo; do not treat this intake text as the citation):
That combination (security-like wrapper + non-cash dividend via scaled UI amount) is the load-bearing fact for this DEX. A naive
balanceOfbridge +CreatePairis the failure mode the memo must kill or tightly bound.Why this work is needed
balanceOf, Terra CW20 accounting, LP shares, limit escrow, and indexer USD all desync on the first corporate action. If it is a rebasingbalanceOf, constant-product reserves still break unless both sides and the pair snapshot the same multiplier at the same height.Constraints / guardrails
AddToWhitelist, no tokenlist.json row, noCreatePair, no wrap-mapper denom, no indexerequityoracle, no/stocksroute, no “dividend APR” copy.balanceOf/ BEP-677 probe. If PoR or the multiplier cannot be verified, the row is Unverified, not “1:1.”0xinto Swap query params (#713 out of scope already). Bridging is not a frontend0xalias.Relevant files
smartcontracts/contracts/factory/,docs/contracts-terraclassic.md, code-id audit harness (#589 / #581)smartcontracts/contracts/pair/(reserves, provide/withdraw, limit escrow). Rebase mid-swap is the hazard.frontend-dappbundled tokenlist +docs/frontend.md(factory universe vs create-pair catalog)smartcontracts/contracts/community-tax template;skills/tax ranking (#615). Contrast with BEP-677 — do not reuse tax hooks as a multiplier.indexer/protocol fees + pair USD;docs/DEFILLAMA.mddocs/listings/README.md,skills/AGENTS_LISTINGS.mddocs/adr/(next unused number; do not collide with #575 / #1207 proposals)Recommended direction
Write ADR
docs/adr/NNNN-bstocks-bridge-listing.md(Status: Proposed) and a one-line pointer fromdocs/README.md. Optional skill stub only if a later implement issue is opened.Define the asset. For a short allowlist of candidate tickers (researchers may add; start from issuer’s current bStock roster, not rumor):
balanceOfthe economic quantity, or is BEP-677 a separate multiplier?On-chain probe (BSC, read-only). For at least one high-volume name and one dividend-paying name:
decimals,balanceOfbefore/after a documented multiplier event if timestamps exist, whether pairs on Pancake/Aster use the raw token or a wrapped static share, and whether LP positions were haircut on the last dividend. Record tx hashes.DEX compatibility matrix (every candidate gets a row):
balanceOfstaticbalanceOfDecision gate: if no candidate is C3 (or a proven-equivalent static wrap), Reject listing. Volume ranking is then academic.
Risk register (required sections, each with source + residual): issuer/custody/PoR, not-a-share, US withholding / tax reporting, geographic eligibility, bridge operator as a new custodian of a security-like token, Terra Classic CW20 having no BEP-677, oracle/USD, lookalike tickers (AAPL vs wrapped AAPL), CMM POL if anyone later seeds a pair (#558 custody still forbids farming-and-exit).
Volume scorecard — only if C3-class exists or the ADR explicitly studies a hypothetical static wrap. Rank a small set (on the order of 8–12 names, not the full roster) by likely columbus-5 flow, not BSC notional.
GET https://indexer.dex.cl8y.com/api/v1/overview(UTC date). If 30d volume is still ~low five figures USD, only 1–2 names could matter, and maybe zero.Hypothesis to test: crypto-narrative names (example set to confirm or kill: MSTR, NVDA, TSLA, COIN, IBIT-class if present) outrank high-dividend staples; dividend aristocrats are the worst AMM candidates because they maximize Multiplier events. Empty-book names are a net negative (phishing surface, support load).
Decision (exactly one): Reject / Defer (legal) / Static-wrap only on BSC then bridge that wrap / Do not list on the AMM but allow bridge-custody (still a later issue). Spawn follow-up implementation issues only if the decision is not Reject/Defer. DEX whitelist and bridge mapping are separate follow-ups, never this MR.
Verify script
scripts/qa/verify-issue-NNN.sh: required ADR headings present; no new tokenlist symbol for a US equity; no factory whitelist address from the memo’s roster in production pins;docs/listings/README.mdpermanent-six table unchanged.Research deliverables
Out of scope
First-pass model recommendation
Recommendation: grok-high
Rationale: This is research, not a local three-file edit. It crosses token standards (BEP-20 + BEP-677 vs CW20), the BSC↔Terra Classic bridge mapping path, factory whitelist / pair reserve invariants, and founder-required securities/custody questions. There is no deterministic unit test that “lists NVDA.” Comparable control-plane calibration: a one-doc RCA can be Composer; this is closer to cross-cutting protocol+legal scope (control-plane PRs that span credentials, workers, and deploy are grok-high). Verification is the ADR + read-only probes, not
cargo testof a listing.