Skip to content
parchmentdocs
Open app

Gas sponsorship

Parchment can pay the Sui network gas for one-click trades: trades signed by a session key that your wallet registered once as a trading delegate of your account. Nothing else is sponsored.

Sponsorship is available when Parchment enables it.

What is sponsored

Only these delegate trade transactions:

  • open request, close request (including Close All), cancel, emergency close, and closing a position on a retired market.

You always pay your own gas for everything else: creating your account, deposits, withdrawals, turning one-click trading on or off, staking, claims, and any trade your wallet signs directly. Keep a little SUI in your wallet.

The app shows a short reason and lets you send the trade from your wallet, paying the gas yourself, when:

  • sponsorship is off or out of funds,
  • a per-account limit is reached,
  • the trade needs more gas than the sponsor covers,
  • your one-click session has ended.

If another sponsored trade is still in flight, the app retries once and then says one-click is busy. A trade that would fail on chain (for example while paused) is not retried with wallet-paid gas.

The keeper pays the gas for filling your orders, funded by the execution fee.

For developers: the session proof

Request sponsorship with POST /sponsor:

JSON
{
  "sender": "0x<session key address>",
  "txKindBase64": "<base64 BCS TransactionKind from the transaction builder>",
  "senderSignature": "<base64 Ed25519 signature of the session proof>",
  "expiresAtMs": "1761091234567n"
}

The session key signs, as a Sui personal message, the UTF-8 bytes of exactly these five lines joined by \n, with no trailing newline:

Parchment session-key sponsorship v1
sender: <sender>
accountId: <account>
txKindSha256: <sha256>
expiresAtMs: <expiresAtMs>
  • sender and accountId are 0x plus 64 lowercase hex digits. accountId is the Parchment account the trade targets.
  • txKindSha256 is the lowercase hex SHA-256 of the transaction kind bytes (the base64-decoded txKindBase64).
  • expiresAtMs is Unix milliseconds, plain decimal in the message and an n string in the request. It must be in the future and at most 120 seconds ahead of the service's clock.
  • Only Ed25519 signatures are accepted, and the signer's address must be sender. sender must be a live delegate of the account.

The response carries txBytesBase64 and sponsorSignature. Sign txBytesBase64 with the session key and execute it with both signatures.

StatusCodeMeaning
400bad_session_proof_expiryexpiresAtMs is more than 120 seconds ahead
401session_proof_expiredexpiresAtMs has passed: sign a fresh proof
401bad_session_proofNot an Ed25519 signature by sender of this exact message
400gas_budget_exceededThe trade needs more gas than the sponsored ceiling: pay gas from the wallet
403not_delegatesender is not a live delegate of the account: forget the session key, offer to turn one-click on again, pay gas from the wallet
400disallowed_function and other 400sThe transaction is not one of the sponsored trades
400paused, simulation_failedThe trade would fail on chain; do not retry with wallet-paid gas
429in_flight_limit, account_rate_limited, account_failure_limit, account_spend_limitA per-account limit: pay gas from the wallet (in_flight_limit: wait for the pending trade, then retry)
503sponsor_unavailableSponsorship is off or out of funds: pay gas from the wallet