GMX-Solana
Audits
| Program | Last Audit Date | Version |
|---|---|---|
| gmsol-store | 2025-03-07 | 2a66761 |
| gmsol-treasury | 2025-03-07 | 2a66761 |
| gmsol-timelock | 2025-03-07 | 2a66761 |
Integration
Method 1: Using the Rust SDK
Add the following to your Cargo.toml:
[]
= { = "0.5.0", = ["client"] }
Create a Client and start using the core APIs:
use ;
let keypair =
read_keypair_file?;
let market_token: Pubkey = var?.parse?;
let client = new?;
let store = client.find_store_address;
let = client
.market_increase
.build_with_address
.await?;
let signature = txn.send.await?;
Method 2: Using declare_program!
1. Initialize a new Rust project and add dependencies
Create a new Rust project and include anchor_lang and bytemuck as dependencies:
[]
= "0.30.1"
= { = "1.19.0", = ["min_const_generics"] }
2. Download and Store IDLs in {PROJECT_ROOT}/idls/
You can retrieve the IDLs using the anchor CLI or download them directly from the explorer (gmsol-store Program and gmsol-treasury Program).
Once downloaded, move them to the {PROJECT_ROOT}/idls/ directory.
Your project structure should now look like this:
}
3. Declaring Programs in lib.rs
Use declare_program! to register the gmsol-store and gmsol-treasury programs:
use declare_program;
declare_program!;
declare_program!;
4. Build and Open the Documentation
Run the following command to generate and view the documentation:
If the build is successful, it will automatically open the documentation in your default web browser.
5. Example Project
For a working implementation, check out the gmx-solana-programs.
Development
Prerequisites
Commands
To run all tests:
To install the gmsol CLI:
Use the following command to verify the CLI is installed properly:
Troubleshooting
1. Failed to start test-validator on MacOS
Error Message:
Posssible Solution:
Check this comment.