internet-court/internet-court-skill / vendored/sendaifun/glam
glam
VerifiedSolana vault management via GLAM Protocol. Triggers: glam, glam-cli, glam-sdk, vault create/manage, tokenized vault, share class, DeFi vault, treasury, asset management, access control, delegate permissions, Jupiter swap, Kamino lending/borrow/vaults/farms, staking (Marinade/native/SPL/Sanctum/LST), cross-chain USDC (CCTP), timelock, subscription/redemption, NAV pricing, token transfer. Supports CLI and TypeScript SDK.
| File | Kind | Size |
|---|---|---|
| LICENSE | other | 11.1 KB |
| SKILL.md | skill md | 7.2 KB |
| docs/troubleshooting.md | markdown | 4.8 KB |
| evaluations.json | config | 10.7 KB |
| examples/EXAMPLES.md | markdown | 10.9 KB |
| resources/cli/advanced.md | markdown | 4.1 KB |
| resources/cli/alt.md | markdown | 1.6 KB |
| resources/cli/delegate.md | markdown | 3.6 KB |
| resources/cli/invest.md | markdown | 1.8 KB |
| resources/cli/jupiter.md | markdown | 2.8 KB |
| resources/cli/kamino-farms.md | markdown | 2.1 KB |
| resources/cli/kamino-lend.md | markdown | 3.4 KB |
| resources/cli/kamino-vaults.md | markdown | 2.3 KB |
| resources/cli/lst.md | markdown | 2.8 KB |
| resources/cli/manage.md | markdown | 2.9 KB |
| resources/cli/staking.md | markdown | 3.8 KB |
| resources/cli/transfer.md | markdown | 1.9 KB |
| resources/cli/vault.md | markdown | 8.0 KB |
| resources/concepts.md | markdown | 6.9 KB |
| resources/sdk/client.md | markdown | 10.3 KB |
| resources/sdk/integrations.md | markdown | 9.7 KB |
| resources/sdk/ix-mapper.md | markdown | 3.9 KB |
| resources/sdk/mint.md | markdown | 2.8 KB |
| resources/sdk/multisig.md | markdown | 3.3 KB |
resources/concepts.md
View on GitHub# Concepts Reference
## Fee Structures
Tokenized vaults support five fee categories:
### Vault Fees (burned from shares)
- **Subscription fee**: Percentage of newly issued shares, burned on subscribe
- **Redemption fee**: Percentage of redeemed shares, burned on redeem
### Manager Fees (claimable by manager)
- **Subscription fee**: Percentage of shares issued, claimable by manager
- **Redemption fee**: Percentage of redemption amount, claimable by manager
- **Management fee**: Time-based fee on AUM, paid in newly issued shares. Formula: `shares_owed = AUM * fee_bps * elapsed_time / (year_in_seconds * 10000)`
- **Performance fee**: Charged on profits above high-water mark (HWM) or hurdle rate. Supports `hard` hurdle (fee only on excess above hurdle) and `soft` hurdle (fee on entire gain once hurdle exceeded)
### Protocol Fees
- **Base fee**: Fixed at 0.2% (20 bps) annually for all tokenized vaults
- **Flow fee**: Percentage of manager subscription/redemption fees, paid in shares
Fee configuration in SDK:
```typescript
feeStructure: {
vault: { subscriptionFeeBps: 10, redemptionFeeBps: 20 },
manager: { subscriptionFeeBps: 10, redemptionFeeBps: 20 },
management: { feeBps: 100 }, // 1% annual
performance: { feeBps: 2000, hurdleRateBps: 500, hurdleType: { hard: {} } },
protocol: { baseFeeBps: 0, flowFeeBps: 0 } // overridden by the program; base fee fixed at 20 bps
}
```
---
## Subscription & Redemption Flows
### Instant Mode
- Shares issued/redeemed in same transaction
- Enabled when notice period AND settlement period both = 0
- Best for highly liquid strategies
### Queued Mode
- Request placed in queue with timestamp
- **Notice period**: Minimum wait before fulfillment eligibility. `hard` = strict wait; `soft` = early fulfillment allowed if liquidity available
- **Settlement period**: Maximum window after notice period for fulfillment
- **Cancellation window**: Duration after submission during which user can cancel (must be <= notice period)
- **Permissionless fulfillment**: If enabled, anyone can fulfill; if disabled, only manager
Flow: Request -> Notice Period -> Settlement Window -> Claim
Configuration in SDK:
```typescript
notifyAndSettle: {
model: { continuous: {} },
permissionlessFulfillment: false,
subscribeNoticePeriodType: { soft: {} },
subscribeNoticePeriod: new BN(0),
subscribeSettlementPeriod: new BN(0),
subscribeCancellationWindow: new BN(0),
redeemNoticePeriodType: { hard: {} },
redeemNoticePeriod: new BN(86400), // 1 day
redeemSettlementPeriod: new BN(86400), // 1 day
redeemCancellationWindow: new BN(3600), // 1 hour
timeUnit: { second: {} }
}
```
---
## NAV & Pricing
### AUM Calculation
AUM = Sum of all token values + sum of all protocol positions (Kamino, staking, etc.)
### NAV (Net Asset Value)
NAV = AUM / Total Share Supply
### Functional Pricing for LSTs
Conversion Rate = Stake Pool SOL Balance / LST Token Supply
Functional Price = SOL Price (USD) x Conversion Rate
Benefits: depeg protection, accurate valuation, reduced manipulation risk.
### Pricing Process
1. Transactions requiring AUM include price instructions for all enabled protocols
2. Price data saved to GLAM State Account's `PricedProtocols` field
3. AUM calculated by summing all valuations
4. Validations ensure fresh oracle data for all vault assets
---
## Program Addresses
### Core Programs
| Program | Mainnet | Staging |
|---------|---------|---------|
| GLAM Protocol | `GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz` | `gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz` |
| GLAM Mint | `GM1NtvvnSXUptTrMCqbogAdZJydZSNv98DoU5AZVLmGh` | `gstgm1M39mhgnvgyScGUDRwNn5kNVSd97hTtyow1Et5` |
| GLAM Config | `gConFzxKL9USmwTdJoeQJvfKmqhJ2CyUaXTyQ8v9TGX` | — |
| GLAM Policies | `po1iCYakK3gHCLbuju4wGzFowTMpAJxkqK1iwUqMonY` | — |
### Integration Programs
| Program | Mainnet | Staging |
|---------|---------|---------|
| CCTP Integration | `G1NTcMDYgNLpDwgnrpSZvoSKQuR9NXG7S3DmtNQCDmrK` | — |
| Kamino Integration | `G1NTkDEUR3pkEqGCKZtmtmVzCUEdYa86pezHkwYbLyde` | `gstgKa2Gq9wf5hM3DFWx1TvUrGYzDYszyFGq3XBY9Uq` |
| SPL Integration | `G1NTsQ36mjPe89HtPYqxKsjY5HmYsDR6CbD2gd2U2pta` | `gstgs9nJgX8PmRHWAAEP9H7xT3ZkaPWSGPYbj3mXdTa` |
| Marinade Integration | — | `G1NTMNMgmgJAWAD9G3toFVMtNcc21dEyHf3fTXc3t74t` |
| Stake Pool Integration | — | `G1NTstCVkEhGVQPnPe6r7yEyRTvnp3ta63AFkEKxqg25` |
---
## Access Control Framework
Three levels of access control:
### 1. Vault-Level
Rules applied uniformly to all signers (e.g., asset allowlist, max slippage).
### 2. Instruction-Level
Individual instructions require authorization. Controlled by delegate permission bitmasks.
### 3. Parameter-Level
Granular restrictions on instruction parameters (e.g., market allowlists, borrowable asset lists).
### Permission Bitmask Table
Protocol names must match exactly when used with `glam-cli integration enable` or `glam-cli delegate grant --protocol`.
| Protocol | Permission | Bitflag |
|----------|-----------|---------|
| **SystemProgram** | WSOL | 0 |
| **SystemProgram** | Transfer | 1 |
| **StakeProgram** (staging) | Stake | 0 |
| **StakeProgram** (staging) | Unstake | 1 |
| **JupiterSwap** | SwapAny / SwapToAny (staging) | 0 |
| **JupiterSwap** | SwapLST | 1 |
| **JupiterSwap** | SwapAllowlisted | 2 |
| **JupiterSwap** | SwapFromAny (staging only) | 3 |
| **GlamMint** | MintTokens | 0 |
| **GlamMint** | BurnTokens | 1 |
| **GlamMint** | ForceTransfer | 2 |
| **GlamMint** | SetTokenAccountState | 3 |
| **GlamMint** | ClaimFees | 4 |
| **GlamMint** | Fulfill | 5 |
| **GlamMint** | EmergencyUpdate | 6 |
| **GlamMint** | CancelRequest | 7 |
| **GlamMint** | ClaimRequest | 8 |
| **KaminoLend** | Init | 0 |
| **KaminoLend** | Deposit | 1 |
| **KaminoLend** | Withdraw | 2 |
| **KaminoLend** | Borrow | 3 |
| **KaminoLend** | Repay | 4 |
| **KaminoVaults** | Deposit | 0 |
| **KaminoVaults** | Withdraw | 1 |
| **KaminoFarms** | Stake | 0 |
| **KaminoFarms** | Unstake | 1 |
| **KaminoFarms** | HarvestReward | 2 |
| **SplToken** | Transfer | 0 |
| **CCTP** | Transfer | 0 |
| **Marinade** (staging) | Stake | 0 |
| **Marinade** (staging) | Unstake | 1 |
| **StakePool** (staging) | DepositSol | 0 |
| **StakePool** (staging) | DepositStake | 1 |
| **StakePool** (staging) | DepositSolAny | 2 |
| **StakePool** (staging) | DepositStakeAny | 3 |
| **StakePool** (staging) | WithdrawSol | 4 |
| **StakePool** (staging) | WithdrawStake | 5 |
| **SanctumSingle** (staging) | DepositSol | 0 |
| **SanctumSingle** (staging) | DepositStake | 1 |
| **SanctumSingle** (staging) | DepositSolAny | 2 |
| **SanctumSingle** (staging) | DepositStakeAny | 3 |
| **SanctumSingle** (staging) | WithdrawSol | 4 |
| **SanctumSingle** (staging) | WithdrawStake | 5 |
| **SanctumMulti** (staging) | DepositSol | 0 |
| **SanctumMulti** (staging) | DepositStake | 1 |
| **SanctumMulti** (staging) | DepositSolAny | 2 |
| **SanctumMulti** (staging) | DepositStakeAny | 3 |
| **SanctumMulti** (staging) | WithdrawSol | 4 |
| **SanctumMulti** (staging) | WithdrawStake | 5 |
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |