Use Case

Spawned Phantom Tutorial: Complete Integration Guide for Developers

This guide provides developers with a complete technical walkthrough for integrating the Phantom wallet with tokens launched on Spawned. You'll learn how to enable secure wallet connections, handle transactions for the 0.30% creator fee model, and implement features that support ongoing holder rewards. Proper integration ensures your community can easily interact with your token while you maintain sustainable revenue streams.

Try It Now

Key Benefits

Phantom is the dominant wallet for Solana, essential for any token's user experience.
Integration handles the 0.30% creator fee per trade and the unique 0.30% holder reward system.
Step-by-step code examples for connection, signing, and sending transactions.
Post-graduation to Token-2022 requires planning for the perpetual 1% fee structure.
Correct setup prevents user friction and maximizes engagement with your launched token.

Why Phantom Integration Is Non-Negotiable for Solana Tokens

Skipping Phantom integration is like building a store with no front door.

For any token launching on Solana, Phantom wallet support isn't an optional feature—it's a foundational requirement. Phantom holds over 80% market share among Solana wallets, making it the primary gateway for users to hold, trade, and interact with your token. Without seamless Phantom integration, you effectively lock out the majority of your potential holders and traders.

Tokens launched on Spawned have specific financial mechanics that the wallet must handle correctly: a 0.30% fee per trade goes to the creator, and a separate 0.30% is distributed as ongoing rewards to token holders. Phantom must be able to request signatures for these transactions and display accurate fee information to users. Failure here leads to transaction errors, user confusion, and abandoned interactions.

Learn about launching gaming tokens on Solana to see how wallet integration fits into a broader launch strategy.

The User Journey: From Wallet Connect to Trade

Understanding the complete user flow is critical for designing a good integration. When a potential holder arrives at your project's website (potentially built with Spawned's AI builder, saving $29-99/month on web hosting), they should encounter a clear 'Connect Wallet' button. Upon clicking, Phantom's interface appears, requesting connection to your site. After approval, your dApp can read the user's public key and token balances.

The key transaction moment comes when a user decides to buy or sell your token. Your interface must clearly communicate that a 0.30% creator fee will be applied and that 0.30% of the trade value will be contributed to the holder reward pool. Phantom presents the user with a transaction summary to sign. A smooth, informative experience here builds trust and reduces failed transactions.

Post-trade, users should be able to view their updated balance and any accrued rewards directly through your interface or by checking their Phantom wallet. This closed loop—connect, inform, transact, verify—is what drives sustained engagement.

Step-by-Step: Integrating Phantom with Your Spawned Token

A practical, code-focused walkthrough for developers.

Follow these technical steps to integrate Phantom wallet functionality. This assumes you have a basic web frontend for your token project.

1. Install and Set Up the Solana Web3.js Library Your project needs the official @solana/web3.js library and a provider for wallet interactions. Phantom injects a solana object into the window scope of the browser.

2. Detect Phantom Wallet Availability Check if the user has Phantom installed. You cannot assume it's present. Provide clear instructions if it's not detected.

3. Implement the Connection Handler Create a function that calls window.solana.connect(). This triggers the Phantom pop-up. Always handle rejection gracefully—users may cancel the connection request.

4. Fetch the User's Public Key and Token Accounts Once connected, use the provided public key to fetch the user's associated token accounts (ATAs) to see if they already hold your token. This informs your UI (e.g., showing a 'Buy' or 'Sell' option).

5. Construct Transactions with Correct Fees This is the most crucial step. When building a transaction for a token trade, you must account for Spawned's fee model. The transaction should include the correct instructions for the Raydium or Orca pool (where your token will likely be trading) and ensure the 0.30% creator fee is included. The network fee (a tiny amount of SOL) is separate and will also be shown by Phantom.

6. Request Signature and Send Transaction Use window.solana.signAndSendTransaction() to send the built transaction to Phantom for user approval. Always provide visual feedback (loading state, success/error messages).

7. Plan for Token-2022 Post-Graduation If your token graduates from Spawned's launchpad to the independent Token-2022 standard, your integration must adapt to handle the new perpetual 1% fee structure. The transaction construction logic will need updating.

Critical Details: Handling Spawned's Fee Model in Code

The financial mechanics of a Spawned-launched token require precise implementation. Here are the key technical details your integration must address:

  • Creator Fee (0.30%): This fee is automatically taken by the smart contract during a trade on a DEX like Raydium. Your code doesn't 'add' it manually, but your UI must disclose it. The transaction instruction sent to the DEX pool inherently includes it. Failing to mention it is a transparency issue.
  • Holder Reward (0.30%): This is a unique Spawned feature. A portion of every trade is allocated to a reward pool distributed to holders. Your website or dApp should ideally have a section that displays the total reward pool and a user's estimated or claimable share. This is a major engagement tool.
  • Launch Fee & Future Fees: Remember the initial 0.1 SOL (~$20) launch fee on Spawned is a one-time cost. The ongoing 0.30% fees are perpetual. After graduation to Token-2022, the 1% fee applies. Your project's documentation should explain this evolution to holders.
  • Transaction Simulation: Before sending a transaction for signing, use connection.simulateTransaction() to catch errors early and estimate final token amounts after fees. This provides a better user experience than a failed transaction in Phantom.
  • UI Disclosure: Clearly state '0.30% creator fee applies' near trade buttons.
  • Reward Display: Build a widget to show the holder reward pool size and user allocation.
  • Error Handling: Simulate transactions first to prevent Phantom pop-ups for doomed tx.
  • Fee Evolution: Document the shift from 0.30% to 1% fee post-graduation for transparency.

