sponsor parameter with the sponsor’s wallet address on a Trade API request. Both the user and sponsor must sign the resulting transaction.
Why Use User-Executed Sponsored Swaps
- Smaller transactions. Eliminates the input transfer to the sponsor and output transfer back to the user, reducing overall transaction size.
- Simpler transaction structure. The user swaps directly from their own token accounts in a single step.
Execution Modes
Execution modes determine who performs the swap.Sponsor Executes (Default)
The sponsor performs the swap on the user’s behalf:- User transfers input tokens to sponsor.
- Sponsor executes the swap using their token accounts.
- Sponsor transfers output tokens to user.
User Executes
The user performs the swap directly using their own token accounts. The sponsor still pays the transaction fee and token account creation costs.Parameters
sponsor
The sponsor’s wallet address. When specified, the sponsor pays the transaction fee and token account creation costs. Cannot be specified alongsidepredictionMarketInitPayer. Base58-encoded.
sponsoredSwap
Set totrue to indicate the swap will be sponsored. This ensures the quote accounts for the correct transaction structure and fees based on the execution mode. Not needed on /order or /swap — those endpoints infer sponsorship from the sponsor parameter.
sponsorExec
Choose who executes the swap in a sponsored transaction.| Value | Executor | Description |
|---|---|---|
true (default) | Sponsor | Sponsor executes the swap using their token accounts |
false | User | User executes the swap using their own token accounts |
GET /order— query parameter, used whensponsoris specified.GET /quote— query parameter, used whensponsoredSwapistrue.POST /swap— request body field, used whensponsoris specified.
Code Examples
GET /order
GET /order
GET /quote
GET /quote
POST /swap
POST /swap
Need Help?
Email Support
Reach out to our team at hello@dflow.net for technical support,
partnership inquiries, or general questions.
Join Our Discord
Connect with other developers, get help, and stay updated on the latest
DFlow developments.
Dev Notifications
Join the DFlow Dev Notifications Telegram group to stay in the loop on
new features and other announcements.