Skip to content

feat(currency-creator): fund currency launches with any currency#1095

Merged
bmc08gt merged 1 commit into
code/cashfrom
feat/launch-token-funded-by-another
Jul 17, 2026
Merged

feat(currency-creator): fund currency launches with any currency#1095
bmc08gt merged 1 commit into
code/cashfrom
feat/launch-token-funded-by-another

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Lets a new currency be created paying with USDF or another launchpad currency (a treasury-funded cross-currency swap), rather than USDF reserves only.

UI

  • New funding-source token picker step in the create flow. Its own top bar is suppressed inside the flow to avoid stacking two bars.
  • "Ready To Create?" confirmation modal before payment (ConfirmPurchase → modal → launch).
  • The intro balance gate now checks any held currency: no balance at all → "No Balance Yet"; some balance but none covers the cost → "Insufficient Balance".

Service layer (opencode)

  • launchToken mints and funds in one call, routing on the funding token:
    • USDF → a plain buy of the freshly-launched stub.
    • any other launchpad currency → the treasury-funded cross-currency swap that creates and funds the new currency in a single transaction.
  • Made the public swap API explicit: the overloaded crossCurrencySwap (which switched modes on a nullable fullAmountExchangeData) is split into swap (existing-currency swaps) and launchToken (new-currency treasury launch). The internal exchange-data type no longer leaks into the app-facing interface.
  • TokenCreateRequest carries a Funding describing how the launch is paid for; the service decides buy vs. swap and builds the exchange data from it.

Server contract (treasury swap)

The new-currency swap's full_amount_exchange_data and the funding intent are validated against the ocp-server rules: quarks are funding-token quarks (the reserve sells them), native_amount is the exact USD launch cost in USD, and the fee is likewise funding-token quarks valued at its USD amount. A small VerifiedFiat.valuedAt(...) helper pins the native to the exact cost (kept in the transaction controller so the exchange-data construction is self-contained).

Create a currency paying with USDF or another launchpad currency:

- Funding-source token picker inside the flow (its own top bar hidden
  to avoid stacking), with a "Ready To Create?" confirmation before paying.
- launchToken mints and funds in one call, routing on the funding token —
  USDF via a plain buy of the freshly-launched stub, any other currency
  via the treasury-funded cross-currency swap that creates and funds the
  new currency in a single transaction.
- Split the overloaded crossCurrencySwap into an explicit swap (existing
  currencies) and launchToken (treasury launch); the launch's full-amount
  exchange data and funding intent report funding-token quarks valued at
  the exact USD launch cost, per the server contract.
- Intro gate now checks any held currency (no balance vs. insufficient).
@github-actions github-actions Bot added area: network gRPC, connectivity, API, exchange rates area: tokens Token accounts, balances, token info type: feature New functionality labels Jul 17, 2026
@bmc08gt
bmc08gt merged commit 37a68ea into code/cash Jul 17, 2026
3 checks passed
@bmc08gt
bmc08gt deleted the feat/launch-token-funded-by-another branch July 17, 2026 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: network gRPC, connectivity, API, exchange rates area: tokens Token accounts, balances, token info type: feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant