Skip to content

Jupiter-DevRel/rust-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jupiter Exchange API Rust Code Examples

This repository showcases fully‑working Rust scripts that exercise every Jupiter public API:

  • Swap API – quote, build & send transactions (standard or via swap‑instructions)
  • Ultra API – place & execute atomic orders with optional referral fees
  • Trigger API – create & execute on‑chain limit orders
  • Recurring API – create & execute dollar‑cost‑average (DCA) schedules

Our goal is to provide clear, ready‑to‑run code that developers can copy, extend, and integrate into their own Solana apps.


Getting Started

#clone this repository
$ git clone https://github.com/Jupiter-DevRel/rust-examples.git
$ cd rust-examples
#Copy the file from .env.example to .env
$ cp .env-example .env
#Build everything once 
$ cargo build --workspace

Running an example

Each flow lives in its own binary crate under examples/. Invoke them from the workspace root:

# Standard quote → swap flow
cargo run -p swap

# Swap‑instructions flow (quote → swap‑instructions → send)
cargo run -p swap_instruction

# Ultra API order & execute
cargo run -p ultra

# Trigger API create & execute
cargo run -p trigger

# Recurring API create & execute
cargo run -p recurring

Note Trigger and Recurring endpoints enforce minimum order sizes (~5 USDC and 50 USDC respectively). Increase the example amounts or fund your keypair before running those flows.


Documentation & Resources


Powered by the Jupiter DevRel Working Group

These examples are maintained by the Jupiter DevRel WG to help onboard and inspire the next wave of Solana builders. We can’t wait to see what you build – feel free to open issues or PRs!

Happy coding! 🚀


About

Rust Examples of Jupiter Exchange APIs

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages