build_swap
Build and simulate an unsigned ExactIn swap, without spending funds.
Requires a Bearer API key and its linked wallet, but no data subscription or
credits. Check get_trading_config first. At least one leg must be SOL/WSOL or
USDC; minimum value is $5 unless Unlimited is active. Execution costs 0.5%
plus tips and network fees. Returns id, unsigned transaction_base64, expiry,
expected/minimum output and cost breakdown. Review them, sign locally, then
call submit_swap. Persist request_id; retry the identical intent after a build
timeout. A 409 means conflicting intent; 410 means expired build and requires
an explicit decision to create a new intent. Never silently increase slippage.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Exact input amount in atomic units, encoded as a decimal integer string, at most u64. SOL/WSOL has 9 decimals and USDC 6; resolve other token decimals first. Example: 0.06 SOL is "60000000". | |
| wallet | Yes | Base58 public key of the signing wallet linked to this API-key account. Obtain/link it through onboarding; never pass a private key. | |
| input_mint | Yes | Asset to spend: SOL for native balance, WSOL for SPL wrapped balance, USDC, or a base58 token mint. One leg must resolve to SOL/WSOL/USDC. | |
| request_id | Yes | Client-generated idempotency key, persisted before calling. Reuse with identical arguments after a timeout; changing the intent under this ID returns 409. | |
| output_mint | Yes | Asset to receive using the same aliases or a base58 mint. Must differ from the input after alias resolution; SOL-to-WSOL wrapping alone is unsupported. | |
| slippage_bps | Yes | Explicit signer-approved slippage tolerance. 100 basis points = 1%; 10000 allows 100%. Never silently increase it to fix a failed route. | |
| tip_lamports | No | Total acceleration tip in SOL lamports, separate from platform and network fees. 2000000 lamports = 0.002 SOL; charged only if the signed transaction executes. | |
| max_priority_fee_lamports | No | Cap on the compute-unit priority fee in lamports. Excludes the base network fee, tips, token-account rent and platform fee; 1000000 = 0.001 SOL. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | PumpView swap ID (32 lowercase hex characters), passed as swap_id to status and submit tools. | |
| tips | No | Total tip and transfer destinations for wallet review, in lamports. | |
| error | No | Failure information if present. Preserve the swap ID and inspect status before deciding on any new intent. | |
| status | Yes | Lifecycle state: built, submitted, confirmed, finalized, failed, or expired. A send timeout may leave state uncertain; poll this ID. | |
| receipt | No | Actual execution details from confirmed onward; null before confirmation or while RPC transaction metadata is pending. | |
| signature | No | Solana transaction signature, or null before submission. Not interchangeable with the PumpView swap ID. | |
| expires_at | No | Unsigned build expiry as Unix seconds; not proof that a submitted transaction failed. | |
| request_id | No | Original client-generated idempotency key for this intent. | |
| input_amount | No | Exact input amount as a string of integer atomic units. | |
| platform_fee | No | Fee basis points, mint, recipient account and calculation basis. | |
| transaction_base64 | No | Unsigned Solana v0 transaction for local wallet signing; only returned for a build still in built state. | |
| network_fee_lamports | No | Estimated total network fee for the built message, as an integer string. | |
| minimum_output_amount | No | Slippage-protected output threshold in atomic units to review before signing. | |
| expected_output_amount | No | Quoted output in atomic units; execution may differ within the slippage bound. | |
| last_valid_block_height | No | Last block height accepted by the transaction blockhash. |