# Token Swap

Sick of joining a community, wanting to get involved and not knowing where to start? We've created a button to make buying tokens a one-click step, all right from within Discord.

#### **You can now buy any SPL token with your custodial balance!**

![](https://917199906-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkxYCbkeZEuQAKHFZg0%2Fuploads%2F8zED5pGUCIGnDdpJeVHA%2FWrap%20Capture%20\(17\).png?alt=media\&token=12f58c98-8940-45df-b001-2d3a1e2b7840)

![](https://917199906-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkxYCbkeZEuQAKHFZg0%2Fuploads%2Fi4xSARAP4hPnMjc9CiSc%2FWrap%20Capture%20\(15\).png?alt=media\&token=c537f0b3-7ded-4053-bad8-56571422c858)

![](https://917199906-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkxYCbkeZEuQAKHFZg0%2Fuploads%2F3keqrb9vSmEAAW4qxUXW%2FWrap%20Capture%20\(16\).png?alt=media\&token=57852c20-da45-4323-8139-4d9eed7c5cc5)

The transaction to do the swap takes about 30 seconds and will sometimes fail because of [slippage](https://help.coinbase.com/en/coinbase/trading-and-funding/advanced-trade/slippage).&#x20;

## How it works?

When we receive a request for a token swap, our services request all available liquid markets between SOL and the requested token (USDC, SRM, etc) through [Jupiter Aggregator](https://jup.ag/). Jupiter ranks the market conditions, optimizing for output token exchange rates between decentralized exchanges. We then perform the Swap on behalf of the user and take a 1% fee.

## For server owners

Anyone can add a token to their server with the `/star token-button` command. The command takes a token ticker or mint address. As a warning, token tickers are not unique. If the wrong token shows up for the ticker, then use the token mint address for 100% token certainty.

![](https://917199906-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkxYCbkeZEuQAKHFZg0%2Fuploads%2FhJ0DBvPisPQTop0ZiK53%2FWrap%20Capture%20\(12\).png?alt=media\&token=51baa3b1-4b84-4b8d-98ba-d56d69d4cfc2)

##
