@liquid-af/sdk 0.1.0

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.
Files changed (225) hide show
  1. package/README.md +776 -0
  2. package/dist/accounts/index.d.ts +5 -0
  3. package/dist/accounts/index.d.ts.map +1 -0
  4. package/dist/accounts/index.js +5 -0
  5. package/dist/accounts/index.js.map +1 -0
  6. package/dist/accounts/liquid-fees.d.ts +63 -0
  7. package/dist/accounts/liquid-fees.d.ts.map +1 -0
  8. package/dist/accounts/liquid-fees.js +27 -0
  9. package/dist/accounts/liquid-fees.js.map +1 -0
  10. package/dist/accounts/liquid-state.d.ts +112 -0
  11. package/dist/accounts/liquid-state.d.ts.map +1 -0
  12. package/dist/accounts/liquid-state.js +92 -0
  13. package/dist/accounts/liquid-state.js.map +1 -0
  14. package/dist/accounts/liquid-swap.d.ts +97 -0
  15. package/dist/accounts/liquid-swap.d.ts.map +1 -0
  16. package/dist/accounts/liquid-swap.js +54 -0
  17. package/dist/accounts/liquid-swap.js.map +1 -0
  18. package/dist/accounts/liquid.d.ts +175 -0
  19. package/dist/accounts/liquid.d.ts.map +1 -0
  20. package/dist/accounts/liquid.js +66 -0
  21. package/dist/accounts/liquid.js.map +1 -0
  22. package/dist/client.d.ts +621 -0
  23. package/dist/client.d.ts.map +1 -0
  24. package/dist/client.js +511 -0
  25. package/dist/client.js.map +1 -0
  26. package/dist/config.d.ts +56 -0
  27. package/dist/config.d.ts.map +1 -0
  28. package/dist/config.js +44 -0
  29. package/dist/config.js.map +1 -0
  30. package/dist/errors.d.ts +39 -0
  31. package/dist/errors.d.ts.map +1 -0
  32. package/dist/errors.js +63 -0
  33. package/dist/errors.js.map +1 -0
  34. package/dist/events/index.d.ts +4 -0
  35. package/dist/events/index.d.ts.map +1 -0
  36. package/dist/events/index.js +2 -0
  37. package/dist/events/index.js.map +1 -0
  38. package/dist/events/parser.d.ts +40 -0
  39. package/dist/events/parser.d.ts.map +1 -0
  40. package/dist/events/parser.js +67 -0
  41. package/dist/events/parser.js.map +1 -0
  42. package/dist/events/types.d.ts +286 -0
  43. package/dist/events/types.d.ts.map +1 -0
  44. package/dist/events/types.js +2 -0
  45. package/dist/events/types.js.map +1 -0
  46. package/dist/helpers/index.d.ts +4 -0
  47. package/dist/helpers/index.d.ts.map +1 -0
  48. package/dist/helpers/index.js +3 -0
  49. package/dist/helpers/index.js.map +1 -0
  50. package/dist/helpers/preview.d.ts +259 -0
  51. package/dist/helpers/preview.d.ts.map +1 -0
  52. package/dist/helpers/preview.js +458 -0
  53. package/dist/helpers/preview.js.map +1 -0
  54. package/dist/helpers/user.d.ts +11 -0
  55. package/dist/helpers/user.d.ts.map +1 -0
  56. package/dist/helpers/user.js +20 -0
  57. package/dist/helpers/user.js.map +1 -0
  58. package/dist/idl/index.d.ts +53 -0
  59. package/dist/idl/index.d.ts.map +1 -0
  60. package/dist/idl/index.js +64 -0
  61. package/dist/idl/index.js.map +1 -0
  62. package/dist/idl/liquid.d.ts +10523 -0
  63. package/dist/idl/liquid.d.ts.map +1 -0
  64. package/dist/idl/liquid.js +2 -0
  65. package/dist/idl/liquid.js.map +1 -0
  66. package/dist/idl/liquid.json +10516 -0
  67. package/dist/idl/liquid_fees.d.ts +1520 -0
  68. package/dist/idl/liquid_fees.d.ts.map +1 -0
  69. package/dist/idl/liquid_fees.js +2 -0
  70. package/dist/idl/liquid_fees.js.map +1 -0
  71. package/dist/idl/liquid_fees.json +1513 -0
  72. package/dist/idl/liquid_state.d.ts +2936 -0
  73. package/dist/idl/liquid_state.d.ts.map +1 -0
  74. package/dist/idl/liquid_state.js +2 -0
  75. package/dist/idl/liquid_state.js.map +1 -0
  76. package/dist/idl/liquid_state.json +2929 -0
  77. package/dist/idl/liquid_swap.d.ts +5849 -0
  78. package/dist/idl/liquid_swap.d.ts.map +1 -0
  79. package/dist/idl/liquid_swap.js +2 -0
  80. package/dist/idl/liquid_swap.js.map +1 -0
  81. package/dist/idl/liquid_swap.json +5842 -0
  82. package/dist/index.d.ts +19 -0
  83. package/dist/index.d.ts.map +1 -0
  84. package/dist/index.js +15 -0
  85. package/dist/index.js.map +1 -0
  86. package/dist/instructions/index.d.ts +9 -0
  87. package/dist/instructions/index.d.ts.map +1 -0
  88. package/dist/instructions/index.js +9 -0
  89. package/dist/instructions/index.js.map +1 -0
  90. package/dist/instructions/liquid-fees.d.ts +111 -0
  91. package/dist/instructions/liquid-fees.d.ts.map +1 -0
  92. package/dist/instructions/liquid-fees.js +169 -0
  93. package/dist/instructions/liquid-fees.js.map +1 -0
  94. package/dist/instructions/liquid-state.d.ts +173 -0
  95. package/dist/instructions/liquid-state.d.ts.map +1 -0
  96. package/dist/instructions/liquid-state.js +194 -0
  97. package/dist/instructions/liquid-state.js.map +1 -0
  98. package/dist/instructions/liquid-swap.d.ts +122 -0
  99. package/dist/instructions/liquid-swap.d.ts.map +1 -0
  100. package/dist/instructions/liquid-swap.js +167 -0
  101. package/dist/instructions/liquid-swap.js.map +1 -0
  102. package/dist/instructions/liquid.d.ts +297 -0
  103. package/dist/instructions/liquid.d.ts.map +1 -0
  104. package/dist/instructions/liquid.js +483 -0
  105. package/dist/instructions/liquid.js.map +1 -0
  106. package/dist/instructions/program-cache.d.ts +35 -0
  107. package/dist/instructions/program-cache.d.ts.map +1 -0
  108. package/dist/instructions/program-cache.js +68 -0
  109. package/dist/instructions/program-cache.js.map +1 -0
  110. package/dist/math/amm.d.ts +42 -0
  111. package/dist/math/amm.d.ts.map +1 -0
  112. package/dist/math/amm.js +109 -0
  113. package/dist/math/amm.js.map +1 -0
  114. package/dist/math/bonding-curve.d.ts +34 -0
  115. package/dist/math/bonding-curve.d.ts.map +1 -0
  116. package/dist/math/bonding-curve.js +80 -0
  117. package/dist/math/bonding-curve.js.map +1 -0
  118. package/dist/math/constants.d.ts +14 -0
  119. package/dist/math/constants.d.ts.map +1 -0
  120. package/dist/math/constants.js +14 -0
  121. package/dist/math/constants.js.map +1 -0
  122. package/dist/math/fees.d.ts +88 -0
  123. package/dist/math/fees.d.ts.map +1 -0
  124. package/dist/math/fees.js +135 -0
  125. package/dist/math/fees.js.map +1 -0
  126. package/dist/math/index.d.ts +8 -0
  127. package/dist/math/index.d.ts.map +1 -0
  128. package/dist/math/index.js +6 -0
  129. package/dist/math/index.js.map +1 -0
  130. package/dist/math/tiered-fees.d.ts +80 -0
  131. package/dist/math/tiered-fees.d.ts.map +1 -0
  132. package/dist/math/tiered-fees.js +129 -0
  133. package/dist/math/tiered-fees.js.map +1 -0
  134. package/dist/oracle.d.ts +53 -0
  135. package/dist/oracle.d.ts.map +1 -0
  136. package/dist/oracle.js +70 -0
  137. package/dist/oracle.js.map +1 -0
  138. package/dist/pda/index.d.ts +89 -0
  139. package/dist/pda/index.d.ts.map +1 -0
  140. package/dist/pda/index.js +127 -0
  141. package/dist/pda/index.js.map +1 -0
  142. package/dist/pda/liquid-fees.d.ts +27 -0
  143. package/dist/pda/liquid-fees.d.ts.map +1 -0
  144. package/dist/pda/liquid-fees.js +36 -0
  145. package/dist/pda/liquid-fees.js.map +1 -0
  146. package/dist/pda/liquid-state.d.ts +56 -0
  147. package/dist/pda/liquid-state.d.ts.map +1 -0
  148. package/dist/pda/liquid-state.js +79 -0
  149. package/dist/pda/liquid-state.js.map +1 -0
  150. package/dist/pda/liquid-swap.d.ts +76 -0
  151. package/dist/pda/liquid-swap.d.ts.map +1 -0
  152. package/dist/pda/liquid-swap.js +103 -0
  153. package/dist/pda/liquid-swap.js.map +1 -0
  154. package/dist/pda/liquid.d.ts +67 -0
  155. package/dist/pda/liquid.d.ts.map +1 -0
  156. package/dist/pda/liquid.js +91 -0
  157. package/dist/pda/liquid.js.map +1 -0
  158. package/dist/provider.d.ts +26 -0
  159. package/dist/provider.d.ts.map +1 -0
  160. package/dist/provider.js +47 -0
  161. package/dist/provider.js.map +1 -0
  162. package/dist/transaction/builder.d.ts +30 -0
  163. package/dist/transaction/builder.d.ts.map +1 -0
  164. package/dist/transaction/builder.js +48 -0
  165. package/dist/transaction/builder.js.map +1 -0
  166. package/dist/transaction/index.d.ts +3 -0
  167. package/dist/transaction/index.d.ts.map +1 -0
  168. package/dist/transaction/index.js +3 -0
  169. package/dist/transaction/index.js.map +1 -0
  170. package/dist/transaction/send.d.ts +25 -0
  171. package/dist/transaction/send.d.ts.map +1 -0
  172. package/dist/transaction/send.js +52 -0
  173. package/dist/transaction/send.js.map +1 -0
  174. package/dist/types.d.ts +311 -0
  175. package/dist/types.d.ts.map +1 -0
  176. package/dist/types.js +46 -0
  177. package/dist/types.js.map +1 -0
  178. package/package.json +112 -0
  179. package/src/accounts/index.ts +26 -0
  180. package/src/accounts/liquid-fees.ts +38 -0
  181. package/src/accounts/liquid-state.ts +134 -0
  182. package/src/accounts/liquid-swap.ts +79 -0
  183. package/src/accounts/liquid.ts +100 -0
  184. package/src/client.ts +1001 -0
  185. package/src/config.ts +91 -0
  186. package/src/errors.ts +94 -0
  187. package/src/events/index.ts +42 -0
  188. package/src/events/parser.ts +90 -0
  189. package/src/events/types.ts +310 -0
  190. package/src/helpers/index.ts +23 -0
  191. package/src/helpers/preview.ts +798 -0
  192. package/src/helpers/user.ts +24 -0
  193. package/src/idl/index.ts +94 -0
  194. package/src/idl/liquid.json +10516 -0
  195. package/src/idl/liquid.ts +10522 -0
  196. package/src/idl/liquid_fees.json +1513 -0
  197. package/src/idl/liquid_fees.ts +1519 -0
  198. package/src/idl/liquid_state.json +2929 -0
  199. package/src/idl/liquid_state.ts +2935 -0
  200. package/src/idl/liquid_swap.json +5842 -0
  201. package/src/idl/liquid_swap.ts +5848 -0
  202. package/src/index.ts +98 -0
  203. package/src/instructions/index.ts +109 -0
  204. package/src/instructions/liquid-fees.ts +289 -0
  205. package/src/instructions/liquid-state.ts +336 -0
  206. package/src/instructions/liquid-swap.ts +414 -0
  207. package/src/instructions/liquid.ts +884 -0
  208. package/src/instructions/program-cache.ts +106 -0
  209. package/src/math/amm.ts +146 -0
  210. package/src/math/bonding-curve.ts +122 -0
  211. package/src/math/constants.ts +19 -0
  212. package/src/math/fees.ts +191 -0
  213. package/src/math/index.ts +40 -0
  214. package/src/math/tiered-fees.ts +165 -0
  215. package/src/oracle.ts +97 -0
  216. package/src/pda/index.ts +331 -0
  217. package/src/pda/liquid-fees.ts +58 -0
  218. package/src/pda/liquid-state.ts +123 -0
  219. package/src/pda/liquid-swap.ts +162 -0
  220. package/src/pda/liquid.ts +152 -0
  221. package/src/provider.ts +60 -0
  222. package/src/transaction/builder.ts +80 -0
  223. package/src/transaction/index.ts +6 -0
  224. package/src/transaction/send.ts +72 -0
  225. package/src/types.ts +354 -0
