> ## Documentation Index
> Fetch the complete documentation index at: https://docs.purps.lol/llms.txt
> Use this file to discover all available pages before exploring further.

# Prepare a change

> Step 1 of a change through creator authority. Say which wallet will sign and what it will do (`kind`: act on a position, change the strategy, ask for authority, or hand the coin on), and get back the exact message to sign plus a `nonce` bound to this coin, this wallet and this exact action. The message is plain English and is the consent: it says what will happen (`does:` or `sets:`) and carries your `why:` note, which holders read on the Changes tab. Sign exactly that string. Nothing is stored or spent here; every check that guards money runs at submit, on the server's own figures. This step only refuses what can never work: the flagship (403), a coin that is not a purps.lol launch or has no strategy yet (404), a frozen coin (423), a request while authority is closed to new coins (403) or already on (409), a malformed action, config or note (400), or a server with signing not set up (503).



## OpenAPI

````yaml /openapi.json post /coins/{mint}/authority/prepare
openapi: 3.1.0
info:
  title: PURPS API
  version: 2.0.0
  description: >-
    Everything purps.lol can do, as JSON. Read the coin list, a coin's full page
    and the launchpad; launch coins on purps.lol, pump.fun and Pons; wire an
    existing pump.fun coin's fees into a strategy; steer a coin you own. No key,
    no signup. A launch is one call that returns unsigned transactions: the
    launch transaction can only land with your wallet's signature, and that is
    the proof. The few writes that need a message signature (Pons launches,
    wiring a strategy onto a coin, creator authority) come as a prepare/submit
    pair. Every transaction is signed in your wallet, never by us. Every
    response is `{ ok: true, data }` or `{ ok: false, error }`. Cross-origin
    requests are allowed from any site. Every answer from the API itself carries
    `RateLimit-Limit` and `RateLimit-Policy`; uncached ones (writes, prepare and
    submit, refusals) carry `RateLimit-Remaining` and `RateLimit-Reset` as well.
    The 503 while the API is paused and the 410 on old v1 write addresses carry
    neither.
servers:
  - url: https://purps.lol/api/v2
security: []
tags:
  - name: Coins
    description: Read what the site shows.
  - name: Launch on purps.lol
    description: Launch a coin on purps.lol. Build, sign, send, poll.
  - name: Launch on pump.fun
    description: Launch straight on pump.fun with fees wired to a strategy.
  - name: Launch on Pons
    description: Launch through Pons, the launchpad on Robinhood Chain.
  - name: Redirect a pump.fun coin
    description: Point an existing pump.fun coin's creator fees at a strategy.
  - name: Manage a coin
    description: Attach a strategy to a coin launched without one. Creator-signed.
  - name: Creator authority
    description: >-
      Steer a purps.lol coin you own: act on a position, change its strategy,
      ask for authority, or hand the coin on. Every move is signed by the
      owner's wallet and published on the coin's Changes tab.
  - name: Transactions
    description: Send a signed Solana transaction through our relay and watch it land.
