Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

developer docs reset using versioning #550

Open
wants to merge 60 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 51 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
2636447
docs version to old
0xYankee-Raccoons Nov 21, 2024
841d413
update
0xYankee-Raccoons Nov 21, 2024
aff0b1c
fix docusaurus config
0xYankee-Raccoons Nov 21, 2024
11e2330
checkpoint: add get started docs
0xYankee-Raccoons Nov 22, 2024
dbcc4bb
checkpoint: add swap api folder and get quote doc
0xYankee-Raccoons Nov 22, 2024
0fc6f33
checkpoint: redo folder order and addd build/send swap transaction docs
0xYankee-Raccoons Nov 22, 2024
ac022df
fix: build swap tx tab item codeblock syntax
0xYankee-Raccoons Nov 24, 2024
a851f96
Merge branch 'main' into developer-version
0xYankee-Raccoons Nov 24, 2024
b310db3
Merge branch 'main' into developer-version
0xYankee-Raccoons Nov 24, 2024
b7868e8
checkpoint: add send swap transaction doc
0xYankee-Raccoons Nov 24, 2024
70e258a
checkpoint: apply custom docs sidebar (bug: applied on all sidebar li…
0xYankee-Raccoons Nov 25, 2024
fd6d117
checkpoint: add add fees to swap doc
0xYankee-Raccoons Nov 26, 2024
92375b7
checkpoint: add payments through swap doc
0xYankee-Raccoons Nov 26, 2024
31f740b
checkpoint: add solana unity sdk doc
0xYankee-Raccoons Nov 27, 2024
8b64a67
checkpoint: add limit order api
0xYankee-Raccoons Nov 27, 2024
10e0782
checkpoint: add price v2 api doc
0xYankee-Raccoons Nov 27, 2024
3c2db48
checkpoint: structure other tools section and add perp api teaser
0xYankee-Raccoons Nov 27, 2024
64f80fd
checkpoint: add terminal overview and walkthrough
0xYankee-Raccoons Nov 27, 2024
643d2bc
checkpoint: structure tool kits category and add wallet kit
0xYankee-Raccoons Nov 28, 2024
34a342c
checkpoint: custom navbar by url path
0xYankee-Raccoons Nov 28, 2024
fb036fb
fix tab titles
0xYankee-Raccoons Nov 28, 2024
5e2fe9a
checkpoint: rework docs mini landing page
0xYankee-Raccoons Nov 28, 2024
0817081
force light theme
0xYankee-Raccoons Nov 29, 2024
531bdef
checkpoint: navbar mobile sidebar
0xYankee-Raccoons Nov 30, 2024
d97ceb4
add links to terminal
0xYankee-Raccoons Nov 30, 2024
452428f
checkpoint: fix docslanding and add more items
0xYankee-Raccoons Nov 30, 2024
86b1232
rename other tools to more
0xYankee-Raccoons Dec 2, 2024
10c87d4
add more to price api and dev basics
0xYankee-Raccoons Dec 2, 2024
58f78e2
checkpoint: add api usage page
0xYankee-Raccoons Dec 2, 2024
e0df7fc
checkpoint: display api reference docs (not updated)
0xYankee-Raccoons Dec 4, 2024
8f23247
fix openapi/api.yaml
0xYankee-Raccoons Dec 4, 2024
c8ad81a
checkpoint: update api docs for quote, swap
0xYankee-Raccoons Dec 5, 2024
70bd669
checkpoint: add forceful redirects for /docs/old/** to /docs
0xYankee-Raccoons Dec 5, 2024
2e79301
remove duplicate redirect
0xYankee-Raccoons Dec 5, 2024
1da0074
checkpoint: fix broken redirects
0xYankee-Raccoons Dec 5, 2024
d43047b
add library versions
0xYankee-Raccoons Dec 5, 2024
2e09989
add api reference to quote and swap
0xYankee-Raccoons Dec 8, 2024
ba7daf8
add spot product to swap section and renamed more to utility
0xYankee-Raccoons Dec 8, 2024
1ddf5bb
checkpoint: add token api guide and api reference
0xYankee-Raccoons Dec 8, 2024
1734f5a
add date to api-usage doc
0xYankee-Raccoons Dec 8, 2024
14977fe
add limit and offset notes to token api doc
0xYankee-Raccoons Dec 8, 2024
997fb8c
correct token api info
0xYankee-Raccoons Dec 9, 2024
58548fc
update redirects
0xYankee-Raccoons Dec 10, 2024
4b30157
fix
0xYankee-Raccoons Dec 10, 2024
126ffa8
checkpoint: add perps program account types doc
0xYankee-Raccoons Dec 11, 2024
d7acd37
attempt fix sidebar linebreak
0xYankee-Raccoons Dec 11, 2024
2349bd5
fix sidebar linebreak
0xYankee-Raccoons Dec 11, 2024
661139b
add position account
0xYankee-Raccoons Dec 11, 2024
4c2f870
add positionrequest doc
0xYankee-Raccoons Dec 11, 2024
42c8186
add pool account
0xYankee-Raccoons Dec 11, 2024
65ab6be
fix all api endpoints to new
0xYankee-Raccoons Dec 13, 2024
77733b0
tiny change
0xYankee-Raccoons Dec 13, 2024
e539f97
tiny change
0xYankee-Raccoons Dec 16, 2024
ef1bdc3
Merge branch 'main' into developer-version
0xYankee-Raccoons Dec 16, 2024
fcadebb
add price api params to openapi
0xYankee-Raccoons Dec 16, 2024
8383a78
Merge remote-tracking branch 'refs/remotes/origin/developer-version' …
0xYankee-Raccoons Dec 16, 2024
8460d79
fix navbar font size
0xYankee-Raccoons Dec 17, 2024
ed6e3a6
add api setup doc
0xYankee-Raccoons Jan 2, 2025
c6f3eb4
fix home nav
0xYankee-Raccoons Jan 2, 2025
f469563
some minor fix
0xYankee-Raccoons Jan 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Moved/1-limit-order-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -525,4 +525,4 @@ The Jupiter Limit Order's project account for the Referral Program is `45ruCyfdR

## Referral

Check out the [referral program](/docs/apis/adding-fees) for Limit Order.
Check out the [referral program](/docs/old//apis/adding-fees) for Limit Order.
2 changes: 1 addition & 1 deletion Moved/2-how-swap-works/2-how-swap-works.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ The Token Ledger caters to a wide range of use cases, which include but are not
- Facilitating the exchange of NFTs for tokens other than SOL.

Read more about the Token Ledger:
https://station.jup.ag/docs/apis/swap-api#using-token-ledger-instruction
https://station.jup.ag/docs/old/apis/swap-api#using-token-ledger-instruction


## Safety Notifications
Expand Down
2 changes: 1 addition & 1 deletion Moved/blog-v1/2023-09-18-dca-out-of-beta/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ So in this scenario, if the **SOL price is within $19-$20**, the DCA will execut

## Expanded Tradable Token Selection

Additionally, we've significantly broadened our range of supported tokens, expanding from the **top 20 traded tokens on Jupiter's list to encompass over 600 tokens**. This expansion is backed by the community-verified [Jupiter Strict Token List](/docs/token-list/token-list-api).
Additionally, we've significantly broadened our range of supported tokens, expanding from the **top 20 traded tokens on Jupiter's list to encompass over 600 tokens**. This expansion is backed by the community-verified [Jupiter Strict Token List](/docs/old/token-list/token-list-api).

![DCAcomment4](DCAcomment4.jpg)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ The Token Ledger caters to a wide range of use cases, which include but are not
- Facilitating the exchange of NFTs for tokens other than SOL.

Read more about the Token Ledger:
https://station.jup.ag/docs/apis/swap-api#using-token-ledger-instruction
https://station.jup.ag/docs/old/apis/swap-api#using-token-ledger-instruction

### Referral Fees Program to Simplify Fee Collection
In our pursuit of making life easier for our partners, we've streamlined the process of charging referral fees with the new referral fees program.
Expand All @@ -109,9 +109,9 @@ The partner journey is now hyper easy - They head over to Jupiter, create a refe

Give our dashboard a spin here: https://referral.jup.ag

Read here on how to add your platform fees to Jupiter Swap : https://station.jup.ag/docs/apis/adding-fees
Read here on how to add your platform fees to Jupiter Swap : https://station.jup.ag/docs/old/apis/adding-fees

More info on Jupiter Referral Program: https://station.jup.ag/docs/additional-topics/referral-program
More info on Jupiter Referral Program: https://station.jup.ag/docs/old/additional-topics/referral-program

![Referral](referral1.jpg)

Expand All @@ -131,7 +131,7 @@ For CPI to work, the transaction will be composed of these instructions:
4. The program then transfers the SOL back to the user.


Read more here: https://station.jup.ag/docs/apis/cpi
Read more here: https://station.jup.ag/docs/old/apis/cpi

The CPI approach is not without its limitations - because of Solana’s transaction limit of 1232 byte size, lookup tables cannot be used within a CPI call, swaps via CPI can fail at runtime since Jupiter routes may involve multiple DEXes in order to reduce price impact. Instead, we recommend taking the “flash-fil” approach to utilizing Jupiter Swap.

Expand All @@ -149,7 +149,7 @@ For Flash Fill to work, the transaction will be composed of these instructions:

This approach entirely bypasses the need for CPI calls, effectively sidestepping the constraints imposed by CPI.

To delve deeper into these two approaches, check out our documentation here: https://station.jup.ag/docs/apis/flash-fill
To delve deeper into these two approaches, check out our documentation here: https://station.jup.ag/docs/old/apis/flash-fill

## Partners Using v6 API
A big shout out to our key early adopters for running our v6 API and helping us improve our stability and features. Check out how they are using Jupiter to power their use cases.
Expand Down Expand Up @@ -194,7 +194,7 @@ ExactOut is particularly useful in scenarios involving the purchase of NFTs, all
The good news is that since the NFT Marketplace has integrated ExactOut into its interface, you can simply purchase the 40 SOL NFT and Jupiter swap would automatically calculate the most optimal amount of BONK required to purchase the 40 SOL NFT. This is achieved in a single click, eliminating the need to leave the site or perform additional calculations, while ensuring that you receive the best possible price through Jupiter.
This is extremely important to Solana as payments are a crucial part of bridging crypto with real-life applications, ultimately contributing to the mainstream adoption of the Solana ecosystem.

Read more about ExactOut here: https://station.jup.ag/docs/apis/payments-api
Read more about ExactOut here: https://station.jup.ag/docs/old/apis/payments-api

### ExactOut Showcase #1 - Sollinked

Expand Down
2 changes: 1 addition & 1 deletion Moved/blog-v2/2023-09-18-dca-out-of-beta/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ So in this scenario, if the **SOL price is within $19-$20**, the DCA will execut

## Expanded Tradable Token Selection

Additionally, we've significantly broadened our range of supported tokens, expanding from the **top 20 traded tokens on Jupiter's list to encompass over 600 tokens**. This expansion is backed by the community-verified [Jupiter Strict Token List](/docs/token-list/token-list-api).
Additionally, we've significantly broadened our range of supported tokens, expanding from the **top 20 traded tokens on Jupiter's list to encompass over 600 tokens**. This expansion is backed by the community-verified [Jupiter Strict Token List](/docs/old//token-list/token-list-api).

![DCAcomment4](DCAcomment4.jpg)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ The Token Ledger caters to a wide range of use cases, which include but are not
- Facilitating the exchange of NFTs for tokens other than SOL.

Read more about the Token Ledger:
https://station.jup.ag/docs/apis/swap-api#using-token-ledger-instruction
https://station.jup.ag/docs/old/apis/swap-api#using-token-ledger-instruction

### Referral Fees Program to Simplify Fee Collection
In our pursuit of making life easier for our partners, we've streamlined the process of charging referral fees with the new referral fees program.
Expand All @@ -109,9 +109,9 @@ The partner journey is now hyper easy - They head over to Jupiter, create a refe

Give our dashboard a spin here: https://referral.jup.ag

Read here on how to add your platform fees to Jupiter Swap : https://station.jup.ag/docs/apis/adding-fees
Read here on how to add your platform fees to Jupiter Swap : https://station.jup.ag/docs/old/apis/adding-fees

More info on Jupiter Referral Program: https://station.jup.ag/docs/additional-topics/referral-program
More info on Jupiter Referral Program: https://station.jup.ag/docs/old/additional-topics/referral-program

![Referral](referral1.jpg)

Expand All @@ -131,7 +131,7 @@ For CPI to work, the transaction will be composed of these instructions:
4. The program then transfers the SOL back to the user.


Read more here: https://station.jup.ag/docs/apis/cpi
Read more here: https://station.jup.ag/docs/old/apis/cpi

The CPI approach is not without its limitations - because of Solana’s transaction limit of 1232 byte size, lookup tables cannot be used within a CPI call, swaps via CPI can fail at runtime since Jupiter routes may involve multiple DEXes in order to reduce price impact. Instead, we recommend taking the “flash-fil” approach to utilizing Jupiter Swap.

Expand All @@ -149,7 +149,7 @@ For Flash Fill to work, the transaction will be composed of these instructions:

This approach entirely bypasses the need for CPI calls, effectively sidestepping the constraints imposed by CPI.

To delve deeper into these two approaches, check out our documentation here: https://station.jup.ag/docs/apis/flash-fill
To delve deeper into these two approaches, check out our documentation here: https://station.jup.ag/docs/old/apis/flash-fill

## Partners Using v6 API
A big shout out to our key early adopters for running our v6 API and helping us improve our stability and features. Check out how they are using Jupiter to power their use cases.
Expand Down Expand Up @@ -194,7 +194,7 @@ ExactOut is particularly useful in scenarios involving the purchase of NFTs, all
The good news is that since the NFT Marketplace has integrated ExactOut into its interface, you can simply purchase the 40 SOL NFT and Jupiter swap would automatically calculate the most optimal amount of BONK required to purchase the 40 SOL NFT. This is achieved in a single click, eliminating the need to leave the site or perform additional calculations, while ensuring that you receive the best possible price through Jupiter.
This is extremely important to Solana as payments are a crucial part of bridging crypto with real-life applications, ultimately contributing to the mainstream adoption of the Solana ecosystem.

Read more about ExactOut here: https://station.jup.ag/docs/apis/payments-api
Read more about ExactOut here: https://station.jup.ag/docs/old//apis/payments-api

### ExactOut Showcase #1 - Sollinked

Expand Down
2 changes: 1 addition & 1 deletion Moved/legacy/2-how-does-jupiter-work.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Jupiter will split your trade into smaller trade sizes. For example, if you want

### Automatically lists new tokens

The number of new tokens being added is increasing at an ever faster pace. Jupiter automatically lists any tokens as long as their have [reached enough liquidity](/docs/get-your-token-onto-jup). This means you can be assured that you'll be able to trade new tokens as they launch on Solana.
The number of new tokens being added is increasing at an ever faster pace. Jupiter automatically lists any tokens as long as their have [reached enough liquidity](/docs/old//get-your-token-onto-jup). This means you can be assured that you'll be able to trade new tokens as they launch on Solana.

### Automatically lists new markets

Expand Down
35 changes: 35 additions & 0 deletions docs/0-api-usage.md
benlvb marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
sidebar_label: "API Usage"
description: "Know how to use Jupiter API to build world class apps."
title: "API Usage"
---

<head>
<title>API Usage</title>
<meta name="twitter:card" content="summary" />
</head>

In 1 December 2024, Jupiter have introduced new hostnames and the usage of our APIs through API keys to facilitate better developer support.

## What's New?

*Last updated: 1 December 2024*
- API will now be served through new hostnames.
- API will now be served through API keys.
- The new service willl comprise of 3 service types.

| Service Types | Description |
| --- | --- |
| Free with no API key | New rate limits, however, will gradually decrease. |
| Paid plan with API key | Fixed rate limits, self served through an API dashboard. |
| Custom with API key | Custom rate limitsk, mainly for partner usage. |

## What's Old?

- Old hostnames will be fully deprecated in the next 6 months on **1 June 2025**.
- Old hostnames during this period will have reduced rate limits to facilitate migration to the new API.

## Help us help you

- If you need have increasing demand and growth in your app, please reach out to us.
- If you need higher rate limits than the free access, please fill up this form.
86 changes: 86 additions & 0 deletions docs/1-get-started.md
0xYankee-Raccoons marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
---
sidebar_label: "Get Started"
description: "Get Started with setting up libraries, connection and local wallet to build with Jupiter API."
title: "Get Started"
---

<head>
<title>Get Started</title>
<meta name="twitter:card" content="summary" />
</head>

To use Jupiter and interact with the Solana network, you need to install the necessary libraries and set up a connection to the network via an RPC endpoint.

:::note about the guide
In this guide, we'll be using the most used library, `web3.js` to get you started. Do note that there are other libraries using Rust instead of Javascript.
:::

## 1. Install required libraries

Running this example requires a minimum of [NodeJS 16](https://nodejs.org/en/). In your command line terminal, install the libraries.

The current documentation walkthrough was developed with
- `"@solana/web3.js": "^1.95.4"`
- `"@coral-xyz/anchor": "^0.30.1"`
- `"@solana/spl-token": "^0.4.9"`
- `"@jup-ag/referral-sdk": "^0.1.7"`

```bash
npm i @solana/web3.js@1
npm i @coral-xyz/anchor
npm i cross-fetch
npm i bs58
```

## 2. Import from libraries

Next, create a new Javascript/Typescript file and import these interfaces and functions.

```jsx
import { Connection, Keypair, VersionedTransaction } from '@solana/web3.js';
import { Wallet } from '@coral-xyz/anchor';
import bs58 from 'bs58';
import fetch from 'cross-fetch';
```

## 3. Set up Connection

Solana provides a [default RPC endpoint](https://solana.com/docs/core/clusters) to get started and in the example code, we will be using that. However, as your application grows, we recommend you to always use your own or provision a 3rd party provider’s RPC endpoint such as [Helius](https://helius.dev/) or [Triton](https://triton.one/).

```jsx
const connection = new Connection('https://api.mainnet-beta.solana.com');
```

## 4. Set up your Wallet

You can paste in your private key for testing purposes but this is not recommended for production applications.

If you want to store your private key in the project directly, you can do it via a `.env` file.

```jsx
// index.js
import dotenv from 'dotenv';

const wallet = new Wallet(Keypair.fromSecretKey(bs58.decode(process.env.PRIVATE_KEY || '')));

console.log(wallet.publicKey.toBase58());
```

```
// .env
PRIVATE_KEY=""
```

If you have [created a wallet via Solana CLI](https://solana.com/docs/intro/installation#solana-cli-basics) and your private key is stored outside of your project, you can do it this way instead.

```jsx
import fs from 'fs';

const privateKeyArray = JSON.parse(fs.readFileSync('/Users/user/.config/solana/id.json', 'utf8').trim());

const wallet = new Wallet(Keypair.fromSecretKey(new Uint8Array(privateKeyArray)));

console.log(wallet.publicKey.toBase58());
```

Now, you are all set up and ready to use one of our product’s APIs and send a transaction to the Solana network!
129 changes: 129 additions & 0 deletions docs/100-swap-api/1-get-quote.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
---
sidebar_label: "Get Quote"
description: "Start using Jupiter Swap API by getting a Quote."
title: "Get Quote"
---

<head>
<title>Get Quote</title>
<meta name="twitter:card" content="summary" />
</head>

:::warning Please use the Swap API at your own discretion.

The Jupiter UI at https://jup.ag/ contains multiple safeguards, warnings and default settings to guide our users to trade safer. Jupiter is not liable for lesses incurred by users on other platforms.

If you need clarification or support, please reach out to us in [Discord](https://discord.gg/jup).
:::

The Quote API enables you to tap into the Jupiter routing engine, which accesses the deep liquidity available within the DEXes of Solana's DeFi ecosystem. In this guide, we will walkthrough how you can get a quote for a specific token pair and other related parameters.

## Let’s Get Started

In this guide, we will be using the Solana web3.js package.

If you have not set up your environment to use the necessary libraries and the connection to the Solana network, please head over to [get started](../1-get-started.md).

:::tip API Reference
To fully utilize the Quote API, check out the [Quote API Reference](/docs/api/quote).
:::

## Quote API

The root URL of the Quote API is as such.

```
https://api.jup.ag/quote
```

The most common trading pair on Solana is SOL and USDC, in order to get a quote for this specific token pair, you need to pass in the required parameters such as:

| Parameters | Description |
| --- | --- |
| inputMint | The pubkey or token mint address e.g. So11111111111111111111111111111111111111112 |
| outputMint | The pubkey or token mint address e.g. EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v |
| amount | The number of **input** tokens before the decimal is applied, also known as the “raw amount” or “integer amount” in lamports for SOL or atomic units for all other tokens. |
| slippageBps | The number of basis points you can tolerate to lose during time of execution. e.g. 1% = 100bps |

## Get Quote

Using the root URL and parameters to pass in, it is as simple as the example code below!

```jsx
const quoteResponse = await (
await fetch(
'https://api.jup.ag/quote/v1?inputMint=So11111111111111111111111111111111111111112&outputMint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount=100000000&slippageBps=50&restrictIntermediateTokens=true'
)
).json();

console.log(JSON.stringify(quoteResponse, null, 2));
```

From the above example, you should see this response.

```json
{
"inputMint": "So11111111111111111111111111111111111111112",
"inAmount": "100000000",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"outAmount": "16198753",
"otherAmountThreshold": "16117760",
"swapMode": "ExactIn",
"slippageBps": 50,
"platformFee": null,
"priceImpactPct": "0",
"routePlan": [
{
"swapInfo": {
"ammKey": "5BKxfWMbmYBAEWvyPZS9esPducUba9GqyMjtLCfbaqyF",
"label": "Meteora DLMM",
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"inAmount": "100000000",
"outAmount": "16198753",
"feeAmount": "24825",
"feeMint": "So11111111111111111111111111111111111111112"
},
"percent": 100
}
],
"contextSlot": 299283763,
"timeTaken": 0.015257836
}
```

:::tip
`outAmount` refers to the best possible output amount based on the route at time of quote, this means that `slippageBps` does not affect.
:::

## What’s Next

Now, you are able to get a quote, next steps is to submit a transaction to execute the swap based on the quote given. Let’s go!

---

## Additional Resources

### Restrict Intermediate Tokens

`restrictIntermediateTokens` can be set to `true` . If your route is routed through random intermediate tokens, it will fail more frequently. With this, we make sure that your route is only routed through highly liquid intermediate tokens to give you the best price and more stable route.

### Legacy Transactions

All Jupiter swaps are using Versioned Transactions and Address Lookup Tables. However, not all wallets support Versioned Transactions yet, so if you detect a wallet that does not support versioned transactions, you will need to set the `asLegacyTransaction` parameter to `true`.

### Adding Fees

By using the Quote API in your app, you can add a fee to charge your users. You can refer to the `platformFeeBps` parameter and to add it, you will need to set up a Referral Account through our Referral Program, read here to get started.

:::note
If you choose to set up platform fees on your app to charge your users, Jupiter will take 2.5% of the fee.
:::

### Direct Routes and Max Accounts

These 2 parameters can be useful for those who are building your own programs or apps. `onlyDirectRoutes` essentially restricts the routing to only go through 1 market; whereas `maxAccounts` can provide you with flexibility to utilize other accounts in your transaction.

:::warning unfavorable trades
Please be aware that using these 2 parameters can often yield unfavorable trades or outcomes.
:::
Loading