@@ -0,0 +1,134 @@
1
+ import type { Connection, PublicKey } from "@solana/web3.js";
2
+ import type { LiquidConfig } from "../config.js";
3
+ import {
4
+ getUserPropertiesPDA,
5
+ getTokenVolumePDA,
6
+ getGlobalCurveVolumePDA,
7
+ getGlobalAmmVolumePDA,
8
+ getCashbackConfigPDA,
9
+ getUserSnapshotPDA,
10
+ getDealPDA,
11
+ } from "../pda/liquid-state.js";
12
+ import { getLiquidStateProgram } from "../idl/index.js";
13
+
14
+ /**
15
+ * Fetches a user's properties (referrer, volumes, cashback state).
16
+ *
17
+ * @param connection - Solana RPC connection
18
+ * @param user - User's public key
19
+ * @param config - Liquid protocol configuration
20
+ * @returns The deserialized user properties account
21
+ */
22
+ export async function fetchUserProperties(
23
+ connection: Connection,
24
+ user: PublicKey,
25
+ config: LiquidConfig
26
+ ) {
27
+ const program = getLiquidStateProgram(connection, config);
28
+ const [pda] = getUserPropertiesPDA(user, config.liquidStateProgramId);
29
+ return program.account.userProperties.fetch(pda);
30
+ }
31
+
32
+ /**
33
+ * Fetches the token volume accumulator for a mint.
34
+ *
35
+ * @param connection - Solana RPC connection
36
+ * @param mint - Token mint address
37
+ * @param config - Liquid protocol configuration
38
+ * @returns The deserialized token volume accumulator account
39
+ */
40
+ export async function fetchTokenVolume(
41
+ connection: Connection,
42
+ mint: PublicKey,
43
+ config: LiquidConfig
44
+ ) {
45
+ const program = getLiquidStateProgram(connection, config);
46
+ const [pda] = getTokenVolumePDA(mint, config.liquidStateProgramId);
47
+ return program.account.tokenVolumeAccumulator.fetch(pda);
48
+ }
49
+
50
+ /**
51
+ * Fetches the global curve volume accumulator.
52
+ *
53
+ * @param connection - Solana RPC connection
54
+ * @param config - Liquid protocol configuration
55
+ * @returns The deserialized global curve volume accumulator account
56
+ */
57
+ export async function fetchGlobalCurveVolume(
58
+ connection: Connection,
59
+ config: LiquidConfig
60
+ ) {
61
+ const program = getLiquidStateProgram(connection, config);
62
+ const [pda] = getGlobalCurveVolumePDA(config.liquidStateProgramId);
63
+ return program.account.globalCurveVolumeAccumulator.fetch(pda);
64
+ }
65
+
66
+ /**
67
+ * Fetches the global AMM volume accumulator.
68
+ *
69
+ * @param connection - Solana RPC connection
70
+ * @param config - Liquid protocol configuration
71
+ * @returns The deserialized global AMM volume accumulator account
72
+ */
73
+ export async function fetchGlobalAmmVolume(
74
+ connection: Connection,
75
+ config: LiquidConfig
76
+ ) {
77
+ const program = getLiquidStateProgram(connection, config);
78
+ const [pda] = getGlobalAmmVolumePDA(config.liquidStateProgramId);
79
+ return program.account.globalAmmVolumeAccumulator.fetch(pda);
80
+ }
81
+
82
+ /**
83
+ * Fetches the cashback configuration.
84
+ *
85
+ * @param connection - Solana RPC connection
86
+ * @param config - Liquid protocol configuration
87
+ * @returns The deserialized cashback configuration account
88
+ */
89
+ export async function fetchCashbackConfig(
90
+ connection: Connection,
91
+ config: LiquidConfig
92
+ ) {
93
+ const program = getLiquidStateProgram(connection, config);
94
+ const [pda] = getCashbackConfigPDA(config.liquidStateProgramId);
95
+ return program.account.cashbackConfiguration.fetch(pda);
96
+ }
97
+
98
+ /**
99
+ * Fetches a user snapshot by user and index.
100
+ *
101
+ * @param connection - Solana RPC connection
102
+ * @param user - User's public key
103
+ * @param index - Snapshot index (0-based)
104
+ * @param config - Liquid protocol configuration
105
+ * @returns The deserialized user snapshot account
106
+ */
107
+ export async function fetchUserSnapshot(
108
+ connection: Connection,
109
+ user: PublicKey,
110
+ index: number,
111
+ config: LiquidConfig
112
+ ) {
113
+ const program = getLiquidStateProgram(connection, config);
114
+ const [pda] = getUserSnapshotPDA(user, index, config.liquidStateProgramId);
115
+ return program.account.userSnapshot.fetch(pda);
116
+ }
117
+
118
+ /**
119
+ * Fetches a deal account by its owner.
120
+ *
121
+ * @param connection - Solana RPC connection
122
+ * @param owner - Deal owner's public key
123
+ * @param config - Liquid protocol configuration
124
+ * @returns The deserialized deal account
125
+ */
126
+ export async function fetchDeal(
127
+ connection: Connection,
128
+ owner: PublicKey,
129
+ config: LiquidConfig
130
+ ) {
131
+ const program = getLiquidStateProgram(connection, config);
132
+ const [pda] = getDealPDA(owner, config.liquidStateProgramId);
133
+ return program.account.deal.fetch(pda);
134
+ }
@@ -0,0 +1,79 @@
1
+ import type { Connection, PublicKey } from "@solana/web3.js";
2
+ import type { LiquidConfig } from "../config.js";
3
+ import {
4
+ getSwapGlobalConfigPDA,
5
+ getPoolPDA,
6
+ getObservationPDA,
7
+ } from "../pda/liquid-swap.js";
8
+ import { getLiquidSwapProgram } from "../idl/index.js";
9
+
10
+ /**
11
+ * Fetches the AMM global configuration.
12
+ *
13
+ * @param connection - Solana RPC connection
14
+ * @param config - Liquid protocol configuration
15
+ * @returns The deserialized AMM configuration account
16
+ */
17
+ export async function fetchAmmConfig(
18
+ connection: Connection,
19
+ config: LiquidConfig
20
+ ) {
21
+ const program = getLiquidSwapProgram(connection, config);
22
+ const [pda] = getSwapGlobalConfigPDA(config.liquidSwapProgramId);
23
+ return program.account.ammConfig.fetch(pda);
24
+ }
25
+
26
+ /**
27
+ * Fetches an AMM pool state by base and quote mint.
28
+ *
29
+ * @param connection - Solana RPC connection
30
+ * @param baseMint - Base token mint address
31
+ * @param quoteMint - Quote token mint address
32
+ * @param config - Liquid protocol configuration
33
+ * @returns The deserialized pool state account
34
+ */
35
+ export async function fetchPoolState(
36
+ connection: Connection,
37
+ baseMint: PublicKey,
38
+ quoteMint: PublicKey,
39
+ config: LiquidConfig
40
+ ) {
41
+ const program = getLiquidSwapProgram(connection, config);
42
+ const [pda] = getPoolPDA(baseMint, quoteMint, config.liquidSwapProgramId);
43
+ return program.account.poolState.fetch(pda);
44
+ }
45
+
46
+ /**
47
+ * Fetches a pool state by its PDA address directly.
48
+ *
49
+ * @param connection - Solana RPC connection
50
+ * @param poolAddress - The pool state PDA address
51
+ * @param config - Liquid protocol configuration
52
+ * @returns The deserialized pool state account
53
+ */
54
+ export async function fetchPoolStateByAddress(
55
+ connection: Connection,
56
+ poolAddress: PublicKey,
57
+ config: LiquidConfig
58
+ ) {
59
+ const program = getLiquidSwapProgram(connection, config);
60
+ return program.account.poolState.fetch(poolAddress);
61
+ }
62
+
63
+ /**
64
+ * Fetches the observation state (oracle) for a pool.
65
+ *
66
+ * @param connection - Solana RPC connection
67
+ * @param poolAddress - The pool state PDA address
68
+ * @param config - Liquid protocol configuration
69
+ * @returns The deserialized observation state account
70
+ */
71
+ export async function fetchObservationState(
72
+ connection: Connection,
73
+ poolAddress: PublicKey,
74
+ config: LiquidConfig
75
+ ) {
76
+ const program = getLiquidSwapProgram(connection, config);
77
+ const [pda] = getObservationPDA(poolAddress, config.liquidSwapProgramId);
78
+ return program.account.observationState.fetch(pda);
79
+ }
@@ -0,0 +1,100 @@
1
+ import type { Connection, PublicKey } from "@solana/web3.js";
2
+ import type { LiquidConfig } from "../config.js";
3
+ import {
4
+ getLiquidGlobalConfigPDA,
5
+ getBondingCurvePDA,
6
+ getStableBondingCurvePDA,
7
+ } from "../pda/liquid.js";
8
+ import { getLiquidProgram } from "../idl/index.js";
9
+
10
+ /**
11
+ * Fetches the global configuration for the bonding curve program.
12
+ *
13
+ * @param connection - Solana RPC connection
14
+ * @param config - Liquid protocol configuration
15
+ * @returns The deserialized global configuration account
16
+ */
17
+ export async function fetchLiquidGlobalConfig(
18
+ connection: Connection,
19
+ config: LiquidConfig
20
+ ) {
21
+ const program = getLiquidProgram(connection, config);
22
+ const [pda] = getLiquidGlobalConfigPDA(config.liquidProgramId);
23
+ return program.account.globalConfiguration.fetch(pda);
24
+ }
25
+
26
+ /**
27
+ * Fetches a bonding curve account by mint address.
28
+ *
29
+ * @param connection - Solana RPC connection
30
+ * @param mint - Token mint address
31
+ * @param config - Liquid protocol configuration
32
+ * @returns The deserialized bonding curve account
33
+ */
34
+ export async function fetchNativeBondingCurve(
35
+ connection: Connection,
36
+ mint: PublicKey,
37
+ config: LiquidConfig
38
+ ) {
39
+ const program = getLiquidProgram(connection, config);
40
+ const [pda] = getBondingCurvePDA(mint, config.liquidProgramId);
41
+ return program.account.nativeBondingCurve.fetch(pda);
42
+ }
43
+
44
+ /**
45
+ * Fetches a bonding curve account by its PDA address directly.
46
+ *
47
+ * @param connection - Solana RPC connection
48
+ * @param bondingCurveAddress - The bonding curve PDA address
49
+ * @param config - Liquid protocol configuration
50
+ * @returns The deserialized bonding curve account
51
+ */
52
+ export async function fetchNativeBondingCurveByAddress(
53
+ connection: Connection,
54
+ bondingCurveAddress: PublicKey,
55
+ config: LiquidConfig
56
+ ) {
57
+ const program = getLiquidProgram(connection, config);
58
+ return program.account.nativeBondingCurve.fetch(bondingCurveAddress);
59
+ }
60
+
61
+ /**
62
+ * Fetches a token bonding curve account by mint and quote mint addresses.
63
+ *
64
+ * @param connection - Solana RPC connection
65
+ * @param mint - Token mint address (base token)
66
+ * @param quoteMint - Quote token mint address (e.g., USDC)
67
+ * @param config - Liquid protocol configuration
68
+ * @returns The deserialized token bonding curve account
69
+ */
70
+ export async function fetchStableBondingCurve(
71
+ connection: Connection,
72
+ mint: PublicKey,
73
+ quoteMint: PublicKey,
74
+ config: LiquidConfig
75
+ ) {
76
+ const program = getLiquidProgram(connection, config);
77
+ const [pda] = getStableBondingCurvePDA(
78
+ mint,
79
+ quoteMint,
80
+ config.liquidProgramId
81
+ );
82
+ return program.account.stableBondingCurve.fetch(pda);
83
+ }
84
+
85
+ /**
86
+ * Fetches a token bonding curve account by its PDA address directly.
87
+ *
88
+ * @param connection - Solana RPC connection
89
+ * @param stableBondingCurveAddress - The token bonding curve PDA address
90
+ * @param config - Liquid protocol configuration
91
+ * @returns The deserialized token bonding curve account
92
+ */
93
+ export async function fetchStableBondingCurveByAddress(
94
+ connection: Connection,
95
+ stableBondingCurveAddress: PublicKey,
96
+ config: LiquidConfig
97
+ ) {
98
+ const program = getLiquidProgram(connection, config);
99
+ return program.account.stableBondingCurve.fetch(stableBondingCurveAddress);
100
+ }