@@ -9,19 +9,14 @@ import {
9
9
SPLASH_POOL_TICK_SPACING ,
10
10
} from "../src/config" ;
11
11
import { setupMint } from "./utils/token" ;
12
- import { setupMintTE , setupMintTEFee } from "./utils/tokenExtensions" ;
12
+ import { setupMintTEFee } from "./utils/tokenExtensions" ;
13
13
import { orderMints } from "../src/token" ;
14
14
import { rpc , sendTransaction , signer } from "./utils/mockRpc" ;
15
- import {
16
- fetchMaybeWhirlpool ,
17
- } from "@orca-so/whirlpools-client" ;
15
+ import { fetchMaybeWhirlpool } from "@orca-so/whirlpools-client" ;
18
16
import assert from "assert" ;
19
17
import type { Address } from "@solana/web3.js" ;
20
18
import { assertAccountExists , lamports } from "@solana/web3.js" ;
21
- import {
22
- _TICK_ARRAY_SIZE ,
23
- priceToSqrtPrice ,
24
- } from "@orca-so/whirlpools-core" ;
19
+ import { _TICK_ARRAY_SIZE , priceToSqrtPrice } from "@orca-so/whirlpools-core" ;
25
20
26
21
describe ( "Create Pool" , ( ) => {
27
22
let mintA : Address ;
@@ -54,15 +49,11 @@ describe("Create Pool", () => {
54
49
let signerAccount = await rpc . getAccountInfo ( signer . address ) . send ( ) ;
55
50
const balanceBefore = signerAccount . value ?. lamports ?? lamports ( 0n ) ;
56
51
57
- const { instructions, poolAddress, estInitializationCost } = await createSplashPoolInstructions (
58
- rpc ,
59
- mintA ,
60
- mintB ,
61
- price ,
62
- ) ;
52
+ const { instructions, poolAddress, estInitializationCost } =
53
+ await createSplashPoolInstructions ( rpc , mintA , mintB , price ) ;
63
54
64
55
const maybePool = await fetchMaybeWhirlpool ( rpc , poolAddress ) ;
65
- assert . strictEqual ( maybePool . exists , false )
56
+ assert . strictEqual ( maybePool . exists , false ) ;
66
57
67
58
await sendTransaction ( instructions ) ;
68
59
@@ -92,15 +83,11 @@ describe("Create Pool", () => {
92
83
let signerAccount = await rpc . getAccountInfo ( signer . address ) . send ( ) ;
93
84
const balanceBefore = signerAccount . value ?. lamports ?? lamports ( 0n ) ;
94
85
95
- const { instructions, poolAddress, estInitializationCost } = await createSplashPoolInstructions (
96
- rpc ,
97
- mintC ,
98
- mintD ,
99
- price ,
100
- ) ;
86
+ const { instructions, poolAddress, estInitializationCost } =
87
+ await createSplashPoolInstructions ( rpc , mintC , mintD , price ) ;
101
88
102
89
const maybePool = await fetchMaybeWhirlpool ( rpc , poolAddress ) ;
103
- assert . strictEqual ( maybePool . exists , false )
90
+ assert . strictEqual ( maybePool . exists , false ) ;
104
91
105
92
await sendTransaction ( instructions ) ;
106
93
@@ -130,15 +117,11 @@ describe("Create Pool", () => {
130
117
let signerAccount = await rpc . getAccountInfo ( signer . address ) . send ( ) ;
131
118
const balanceBefore = signerAccount . value ?. lamports ?? lamports ( 0n ) ;
132
119
133
- const { instructions, poolAddress, estInitializationCost } = await createSplashPoolInstructions (
134
- rpc ,
135
- mintC ,
136
- mintD ,
137
- price ,
138
- ) ;
120
+ const { instructions, poolAddress, estInitializationCost } =
121
+ await createSplashPoolInstructions ( rpc , mintC , mintD , price ) ;
139
122
140
123
const maybePool = await fetchMaybeWhirlpool ( rpc , poolAddress ) ;
141
- assert . strictEqual ( maybePool . exists , false )
124
+ assert . strictEqual ( maybePool . exists , false ) ;
142
125
143
126
await sendTransaction ( instructions ) ;
144
127
@@ -159,23 +142,24 @@ describe("Create Pool", () => {
159
142
} ) ;
160
143
161
144
it ( "Should create concentrated liquidity pool" , async ( ) => {
162
- const tickSpacing = 64
145
+ const tickSpacing = 64 ;
163
146
const price = 10 ;
164
147
const sqrtPrice = priceToSqrtPrice ( price , 6 , 6 ) ;
165
148
166
149
let signerAccount = await rpc . getAccountInfo ( signer . address ) . send ( ) ;
167
150
const balanceBefore = signerAccount . value ?. lamports ?? lamports ( 0n ) ;
168
151
169
- const { instructions, poolAddress, estInitializationCost } = await createConcentratedLiquidityPoolInstructions (
170
- rpc ,
171
- mintA ,
172
- mintB ,
173
- tickSpacing ,
174
- price ,
175
- ) ;
152
+ const { instructions, poolAddress, estInitializationCost } =
153
+ await createConcentratedLiquidityPoolInstructions (
154
+ rpc ,
155
+ mintA ,
156
+ mintB ,
157
+ tickSpacing ,
158
+ price ,
159
+ ) ;
176
160
177
161
const maybePool = await fetchMaybeWhirlpool ( rpc , poolAddress ) ;
178
- assert . strictEqual ( maybePool . exists , false )
162
+ assert . strictEqual ( maybePool . exists , false ) ;
179
163
180
164
await sendTransaction ( instructions ) ;
181
165
@@ -206,16 +190,17 @@ describe("Create Pool", () => {
206
190
let signerAccount = await rpc . getAccountInfo ( signer . address ) . send ( ) ;
207
191
const balanceBefore = signerAccount . value ?. lamports ?? lamports ( 0n ) ;
208
192
209
- const { instructions, poolAddress, estInitializationCost } = await createConcentratedLiquidityPoolInstructions (
210
- rpc ,
211
- mintC ,
212
- mintD ,
213
- tickSpacing ,
214
- price ,
215
- ) ;
193
+ const { instructions, poolAddress, estInitializationCost } =
194
+ await createConcentratedLiquidityPoolInstructions (
195
+ rpc ,
196
+ mintC ,
197
+ mintD ,
198
+ tickSpacing ,
199
+ price ,
200
+ ) ;
216
201
217
202
const maybePool = await fetchMaybeWhirlpool ( rpc , poolAddress ) ;
218
- assert . strictEqual ( maybePool . exists , false )
203
+ assert . strictEqual ( maybePool . exists , false ) ;
219
204
220
205
await sendTransaction ( instructions ) ;
221
206
@@ -246,16 +231,17 @@ describe("Create Pool", () => {
246
231
let signerAccount = await rpc . getAccountInfo ( signer . address ) . send ( ) ;
247
232
const balanceBefore = signerAccount . value ?. lamports ?? lamports ( 0n ) ;
248
233
249
- const { instructions, poolAddress, estInitializationCost } = await createConcentratedLiquidityPoolInstructions (
250
- rpc ,
251
- mintC ,
252
- mintD ,
253
- tickSpacing ,
254
- price ,
255
- ) ;
234
+ const { instructions, poolAddress, estInitializationCost } =
235
+ await createConcentratedLiquidityPoolInstructions (
236
+ rpc ,
237
+ mintC ,
238
+ mintD ,
239
+ tickSpacing ,
240
+ price ,
241
+ ) ;
256
242
257
243
const maybePool = await fetchMaybeWhirlpool ( rpc , poolAddress ) ;
258
- assert . strictEqual ( maybePool . exists , false )
244
+ assert . strictEqual ( maybePool . exists , false ) ;
259
245
260
246
await sendTransaction ( instructions ) ;
261
247
0 commit comments