Advanced Usage
Overview
SynthFi is designed to be both intuitive for non-coders and powerful for developers. Once you’re comfortable with the basics, you can begin to:
Modify the generated contracts
Extend the frontend UI
Add new instructions and features
Manually deploy and test contracts
Connect with external Solana programs
This section explores how to go beyond the default flow and tailor SynthFi to your custom use case.
1. Modifying the Anchor Program
SynthFi’s AI output follows standard Anchor framework structure, making it easy to:
Add new instructions (e.g.,
pause
,claim
,distribute
)Create new accounts with
#[account]
Add
#[access_control]
and custom constraintsInsert new logic: APR curves, vesting formulas, role checks, etc.
Example: Add early withdrawal penalty:
rustCopyEditif clock.unix_timestamp < stake_data.unlock_time {
let penalty = amount / 10;
amount -= penalty;
}
2. Custom Prompts for Specialized Logic
Want to build logic beyond staking?
Try prompts like:
“Create a reward pool where only NFT holders can stake an SPL token”
“Build a vault contract with emergency withdraw, but only after a DAO vote”
“Write a token vesting contract with a linear schedule and 3-month cliff”
SynthFi can respond to advanced concepts — and explain what it generates.
3. Working with the Frontend
The frontend is built for extensibility:
Framework
React + Next.js
Wallet
Phantom (Wallet Adapter)
Styling
Tailwind CSS
Contract Connection
@project-serum/anchor
, Solana Web3
You Can:
Add new components (e.g. lock timers, DAO vote status)
Update form flows or approval prompts
Theme the UI for your brand
Export the frontend and self-host
4. Manual Testing & Deployment
Before sending anything to Devnet, you can test:
bashCopyEditanchor test
You can also:
Use localnet with
anchor localnet
Simulate time passing for vesting contracts
Check if signer logic works using test wallets
After testing, run:
bashCopyEditanchor build
anchor deploy
And update your frontend .env
:
envCopyEditNEXT_PUBLIC_PROGRAM_ID=YourProgramID
5. Using External Solana Programs
SynthFi doesn’t limit you to isolated logic, you can integrate with:
SPL Token program (minting, burning)
Metaplex for NFT validation
DAO tools for gated actions
Other Anchor-based programs via CPI
Just request it in your prompt or modify the code manually post-generation.
6. Launchpad Metadata Customization
In the Launchpad, you can extend:
Token metadata (symbol, supply)
Project name and description
Deployment flags (e.g. audit badge, verified template)
Social links and custom tags
Eventually, these will also power project listings and verified deploy dashboards.
7. Saving & Managing Projects (Planned)
Coming features for devs:
Persistent project saving (via wallet signature)
Auto-versioned contract history
Forking and remixing existing contracts
GitHub export + deploy logs
Optional code diffs and audit history
Last updated