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:
{
"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>senderandaccountIdare0xplus 64 lowercase hex digits.accountIdis the Parchment account the trade targets.txKindSha256is the lowercase hex SHA-256 of the transaction kind bytes (the base64-decodedtxKindBase64).expiresAtMsis Unix milliseconds, plain decimal in the message and annstring 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.sendermust 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.
| Status | Code | Meaning |
|---|---|---|
| 400 | bad_session_proof_expiry | expiresAtMs is more than 120 seconds ahead |
| 401 | session_proof_expired | expiresAtMs has passed: sign a fresh proof |
| 401 | bad_session_proof | Not an Ed25519 signature by sender of this exact message |
| 400 | gas_budget_exceeded | The trade needs more gas than the sponsored ceiling: pay gas from the wallet |
| 403 | not_delegate | sender is not a live delegate of the account: forget the session key, offer to turn one-click on again, pay gas from the wallet |
| 400 | disallowed_function and other 400s | The transaction is not one of the sponsored trades |
| 400 | paused, simulation_failed | The trade would fail on chain; do not retry with wallet-paid gas |
| 429 | in_flight_limit, account_rate_limited, account_failure_limit, account_spend_limit | A per-account limit: pay gas from the wallet (in_flight_limit: wait for the pending trade, then retry) |
| 503 | sponsor_unavailable | Sponsorship is off or out of funds: pay gas from the wallet |