Common Integration Pitfalls and How to Solve Them

Anticipate and fix these issues before your users encounter them.

Pitfall 1: 'Phantom not detected' error for users who have it installed. Solution: Ensure your detection logic waits for the window object to be fully loaded. Sometimes the Phantom injection takes a moment. Use event listeners or a short delay before declaring it absent.

Pitfall 2: Users see an unexpected token amount after trading. Solution: This is almost always due to not displaying the net amount after the 0.30% fee. Always calculate and show the estimated received amount after fees in your UI before the user signs. Use the simulation method mentioned above.

Pitfall 3: Transaction fails with 'Insufficient SOL for fee' even though the user has enough. Solution: Remember there are two fees: the network fee (in SOL) and the creator fee (in the token). The user needs a small amount of SOL (~0.000005 SOL) in addition to the token amount they are trading. Your pre-transaction checks should validate both.

Pitfall 4: Holder rewards aren't updating in your dApp's display. Solution: The reward pool is likely tracked in a separate on-chain account. Your frontend needs to periodically fetch data from this specific account, not just the user's token balance. Implement a polling mechanism or use Solana's WebSocket subscriptions for live updates.

Integrating with other chains like Ethereum or Base involves different wallets (like MetaMask) but similar core principles of fee communication and transaction building.

Going Beyond Connection: Using Phantom for Holder Engagement

Transform a simple wallet check into a dynamic user experience.

A basic connection is just the start. Sophisticated projects use Phantom integration to create deeper engagement loops. Since you can (with permission) see the tokens a user holds, you can create gated experiences. For example, users holding a certain amount of your token could access exclusive content, participate in community votes, or receive special airdrops.

The 0.30% holder reward mechanism is a built-in engagement tool. You can build a dashboard that shows holders how much they've earned from the reward pool over time, turning passive holding into a more active, tracked benefit. This directly supports token price stability by incentivizing holding.

Furthermore, by combining Phantom's connection with Spawned's included AI website builder, you can create a cohesive brand experience. The website can dynamically change elements based on the connecting wallet's status (e.g., 'Welcome, holder!' vs. 'Join our community!'). This level of integration makes your project feel professional and responsive.

Ready to Launch with Proper Phantom Integration?

A flawless wallet experience is the cornerstone of token adoption.

Integrating Phantom correctly is a technical necessity with direct business implications. A smooth integration reduces support overhead, increases successful transaction rates, and fosters trust with your community. It ensures the 0.30% creator fee and holder reward system work as intended, providing you with sustainable revenue and your holders with tangible benefits.

If you're planning a token launch, start with the technical integration outlined here. Ensure your developers understand the Solana transaction model and Spawned's specific fee parameters. A well-executed launch with full Phantom support sets the stage for long-term success, clear communication, and a loyal holder base ready to support your project through its graduation to the Token-2022 standard.

Your next step: Begin development with the Solana Web3.js docs and the Phantom developer guides. Test extensively on Solana devnet before your mainnet launch on Spawned.

Related Topics

Frequently Asked Questions

While Phantom is essential due to its market dominance, supporting additional wallets like Solflare and Backpack is recommended for broader accessibility. However, prioritize Phantom first, as it will handle the vast majority of user interactions. The integration patterns for other Solana wallets are very similar, often using the same Wallet Standard interface.

Use Solana's devnet and a Phantom wallet configured for devnet. You can deploy your token's smart contract logic to devnet and practice the entire connection and transaction flow. Phantom's test version uses fake SOL. This allows you to verify fee calculations, error messages, and the user experience without spending real funds.

The 0.30% allocation to the holder reward pool is managed by Spawned's core smart contract mechanics at the time of the trade on the DEX. You do not code this distribution. However, you are responsible for building a way for holders to see their share of the rewards and potentially claim them, which requires frontend code to interact with the reward pool's on-chain data.

The main change is the fee structure, moving from 0.30% to a perpetual 1% fee. Your user interface must update all disclosures from '0.30% fee' to '1% fee'. The technical transaction construction may also change slightly depending on how the Token-2022 program handles fees. You will need to update your web3.js code to use the Token-2022 program ID and its specific instructions.

Yes. The AI website builder provides a hosting environment where you can embed the JavaScript code for Phantom integration. You can create custom pages for connecting wallets, displaying token metrics, showing the reward pool, and facilitating community interaction. This consolidates your project's presence, saving on separate web hosting costs.

First, verify the transaction simulation on your backend or in your client-side code before sending it to Phantom. Most errors come from incorrect instruction ordering, insufficient lamports for rent or fees, or missing signers. Ensure you are calculating the correct minimum output amounts from the DEX pool after the 0.30% fee is applied.

The core wallet connection process is identical. The difference lies in the financial specifics you must communicate and handle. For a Spawned token, your UI has a responsibility to clearly inform users about the dual 0.30% fees (creator + holder reward). Tokens on other launchpads like pump.fun have a 0% creator fee but lack built-in holder rewards, so your messaging and value proposition will be different.

Ready to get started?

Join thousands of users who are already building with Spawned. Start your project today - no credit card required.