@oobe-protocol-labs/sap-mcp-server 0.9.37 → 0.9.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +14 -0
- package/CHANGELOG.md +85 -0
- package/README.md +3 -3
- package/USER_DOCS/01_HOSTED_REMOTE_MCP.md +1 -1
- package/USER_DOCS/04_CLIENT_CONFIGS.md +3 -3
- package/USER_DOCS/06_DESKTOP_GUI_WIZARD.md +5 -5
- package/dist/config/env.d.ts +51 -0
- package/dist/config/env.d.ts.map +1 -1
- package/dist/config/env.js +32 -2
- package/dist/config/env.js.map +1 -1
- package/dist/core/constants.d.ts +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/logger.js +1 -1
- package/dist/payments/monetization-gate.d.ts +5 -0
- package/dist/payments/monetization-gate.d.ts.map +1 -1
- package/dist/payments/monetization-gate.js +39 -2
- package/dist/payments/monetization-gate.js.map +1 -1
- package/dist/payments/prepaid-credit-store.d.ts +111 -0
- package/dist/payments/prepaid-credit-store.d.ts.map +1 -0
- package/dist/payments/prepaid-credit-store.js +230 -0
- package/dist/payments/prepaid-credit-store.js.map +1 -0
- package/dist/payments/pricing.d.ts.map +1 -1
- package/dist/payments/pricing.js +40 -1
- package/dist/payments/pricing.js.map +1 -1
- package/dist/payments/schema-validation.d.ts +52 -0
- package/dist/payments/schema-validation.d.ts.map +1 -0
- package/dist/payments/schema-validation.js +112 -0
- package/dist/payments/schema-validation.js.map +1 -0
- package/dist/payments/x402-paid-call.d.ts +21 -0
- package/dist/payments/x402-paid-call.d.ts.map +1 -1
- package/dist/payments/x402-paid-call.js +108 -3
- package/dist/payments/x402-paid-call.js.map +1 -1
- package/dist/perps/adrena/adrena-builder-commodity.d.ts +63 -0
- package/dist/perps/adrena/adrena-builder-commodity.d.ts.map +1 -0
- package/dist/perps/adrena/adrena-builder-commodity.js +200 -0
- package/dist/perps/adrena/adrena-builder-commodity.js.map +1 -0
- package/dist/perps/adrena/adrena-builder-core.d.ts +319 -0
- package/dist/perps/adrena/adrena-builder-core.d.ts.map +1 -0
- package/dist/perps/adrena/adrena-builder-core.js +517 -0
- package/dist/perps/adrena/adrena-builder-core.js.map +1 -0
- package/dist/perps/adrena/adrena-builder-liquidity.d.ts +50 -0
- package/dist/perps/adrena/adrena-builder-liquidity.d.ts.map +1 -0
- package/dist/perps/adrena/adrena-builder-liquidity.js +196 -0
- package/dist/perps/adrena/adrena-builder-liquidity.js.map +1 -0
- package/dist/perps/adrena/adrena-builder-staking.d.ts +57 -0
- package/dist/perps/adrena/adrena-builder-staking.d.ts.map +1 -0
- package/dist/perps/adrena/adrena-builder-staking.js +368 -0
- package/dist/perps/adrena/adrena-builder-staking.js.map +1 -0
- package/dist/perps/adrena/adrena-builder-trading.d.ts +160 -0
- package/dist/perps/adrena/adrena-builder-trading.d.ts.map +1 -0
- package/dist/perps/adrena/adrena-builder-trading.js +835 -0
- package/dist/perps/adrena/adrena-builder-trading.js.map +1 -0
- package/dist/perps/adrena/adrena-builder.d.ts +22 -0
- package/dist/perps/adrena/adrena-builder.d.ts.map +1 -0
- package/dist/perps/adrena/adrena-builder.js +22 -0
- package/dist/perps/adrena/adrena-builder.js.map +1 -0
- package/dist/perps/adrena/adrena-constants.d.ts +163 -0
- package/dist/perps/adrena/adrena-constants.d.ts.map +1 -0
- package/dist/perps/adrena/adrena-constants.js +122 -0
- package/dist/perps/adrena/adrena-constants.js.map +1 -0
- package/dist/perps/adrena/adrena-data-api.d.ts +180 -0
- package/dist/perps/adrena/adrena-data-api.d.ts.map +1 -0
- package/dist/perps/adrena/adrena-data-api.js +169 -0
- package/dist/perps/adrena/adrena-data-api.js.map +1 -0
- package/dist/perps/adrena/adrena-idl.d.ts +15084 -0
- package/dist/perps/adrena/adrena-idl.d.ts.map +1 -0
- package/dist/perps/adrena/adrena-idl.js +29903 -0
- package/dist/perps/adrena/adrena-idl.js.map +1 -0
- package/dist/perps/adrena/adrena-pda.d.ts +147 -0
- package/dist/perps/adrena/adrena-pda.d.ts.map +1 -0
- package/dist/perps/adrena/adrena-pda.js +211 -0
- package/dist/perps/adrena/adrena-pda.js.map +1 -0
- package/dist/perps/adrena/index.d.ts +12 -0
- package/dist/perps/adrena/index.d.ts.map +1 -0
- package/dist/perps/adrena/index.js +12 -0
- package/dist/perps/adrena/index.js.map +1 -0
- package/dist/perps/chart-indicators.d.ts +27 -0
- package/dist/perps/chart-indicators.d.ts.map +1 -0
- package/dist/perps/chart-indicators.js +345 -0
- package/dist/perps/chart-indicators.js.map +1 -0
- package/dist/perps/chart-tools.d.ts +45 -0
- package/dist/perps/chart-tools.d.ts.map +1 -0
- package/dist/perps/chart-tools.js +341 -0
- package/dist/perps/chart-tools.js.map +1 -0
- package/dist/perps/perp-analytics-tools.d.ts +20 -0
- package/dist/perps/perp-analytics-tools.d.ts.map +1 -0
- package/dist/perps/perp-analytics-tools.js +868 -0
- package/dist/perps/perp-analytics-tools.js.map +1 -0
- package/dist/perps/perp-constants.d.ts +362 -0
- package/dist/perps/perp-constants.d.ts.map +1 -0
- package/dist/perps/perp-constants.js +210 -0
- package/dist/perps/perp-constants.js.map +1 -0
- package/dist/perps/perp-decoders.d.ts +47 -0
- package/dist/perps/perp-decoders.d.ts.map +1 -0
- package/dist/perps/perp-decoders.js +332 -0
- package/dist/perps/perp-decoders.js.map +1 -0
- package/dist/policy/policy-engine.d.ts +42 -0
- package/dist/policy/policy-engine.d.ts.map +1 -1
- package/dist/policy/policy-engine.js +43 -0
- package/dist/policy/policy-engine.js.map +1 -1
- package/dist/premium/activation-manager.d.ts.map +1 -1
- package/dist/premium/activation-manager.js +20 -2
- package/dist/premium/activation-manager.js.map +1 -1
- package/dist/prompts/context/sap-agent-context.prompt.js +15 -1
- package/dist/prompts/context/sap-agent-context.prompt.js.map +1 -1
- package/dist/server/server-metadata.d.ts +15 -0
- package/dist/server/server-metadata.d.ts.map +1 -1
- package/dist/server/server-metadata.js +16 -1
- package/dist/server/server-metadata.js.map +1 -1
- package/dist/solana/ata-utils.d.ts +39 -0
- package/dist/solana/ata-utils.d.ts.map +1 -0
- package/dist/solana/ata-utils.js +49 -0
- package/dist/solana/ata-utils.js.map +1 -0
- package/dist/strategies/trade-journal.d.ts +78 -0
- package/dist/strategies/trade-journal.d.ts.map +1 -0
- package/dist/strategies/trade-journal.js +92 -0
- package/dist/strategies/trade-journal.js.map +1 -0
- package/dist/tools/adrena/adrena-commodity-tools.d.ts +15 -0
- package/dist/tools/adrena/adrena-commodity-tools.d.ts.map +1 -0
- package/dist/tools/adrena/adrena-commodity-tools.js +137 -0
- package/dist/tools/adrena/adrena-commodity-tools.js.map +1 -0
- package/dist/tools/adrena/adrena-data-tools.d.ts +23 -0
- package/dist/tools/adrena/adrena-data-tools.d.ts.map +1 -0
- package/dist/tools/adrena/adrena-data-tools.js +437 -0
- package/dist/tools/adrena/adrena-data-tools.js.map +1 -0
- package/dist/tools/adrena/adrena-helpers.d.ts +46 -0
- package/dist/tools/adrena/adrena-helpers.d.ts.map +1 -0
- package/dist/tools/adrena/adrena-helpers.js +41 -0
- package/dist/tools/adrena/adrena-helpers.js.map +1 -0
- package/dist/tools/adrena/adrena-index.d.ts +20 -0
- package/dist/tools/adrena/adrena-index.d.ts.map +1 -0
- package/dist/tools/adrena/adrena-index.js +75 -0
- package/dist/tools/adrena/adrena-index.js.map +1 -0
- package/dist/tools/adrena/adrena-limit-order-tools.d.ts +22 -0
- package/dist/tools/adrena/adrena-limit-order-tools.d.ts.map +1 -0
- package/dist/tools/adrena/adrena-limit-order-tools.js +91 -0
- package/dist/tools/adrena/adrena-limit-order-tools.js.map +1 -0
- package/dist/tools/adrena/adrena-liquidity-tools.d.ts +15 -0
- package/dist/tools/adrena/adrena-liquidity-tools.d.ts.map +1 -0
- package/dist/tools/adrena/adrena-liquidity-tools.js +108 -0
- package/dist/tools/adrena/adrena-liquidity-tools.js.map +1 -0
- package/dist/tools/adrena/adrena-snapshot-tools.d.ts +42 -0
- package/dist/tools/adrena/adrena-snapshot-tools.d.ts.map +1 -0
- package/dist/tools/adrena/adrena-snapshot-tools.js +124 -0
- package/dist/tools/adrena/adrena-snapshot-tools.js.map +1 -0
- package/dist/tools/adrena/adrena-staking-tools.d.ts +15 -0
- package/dist/tools/adrena/adrena-staking-tools.d.ts.map +1 -0
- package/dist/tools/adrena/adrena-staking-tools.js +139 -0
- package/dist/tools/adrena/adrena-staking-tools.js.map +1 -0
- package/dist/tools/adrena/adrena-trading-tools.d.ts +78 -0
- package/dist/tools/adrena/adrena-trading-tools.d.ts.map +1 -0
- package/dist/tools/adrena/adrena-trading-tools.js +556 -0
- package/dist/tools/adrena/adrena-trading-tools.js.map +1 -0
- package/dist/tools/adrena-tools.d.ts +2 -0
- package/dist/tools/adrena-tools.d.ts.map +1 -0
- package/dist/tools/adrena-tools.js +2 -0
- package/dist/tools/adrena-tools.js.map +1 -0
- package/dist/tools/client-sdk-tools.d.ts +8 -0
- package/dist/tools/client-sdk-tools.d.ts.map +1 -1
- package/dist/tools/client-sdk-tools.js +32 -7
- package/dist/tools/client-sdk-tools.js.map +1 -1
- package/dist/tools/memory-tools.d.ts.map +1 -1
- package/dist/tools/memory-tools.js +170 -0
- package/dist/tools/memory-tools.js.map +1 -1
- package/dist/tools/perp-tools.d.ts +6 -31
- package/dist/tools/perp-tools.d.ts.map +1 -1
- package/dist/tools/perp-tools.js +6 -1141
- package/dist/tools/perp-tools.js.map +1 -1
- package/dist/tools/premium-tools.d.ts.map +1 -1
- package/dist/tools/premium-tools.js +123 -5
- package/dist/tools/premium-tools.js.map +1 -1
- package/dist/tools/quick-context-tool.js +1 -0
- package/dist/tools/quick-context-tool.js.map +1 -1
- package/dist/tools/register-tools.d.ts.map +1 -1
- package/dist/tools/register-tools.js +4 -0
- package/dist/tools/register-tools.js.map +1 -1
- package/dist/tools/transaction-tools.d.ts +21 -1
- package/dist/tools/transaction-tools.d.ts.map +1 -1
- package/dist/tools/transaction-tools.js +114 -30
- package/dist/tools/transaction-tools.js.map +1 -1
- package/dist/tools/x402-paid-call-tool.d.ts.map +1 -1
- package/dist/tools/x402-paid-call-tool.js +288 -0
- package/dist/tools/x402-paid-call-tool.js.map +1 -1
- package/docs/07_ENDPOINTS_AND_CLIENTS.md +1 -1
- package/docs/10_OPERATIONS_RELEASE_AND_PM2.md +54 -6
- package/docs/14_DESKTOP_WIZARD_RELEASE.md +3 -3
- package/docs/BRANCH_AND_CI.md +2 -2
- package/package.json +3 -2
- package/server.json +3 -3
- package/skills/sap-defi/SKILL.md +93 -22
- package/skills/sap-mcp/TOOL_REFERENCE.md +39 -4
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name perps/adrena/adrena-pda
|
|
3
|
+
* @description PDA derivation helpers for the Adrena protocol on Solana.
|
|
4
|
+
*
|
|
5
|
+
* All PDAs are derived from the official Adrena release/39 ABI layout using
|
|
6
|
+
* `@solana/web3.js` `PublicKey.findProgramAddressSync`.
|
|
7
|
+
*
|
|
8
|
+
* @module perps/adrena/adrena-pda
|
|
9
|
+
*/
|
|
10
|
+
import { PublicKey } from '@solana/web3.js';
|
|
11
|
+
/**
|
|
12
|
+
* Derive the Cortex PDA: [Buffer.from("cortex")].
|
|
13
|
+
* @returns Cortex public key.
|
|
14
|
+
*/
|
|
15
|
+
export declare function deriveCortexPda(): PublicKey;
|
|
16
|
+
/**
|
|
17
|
+
* Derive a Pool PDA from a pool address: [Buffer.from("pool"), poolAddress].
|
|
18
|
+
* Note: Adrena pools are existing accounts, not PDAs in most instructions.
|
|
19
|
+
* The Pool PDA is used for named pools where the seed is the pool name.
|
|
20
|
+
* @param poolName — Pool name bytes (e.g. "main-pool").
|
|
21
|
+
* @returns Pool PDA public key.
|
|
22
|
+
*/
|
|
23
|
+
export declare function derivePoolPdaFromName(poolName: string): PublicKey;
|
|
24
|
+
/**
|
|
25
|
+
* Derive a Custody PDA: [Buffer.from("custody"), pool, seed].
|
|
26
|
+
* @param pool — Pool public key.
|
|
27
|
+
* @param seed — Custody seed (u32 little-endian, 4 bytes).
|
|
28
|
+
* @returns Custody PDA public key.
|
|
29
|
+
*/
|
|
30
|
+
export declare function deriveCustodyPda(pool: PublicKey, seed: Buffer): PublicKey;
|
|
31
|
+
/**
|
|
32
|
+
* Derive a custody token account PDA: [Buffer.from("custody_token_account"), custody].
|
|
33
|
+
* @param custody — Custody public key.
|
|
34
|
+
* @returns Custody token account public key.
|
|
35
|
+
*/
|
|
36
|
+
export declare function deriveCustodyTokenAccountPda(custody: PublicKey): PublicKey;
|
|
37
|
+
/**
|
|
38
|
+
* Derive the Oracle PDA: [Buffer.from("oracle")].
|
|
39
|
+
* @returns Oracle public key.
|
|
40
|
+
*/
|
|
41
|
+
export declare function deriveOraclePda(): PublicKey;
|
|
42
|
+
/**
|
|
43
|
+
* Derive the transfer authority PDA: [Buffer.from("transfer_authority")].
|
|
44
|
+
* @returns Transfer authority public key.
|
|
45
|
+
*/
|
|
46
|
+
export declare function deriveTransferAuthorityPda(): PublicKey;
|
|
47
|
+
/**
|
|
48
|
+
* Derive a user profile PDA: [Buffer.from("user_profile"), owner].
|
|
49
|
+
* @param owner — Owner wallet public key.
|
|
50
|
+
* @returns User profile PDA public key.
|
|
51
|
+
*/
|
|
52
|
+
export declare function deriveUserProfilePda(owner: PublicKey): PublicKey;
|
|
53
|
+
/**
|
|
54
|
+
* Derive a Position PDA: [Buffer.from("position"), owner, pool, custody, side_byte].
|
|
55
|
+
* Side enum: Long = 1, Short = 2 (NOT 0/1 — see Adrena types.rs Side enum).
|
|
56
|
+
* @param owner — Owner wallet public key.
|
|
57
|
+
* @param pool — Pool public key.
|
|
58
|
+
* @param custody — Custody (principal) public key.
|
|
59
|
+
* @param side — Position side: 'long' | 'short'.
|
|
60
|
+
* @returns Position PDA public key.
|
|
61
|
+
*/
|
|
62
|
+
export declare function derivePositionPda(owner: PublicKey, pool: PublicKey, custody: PublicKey, side: 'long' | 'short'): PublicKey;
|
|
63
|
+
/**
|
|
64
|
+
* Derive a limit order book PDA: [Buffer.from("limit_order_book"), owner, pool].
|
|
65
|
+
* @param owner — Owner wallet public key.
|
|
66
|
+
* @param pool — Pool public key.
|
|
67
|
+
* @returns Limit order book PDA public key.
|
|
68
|
+
*/
|
|
69
|
+
export declare function deriveLimitOrderBookPda(owner: PublicKey, pool: PublicKey): PublicKey;
|
|
70
|
+
/**
|
|
71
|
+
* Derive a collateral escrow PDA: [Buffer.from("escrow_account"), owner, pool, collateralCustody].
|
|
72
|
+
* @param owner — Owner wallet public key.
|
|
73
|
+
* @param pool — Pool public key.
|
|
74
|
+
* @param collateralCustody — Collateral custody public key.
|
|
75
|
+
* @returns Collateral escrow PDA public key.
|
|
76
|
+
*/
|
|
77
|
+
export declare function deriveCollateralEscrowPda(owner: PublicKey, pool: PublicKey, collateralCustody: PublicKey): PublicKey;
|
|
78
|
+
/**
|
|
79
|
+
* Derive LP token mint PDA: [Buffer.from("lp_token_mint"), pool].
|
|
80
|
+
* @param pool — Pool public key.
|
|
81
|
+
* @returns LP token mint PDA public key.
|
|
82
|
+
*/
|
|
83
|
+
export declare function deriveLpTokenMintPda(pool: PublicKey): PublicKey;
|
|
84
|
+
/**
|
|
85
|
+
* Derive staking PDA: [Buffer.from("staking"), stakingSeed].
|
|
86
|
+
* The staking seed is the LP token mint for LP staking, or the governance token mint for ADX staking.
|
|
87
|
+
* @param stakingSeed — Staking seed public key (e.g. LP token mint).
|
|
88
|
+
* @returns Staking PDA public key.
|
|
89
|
+
*/
|
|
90
|
+
export declare function deriveStakingPda(stakingSeed: PublicKey): PublicKey;
|
|
91
|
+
/**
|
|
92
|
+
* Derive user staking PDA: [Buffer.from("user_staking"), owner, staking].
|
|
93
|
+
* @param owner — Owner wallet public key.
|
|
94
|
+
* @param staking — Staking PDA public key.
|
|
95
|
+
* @returns User staking PDA public key.
|
|
96
|
+
*/
|
|
97
|
+
export declare function deriveUserStakingPda(owner: PublicKey, staking: PublicKey): PublicKey;
|
|
98
|
+
/**
|
|
99
|
+
* Derive genesis lock PDA: [Buffer.from("genesis_lock"), pool].
|
|
100
|
+
* @param pool — Pool public key.
|
|
101
|
+
* @returns Genesis lock PDA public key.
|
|
102
|
+
*/
|
|
103
|
+
export declare function deriveGenesisLockPda(pool: PublicKey): PublicKey;
|
|
104
|
+
/**
|
|
105
|
+
* Derive LM token treasury PDA: [Buffer.from("lm_token_treasury"), cortex].
|
|
106
|
+
* @param cortex — Cortex PDA public key.
|
|
107
|
+
* @returns LM token treasury PDA public key.
|
|
108
|
+
*/
|
|
109
|
+
export declare function deriveLmTokenTreasuryPda(cortex: PublicKey): PublicKey;
|
|
110
|
+
/**
|
|
111
|
+
* Derive LM token mint PDA: [Buffer.from("lm_token_mint")].
|
|
112
|
+
* @returns LM token mint PDA public key.
|
|
113
|
+
*/
|
|
114
|
+
export declare function deriveLmTokenMintPda(): PublicKey;
|
|
115
|
+
/**
|
|
116
|
+
* Derive governance token mint PDA: [Buffer.from("governance_token_mint")].
|
|
117
|
+
* @returns Governance token mint PDA public key.
|
|
118
|
+
*/
|
|
119
|
+
export declare function deriveGovernanceTokenMintPda(): PublicKey;
|
|
120
|
+
/**
|
|
121
|
+
* Derive staking staked token vault PDA: [Buffer.from("staking_staked_token_vault"), staking].
|
|
122
|
+
* @param staking — Staking PDA public key.
|
|
123
|
+
* @returns Staking staked token vault PDA public key.
|
|
124
|
+
*/
|
|
125
|
+
export declare function deriveStakingStakedTokenVaultPda(staking: PublicKey): PublicKey;
|
|
126
|
+
/**
|
|
127
|
+
* Derive staking reward token vault PDA: [Buffer.from("staking_reward_token_vault"), staking].
|
|
128
|
+
* @param staking — Staking PDA public key.
|
|
129
|
+
* @returns Staking reward token vault PDA public key.
|
|
130
|
+
*/
|
|
131
|
+
export declare function deriveStakingRewardTokenVaultPda(staking: PublicKey): PublicKey;
|
|
132
|
+
/**
|
|
133
|
+
* Derive staking LM reward token vault PDA: [Buffer.from("staking_lm_reward_token_vault"), staking].
|
|
134
|
+
* @param staking — Staking PDA public key.
|
|
135
|
+
* @returns Staking LM reward token vault PDA public key.
|
|
136
|
+
*/
|
|
137
|
+
export declare function deriveStakingLmRewardTokenVaultPda(staking: PublicKey): PublicKey;
|
|
138
|
+
/**
|
|
139
|
+
* Derive the associated token account address for a wallet and mint.
|
|
140
|
+
* Re-exported from the shared `solana/ata-utils` module for backward compat.
|
|
141
|
+
* New code should import from `solana/ata-utils.ts` directly.
|
|
142
|
+
* @param owner — Wallet public key.
|
|
143
|
+
* @param mint — Token mint public key.
|
|
144
|
+
* @returns ATA public key.
|
|
145
|
+
*/
|
|
146
|
+
export { deriveAtaAddress as deriveAta } from '../../solana/ata-utils.js';
|
|
147
|
+
//# sourceMappingURL=adrena-pda.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adrena-pda.d.ts","sourceRoot":"","sources":["../../../src/perps/adrena/adrena-pda.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AA2B5C;;;GAGG;AACH,wBAAgB,eAAe,IAAI,SAAS,CAG3C;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAGjE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,CAGzE;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,SAAS,GAAG,SAAS,CAG1E;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,SAAS,CAG3C;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,IAAI,SAAS,CAGtD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,CAGhE;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,SAAS,EACf,OAAO,EAAE,SAA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
* @description PDA derivation helpers for the Adrena protocol on Solana.
|
|
4
|
+
*
|
|
5
|
+
* All PDAs are derived from the official Adrena release/39 ABI layout using
|
|
6
|
+
* `@solana/web3.js` `PublicKey.findProgramAddressSync`.
|
|
7
|
+
*
|
|
8
|
+
* @module perps/adrena/adrena-pda
|
|
9
|
+
*/
|
|
10
|
+
import { PublicKey } from '@solana/web3.js';
|
|
11
|
+
import { ADRENA_PROGRAM_ID, CORTEX_SEED, POOL_SEED, CUSTODY_SEED, CUSTODY_TOKEN_ACCOUNT_SEED, ORACLE_SEED, TRANSFER_AUTHORITY_SEED, USER_PROFILE_SEED, LIMIT_ORDER_BOOK_SEED, ESCROW_ACCOUNT_SEED, LP_TOKEN_MINT_SEED, STAKING_SEED, USER_STAKING_SEED, GENESIS_LOCK_SEED, LM_TOKEN_TREASURY_SEED, LM_TOKEN_MINT_SEED, GOVERNANCE_TOKEN_MINT_SEED, STAKING_STAKED_TOKEN_VAULT_SEED, STAKING_REWARD_TOKEN_VAULT_SEED, STAKING_LM_REWARD_TOKEN_VAULT_SEED, } from './adrena-constants.js';
|
|
12
|
+
/** Adrena program public key. */
|
|
13
|
+
const PROGRAM = new PublicKey(ADRENA_PROGRAM_ID);
|
|
14
|
+
/**
|
|
15
|
+
* Derive the Cortex PDA: [Buffer.from("cortex")].
|
|
16
|
+
* @returns Cortex public key.
|
|
17
|
+
*/
|
|
18
|
+
export function deriveCortexPda() {
|
|
19
|
+
const [pda] = PublicKey.findProgramAddressSync([CORTEX_SEED], PROGRAM);
|
|
20
|
+
return pda;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Derive a Pool PDA from a pool address: [Buffer.from("pool"), poolAddress].
|
|
24
|
+
* Note: Adrena pools are existing accounts, not PDAs in most instructions.
|
|
25
|
+
* The Pool PDA is used for named pools where the seed is the pool name.
|
|
26
|
+
* @param poolName — Pool name bytes (e.g. "main-pool").
|
|
27
|
+
* @returns Pool PDA public key.
|
|
28
|
+
*/
|
|
29
|
+
export function derivePoolPdaFromName(poolName) {
|
|
30
|
+
const [pda] = PublicKey.findProgramAddressSync([POOL_SEED, Buffer.from(poolName, 'utf8')], PROGRAM);
|
|
31
|
+
return pda;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Derive a Custody PDA: [Buffer.from("custody"), pool, seed].
|
|
35
|
+
* @param pool — Pool public key.
|
|
36
|
+
* @param seed — Custody seed (u32 little-endian, 4 bytes).
|
|
37
|
+
* @returns Custody PDA public key.
|
|
38
|
+
*/
|
|
39
|
+
export function deriveCustodyPda(pool, seed) {
|
|
40
|
+
const [pda] = PublicKey.findProgramAddressSync([CUSTODY_SEED, pool.toBuffer(), seed], PROGRAM);
|
|
41
|
+
return pda;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Derive a custody token account PDA: [Buffer.from("custody_token_account"), custody].
|
|
45
|
+
* @param custody — Custody public key.
|
|
46
|
+
* @returns Custody token account public key.
|
|
47
|
+
*/
|
|
48
|
+
export function deriveCustodyTokenAccountPda(custody) {
|
|
49
|
+
const [pda] = PublicKey.findProgramAddressSync([CUSTODY_TOKEN_ACCOUNT_SEED, custody.toBuffer()], PROGRAM);
|
|
50
|
+
return pda;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Derive the Oracle PDA: [Buffer.from("oracle")].
|
|
54
|
+
* @returns Oracle public key.
|
|
55
|
+
*/
|
|
56
|
+
export function deriveOraclePda() {
|
|
57
|
+
const [pda] = PublicKey.findProgramAddressSync([ORACLE_SEED], PROGRAM);
|
|
58
|
+
return pda;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Derive the transfer authority PDA: [Buffer.from("transfer_authority")].
|
|
62
|
+
* @returns Transfer authority public key.
|
|
63
|
+
*/
|
|
64
|
+
export function deriveTransferAuthorityPda() {
|
|
65
|
+
const [pda] = PublicKey.findProgramAddressSync([TRANSFER_AUTHORITY_SEED], PROGRAM);
|
|
66
|
+
return pda;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Derive a user profile PDA: [Buffer.from("user_profile"), owner].
|
|
70
|
+
* @param owner — Owner wallet public key.
|
|
71
|
+
* @returns User profile PDA public key.
|
|
72
|
+
*/
|
|
73
|
+
export function deriveUserProfilePda(owner) {
|
|
74
|
+
const [pda] = PublicKey.findProgramAddressSync([USER_PROFILE_SEED, owner.toBuffer()], PROGRAM);
|
|
75
|
+
return pda;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Derive a Position PDA: [Buffer.from("position"), owner, pool, custody, side_byte].
|
|
79
|
+
* Side enum: Long = 1, Short = 2 (NOT 0/1 — see Adrena types.rs Side enum).
|
|
80
|
+
* @param owner — Owner wallet public key.
|
|
81
|
+
* @param pool — Pool public key.
|
|
82
|
+
* @param custody — Custody (principal) public key.
|
|
83
|
+
* @param side — Position side: 'long' | 'short'.
|
|
84
|
+
* @returns Position PDA public key.
|
|
85
|
+
*/
|
|
86
|
+
export function derivePositionPda(owner, pool, custody, side) {
|
|
87
|
+
const sideByte = Buffer.from([side === 'long' ? 1 : 2]);
|
|
88
|
+
const [pda] = PublicKey.findProgramAddressSync([Buffer.from('position', 'ascii'), owner.toBuffer(), pool.toBuffer(), custody.toBuffer(), sideByte], PROGRAM);
|
|
89
|
+
return pda;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Derive a limit order book PDA: [Buffer.from("limit_order_book"), owner, pool].
|
|
93
|
+
* @param owner — Owner wallet public key.
|
|
94
|
+
* @param pool — Pool public key.
|
|
95
|
+
* @returns Limit order book PDA public key.
|
|
96
|
+
*/
|
|
97
|
+
export function deriveLimitOrderBookPda(owner, pool) {
|
|
98
|
+
const [pda] = PublicKey.findProgramAddressSync([LIMIT_ORDER_BOOK_SEED, owner.toBuffer(), pool.toBuffer()], PROGRAM);
|
|
99
|
+
return pda;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Derive a collateral escrow PDA: [Buffer.from("escrow_account"), owner, pool, collateralCustody].
|
|
103
|
+
* @param owner — Owner wallet public key.
|
|
104
|
+
* @param pool — Pool public key.
|
|
105
|
+
* @param collateralCustody — Collateral custody public key.
|
|
106
|
+
* @returns Collateral escrow PDA public key.
|
|
107
|
+
*/
|
|
108
|
+
export function deriveCollateralEscrowPda(owner, pool, collateralCustody) {
|
|
109
|
+
const [pda] = PublicKey.findProgramAddressSync([ESCROW_ACCOUNT_SEED, owner.toBuffer(), pool.toBuffer(), collateralCustody.toBuffer()], PROGRAM);
|
|
110
|
+
return pda;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Derive LP token mint PDA: [Buffer.from("lp_token_mint"), pool].
|
|
114
|
+
* @param pool — Pool public key.
|
|
115
|
+
* @returns LP token mint PDA public key.
|
|
116
|
+
*/
|
|
117
|
+
export function deriveLpTokenMintPda(pool) {
|
|
118
|
+
const [pda] = PublicKey.findProgramAddressSync([LP_TOKEN_MINT_SEED, pool.toBuffer()], PROGRAM);
|
|
119
|
+
return pda;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Derive staking PDA: [Buffer.from("staking"), stakingSeed].
|
|
123
|
+
* The staking seed is the LP token mint for LP staking, or the governance token mint for ADX staking.
|
|
124
|
+
* @param stakingSeed — Staking seed public key (e.g. LP token mint).
|
|
125
|
+
* @returns Staking PDA public key.
|
|
126
|
+
*/
|
|
127
|
+
export function deriveStakingPda(stakingSeed) {
|
|
128
|
+
const [pda] = PublicKey.findProgramAddressSync([STAKING_SEED, stakingSeed.toBuffer()], PROGRAM);
|
|
129
|
+
return pda;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Derive user staking PDA: [Buffer.from("user_staking"), owner, staking].
|
|
133
|
+
* @param owner — Owner wallet public key.
|
|
134
|
+
* @param staking — Staking PDA public key.
|
|
135
|
+
* @returns User staking PDA public key.
|
|
136
|
+
*/
|
|
137
|
+
export function deriveUserStakingPda(owner, staking) {
|
|
138
|
+
const [pda] = PublicKey.findProgramAddressSync([USER_STAKING_SEED, owner.toBuffer(), staking.toBuffer()], PROGRAM);
|
|
139
|
+
return pda;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Derive genesis lock PDA: [Buffer.from("genesis_lock"), pool].
|
|
143
|
+
* @param pool — Pool public key.
|
|
144
|
+
* @returns Genesis lock PDA public key.
|
|
145
|
+
*/
|
|
146
|
+
export function deriveGenesisLockPda(pool) {
|
|
147
|
+
const [pda] = PublicKey.findProgramAddressSync([GENESIS_LOCK_SEED, pool.toBuffer()], PROGRAM);
|
|
148
|
+
return pda;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Derive LM token treasury PDA: [Buffer.from("lm_token_treasury"), cortex].
|
|
152
|
+
* @param cortex — Cortex PDA public key.
|
|
153
|
+
* @returns LM token treasury PDA public key.
|
|
154
|
+
*/
|
|
155
|
+
export function deriveLmTokenTreasuryPda(cortex) {
|
|
156
|
+
const [pda] = PublicKey.findProgramAddressSync([LM_TOKEN_TREASURY_SEED, cortex.toBuffer()], PROGRAM);
|
|
157
|
+
return pda;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Derive LM token mint PDA: [Buffer.from("lm_token_mint")].
|
|
161
|
+
* @returns LM token mint PDA public key.
|
|
162
|
+
*/
|
|
163
|
+
export function deriveLmTokenMintPda() {
|
|
164
|
+
const [pda] = PublicKey.findProgramAddressSync([LM_TOKEN_MINT_SEED], PROGRAM);
|
|
165
|
+
return pda;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Derive governance token mint PDA: [Buffer.from("governance_token_mint")].
|
|
169
|
+
* @returns Governance token mint PDA public key.
|
|
170
|
+
*/
|
|
171
|
+
export function deriveGovernanceTokenMintPda() {
|
|
172
|
+
const [pda] = PublicKey.findProgramAddressSync([GOVERNANCE_TOKEN_MINT_SEED], PROGRAM);
|
|
173
|
+
return pda;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Derive staking staked token vault PDA: [Buffer.from("staking_staked_token_vault"), staking].
|
|
177
|
+
* @param staking — Staking PDA public key.
|
|
178
|
+
* @returns Staking staked token vault PDA public key.
|
|
179
|
+
*/
|
|
180
|
+
export function deriveStakingStakedTokenVaultPda(staking) {
|
|
181
|
+
const [pda] = PublicKey.findProgramAddressSync([STAKING_STAKED_TOKEN_VAULT_SEED, staking.toBuffer()], PROGRAM);
|
|
182
|
+
return pda;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Derive staking reward token vault PDA: [Buffer.from("staking_reward_token_vault"), staking].
|
|
186
|
+
* @param staking — Staking PDA public key.
|
|
187
|
+
* @returns Staking reward token vault PDA public key.
|
|
188
|
+
*/
|
|
189
|
+
export function deriveStakingRewardTokenVaultPda(staking) {
|
|
190
|
+
const [pda] = PublicKey.findProgramAddressSync([STAKING_REWARD_TOKEN_VAULT_SEED, staking.toBuffer()], PROGRAM);
|
|
191
|
+
return pda;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Derive staking LM reward token vault PDA: [Buffer.from("staking_lm_reward_token_vault"), staking].
|
|
195
|
+
* @param staking — Staking PDA public key.
|
|
196
|
+
* @returns Staking LM reward token vault PDA public key.
|
|
197
|
+
*/
|
|
198
|
+
export function deriveStakingLmRewardTokenVaultPda(staking) {
|
|
199
|
+
const [pda] = PublicKey.findProgramAddressSync([STAKING_LM_REWARD_TOKEN_VAULT_SEED, staking.toBuffer()], PROGRAM);
|
|
200
|
+
return pda;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Derive the associated token account address for a wallet and mint.
|
|
204
|
+
* Re-exported from the shared `solana/ata-utils` module for backward compat.
|
|
205
|
+
* New code should import from `solana/ata-utils.ts` directly.
|
|
206
|
+
* @param owner — Wallet public key.
|
|
207
|
+
* @param mint — Token mint public key.
|
|
208
|
+
* @returns ATA public key.
|
|
209
|
+
*/
|
|
210
|
+
export { deriveAtaAddress as deriveAta } from '../../solana/ata-utils.js';
|
|
211
|
+
//# sourceMappingURL=adrena-pda.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adrena-pda.js","sourceRoot":"","sources":["../../../src/perps/adrena/adrena-pda.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,SAAS,EACT,YAAY,EACZ,0BAA0B,EAC1B,WAAW,EACX,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,0BAA0B,EAC1B,+BAA+B,EAC/B,+BAA+B,EAC/B,kCAAkC,GACnC,MAAM,uBAAuB,CAAC;AAE/B,iCAAiC;AACjC,MAAM,OAAO,GAAG,IAAI,SAAS,CAAC,iBAAiB,CAAC,CAAC;AAEjD;;;GAGG;AACH,MAAM,UAAU,eAAe;IAC7B,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,sBAAsB,CAAC,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,CAAC;IACvE,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAAgB;IACpD,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,sBAAsB,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IACpG,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAe,EAAE,IAAY;IAC5D,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,sBAAsB,CAAC,CAAC,YAAY,EAAE,IAAI,CAAC,QAAQ,EAAE,EAA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EAAE,CAAC,EACrD,OAAO,CACR,CAAC;IACF,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gCAAgC,CAAC,OAAkB;IACjE,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,sBAAsB,CAC5C,CAAC,+BAA+B,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,EACrD,OAAO,CACR,CAAC;IACF,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kCAAkC,CAAC,OAAkB;IACnE,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,sBAAsB,CAC5C,CAAC,kCAAkC,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,EACxD,OAAO,CACR,CAAC;IACF,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;;;GAOG;AACH,OAAO,EAAE,gBAAgB,IAAI,SAAS,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name perps/adrena/index
|
|
3
|
+
* @description Barrel export for the Adrena perps integration module.
|
|
4
|
+
*
|
|
5
|
+
* @module perps/adrena/index
|
|
6
|
+
*/
|
|
7
|
+
export * from './adrena-constants.js';
|
|
8
|
+
export * from './adrena-pda.js';
|
|
9
|
+
export * from './adrena-builder.js';
|
|
10
|
+
export * from './adrena-data-api.js';
|
|
11
|
+
export { ADRENA_IDL } from './adrena-idl.js';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/perps/adrena/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name perps/adrena/index
|
|
3
|
+
* @description Barrel export for the Adrena perps integration module.
|
|
4
|
+
*
|
|
5
|
+
* @module perps/adrena/index
|
|
6
|
+
*/
|
|
7
|
+
export * from './adrena-constants.js';
|
|
8
|
+
export * from './adrena-pda.js';
|
|
9
|
+
export * from './adrena-builder.js';
|
|
10
|
+
export * from './adrena-data-api.js';
|
|
11
|
+
export { ADRENA_IDL } from './adrena-idl.js';
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/perps/adrena/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name perps/chart-indicators
|
|
3
|
+
* @description Multi-timeframe OHLC batch and technical indicator calculations.
|
|
4
|
+
*
|
|
5
|
+
* All indicator math is implemented from scratch — RSI (Wilder's smoothing),
|
|
6
|
+
* EMA, MACD (12-26-9), Bollinger Bands (20, 2σ), and ATR (14-period).
|
|
7
|
+
* No external libraries, no mocks, no placeholders.
|
|
8
|
+
*
|
|
9
|
+
* @module perps/chart-indicators
|
|
10
|
+
*/
|
|
11
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
12
|
+
import type { SapMcpContext } from '../core/types.js';
|
|
13
|
+
/**
|
|
14
|
+
* @name registerChartMultiOhlcTool
|
|
15
|
+
* @description Register sap_chart_multi_ohlc — fetch OHLC for multiple resolutions
|
|
16
|
+
* in a single DexScreener call. Reduces chart analysis costs 5x.
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare function registerChartMultiOhlcTool(server: Server, _context: SapMcpContext): void;
|
|
20
|
+
/**
|
|
21
|
+
* @name registerChartIndicatorsTool
|
|
22
|
+
* @description Register sap_chart_indicators — compute RSI, EMA, MACD, Bollinger,
|
|
23
|
+
* and ATR from DexScreener price data. All indicator math is real — no mocks.
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export declare function registerChartIndicatorsTool(server: Server, _context: SapMcpContext): void;
|
|
27
|
+
//# sourceMappingURL=chart-indicators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart-indicators.d.ts","sourceRoot":"","sources":["../../src/perps/chart-indicators.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAmPtD;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,IAAI,CAoDxF;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,IAAI,CAkHzF"}
|