paths:
  /coins/{mint}/authority/prepare:
    post:
      tags:
        - Creator authority
      summary: Prepare a change
      description: >-
        Step 1 of a change through creator authority. Say which wallet will sign
        and what it will do (`kind`: act on a position, change the strategy, ask
        for authority, or hand the coin on), and get back the exact message to
        sign plus a `nonce` bound to this coin, this wallet and this exact
        action. The message is plain English and is the consent: it says what
        will happen (`does:` or `sets:`) and carries your `why:` note, which
        holders read on the Changes tab. Sign exactly that string. Nothing is
        stored or spent here; every check that guards money runs at submit, on
        the server's own figures. This step only refuses what can never work:
        the flagship (403), a coin that is not a purps.lol launch or has no
        strategy yet (404), a frozen coin (423), a request while authority is
        closed to new coins (403) or already on (409), a malformed action,
        config or note (400), or a server with signing not set up (503).
      operationId: prepareAuthority
      parameters:
        - name: mint
          in: path
          required: true
          description: >-
            The token's mint address (Solana) or contract address (Robinhood
            Chain).
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthorityPrepare'
      responses:
        '200':
          description: What to sign.
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                  data:
                    $ref: '#/components/schemas/AuthorityPrepared'
        '400':
          description: Every failure carries the same envelope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Every failure carries the same envelope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Every failure carries the same envelope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Every failure carries the same envelope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '423':
          description: Every failure carries the same envelope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Every failure carries the same envelope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Every failure carries the same envelope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    AuthorityPrepare:
      type: object
      properties:
        wallet:
          type: string
          description: >-
            The Solana wallet that will sign: the coin's owner (from
            /coins/{mint}/authority), or a platform admin wallet for `action`
            and `strategy`.
          required: true
        kind:
          type: string
          description: >-
            `action` acts on one position. `strategy` replaces the coin's whole
            strategy. `request` asks for creator authority on a coin from before
            it existed. `handover` hands the creator rewards, and the authority,
            to another wallet.
          enum:
            - action
            - strategy
            - request
            - handover
          required: true
        action:
          $ref: '#/components/schemas/OwnerAction'
          type: object
          description: '`action` only: what to do.'
        config:
          $ref: '#/components/schemas/Strategy'
          type: object
          description: >-
            `strategy` only: the whole new config. Sent byte-for-byte the same
            to submit; its hash is in the message.
        note:
          type: string
          description: >-
            `action` and `strategy`: required, 3 to 140 characters on one line,
            your reason. It is in the signed words and holders read it.
            `request`: optional, up to 500 characters on one line. `handover`:
            none.
        payoutWallet:
          type: string
          description: >-
            `handover` only: the wallet to hand the coin to. A plain wallet, not
            the coin's own wallet or a platform wallet.
    AuthorityPrepared:
      type: object
      properties:
        kind:
          type: string
          description: As sent.
          enum:
            - action
            - strategy
            - request
            - handover
        wallet:
          type: string
          description: The wallet that must sign.
        ts:
          type: integer
          description: Unix seconds. Send it back unchanged.
        nonce:
          type: string
          description: >-
            Starts with `api.`. Bound to this coin, this wallet and this exact
            action for five minutes; the signature you send with it is good
            once. Send it back unchanged.
        message:
          type: string
          description: >-
            The exact text to sign: ed25519 over the UTF-8 bytes, no prefix, no
            hashing. It reads as plain English (`does:` or `sets:` says what
            will happen, `why:` is your note) and is the consent.
        hash:
          type: string
          description: >-
            The hash of the action or config, as embedded in the message. Null
            for `request` and `handover`.
          nullable: true
        expiresInSeconds:
          type: integer
          description: How long the signature stays valid. 300.
    Error:
      type: object
      properties:
        ok:
          type: boolean
          description: Always false on a failure.
        error:
          type: string
          description: >-
            A short reason in plain words: `coin not found`, `too many
            requests`, `invalid wallet signature`.
    OwnerAction:
      type: object
      description: >-
        One action on one position. `action` picks the shape; the other fields
        depend on it. `close` { market, margin }. `trim` { market, pct, margin
        }. `swap` { market, to, direction, leverage }. `open` { market,
        direction, leverage, usdc? }. `leverage` { market, leverage, method,
        profit? }. `margin` { market, usdc, direction }. A market is one of the
        coin's legs (or, for `swap`, the `to` market is any market from /markets
        on the coin's exchange). `usdc` amounts are dollars to the cent, at most
        100,000.
      properties:
        action:
          type: string
          description: What to do.
          enum:
            - close
            - trim
            - swap
            - open
            - leverage
            - margin
          required: true
        market:
          type: string
          description: >-
            The leg to act on, e.g. `ETH`. 1 to 32 characters of letters,
            digits, `:`, `_` or `-`.
          required: true
        margin:
          type: string
          description: >-
            `close` and `trim`: where the freed margin goes. `hold` parks it on
            the exchange for seven days for a re-entry; `home` pays it out
            through the buyback road.
          enum:
            - hold
            - home
        pct:
          type: integer
          description: '`trim`: how much of the position to close, 1 to 99 percent.'
        to:
          type: string
          description: >-
            `swap`: the market to move into. The same market with the other
            `direction` is a flip.
        direction:
          type: string
          description: >-
            `swap` and `open`: `long` or `short`. `margin`: `add` moves money
            from the reserve into the position, `remove` moves it back.
          enum:
            - long
            - short
            - add
            - remove
        leverage:
          type: integer
          description: >-
            `swap`, `open` and `leverage`: a whole number, 1 to 50, within the
            market's cap and the platform's `maxLeverage`.
        usdc:
          type: number
          description: >-
            `margin`: the dollars to move, at most 100000, in cents. `open`: how
            much of the parked money to open with; all of it when absent.
        method:
          type: string
          description: >-
            `leverage`: `resize` keeps the margin and buys or sells part of the
            position; `margin` keeps the size and moves money in or out of the
            reserve.
          enum:
            - resize
            - margin
        profit:
          type: string
          description: >-
            `leverage` with `resize`, when lowering: the profit on the part sold
            goes `home` like any close, or stays in the position as margin with
            `keep`. The creator's share is paid either way.
          enum:
            - home
            - keep
    Strategy:
      type: object
      description: >-
        How a coin uses its fees. Basis points sum to 10000 across the three
        splits.
      properties:
        splitBuybackBps:
          type: integer
          description: Share of each fee that buys the coin back.
          required: true
        splitMarginBps:
          type: integer
          description: Share sent to the perp exchange as margin.
          required: true
        splitReserveBps:
          type: integer
          description: Share kept as a reserve that backs the positions.
          required: true
        perpLegs:
          type: array
          description: >-
            The positions to hold: `{ market, direction, leverage, weightBps,
            reserveMode }`. `market` from /markets, `leverage` a whole number
            within its cap, weights summing to 10000, `reserveMode` `defensive`
            or `none` (use the preset's `legReserveMode`); optional
            `takeProfitPct` and `stopLossPct` (percent, shown in the signed
            words when set) and `reserveTranches`. Empty means no perps, in
            which case margin and reserve must be 0.
          items:
            type: object
          required: true
        rewardMode:
          type: string
          description: >-
            What profits do: `burn` (default), `holders` pays the coin itself,
            `backed` pays `payoutMint`. Paying coins need `holderPayoutsEnabled`
            in /launch-options.
          enum:
            - burn
            - holders
            - backed
        payoutMint:
          type: string
          description: >-
            `backed` only: the asset holders are paid in. On Solana, a mint from
            /launch-options `payoutAssets` or any Solana mint with a real
            market. On Robinhood Chain, a `0x` token address that passes the
            depth check: one of the launchpad's `payoutAssets`, or any token
            /pons/assets/{address} reports as payable. ETH itself cannot be a
            payout asset there.
          nullable: true
        payoutMintsExtra:
          type: array
          items:
            type: string
          description: >-
            Further payout assets for any paying coin, up to four beyond the
            first; every buyback splits evenly across all of them and holders
            receive each. Same rules per asset as `payoutMint`.
          nullable: true
        payoutMint2:
          type: string
          description: Older form of `payoutMintsExtra` with one asset; still accepted.
          nullable: true
        strategy:
          type: object
          description: >-
            The trading rules: `{ preset, tpTriggerPct, tpSlicePct, rungCount,
            rungMode }`. Take a preset's `config.strategy` from /launch-options,
            or set your own.
          nullable: true
        ownerControls:
          type: boolean
          description: >-
            Creator authority from launch: the creator can steer the coin from
            its page or through /coins/{mint}/authority, every move signed and
            shown to holders. Off unless set; honoured only while the platform
            has creator authority open (see `openToPublic` on
            /coins/{mint}/authority). It is part of the signed words when set.

````