Overview
The GLAM SDK provides built-in integrations with:- Jupiter: Token swaps and limit orders
- Kamino: Lending, borrowing, and liquidity vaults
- Drift: Perpetual futures and spot trading
- Marinade: Liquid staking
- Stake pools: Native staking
Enabling protocol integrations
Before using a protocol, you must enable it in your vault’s access control:Define protocol bitmask
Protocols use bitmasks to represent different operations:
examples/nodejs-app/src/index.ts
Jupiter: Token swaps
Jupiter provides the best swap routes across Solana DEXs.Performing a swap
src/client/jupiter.ts
Using quote parameters
You can also provide quote parameters directly:- Fetches the best quote from Jupiter
- Wraps SOL to wSOL if needed
- Creates output token account if needed
- Validates the swap using on-chain oracles
Kamino: Lending protocol
Kamino is a leading lending and liquidity protocol on Solana.Deposit to lending
src/client/kamino/lending.ts
Withdraw from lending
Borrow assets
Repay borrowed assets
Drift: Perpetual futures
Trade perpetual futures on Drift Protocol.Initialize Drift user
Before trading, initialize a Drift user account:Deposit collateral
Open a position
Marinade: Liquid staking
Stake SOL and receive mSOL, a liquid staking token:Setting protocol policies
You can configure policies for protocol interactions, such as allowlisting transfer destinations:examples/nodejs-app/src/index.ts
Disabling protocols
To revoke access to a protocol:src/client/access.ts
Best practices
- Always enable protocols before attempting to use them
- Use slippage protection on swaps (recommended 0.5-1%)
- Monitor oracle prices for large swaps
- Set protocol policies to restrict unauthorized actions
- Test integrations on devnet before mainnet
- Use appropriate position sizing for leveraged protocols
Next steps
Access control
Manage permissions and delegate access
Managing assets
Learn about deposits and withdrawals