amm_v3.json 92 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625
  1. {
  2. "version": "0.1.0",
  3. "name": "amm_v3",
  4. "instructions": [
  5. {
  6. "name": "createAmmConfig",
  7. "docs": [
  8. "# Arguments",
  9. "",
  10. "* `ctx`- The accounts needed by instruction.",
  11. "* `index` - The index of amm config, there may be multiple config.",
  12. "* `tick_spacing` - The tickspacing binding with config, cannot be changed.",
  13. "* `trade_fee_rate` - Trade fee rate, can be changed.",
  14. "* `protocol_fee_rate` - The rate of protocol fee within tarde fee.",
  15. "* `fund_fee_rate` - The rate of fund fee within tarde fee.",
  16. ""
  17. ],
  18. "accounts": [
  19. {
  20. "name": "owner",
  21. "isMut": true,
  22. "isSigner": true,
  23. "docs": ["Address to be set as protocol owner."]
  24. },
  25. {
  26. "name": "ammConfig",
  27. "isMut": true,
  28. "isSigner": false,
  29. "docs": [
  30. "Initialize config state account to store protocol owner address and fee rates."
  31. ]
  32. },
  33. {
  34. "name": "systemProgram",
  35. "isMut": false,
  36. "isSigner": false
  37. }
  38. ],
  39. "args": [
  40. {
  41. "name": "index",
  42. "type": "u16"
  43. },
  44. {
  45. "name": "tickSpacing",
  46. "type": "u16"
  47. },
  48. {
  49. "name": "tradeFeeRate",
  50. "type": "u32"
  51. },
  52. {
  53. "name": "protocolFeeRate",
  54. "type": "u32"
  55. },
  56. {
  57. "name": "fundFeeRate",
  58. "type": "u32"
  59. }
  60. ]
  61. },
  62. {
  63. "name": "updateAmmConfig",
  64. "docs": [
  65. "Updates the owner of the amm config",
  66. "Must be called by the current owner or admin",
  67. "",
  68. "# Arguments",
  69. "",
  70. "* `ctx`- The context of accounts",
  71. "* `trade_fee_rate`- The new trade fee rate of amm config, be set when `param` is 0",
  72. "* `protocol_fee_rate`- The new protocol fee rate of amm config, be set when `param` is 1",
  73. "* `fund_fee_rate`- The new fund fee rate of amm config, be set when `param` is 2",
  74. "* `new_owner`- The config's new owner, be set when `param` is 3",
  75. "* `new_fund_owner`- The config's new fund owner, be set when `param` is 4",
  76. "* `param`- The vaule can be 0 | 1 | 2 | 3 | 4, otherwise will report a error",
  77. ""
  78. ],
  79. "accounts": [
  80. {
  81. "name": "owner",
  82. "isMut": false,
  83. "isSigner": true,
  84. "docs": ["The amm config owner or admin"]
  85. },
  86. {
  87. "name": "ammConfig",
  88. "isMut": true,
  89. "isSigner": false,
  90. "docs": ["Amm config account to be changed"]
  91. }
  92. ],
  93. "args": [
  94. {
  95. "name": "param",
  96. "type": "u8"
  97. },
  98. {
  99. "name": "value",
  100. "type": "u32"
  101. }
  102. ]
  103. },
  104. {
  105. "name": "createPool",
  106. "docs": [
  107. "Creates a pool for the given token pair and the initial price",
  108. "",
  109. "# Arguments",
  110. "",
  111. "* `ctx`- The context of accounts",
  112. "* `sqrt_price_x64` - the initial sqrt price (amount_token_1 / amount_token_0) of the pool as a Q64.64",
  113. ""
  114. ],
  115. "accounts": [
  116. {
  117. "name": "poolCreator",
  118. "isMut": true,
  119. "isSigner": true,
  120. "docs": ["Address paying to create the pool. Can be anyone"]
  121. },
  122. {
  123. "name": "ammConfig",
  124. "isMut": false,
  125. "isSigner": false,
  126. "docs": ["Which config the pool belongs to."]
  127. },
  128. {
  129. "name": "poolState",
  130. "isMut": true,
  131. "isSigner": false,
  132. "docs": ["Initialize an account to store the pool state"]
  133. },
  134. {
  135. "name": "tokenMint0",
  136. "isMut": false,
  137. "isSigner": false,
  138. "docs": ["Token_0 mint, the key must be smaller then token_1 mint."]
  139. },
  140. {
  141. "name": "tokenMint1",
  142. "isMut": false,
  143. "isSigner": false,
  144. "docs": ["Token_1 mint"]
  145. },
  146. {
  147. "name": "tokenVault0",
  148. "isMut": true,
  149. "isSigner": false,
  150. "docs": ["Token_0 vault for the pool"]
  151. },
  152. {
  153. "name": "tokenVault1",
  154. "isMut": true,
  155. "isSigner": false,
  156. "docs": ["Token_1 vault for the pool"]
  157. },
  158. {
  159. "name": "observationState",
  160. "isMut": true,
  161. "isSigner": false,
  162. "docs": ["Initialize an account to store oracle observations"]
  163. },
  164. {
  165. "name": "tickArrayBitmap",
  166. "isMut": true,
  167. "isSigner": false,
  168. "docs": [
  169. "Initialize an account to store if a tick array is initialized."
  170. ]
  171. },
  172. {
  173. "name": "tokenProgram0",
  174. "isMut": false,
  175. "isSigner": false,
  176. "docs": ["Spl token program or token program 2022"]
  177. },
  178. {
  179. "name": "tokenProgram1",
  180. "isMut": false,
  181. "isSigner": false,
  182. "docs": ["Spl token program or token program 2022"]
  183. },
  184. {
  185. "name": "systemProgram",
  186. "isMut": false,
  187. "isSigner": false,
  188. "docs": ["To create a new program account"]
  189. },
  190. {
  191. "name": "rent",
  192. "isMut": false,
  193. "isSigner": false,
  194. "docs": ["Sysvar for program account"]
  195. }
  196. ],
  197. "args": [
  198. {
  199. "name": "sqrtPriceX64",
  200. "type": "u128"
  201. },
  202. {
  203. "name": "openTime",
  204. "type": "u64"
  205. }
  206. ]
  207. },
  208. {
  209. "name": "updatePoolStatus",
  210. "docs": [
  211. "Update pool status for given vaule",
  212. "",
  213. "# Arguments",
  214. "",
  215. "* `ctx`- The context of accounts",
  216. "* `status` - The vaule of status",
  217. ""
  218. ],
  219. "accounts": [
  220. {
  221. "name": "authority",
  222. "isMut": false,
  223. "isSigner": true
  224. },
  225. {
  226. "name": "poolState",
  227. "isMut": true,
  228. "isSigner": false
  229. }
  230. ],
  231. "args": [
  232. {
  233. "name": "status",
  234. "type": "u8"
  235. }
  236. ]
  237. },
  238. {
  239. "name": "createOperationAccount",
  240. "docs": [
  241. "Creates an operation account for the program",
  242. "",
  243. "# Arguments",
  244. "",
  245. "* `ctx`- The context of accounts",
  246. ""
  247. ],
  248. "accounts": [
  249. {
  250. "name": "owner",
  251. "isMut": true,
  252. "isSigner": true,
  253. "docs": ["Address to be set as operation account owner."]
  254. },
  255. {
  256. "name": "operationState",
  257. "isMut": true,
  258. "isSigner": false,
  259. "docs": [
  260. "Initialize operation state account to store operation owner address and white list mint."
  261. ]
  262. },
  263. {
  264. "name": "systemProgram",
  265. "isMut": false,
  266. "isSigner": false
  267. }
  268. ],
  269. "args": []
  270. },
  271. {
  272. "name": "updateOperationAccount",
  273. "docs": [
  274. "Update the operation account",
  275. "",
  276. "# Arguments",
  277. "",
  278. "* `ctx`- The context of accounts",
  279. "* `param`- The vaule can be 0 | 1 | 2 | 3, otherwise will report a error",
  280. "* `keys`- update operation owner when the `param` is 0",
  281. "remove operation owner when the `param` is 1",
  282. "update whitelist mint when the `param` is 2",
  283. "remove whitelist mint when the `param` is 3",
  284. ""
  285. ],
  286. "accounts": [
  287. {
  288. "name": "owner",
  289. "isMut": false,
  290. "isSigner": true,
  291. "docs": ["Address to be set as operation account owner."]
  292. },
  293. {
  294. "name": "operationState",
  295. "isMut": true,
  296. "isSigner": false,
  297. "docs": [
  298. "Initialize operation state account to store operation owner address and white list mint."
  299. ]
  300. },
  301. {
  302. "name": "systemProgram",
  303. "isMut": false,
  304. "isSigner": false
  305. }
  306. ],
  307. "args": [
  308. {
  309. "name": "param",
  310. "type": "u8"
  311. },
  312. {
  313. "name": "keys",
  314. "type": {
  315. "vec": "publicKey"
  316. }
  317. }
  318. ]
  319. },
  320. {
  321. "name": "transferRewardOwner",
  322. "docs": [
  323. "Transfer reward owner",
  324. "",
  325. "# Arguments",
  326. "",
  327. "* `ctx`- The context of accounts",
  328. "* `new_owner`- new owner pubkey",
  329. ""
  330. ],
  331. "accounts": [
  332. {
  333. "name": "authority",
  334. "isMut": false,
  335. "isSigner": true,
  336. "docs": ["Address to be set as operation account owner."]
  337. },
  338. {
  339. "name": "poolState",
  340. "isMut": true,
  341. "isSigner": false
  342. }
  343. ],
  344. "args": [
  345. {
  346. "name": "newOwner",
  347. "type": "publicKey"
  348. }
  349. ]
  350. },
  351. {
  352. "name": "initializeReward",
  353. "docs": [
  354. "Initialize a reward info for a given pool and reward index",
  355. "",
  356. "# Arguments",
  357. "",
  358. "* `ctx`- The context of accounts",
  359. "* `reward_index` - the index to reward info",
  360. "* `open_time` - reward open timestamp",
  361. "* `end_time` - reward end timestamp",
  362. "* `emissions_per_second_x64` - Token reward per second are earned per unit of liquidity.",
  363. ""
  364. ],
  365. "accounts": [
  366. {
  367. "name": "rewardFunder",
  368. "isMut": true,
  369. "isSigner": true,
  370. "docs": ["The founder deposit reward token to vault"]
  371. },
  372. {
  373. "name": "funderTokenAccount",
  374. "isMut": true,
  375. "isSigner": false
  376. },
  377. {
  378. "name": "ammConfig",
  379. "isMut": false,
  380. "isSigner": false,
  381. "docs": ["For check the reward_funder authority"]
  382. },
  383. {
  384. "name": "poolState",
  385. "isMut": true,
  386. "isSigner": false,
  387. "docs": ["Set reward for this pool"]
  388. },
  389. {
  390. "name": "operationState",
  391. "isMut": false,
  392. "isSigner": false,
  393. "docs": ["load info from the account to judge reward permission"]
  394. },
  395. {
  396. "name": "rewardTokenMint",
  397. "isMut": false,
  398. "isSigner": false,
  399. "docs": ["Reward mint"]
  400. },
  401. {
  402. "name": "rewardTokenVault",
  403. "isMut": true,
  404. "isSigner": false,
  405. "docs": ["A pda, reward vault"]
  406. },
  407. {
  408. "name": "rewardTokenProgram",
  409. "isMut": false,
  410. "isSigner": false
  411. },
  412. {
  413. "name": "systemProgram",
  414. "isMut": false,
  415. "isSigner": false
  416. },
  417. {
  418. "name": "rent",
  419. "isMut": false,
  420. "isSigner": false
  421. }
  422. ],
  423. "args": [
  424. {
  425. "name": "param",
  426. "type": {
  427. "defined": "InitializeRewardParam"
  428. }
  429. }
  430. ]
  431. },
  432. {
  433. "name": "collectRemainingRewards",
  434. "docs": [
  435. "Collect remaining reward token for reward founder",
  436. "",
  437. "# Arguments",
  438. "",
  439. "* `ctx`- The context of accounts",
  440. "* `reward_index` - the index to reward info",
  441. ""
  442. ],
  443. "accounts": [
  444. {
  445. "name": "rewardFunder",
  446. "isMut": false,
  447. "isSigner": true,
  448. "docs": ["The founder who init reward info in berfore"]
  449. },
  450. {
  451. "name": "funderTokenAccount",
  452. "isMut": true,
  453. "isSigner": false,
  454. "docs": ["The funder's reward token account"]
  455. },
  456. {
  457. "name": "poolState",
  458. "isMut": true,
  459. "isSigner": false,
  460. "docs": ["Set reward for this pool"]
  461. },
  462. {
  463. "name": "rewardTokenVault",
  464. "isMut": false,
  465. "isSigner": false,
  466. "docs": [
  467. "Reward vault transfer remaining token to founder token account"
  468. ]
  469. },
  470. {
  471. "name": "rewardVaultMint",
  472. "isMut": false,
  473. "isSigner": false,
  474. "docs": ["The mint of reward token vault"]
  475. },
  476. {
  477. "name": "tokenProgram",
  478. "isMut": false,
  479. "isSigner": false
  480. },
  481. {
  482. "name": "tokenProgram2022",
  483. "isMut": false,
  484. "isSigner": false,
  485. "docs": ["Token program 2022"]
  486. },
  487. {
  488. "name": "memoProgram",
  489. "isMut": false,
  490. "isSigner": false,
  491. "docs": ["memo program"]
  492. }
  493. ],
  494. "args": [
  495. {
  496. "name": "rewardIndex",
  497. "type": "u8"
  498. }
  499. ]
  500. },
  501. {
  502. "name": "updateRewardInfos",
  503. "docs": [
  504. "Update rewards info of the given pool, can be called for everyone",
  505. "",
  506. "# Arguments",
  507. "",
  508. "* `ctx`- The context of accounts",
  509. ""
  510. ],
  511. "accounts": [
  512. {
  513. "name": "poolState",
  514. "isMut": true,
  515. "isSigner": false,
  516. "docs": ["The liquidity pool for which reward info to update"]
  517. }
  518. ],
  519. "args": []
  520. },
  521. {
  522. "name": "setRewardParams",
  523. "docs": [
  524. "Restset reward param, start a new reward cycle or extend the current cycle.",
  525. "",
  526. "# Arguments",
  527. "",
  528. "* `ctx` - The context of accounts",
  529. "* `reward_index` - The index of reward token in the pool.",
  530. "* `emissions_per_second_x64` - The per second emission reward, when extend the current cycle,",
  531. "new value can't be less than old value",
  532. "* `open_time` - reward open timestamp, must be set when state a new cycle",
  533. "* `end_time` - reward end timestamp",
  534. ""
  535. ],
  536. "accounts": [
  537. {
  538. "name": "authority",
  539. "isMut": false,
  540. "isSigner": true,
  541. "docs": [
  542. "Address to be set as protocol owner. It pays to create factory state account."
  543. ]
  544. },
  545. {
  546. "name": "ammConfig",
  547. "isMut": false,
  548. "isSigner": false
  549. },
  550. {
  551. "name": "poolState",
  552. "isMut": true,
  553. "isSigner": false
  554. },
  555. {
  556. "name": "operationState",
  557. "isMut": false,
  558. "isSigner": false,
  559. "docs": ["load info from the account to judge reward permission"]
  560. },
  561. {
  562. "name": "tokenProgram",
  563. "isMut": false,
  564. "isSigner": false,
  565. "docs": ["Token program"]
  566. },
  567. {
  568. "name": "tokenProgram2022",
  569. "isMut": false,
  570. "isSigner": false,
  571. "docs": ["Token program 2022"]
  572. }
  573. ],
  574. "args": [
  575. {
  576. "name": "rewardIndex",
  577. "type": "u8"
  578. },
  579. {
  580. "name": "emissionsPerSecondX64",
  581. "type": "u128"
  582. },
  583. {
  584. "name": "openTime",
  585. "type": "u64"
  586. },
  587. {
  588. "name": "endTime",
  589. "type": "u64"
  590. }
  591. ]
  592. },
  593. {
  594. "name": "collectProtocolFee",
  595. "docs": [
  596. "Collect the protocol fee accrued to the pool",
  597. "",
  598. "# Arguments",
  599. "",
  600. "* `ctx` - The context of accounts",
  601. "* `amount_0_requested` - The maximum amount of token_0 to send, can be 0 to collect fees in only token_1",
  602. "* `amount_1_requested` - The maximum amount of token_1 to send, can be 0 to collect fees in only token_0",
  603. ""
  604. ],
  605. "accounts": [
  606. {
  607. "name": "owner",
  608. "isMut": false,
  609. "isSigner": true,
  610. "docs": ["Only admin or config owner can collect fee now"]
  611. },
  612. {
  613. "name": "poolState",
  614. "isMut": true,
  615. "isSigner": false,
  616. "docs": ["Pool state stores accumulated protocol fee amount"]
  617. },
  618. {
  619. "name": "ammConfig",
  620. "isMut": false,
  621. "isSigner": false,
  622. "docs": ["Amm config account stores owner"]
  623. },
  624. {
  625. "name": "tokenVault0",
  626. "isMut": true,
  627. "isSigner": false,
  628. "docs": ["The address that holds pool tokens for token_0"]
  629. },
  630. {
  631. "name": "tokenVault1",
  632. "isMut": true,
  633. "isSigner": false,
  634. "docs": ["The address that holds pool tokens for token_1"]
  635. },
  636. {
  637. "name": "vault0Mint",
  638. "isMut": false,
  639. "isSigner": false,
  640. "docs": ["The mint of token vault 0"]
  641. },
  642. {
  643. "name": "vault1Mint",
  644. "isMut": false,
  645. "isSigner": false,
  646. "docs": ["The mint of token vault 1"]
  647. },
  648. {
  649. "name": "recipientTokenAccount0",
  650. "isMut": true,
  651. "isSigner": false,
  652. "docs": [
  653. "The address that receives the collected token_0 protocol fees"
  654. ]
  655. },
  656. {
  657. "name": "recipientTokenAccount1",
  658. "isMut": true,
  659. "isSigner": false,
  660. "docs": [
  661. "The address that receives the collected token_1 protocol fees"
  662. ]
  663. },
  664. {
  665. "name": "tokenProgram",
  666. "isMut": false,
  667. "isSigner": false,
  668. "docs": ["The SPL program to perform token transfers"]
  669. },
  670. {
  671. "name": "tokenProgram2022",
  672. "isMut": false,
  673. "isSigner": false,
  674. "docs": ["The SPL program 2022 to perform token transfers"]
  675. }
  676. ],
  677. "args": [
  678. {
  679. "name": "amount0Requested",
  680. "type": "u64"
  681. },
  682. {
  683. "name": "amount1Requested",
  684. "type": "u64"
  685. }
  686. ]
  687. },
  688. {
  689. "name": "collectFundFee",
  690. "docs": [
  691. "Collect the fund fee accrued to the pool",
  692. "",
  693. "# Arguments",
  694. "",
  695. "* `ctx` - The context of accounts",
  696. "* `amount_0_requested` - The maximum amount of token_0 to send, can be 0 to collect fees in only token_1",
  697. "* `amount_1_requested` - The maximum amount of token_1 to send, can be 0 to collect fees in only token_0",
  698. ""
  699. ],
  700. "accounts": [
  701. {
  702. "name": "owner",
  703. "isMut": false,
  704. "isSigner": true,
  705. "docs": ["Only admin or fund_owner can collect fee now"]
  706. },
  707. {
  708. "name": "poolState",
  709. "isMut": true,
  710. "isSigner": false,
  711. "docs": ["Pool state stores accumulated protocol fee amount"]
  712. },
  713. {
  714. "name": "ammConfig",
  715. "isMut": false,
  716. "isSigner": false,
  717. "docs": ["Amm config account stores fund_owner"]
  718. },
  719. {
  720. "name": "tokenVault0",
  721. "isMut": true,
  722. "isSigner": false,
  723. "docs": ["The address that holds pool tokens for token_0"]
  724. },
  725. {
  726. "name": "tokenVault1",
  727. "isMut": true,
  728. "isSigner": false,
  729. "docs": ["The address that holds pool tokens for token_1"]
  730. },
  731. {
  732. "name": "vault0Mint",
  733. "isMut": false,
  734. "isSigner": false,
  735. "docs": ["The mint of token vault 0"]
  736. },
  737. {
  738. "name": "vault1Mint",
  739. "isMut": false,
  740. "isSigner": false,
  741. "docs": ["The mint of token vault 1"]
  742. },
  743. {
  744. "name": "recipientTokenAccount0",
  745. "isMut": true,
  746. "isSigner": false,
  747. "docs": [
  748. "The address that receives the collected token_0 protocol fees"
  749. ]
  750. },
  751. {
  752. "name": "recipientTokenAccount1",
  753. "isMut": true,
  754. "isSigner": false,
  755. "docs": [
  756. "The address that receives the collected token_1 protocol fees"
  757. ]
  758. },
  759. {
  760. "name": "tokenProgram",
  761. "isMut": false,
  762. "isSigner": false,
  763. "docs": ["The SPL program to perform token transfers"]
  764. },
  765. {
  766. "name": "tokenProgram2022",
  767. "isMut": false,
  768. "isSigner": false,
  769. "docs": ["The SPL program 2022 to perform token transfers"]
  770. }
  771. ],
  772. "args": [
  773. {
  774. "name": "amount0Requested",
  775. "type": "u64"
  776. },
  777. {
  778. "name": "amount1Requested",
  779. "type": "u64"
  780. }
  781. ]
  782. },
  783. {
  784. "name": "openPosition",
  785. "docs": [
  786. "#[deprecated(note = \"Use `open_position_with_token22_nft` instead.\")]",
  787. "Creates a new position wrapped in a NFT",
  788. "",
  789. "# Arguments",
  790. "",
  791. "* `ctx` - The context of accounts",
  792. "* `tick_lower_index` - The low boundary of market",
  793. "* `tick_upper_index` - The upper boundary of market",
  794. "* `tick_array_lower_start_index` - The start index of tick array which include tick low",
  795. "* `tick_array_upper_start_index` - The start index of tick array which include tick upper",
  796. "* `liquidity` - The liquidity to be added",
  797. "* `amount_0_max` - The max amount of token_0 to spend, which serves as a slippage check",
  798. "* `amount_1_max` - The max amount of token_1 to spend, which serves as a slippage check",
  799. ""
  800. ],
  801. "accounts": [
  802. {
  803. "name": "payer",
  804. "isMut": true,
  805. "isSigner": true,
  806. "docs": ["Pays to mint the position"]
  807. },
  808. {
  809. "name": "positionNftOwner",
  810. "isMut": false,
  811. "isSigner": false
  812. },
  813. {
  814. "name": "positionNftMint",
  815. "isMut": true,
  816. "isSigner": true,
  817. "docs": ["Unique token mint address"]
  818. },
  819. {
  820. "name": "positionNftAccount",
  821. "isMut": true,
  822. "isSigner": false,
  823. "docs": [
  824. "Token account where position NFT will be minted",
  825. "This account created in the contract by cpi to avoid large stack variables"
  826. ]
  827. },
  828. {
  829. "name": "metadataAccount",
  830. "isMut": true,
  831. "isSigner": false,
  832. "docs": ["To store metaplex metadata"]
  833. },
  834. {
  835. "name": "poolState",
  836. "isMut": true,
  837. "isSigner": false,
  838. "docs": ["Add liquidity for this pool"]
  839. },
  840. {
  841. "name": "protocolPosition",
  842. "isMut": true,
  843. "isSigner": false,
  844. "docs": ["Store the information of market marking in range"]
  845. },
  846. {
  847. "name": "tickArrayLower",
  848. "isMut": true,
  849. "isSigner": false
  850. },
  851. {
  852. "name": "tickArrayUpper",
  853. "isMut": true,
  854. "isSigner": false
  855. },
  856. {
  857. "name": "personalPosition",
  858. "isMut": true,
  859. "isSigner": false,
  860. "docs": ["personal position state"]
  861. },
  862. {
  863. "name": "tokenAccount0",
  864. "isMut": true,
  865. "isSigner": false,
  866. "docs": ["The token_0 account deposit token to the pool"]
  867. },
  868. {
  869. "name": "tokenAccount1",
  870. "isMut": true,
  871. "isSigner": false,
  872. "docs": ["The token_1 account deposit token to the pool"]
  873. },
  874. {
  875. "name": "tokenVault0",
  876. "isMut": true,
  877. "isSigner": false,
  878. "docs": ["The address that holds pool tokens for token_0"]
  879. },
  880. {
  881. "name": "tokenVault1",
  882. "isMut": true,
  883. "isSigner": false,
  884. "docs": ["The address that holds pool tokens for token_1"]
  885. },
  886. {
  887. "name": "rent",
  888. "isMut": false,
  889. "isSigner": false,
  890. "docs": ["Sysvar for token mint and ATA creation"]
  891. },
  892. {
  893. "name": "systemProgram",
  894. "isMut": false,
  895. "isSigner": false,
  896. "docs": ["Program to create the position manager state account"]
  897. },
  898. {
  899. "name": "tokenProgram",
  900. "isMut": false,
  901. "isSigner": false,
  902. "docs": ["Program to create mint account and mint tokens"]
  903. },
  904. {
  905. "name": "associatedTokenProgram",
  906. "isMut": false,
  907. "isSigner": false,
  908. "docs": ["Program to create an ATA for receiving position NFT"]
  909. },
  910. {
  911. "name": "metadataProgram",
  912. "isMut": false,
  913. "isSigner": false,
  914. "docs": ["Program to create NFT metadata"]
  915. }
  916. ],
  917. "args": [
  918. {
  919. "name": "tickLowerIndex",
  920. "type": "i32"
  921. },
  922. {
  923. "name": "tickUpperIndex",
  924. "type": "i32"
  925. },
  926. {
  927. "name": "tickArrayLowerStartIndex",
  928. "type": "i32"
  929. },
  930. {
  931. "name": "tickArrayUpperStartIndex",
  932. "type": "i32"
  933. },
  934. {
  935. "name": "liquidity",
  936. "type": "u128"
  937. },
  938. {
  939. "name": "amount0Max",
  940. "type": "u64"
  941. },
  942. {
  943. "name": "amount1Max",
  944. "type": "u64"
  945. }
  946. ]
  947. },
  948. {
  949. "name": "openPositionV2",
  950. "docs": [
  951. "#[deprecated(note = \"Use `open_position_with_token22_nft` instead.\")]",
  952. "Creates a new position wrapped in a NFT, support Token2022",
  953. "",
  954. "# Arguments",
  955. "",
  956. "* `ctx` - The context of accounts",
  957. "* `tick_lower_index` - The low boundary of market",
  958. "* `tick_upper_index` - The upper boundary of market",
  959. "* `tick_array_lower_start_index` - The start index of tick array which include tick low",
  960. "* `tick_array_upper_start_index` - The start index of tick array which include tick upper",
  961. "* `liquidity` - The liquidity to be added, if zero, and the base_flage is specified, calculate liquidity base amount_0_max or amount_1_max according base_flag, otherwise open position with zero liquidity",
  962. "* `amount_0_max` - The max amount of token_0 to spend, which serves as a slippage check",
  963. "* `amount_1_max` - The max amount of token_1 to spend, which serves as a slippage check",
  964. "* `with_metadata` - The flag indicating whether to create NFT mint metadata",
  965. "* `base_flag` - if the liquidity specified as zero, true: calculate liquidity base amount_0_max otherwise base amount_1_max",
  966. ""
  967. ],
  968. "accounts": [
  969. {
  970. "name": "payer",
  971. "isMut": true,
  972. "isSigner": true,
  973. "docs": ["Pays to mint the position"]
  974. },
  975. {
  976. "name": "positionNftOwner",
  977. "isMut": false,
  978. "isSigner": false
  979. },
  980. {
  981. "name": "positionNftMint",
  982. "isMut": true,
  983. "isSigner": true,
  984. "docs": ["Unique token mint address"]
  985. },
  986. {
  987. "name": "positionNftAccount",
  988. "isMut": true,
  989. "isSigner": false,
  990. "docs": ["Token account where position NFT will be minted"]
  991. },
  992. {
  993. "name": "metadataAccount",
  994. "isMut": true,
  995. "isSigner": false,
  996. "docs": ["To store metaplex metadata"]
  997. },
  998. {
  999. "name": "poolState",
  1000. "isMut": true,
  1001. "isSigner": false,
  1002. "docs": ["Add liquidity for this pool"]
  1003. },
  1004. {
  1005. "name": "protocolPosition",
  1006. "isMut": true,
  1007. "isSigner": false,
  1008. "docs": ["Store the information of market marking in range"]
  1009. },
  1010. {
  1011. "name": "tickArrayLower",
  1012. "isMut": true,
  1013. "isSigner": false
  1014. },
  1015. {
  1016. "name": "tickArrayUpper",
  1017. "isMut": true,
  1018. "isSigner": false
  1019. },
  1020. {
  1021. "name": "personalPosition",
  1022. "isMut": true,
  1023. "isSigner": false,
  1024. "docs": ["personal position state"]
  1025. },
  1026. {
  1027. "name": "tokenAccount0",
  1028. "isMut": true,
  1029. "isSigner": false,
  1030. "docs": ["The token_0 account deposit token to the pool"]
  1031. },
  1032. {
  1033. "name": "tokenAccount1",
  1034. "isMut": true,
  1035. "isSigner": false,
  1036. "docs": ["The token_1 account deposit token to the pool"]
  1037. },
  1038. {
  1039. "name": "tokenVault0",
  1040. "isMut": true,
  1041. "isSigner": false,
  1042. "docs": ["The address that holds pool tokens for token_0"]
  1043. },
  1044. {
  1045. "name": "tokenVault1",
  1046. "isMut": true,
  1047. "isSigner": false,
  1048. "docs": ["The address that holds pool tokens for token_1"]
  1049. },
  1050. {
  1051. "name": "rent",
  1052. "isMut": false,
  1053. "isSigner": false,
  1054. "docs": ["Sysvar for token mint and ATA creation"]
  1055. },
  1056. {
  1057. "name": "systemProgram",
  1058. "isMut": false,
  1059. "isSigner": false,
  1060. "docs": ["Program to create the position manager state account"]
  1061. },
  1062. {
  1063. "name": "tokenProgram",
  1064. "isMut": false,
  1065. "isSigner": false,
  1066. "docs": ["Program to create mint account and mint tokens"]
  1067. },
  1068. {
  1069. "name": "associatedTokenProgram",
  1070. "isMut": false,
  1071. "isSigner": false,
  1072. "docs": ["Program to create an ATA for receiving position NFT"]
  1073. },
  1074. {
  1075. "name": "metadataProgram",
  1076. "isMut": false,
  1077. "isSigner": false,
  1078. "docs": ["Program to create NFT metadata"]
  1079. },
  1080. {
  1081. "name": "tokenProgram2022",
  1082. "isMut": false,
  1083. "isSigner": false,
  1084. "docs": ["Program to create mint account and mint tokens"]
  1085. },
  1086. {
  1087. "name": "vault0Mint",
  1088. "isMut": false,
  1089. "isSigner": false,
  1090. "docs": ["The mint of token vault 0"]
  1091. },
  1092. {
  1093. "name": "vault1Mint",
  1094. "isMut": false,
  1095. "isSigner": false,
  1096. "docs": ["The mint of token vault 1"]
  1097. }
  1098. ],
  1099. "args": [
  1100. {
  1101. "name": "tickLowerIndex",
  1102. "type": "i32"
  1103. },
  1104. {
  1105. "name": "tickUpperIndex",
  1106. "type": "i32"
  1107. },
  1108. {
  1109. "name": "tickArrayLowerStartIndex",
  1110. "type": "i32"
  1111. },
  1112. {
  1113. "name": "tickArrayUpperStartIndex",
  1114. "type": "i32"
  1115. },
  1116. {
  1117. "name": "liquidity",
  1118. "type": "u128"
  1119. },
  1120. {
  1121. "name": "amount0Max",
  1122. "type": "u64"
  1123. },
  1124. {
  1125. "name": "amount1Max",
  1126. "type": "u64"
  1127. },
  1128. {
  1129. "name": "withMetadata",
  1130. "type": "bool"
  1131. },
  1132. {
  1133. "name": "baseFlag",
  1134. "type": {
  1135. "option": "bool"
  1136. }
  1137. }
  1138. ]
  1139. },
  1140. {
  1141. "name": "openPositionWithToken22Nft",
  1142. "docs": [
  1143. "Creates a new position wrapped in a Token2022 NFT without relying on metadata_program and metadata_account, reduce the cost for user to create a personal position.",
  1144. "",
  1145. "# Arguments",
  1146. "",
  1147. "* `ctx` - The context of accounts",
  1148. "* `tick_lower_index` - The low boundary of market",
  1149. "* `tick_upper_index` - The upper boundary of market",
  1150. "* `tick_array_lower_start_index` - The start index of tick array which include tick low",
  1151. "* `tick_array_upper_start_index` - The start index of tick array which include tick upper",
  1152. "* `liquidity` - The liquidity to be added, if zero, and the base_flage is specified, calculate liquidity base amount_0_max or amount_1_max according base_flag, otherwise open position with zero liquidity",
  1153. "* `amount_0_max` - The max amount of token_0 to spend, which serves as a slippage check",
  1154. "* `amount_1_max` - The max amount of token_1 to spend, which serves as a slippage check",
  1155. "* `with_metadata` - The flag indicating whether to create NFT mint metadata",
  1156. "* `base_flag` - if the liquidity specified as zero, true: calculate liquidity base amount_0_max otherwise base amount_1_max",
  1157. ""
  1158. ],
  1159. "accounts": [
  1160. {
  1161. "name": "payer",
  1162. "isMut": true,
  1163. "isSigner": true,
  1164. "docs": ["Pays to mint the position"]
  1165. },
  1166. {
  1167. "name": "positionNftOwner",
  1168. "isMut": false,
  1169. "isSigner": false
  1170. },
  1171. {
  1172. "name": "positionNftMint",
  1173. "isMut": true,
  1174. "isSigner": true,
  1175. "docs": ["Unique token mint address, initialize in constract"]
  1176. },
  1177. {
  1178. "name": "positionNftAccount",
  1179. "isMut": true,
  1180. "isSigner": false
  1181. },
  1182. {
  1183. "name": "poolState",
  1184. "isMut": true,
  1185. "isSigner": false,
  1186. "docs": ["Add liquidity for this pool"]
  1187. },
  1188. {
  1189. "name": "protocolPosition",
  1190. "isMut": true,
  1191. "isSigner": false,
  1192. "docs": ["Store the information of market marking in range"]
  1193. },
  1194. {
  1195. "name": "tickArrayLower",
  1196. "isMut": true,
  1197. "isSigner": false
  1198. },
  1199. {
  1200. "name": "tickArrayUpper",
  1201. "isMut": true,
  1202. "isSigner": false
  1203. },
  1204. {
  1205. "name": "personalPosition",
  1206. "isMut": true,
  1207. "isSigner": false,
  1208. "docs": ["personal position state"]
  1209. },
  1210. {
  1211. "name": "tokenAccount0",
  1212. "isMut": true,
  1213. "isSigner": false,
  1214. "docs": ["The token_0 account deposit token to the pool"]
  1215. },
  1216. {
  1217. "name": "tokenAccount1",
  1218. "isMut": true,
  1219. "isSigner": false,
  1220. "docs": ["The token_1 account deposit token to the pool"]
  1221. },
  1222. {
  1223. "name": "tokenVault0",
  1224. "isMut": true,
  1225. "isSigner": false,
  1226. "docs": ["The address that holds pool tokens for token_0"]
  1227. },
  1228. {
  1229. "name": "tokenVault1",
  1230. "isMut": true,
  1231. "isSigner": false,
  1232. "docs": ["The address that holds pool tokens for token_1"]
  1233. },
  1234. {
  1235. "name": "rent",
  1236. "isMut": false,
  1237. "isSigner": false,
  1238. "docs": ["Sysvar for token mint and ATA creation"]
  1239. },
  1240. {
  1241. "name": "systemProgram",
  1242. "isMut": false,
  1243. "isSigner": false,
  1244. "docs": ["Program to create the position manager state account"]
  1245. },
  1246. {
  1247. "name": "tokenProgram",
  1248. "isMut": false,
  1249. "isSigner": false,
  1250. "docs": ["Program to transfer for token account"]
  1251. },
  1252. {
  1253. "name": "associatedTokenProgram",
  1254. "isMut": false,
  1255. "isSigner": false,
  1256. "docs": ["Program to create an ATA for receiving position NFT"]
  1257. },
  1258. {
  1259. "name": "tokenProgram2022",
  1260. "isMut": false,
  1261. "isSigner": false,
  1262. "docs": [
  1263. "Program to create NFT mint/token account and transfer for token22 account"
  1264. ]
  1265. },
  1266. {
  1267. "name": "vault0Mint",
  1268. "isMut": false,
  1269. "isSigner": false,
  1270. "docs": ["The mint of token vault 0"]
  1271. },
  1272. {
  1273. "name": "vault1Mint",
  1274. "isMut": false,
  1275. "isSigner": false,
  1276. "docs": ["The mint of token vault 1"]
  1277. }
  1278. ],
  1279. "args": [
  1280. {
  1281. "name": "tickLowerIndex",
  1282. "type": "i32"
  1283. },
  1284. {
  1285. "name": "tickUpperIndex",
  1286. "type": "i32"
  1287. },
  1288. {
  1289. "name": "tickArrayLowerStartIndex",
  1290. "type": "i32"
  1291. },
  1292. {
  1293. "name": "tickArrayUpperStartIndex",
  1294. "type": "i32"
  1295. },
  1296. {
  1297. "name": "liquidity",
  1298. "type": "u128"
  1299. },
  1300. {
  1301. "name": "amount0Max",
  1302. "type": "u64"
  1303. },
  1304. {
  1305. "name": "amount1Max",
  1306. "type": "u64"
  1307. },
  1308. {
  1309. "name": "withMetadata",
  1310. "type": "bool"
  1311. },
  1312. {
  1313. "name": "baseFlag",
  1314. "type": {
  1315. "option": "bool"
  1316. }
  1317. }
  1318. ]
  1319. },
  1320. {
  1321. "name": "closePosition",
  1322. "docs": [
  1323. "Close the user's position and NFT account. If the NFT mint belongs to token2022, it will also be closed and the funds returned to the NFT owner.",
  1324. "",
  1325. "# Arguments",
  1326. "",
  1327. "* `ctx` - The context of accounts",
  1328. ""
  1329. ],
  1330. "accounts": [
  1331. {
  1332. "name": "nftOwner",
  1333. "isMut": true,
  1334. "isSigner": true,
  1335. "docs": ["The position nft owner"]
  1336. },
  1337. {
  1338. "name": "positionNftMint",
  1339. "isMut": true,
  1340. "isSigner": false,
  1341. "docs": ["Mint address bound to the personal position."]
  1342. },
  1343. {
  1344. "name": "positionNftAccount",
  1345. "isMut": true,
  1346. "isSigner": false,
  1347. "docs": ["User token account where position NFT be minted to"]
  1348. },
  1349. {
  1350. "name": "personalPosition",
  1351. "isMut": true,
  1352. "isSigner": false
  1353. },
  1354. {
  1355. "name": "systemProgram",
  1356. "isMut": false,
  1357. "isSigner": false,
  1358. "docs": ["System program to close the position state account"]
  1359. },
  1360. {
  1361. "name": "tokenProgram",
  1362. "isMut": false,
  1363. "isSigner": false,
  1364. "docs": ["Token/Token2022 program to close token/mint account"]
  1365. }
  1366. ],
  1367. "args": []
  1368. },
  1369. {
  1370. "name": "increaseLiquidity",
  1371. "docs": [
  1372. "#[deprecated(note = \"Use `increase_liquidity_v2` instead.\")]",
  1373. "Increases liquidity with a exist position, with amount paid by `payer`",
  1374. "",
  1375. "# Arguments",
  1376. "",
  1377. "* `ctx` - The context of accounts",
  1378. "* `liquidity` - The desired liquidity to be added, can't be zero",
  1379. "* `amount_0_max` - The max amount of token_0 to spend, which serves as a slippage check",
  1380. "* `amount_1_max` - The max amount of token_1 to spend, which serves as a slippage check",
  1381. ""
  1382. ],
  1383. "accounts": [
  1384. {
  1385. "name": "nftOwner",
  1386. "isMut": false,
  1387. "isSigner": true,
  1388. "docs": ["Pays to mint the position"]
  1389. },
  1390. {
  1391. "name": "nftAccount",
  1392. "isMut": false,
  1393. "isSigner": false,
  1394. "docs": ["The token account for nft"]
  1395. },
  1396. {
  1397. "name": "poolState",
  1398. "isMut": true,
  1399. "isSigner": false
  1400. },
  1401. {
  1402. "name": "protocolPosition",
  1403. "isMut": true,
  1404. "isSigner": false
  1405. },
  1406. {
  1407. "name": "personalPosition",
  1408. "isMut": true,
  1409. "isSigner": false,
  1410. "docs": ["Increase liquidity for this position"]
  1411. },
  1412. {
  1413. "name": "tickArrayLower",
  1414. "isMut": true,
  1415. "isSigner": false,
  1416. "docs": ["Stores init state for the lower tick"]
  1417. },
  1418. {
  1419. "name": "tickArrayUpper",
  1420. "isMut": true,
  1421. "isSigner": false,
  1422. "docs": ["Stores init state for the upper tick"]
  1423. },
  1424. {
  1425. "name": "tokenAccount0",
  1426. "isMut": true,
  1427. "isSigner": false,
  1428. "docs": ["The payer's token account for token_0"]
  1429. },
  1430. {
  1431. "name": "tokenAccount1",
  1432. "isMut": true,
  1433. "isSigner": false,
  1434. "docs": ["The token account spending token_1 to mint the position"]
  1435. },
  1436. {
  1437. "name": "tokenVault0",
  1438. "isMut": true,
  1439. "isSigner": false,
  1440. "docs": ["The address that holds pool tokens for token_0"]
  1441. },
  1442. {
  1443. "name": "tokenVault1",
  1444. "isMut": true,
  1445. "isSigner": false,
  1446. "docs": ["The address that holds pool tokens for token_1"]
  1447. },
  1448. {
  1449. "name": "tokenProgram",
  1450. "isMut": false,
  1451. "isSigner": false,
  1452. "docs": ["Program to create mint account and mint tokens"]
  1453. }
  1454. ],
  1455. "args": [
  1456. {
  1457. "name": "liquidity",
  1458. "type": "u128"
  1459. },
  1460. {
  1461. "name": "amount0Max",
  1462. "type": "u64"
  1463. },
  1464. {
  1465. "name": "amount1Max",
  1466. "type": "u64"
  1467. }
  1468. ]
  1469. },
  1470. {
  1471. "name": "increaseLiquidityV2",
  1472. "docs": [
  1473. "Increases liquidity with a exist position, with amount paid by `payer`, support Token2022",
  1474. "",
  1475. "# Arguments",
  1476. "",
  1477. "* `ctx` - The context of accounts",
  1478. "* `liquidity` - The desired liquidity to be added, if zero, calculate liquidity base amount_0 or amount_1 according base_flag",
  1479. "* `amount_0_max` - The max amount of token_0 to spend, which serves as a slippage check",
  1480. "* `amount_1_max` - The max amount of token_1 to spend, which serves as a slippage check",
  1481. "* `base_flag` - must be specified if liquidity is zero, true: calculate liquidity base amount_0_max otherwise base amount_1_max",
  1482. ""
  1483. ],
  1484. "accounts": [
  1485. {
  1486. "name": "nftOwner",
  1487. "isMut": false,
  1488. "isSigner": true,
  1489. "docs": ["Pays to mint the position"]
  1490. },
  1491. {
  1492. "name": "nftAccount",
  1493. "isMut": false,
  1494. "isSigner": false,
  1495. "docs": ["The token account for nft"]
  1496. },
  1497. {
  1498. "name": "poolState",
  1499. "isMut": true,
  1500. "isSigner": false
  1501. },
  1502. {
  1503. "name": "protocolPosition",
  1504. "isMut": true,
  1505. "isSigner": false
  1506. },
  1507. {
  1508. "name": "personalPosition",
  1509. "isMut": true,
  1510. "isSigner": false,
  1511. "docs": ["Increase liquidity for this position"]
  1512. },
  1513. {
  1514. "name": "tickArrayLower",
  1515. "isMut": true,
  1516. "isSigner": false,
  1517. "docs": ["Stores init state for the lower tick"]
  1518. },
  1519. {
  1520. "name": "tickArrayUpper",
  1521. "isMut": true,
  1522. "isSigner": false,
  1523. "docs": ["Stores init state for the upper tick"]
  1524. },
  1525. {
  1526. "name": "tokenAccount0",
  1527. "isMut": true,
  1528. "isSigner": false,
  1529. "docs": ["The payer's token account for token_0"]
  1530. },
  1531. {
  1532. "name": "tokenAccount1",
  1533. "isMut": true,
  1534. "isSigner": false,
  1535. "docs": ["The token account spending token_1 to mint the position"]
  1536. },
  1537. {
  1538. "name": "tokenVault0",
  1539. "isMut": true,
  1540. "isSigner": false,
  1541. "docs": ["The address that holds pool tokens for token_0"]
  1542. },
  1543. {
  1544. "name": "tokenVault1",
  1545. "isMut": true,
  1546. "isSigner": false,
  1547. "docs": ["The address that holds pool tokens for token_1"]
  1548. },
  1549. {
  1550. "name": "tokenProgram",
  1551. "isMut": false,
  1552. "isSigner": false,
  1553. "docs": ["Program to create mint account and mint tokens"]
  1554. },
  1555. {
  1556. "name": "tokenProgram2022",
  1557. "isMut": false,
  1558. "isSigner": false,
  1559. "docs": ["Token program 2022"]
  1560. },
  1561. {
  1562. "name": "vault0Mint",
  1563. "isMut": false,
  1564. "isSigner": false,
  1565. "docs": ["The mint of token vault 0"]
  1566. },
  1567. {
  1568. "name": "vault1Mint",
  1569. "isMut": false,
  1570. "isSigner": false,
  1571. "docs": ["The mint of token vault 1"]
  1572. }
  1573. ],
  1574. "args": [
  1575. {
  1576. "name": "liquidity",
  1577. "type": "u128"
  1578. },
  1579. {
  1580. "name": "amount0Max",
  1581. "type": "u64"
  1582. },
  1583. {
  1584. "name": "amount1Max",
  1585. "type": "u64"
  1586. },
  1587. {
  1588. "name": "baseFlag",
  1589. "type": {
  1590. "option": "bool"
  1591. }
  1592. }
  1593. ]
  1594. },
  1595. {
  1596. "name": "decreaseLiquidity",
  1597. "docs": [
  1598. "#[deprecated(note = \"Use `decrease_liquidity_v2` instead.\")]",
  1599. "Decreases liquidity with a exist position",
  1600. "",
  1601. "# Arguments",
  1602. "",
  1603. "* `ctx` - The context of accounts",
  1604. "* `liquidity` - The amount by which liquidity will be decreased",
  1605. "* `amount_0_min` - The minimum amount of token_0 that should be accounted for the burned liquidity",
  1606. "* `amount_1_min` - The minimum amount of token_1 that should be accounted for the burned liquidity",
  1607. ""
  1608. ],
  1609. "accounts": [
  1610. {
  1611. "name": "nftOwner",
  1612. "isMut": false,
  1613. "isSigner": true,
  1614. "docs": ["The position owner or delegated authority"]
  1615. },
  1616. {
  1617. "name": "nftAccount",
  1618. "isMut": false,
  1619. "isSigner": false,
  1620. "docs": ["The token account for the tokenized position"]
  1621. },
  1622. {
  1623. "name": "personalPosition",
  1624. "isMut": true,
  1625. "isSigner": false,
  1626. "docs": ["Decrease liquidity for this position"]
  1627. },
  1628. {
  1629. "name": "poolState",
  1630. "isMut": true,
  1631. "isSigner": false
  1632. },
  1633. {
  1634. "name": "protocolPosition",
  1635. "isMut": true,
  1636. "isSigner": false
  1637. },
  1638. {
  1639. "name": "tokenVault0",
  1640. "isMut": true,
  1641. "isSigner": false,
  1642. "docs": ["Token_0 vault"]
  1643. },
  1644. {
  1645. "name": "tokenVault1",
  1646. "isMut": true,
  1647. "isSigner": false,
  1648. "docs": ["Token_1 vault"]
  1649. },
  1650. {
  1651. "name": "tickArrayLower",
  1652. "isMut": true,
  1653. "isSigner": false,
  1654. "docs": ["Stores init state for the lower tick"]
  1655. },
  1656. {
  1657. "name": "tickArrayUpper",
  1658. "isMut": true,
  1659. "isSigner": false,
  1660. "docs": ["Stores init state for the upper tick"]
  1661. },
  1662. {
  1663. "name": "recipientTokenAccount0",
  1664. "isMut": true,
  1665. "isSigner": false,
  1666. "docs": ["The destination token account for receive amount_0"]
  1667. },
  1668. {
  1669. "name": "recipientTokenAccount1",
  1670. "isMut": true,
  1671. "isSigner": false,
  1672. "docs": ["The destination token account for receive amount_1"]
  1673. },
  1674. {
  1675. "name": "tokenProgram",
  1676. "isMut": false,
  1677. "isSigner": false,
  1678. "docs": ["SPL program to transfer out tokens"]
  1679. }
  1680. ],
  1681. "args": [
  1682. {
  1683. "name": "liquidity",
  1684. "type": "u128"
  1685. },
  1686. {
  1687. "name": "amount0Min",
  1688. "type": "u64"
  1689. },
  1690. {
  1691. "name": "amount1Min",
  1692. "type": "u64"
  1693. }
  1694. ]
  1695. },
  1696. {
  1697. "name": "decreaseLiquidityV2",
  1698. "docs": [
  1699. "Decreases liquidity with a exist position, support Token2022",
  1700. "",
  1701. "# Arguments",
  1702. "",
  1703. "* `ctx` - The context of accounts",
  1704. "* `liquidity` - The amount by which liquidity will be decreased",
  1705. "* `amount_0_min` - The minimum amount of token_0 that should be accounted for the burned liquidity",
  1706. "* `amount_1_min` - The minimum amount of token_1 that should be accounted for the burned liquidity",
  1707. ""
  1708. ],
  1709. "accounts": [
  1710. {
  1711. "name": "nftOwner",
  1712. "isMut": false,
  1713. "isSigner": true,
  1714. "docs": ["The position owner or delegated authority"]
  1715. },
  1716. {
  1717. "name": "nftAccount",
  1718. "isMut": false,
  1719. "isSigner": false,
  1720. "docs": ["The token account for the tokenized position"]
  1721. },
  1722. {
  1723. "name": "personalPosition",
  1724. "isMut": true,
  1725. "isSigner": false,
  1726. "docs": ["Decrease liquidity for this position"]
  1727. },
  1728. {
  1729. "name": "poolState",
  1730. "isMut": true,
  1731. "isSigner": false
  1732. },
  1733. {
  1734. "name": "protocolPosition",
  1735. "isMut": true,
  1736. "isSigner": false
  1737. },
  1738. {
  1739. "name": "tokenVault0",
  1740. "isMut": true,
  1741. "isSigner": false,
  1742. "docs": ["Token_0 vault"]
  1743. },
  1744. {
  1745. "name": "tokenVault1",
  1746. "isMut": true,
  1747. "isSigner": false,
  1748. "docs": ["Token_1 vault"]
  1749. },
  1750. {
  1751. "name": "tickArrayLower",
  1752. "isMut": true,
  1753. "isSigner": false,
  1754. "docs": ["Stores init state for the lower tick"]
  1755. },
  1756. {
  1757. "name": "tickArrayUpper",
  1758. "isMut": true,
  1759. "isSigner": false,
  1760. "docs": ["Stores init state for the upper tick"]
  1761. },
  1762. {
  1763. "name": "recipientTokenAccount0",
  1764. "isMut": true,
  1765. "isSigner": false,
  1766. "docs": ["The destination token account for receive amount_0"]
  1767. },
  1768. {
  1769. "name": "recipientTokenAccount1",
  1770. "isMut": true,
  1771. "isSigner": false,
  1772. "docs": ["The destination token account for receive amount_1"]
  1773. },
  1774. {
  1775. "name": "tokenProgram",
  1776. "isMut": false,
  1777. "isSigner": false,
  1778. "docs": ["SPL program to transfer out tokens"]
  1779. },
  1780. {
  1781. "name": "tokenProgram2022",
  1782. "isMut": false,
  1783. "isSigner": false,
  1784. "docs": ["Token program 2022"]
  1785. },
  1786. {
  1787. "name": "memoProgram",
  1788. "isMut": false,
  1789. "isSigner": false,
  1790. "docs": ["memo program"]
  1791. },
  1792. {
  1793. "name": "vault0Mint",
  1794. "isMut": false,
  1795. "isSigner": false,
  1796. "docs": ["The mint of token vault 0"]
  1797. },
  1798. {
  1799. "name": "vault1Mint",
  1800. "isMut": false,
  1801. "isSigner": false,
  1802. "docs": ["The mint of token vault 1"]
  1803. }
  1804. ],
  1805. "args": [
  1806. {
  1807. "name": "liquidity",
  1808. "type": "u128"
  1809. },
  1810. {
  1811. "name": "amount0Min",
  1812. "type": "u64"
  1813. },
  1814. {
  1815. "name": "amount1Min",
  1816. "type": "u64"
  1817. }
  1818. ]
  1819. },
  1820. {
  1821. "name": "swap",
  1822. "docs": [
  1823. "#[deprecated(note = \"Use `swap_v2` instead.\")]",
  1824. "Swaps one token for as much as possible of another token across a single pool",
  1825. "",
  1826. "# Arguments",
  1827. "",
  1828. "* `ctx` - The context of accounts",
  1829. "* `amount` - Arranged in pairs with other_amount_threshold. (amount_in, amount_out_minimum) or (amount_out, amount_in_maximum)",
  1830. "* `other_amount_threshold` - For slippage check",
  1831. "* `sqrt_price_limit` - The Q64.64 sqrt price √P limit. If zero for one, the price cannot",
  1832. "* `is_base_input` - swap base input or swap base output",
  1833. ""
  1834. ],
  1835. "accounts": [
  1836. {
  1837. "name": "payer",
  1838. "isMut": false,
  1839. "isSigner": true,
  1840. "docs": ["The user performing the swap"]
  1841. },
  1842. {
  1843. "name": "ammConfig",
  1844. "isMut": false,
  1845. "isSigner": false,
  1846. "docs": ["The factory state to read protocol fees"]
  1847. },
  1848. {
  1849. "name": "poolState",
  1850. "isMut": true,
  1851. "isSigner": false,
  1852. "docs": [
  1853. "The program account of the pool in which the swap will be performed"
  1854. ]
  1855. },
  1856. {
  1857. "name": "inputTokenAccount",
  1858. "isMut": true,
  1859. "isSigner": false,
  1860. "docs": ["The user token account for input token"]
  1861. },
  1862. {
  1863. "name": "outputTokenAccount",
  1864. "isMut": true,
  1865. "isSigner": false,
  1866. "docs": ["The user token account for output token"]
  1867. },
  1868. {
  1869. "name": "inputVault",
  1870. "isMut": true,
  1871. "isSigner": false,
  1872. "docs": ["The vault token account for input token"]
  1873. },
  1874. {
  1875. "name": "outputVault",
  1876. "isMut": true,
  1877. "isSigner": false,
  1878. "docs": ["The vault token account for output token"]
  1879. },
  1880. {
  1881. "name": "observationState",
  1882. "isMut": true,
  1883. "isSigner": false,
  1884. "docs": ["The program account for the most recent oracle observation"]
  1885. },
  1886. {
  1887. "name": "tokenProgram",
  1888. "isMut": false,
  1889. "isSigner": false,
  1890. "docs": ["SPL program for token transfers"]
  1891. },
  1892. {
  1893. "name": "tickArray",
  1894. "isMut": true,
  1895. "isSigner": false
  1896. }
  1897. ],
  1898. "args": [
  1899. {
  1900. "name": "amount",
  1901. "type": "u64"
  1902. },
  1903. {
  1904. "name": "otherAmountThreshold",
  1905. "type": "u64"
  1906. },
  1907. {
  1908. "name": "sqrtPriceLimitX64",
  1909. "type": "u128"
  1910. },
  1911. {
  1912. "name": "isBaseInput",
  1913. "type": "bool"
  1914. }
  1915. ]
  1916. },
  1917. {
  1918. "name": "swapV2",
  1919. "docs": [
  1920. "Swaps one token for as much as possible of another token across a single pool, support token program 2022",
  1921. "",
  1922. "# Arguments",
  1923. "",
  1924. "* `ctx` - The context of accounts",
  1925. "* `amount` - Arranged in pairs with other_amount_threshold. (amount_in, amount_out_minimum) or (amount_out, amount_in_maximum)",
  1926. "* `other_amount_threshold` - For slippage check",
  1927. "* `sqrt_price_limit` - The Q64.64 sqrt price √P limit. If zero for one, the price cannot",
  1928. "* `is_base_input` - swap base input or swap base output",
  1929. ""
  1930. ],
  1931. "accounts": [
  1932. {
  1933. "name": "payer",
  1934. "isMut": false,
  1935. "isSigner": true,
  1936. "docs": ["The user performing the swap"]
  1937. },
  1938. {
  1939. "name": "ammConfig",
  1940. "isMut": false,
  1941. "isSigner": false,
  1942. "docs": ["The factory state to read protocol fees"]
  1943. },
  1944. {
  1945. "name": "poolState",
  1946. "isMut": true,
  1947. "isSigner": false,
  1948. "docs": [
  1949. "The program account of the pool in which the swap will be performed"
  1950. ]
  1951. },
  1952. {
  1953. "name": "inputTokenAccount",
  1954. "isMut": true,
  1955. "isSigner": false,
  1956. "docs": ["The user token account for input token"]
  1957. },
  1958. {
  1959. "name": "outputTokenAccount",
  1960. "isMut": true,
  1961. "isSigner": false,
  1962. "docs": ["The user token account for output token"]
  1963. },
  1964. {
  1965. "name": "inputVault",
  1966. "isMut": true,
  1967. "isSigner": false,
  1968. "docs": ["The vault token account for input token"]
  1969. },
  1970. {
  1971. "name": "outputVault",
  1972. "isMut": true,
  1973. "isSigner": false,
  1974. "docs": ["The vault token account for output token"]
  1975. },
  1976. {
  1977. "name": "observationState",
  1978. "isMut": true,
  1979. "isSigner": false,
  1980. "docs": ["The program account for the most recent oracle observation"]
  1981. },
  1982. {
  1983. "name": "tokenProgram",
  1984. "isMut": false,
  1985. "isSigner": false,
  1986. "docs": ["SPL program for token transfers"]
  1987. },
  1988. {
  1989. "name": "tokenProgram2022",
  1990. "isMut": false,
  1991. "isSigner": false,
  1992. "docs": ["SPL program 2022 for token transfers"]
  1993. },
  1994. {
  1995. "name": "memoProgram",
  1996. "isMut": false,
  1997. "isSigner": false
  1998. },
  1999. {
  2000. "name": "inputVaultMint",
  2001. "isMut": false,
  2002. "isSigner": false,
  2003. "docs": ["The mint of token vault 0"]
  2004. },
  2005. {
  2006. "name": "outputVaultMint",
  2007. "isMut": false,
  2008. "isSigner": false,
  2009. "docs": ["The mint of token vault 1"]
  2010. }
  2011. ],
  2012. "args": [
  2013. {
  2014. "name": "amount",
  2015. "type": "u64"
  2016. },
  2017. {
  2018. "name": "otherAmountThreshold",
  2019. "type": "u64"
  2020. },
  2021. {
  2022. "name": "sqrtPriceLimitX64",
  2023. "type": "u128"
  2024. },
  2025. {
  2026. "name": "isBaseInput",
  2027. "type": "bool"
  2028. }
  2029. ]
  2030. },
  2031. {
  2032. "name": "swapRouterBaseIn",
  2033. "docs": [
  2034. "Swap token for as much as possible of another token across the path provided, base input",
  2035. "",
  2036. "# Arguments",
  2037. "",
  2038. "* `ctx` - The context of accounts",
  2039. "* `amount_in` - Token amount to be swapped in",
  2040. "* `amount_out_minimum` - Panic if output amount is below minimum amount. For slippage.",
  2041. ""
  2042. ],
  2043. "accounts": [
  2044. {
  2045. "name": "payer",
  2046. "isMut": false,
  2047. "isSigner": true,
  2048. "docs": ["The user performing the swap"]
  2049. },
  2050. {
  2051. "name": "inputTokenAccount",
  2052. "isMut": true,
  2053. "isSigner": false,
  2054. "docs": ["The token account that pays input tokens for the swap"]
  2055. },
  2056. {
  2057. "name": "inputTokenMint",
  2058. "isMut": true,
  2059. "isSigner": false,
  2060. "docs": ["The mint of input token"]
  2061. },
  2062. {
  2063. "name": "tokenProgram",
  2064. "isMut": false,
  2065. "isSigner": false,
  2066. "docs": ["SPL program for token transfers"]
  2067. },
  2068. {
  2069. "name": "tokenProgram2022",
  2070. "isMut": false,
  2071. "isSigner": false,
  2072. "docs": ["SPL program 2022 for token transfers"]
  2073. },
  2074. {
  2075. "name": "memoProgram",
  2076. "isMut": false,
  2077. "isSigner": false
  2078. }
  2079. ],
  2080. "args": [
  2081. {
  2082. "name": "amountIn",
  2083. "type": "u64"
  2084. },
  2085. {
  2086. "name": "amountOutMinimum",
  2087. "type": "u64"
  2088. }
  2089. ]
  2090. }
  2091. ],
  2092. "accounts": [
  2093. {
  2094. "name": "AmmConfig",
  2095. "docs": ["Holds the current owner of the factory"],
  2096. "type": {
  2097. "kind": "struct",
  2098. "fields": [
  2099. {
  2100. "name": "bump",
  2101. "docs": ["Bump to identify PDA"],
  2102. "type": "u8"
  2103. },
  2104. {
  2105. "name": "index",
  2106. "type": "u16"
  2107. },
  2108. {
  2109. "name": "owner",
  2110. "docs": ["Address of the protocol owner"],
  2111. "type": "publicKey"
  2112. },
  2113. {
  2114. "name": "protocolFeeRate",
  2115. "docs": ["The protocol fee"],
  2116. "type": "u32"
  2117. },
  2118. {
  2119. "name": "tradeFeeRate",
  2120. "docs": [
  2121. "The trade fee, denominated in hundredths of a bip (10^-6)"
  2122. ],
  2123. "type": "u32"
  2124. },
  2125. {
  2126. "name": "tickSpacing",
  2127. "docs": ["The tick spacing"],
  2128. "type": "u16"
  2129. },
  2130. {
  2131. "name": "fundFeeRate",
  2132. "docs": [
  2133. "The fund fee, denominated in hundredths of a bip (10^-6)"
  2134. ],
  2135. "type": "u32"
  2136. },
  2137. {
  2138. "name": "paddingU32",
  2139. "type": "u32"
  2140. },
  2141. {
  2142. "name": "fundOwner",
  2143. "type": "publicKey"
  2144. },
  2145. {
  2146. "name": "padding",
  2147. "type": {
  2148. "array": ["u64", 3]
  2149. }
  2150. }
  2151. ]
  2152. }
  2153. },
  2154. {
  2155. "name": "OperationState",
  2156. "docs": ["Holds the current owner of the factory"],
  2157. "type": {
  2158. "kind": "struct",
  2159. "fields": [
  2160. {
  2161. "name": "bump",
  2162. "docs": ["Bump to identify PDA"],
  2163. "type": "u8"
  2164. },
  2165. {
  2166. "name": "operationOwners",
  2167. "docs": ["Address of the operation owner"],
  2168. "type": {
  2169. "array": ["publicKey", 10]
  2170. }
  2171. },
  2172. {
  2173. "name": "whitelistMints",
  2174. "docs": ["The mint address of whitelist to emmit reward"],
  2175. "type": {
  2176. "array": ["publicKey", 100]
  2177. }
  2178. }
  2179. ]
  2180. }
  2181. },
  2182. {
  2183. "name": "ObservationState",
  2184. "type": {
  2185. "kind": "struct",
  2186. "fields": [
  2187. {
  2188. "name": "initialized",
  2189. "docs": ["Whether the ObservationState is initialized"],
  2190. "type": "bool"
  2191. },
  2192. {
  2193. "name": "recentEpoch",
  2194. "docs": ["recent update epoch"],
  2195. "type": "u64"
  2196. },
  2197. {
  2198. "name": "observationIndex",
  2199. "docs": [
  2200. "the most-recently updated index of the observations array"
  2201. ],
  2202. "type": "u16"
  2203. },
  2204. {
  2205. "name": "poolId",
  2206. "docs": ["belongs to which pool"],
  2207. "type": "publicKey"
  2208. },
  2209. {
  2210. "name": "observations",
  2211. "docs": ["observation array"],
  2212. "type": {
  2213. "array": [
  2214. {
  2215. "defined": "Observation"
  2216. },
  2217. 100
  2218. ]
  2219. }
  2220. },
  2221. {
  2222. "name": "padding",
  2223. "docs": ["padding for feature update"],
  2224. "type": {
  2225. "array": ["u64", 4]
  2226. }
  2227. }
  2228. ]
  2229. }
  2230. },
  2231. {
  2232. "name": "PersonalPositionState",
  2233. "type": {
  2234. "kind": "struct",
  2235. "fields": [
  2236. {
  2237. "name": "bump",
  2238. "docs": ["Bump to identify PDA"],
  2239. "type": {
  2240. "array": ["u8", 1]
  2241. }
  2242. },
  2243. {
  2244. "name": "nftMint",
  2245. "docs": ["Mint address of the tokenized position"],
  2246. "type": "publicKey"
  2247. },
  2248. {
  2249. "name": "poolId",
  2250. "docs": ["The ID of the pool with which this token is connected"],
  2251. "type": "publicKey"
  2252. },
  2253. {
  2254. "name": "tickLowerIndex",
  2255. "docs": ["The lower bound tick of the position"],
  2256. "type": "i32"
  2257. },
  2258. {
  2259. "name": "tickUpperIndex",
  2260. "docs": ["The upper bound tick of the position"],
  2261. "type": "i32"
  2262. },
  2263. {
  2264. "name": "liquidity",
  2265. "docs": ["The amount of liquidity owned by this position"],
  2266. "type": "u128"
  2267. },
  2268. {
  2269. "name": "feeGrowthInside0LastX64",
  2270. "docs": [
  2271. "The token_0 fee growth of the aggregate position as of the last action on the individual position"
  2272. ],
  2273. "type": "u128"
  2274. },
  2275. {
  2276. "name": "feeGrowthInside1LastX64",
  2277. "docs": [
  2278. "The token_1 fee growth of the aggregate position as of the last action on the individual position"
  2279. ],
  2280. "type": "u128"
  2281. },
  2282. {
  2283. "name": "tokenFeesOwed0",
  2284. "docs": [
  2285. "The fees owed to the position owner in token_0, as of the last computation"
  2286. ],
  2287. "type": "u64"
  2288. },
  2289. {
  2290. "name": "tokenFeesOwed1",
  2291. "docs": [
  2292. "The fees owed to the position owner in token_1, as of the last computation"
  2293. ],
  2294. "type": "u64"
  2295. },
  2296. {
  2297. "name": "rewardInfos",
  2298. "type": {
  2299. "array": [
  2300. {
  2301. "defined": "PositionRewardInfo"
  2302. },
  2303. 3
  2304. ]
  2305. }
  2306. },
  2307. {
  2308. "name": "recentEpoch",
  2309. "type": "u64"
  2310. },
  2311. {
  2312. "name": "padding",
  2313. "type": {
  2314. "array": ["u64", 7]
  2315. }
  2316. }
  2317. ]
  2318. }
  2319. },
  2320. {
  2321. "name": "PoolState",
  2322. "docs": [
  2323. "The pool state",
  2324. "",
  2325. "PDA of `[POOL_SEED, config, token_mint_0, token_mint_1]`",
  2326. ""
  2327. ],
  2328. "type": {
  2329. "kind": "struct",
  2330. "fields": [
  2331. {
  2332. "name": "bump",
  2333. "docs": ["Bump to identify PDA"],
  2334. "type": {
  2335. "array": ["u8", 1]
  2336. }
  2337. },
  2338. {
  2339. "name": "ammConfig",
  2340. "type": "publicKey"
  2341. },
  2342. {
  2343. "name": "owner",
  2344. "type": "publicKey"
  2345. },
  2346. {
  2347. "name": "tokenMint0",
  2348. "docs": [
  2349. "Token pair of the pool, where token_mint_0 address < token_mint_1 address"
  2350. ],
  2351. "type": "publicKey"
  2352. },
  2353. {
  2354. "name": "tokenMint1",
  2355. "type": "publicKey"
  2356. },
  2357. {
  2358. "name": "tokenVault0",
  2359. "docs": ["Token pair vault"],
  2360. "type": "publicKey"
  2361. },
  2362. {
  2363. "name": "tokenVault1",
  2364. "type": "publicKey"
  2365. },
  2366. {
  2367. "name": "observationKey",
  2368. "docs": ["observation account key"],
  2369. "type": "publicKey"
  2370. },
  2371. {
  2372. "name": "mintDecimals0",
  2373. "docs": ["mint0 and mint1 decimals"],
  2374. "type": "u8"
  2375. },
  2376. {
  2377. "name": "mintDecimals1",
  2378. "type": "u8"
  2379. },
  2380. {
  2381. "name": "tickSpacing",
  2382. "docs": ["The minimum number of ticks between initialized ticks"],
  2383. "type": "u16"
  2384. },
  2385. {
  2386. "name": "liquidity",
  2387. "docs": ["The currently in range liquidity available to the pool."],
  2388. "type": "u128"
  2389. },
  2390. {
  2391. "name": "sqrtPriceX64",
  2392. "docs": [
  2393. "The current price of the pool as a sqrt(token_1/token_0) Q64.64 value"
  2394. ],
  2395. "type": "u128"
  2396. },
  2397. {
  2398. "name": "tickCurrent",
  2399. "docs": [
  2400. "The current tick of the pool, i.e. according to the last tick transition that was run."
  2401. ],
  2402. "type": "i32"
  2403. },
  2404. {
  2405. "name": "padding3",
  2406. "type": "u16"
  2407. },
  2408. {
  2409. "name": "padding4",
  2410. "type": "u16"
  2411. },
  2412. {
  2413. "name": "feeGrowthGlobal0X64",
  2414. "docs": [
  2415. "The fee growth as a Q64.64 number, i.e. fees of token_0 and token_1 collected per",
  2416. "unit of liquidity for the entire life of the pool."
  2417. ],
  2418. "type": "u128"
  2419. },
  2420. {
  2421. "name": "feeGrowthGlobal1X64",
  2422. "type": "u128"
  2423. },
  2424. {
  2425. "name": "protocolFeesToken0",
  2426. "docs": [
  2427. "The amounts of token_0 and token_1 that are owed to the protocol."
  2428. ],
  2429. "type": "u64"
  2430. },
  2431. {
  2432. "name": "protocolFeesToken1",
  2433. "type": "u64"
  2434. },
  2435. {
  2436. "name": "swapInAmountToken0",
  2437. "docs": ["The amounts in and out of swap token_0 and token_1"],
  2438. "type": "u128"
  2439. },
  2440. {
  2441. "name": "swapOutAmountToken1",
  2442. "type": "u128"
  2443. },
  2444. {
  2445. "name": "swapInAmountToken1",
  2446. "type": "u128"
  2447. },
  2448. {
  2449. "name": "swapOutAmountToken0",
  2450. "type": "u128"
  2451. },
  2452. {
  2453. "name": "status",
  2454. "docs": [
  2455. "Bitwise representation of the state of the pool",
  2456. "bit0, 1: disable open position and increase liquidity, 0: normal",
  2457. "bit1, 1: disable decrease liquidity, 0: normal",
  2458. "bit2, 1: disable collect fee, 0: normal",
  2459. "bit3, 1: disable collect reward, 0: normal",
  2460. "bit4, 1: disable swap, 0: normal"
  2461. ],
  2462. "type": "u8"
  2463. },
  2464. {
  2465. "name": "padding",
  2466. "docs": ["Leave blank for future use"],
  2467. "type": {
  2468. "array": ["u8", 7]
  2469. }
  2470. },
  2471. {
  2472. "name": "rewardInfos",
  2473. "type": {
  2474. "array": [
  2475. {
  2476. "defined": "RewardInfo"
  2477. },
  2478. 3
  2479. ]
  2480. }
  2481. },
  2482. {
  2483. "name": "tickArrayBitmap",
  2484. "docs": ["Packed initialized tick array state"],
  2485. "type": {
  2486. "array": ["u64", 16]
  2487. }
  2488. },
  2489. {
  2490. "name": "totalFeesToken0",
  2491. "docs": ["except protocol_fee and fund_fee"],
  2492. "type": "u64"
  2493. },
  2494. {
  2495. "name": "totalFeesClaimedToken0",
  2496. "docs": ["except protocol_fee and fund_fee"],
  2497. "type": "u64"
  2498. },
  2499. {
  2500. "name": "totalFeesToken1",
  2501. "type": "u64"
  2502. },
  2503. {
  2504. "name": "totalFeesClaimedToken1",
  2505. "type": "u64"
  2506. },
  2507. {
  2508. "name": "fundFeesToken0",
  2509. "type": "u64"
  2510. },
  2511. {
  2512. "name": "fundFeesToken1",
  2513. "type": "u64"
  2514. },
  2515. {
  2516. "name": "openTime",
  2517. "type": "u64"
  2518. },
  2519. {
  2520. "name": "recentEpoch",
  2521. "type": "u64"
  2522. },
  2523. {
  2524. "name": "padding1",
  2525. "type": {
  2526. "array": ["u64", 24]
  2527. }
  2528. },
  2529. {
  2530. "name": "padding2",
  2531. "type": {
  2532. "array": ["u64", 32]
  2533. }
  2534. }
  2535. ]
  2536. }
  2537. },
  2538. {
  2539. "name": "ProtocolPositionState",
  2540. "docs": ["Info stored for each user's position"],
  2541. "type": {
  2542. "kind": "struct",
  2543. "fields": [
  2544. {
  2545. "name": "bump",
  2546. "docs": ["Bump to identify PDA"],
  2547. "type": "u8"
  2548. },
  2549. {
  2550. "name": "poolId",
  2551. "docs": ["The ID of the pool with which this token is connected"],
  2552. "type": "publicKey"
  2553. },
  2554. {
  2555. "name": "tickLowerIndex",
  2556. "docs": ["The lower bound tick of the position"],
  2557. "type": "i32"
  2558. },
  2559. {
  2560. "name": "tickUpperIndex",
  2561. "docs": ["The upper bound tick of the position"],
  2562. "type": "i32"
  2563. },
  2564. {
  2565. "name": "liquidity",
  2566. "docs": ["The amount of liquidity owned by this position"],
  2567. "type": "u128"
  2568. },
  2569. {
  2570. "name": "feeGrowthInside0LastX64",
  2571. "docs": [
  2572. "The token_0 fee growth per unit of liquidity as of the last update to liquidity or fees owed"
  2573. ],
  2574. "type": "u128"
  2575. },
  2576. {
  2577. "name": "feeGrowthInside1LastX64",
  2578. "docs": [
  2579. "The token_1 fee growth per unit of liquidity as of the last update to liquidity or fees owed"
  2580. ],
  2581. "type": "u128"
  2582. },
  2583. {
  2584. "name": "tokenFeesOwed0",
  2585. "docs": ["The fees owed to the position owner in token_0"],
  2586. "type": "u64"
  2587. },
  2588. {
  2589. "name": "tokenFeesOwed1",
  2590. "docs": ["The fees owed to the position owner in token_1"],
  2591. "type": "u64"
  2592. },
  2593. {
  2594. "name": "rewardGrowthInside",
  2595. "docs": [
  2596. "The reward growth per unit of liquidity as of the last update to liquidity"
  2597. ],
  2598. "type": {
  2599. "array": ["u128", 3]
  2600. }
  2601. },
  2602. {
  2603. "name": "recentEpoch",
  2604. "type": "u64"
  2605. },
  2606. {
  2607. "name": "padding",
  2608. "type": {
  2609. "array": ["u64", 7]
  2610. }
  2611. }
  2612. ]
  2613. }
  2614. },
  2615. {
  2616. "name": "TickArrayState",
  2617. "type": {
  2618. "kind": "struct",
  2619. "fields": [
  2620. {
  2621. "name": "poolId",
  2622. "type": "publicKey"
  2623. },
  2624. {
  2625. "name": "startTickIndex",
  2626. "type": "i32"
  2627. },
  2628. {
  2629. "name": "ticks",
  2630. "type": {
  2631. "array": [
  2632. {
  2633. "defined": "TickState"
  2634. },
  2635. 60
  2636. ]
  2637. }
  2638. },
  2639. {
  2640. "name": "initializedTickCount",
  2641. "type": "u8"
  2642. },
  2643. {
  2644. "name": "recentEpoch",
  2645. "type": "u64"
  2646. },
  2647. {
  2648. "name": "padding",
  2649. "type": {
  2650. "array": ["u8", 107]
  2651. }
  2652. }
  2653. ]
  2654. }
  2655. },
  2656. {
  2657. "name": "TickArrayBitmapExtension",
  2658. "type": {
  2659. "kind": "struct",
  2660. "fields": [
  2661. {
  2662. "name": "poolId",
  2663. "type": "publicKey"
  2664. },
  2665. {
  2666. "name": "positiveTickArrayBitmap",
  2667. "docs": [
  2668. "Packed initialized tick array state for start_tick_index is positive"
  2669. ],
  2670. "type": {
  2671. "array": [
  2672. {
  2673. "array": ["u64", 8]
  2674. },
  2675. 14
  2676. ]
  2677. }
  2678. },
  2679. {
  2680. "name": "negativeTickArrayBitmap",
  2681. "docs": [
  2682. "Packed initialized tick array state for start_tick_index is negitive"
  2683. ],
  2684. "type": {
  2685. "array": [
  2686. {
  2687. "array": ["u64", 8]
  2688. },
  2689. 14
  2690. ]
  2691. }
  2692. }
  2693. ]
  2694. }
  2695. }
  2696. ],
  2697. "types": [
  2698. {
  2699. "name": "InitializeRewardParam",
  2700. "type": {
  2701. "kind": "struct",
  2702. "fields": [
  2703. {
  2704. "name": "openTime",
  2705. "docs": ["Reward open time"],
  2706. "type": "u64"
  2707. },
  2708. {
  2709. "name": "endTime",
  2710. "docs": ["Reward end time"],
  2711. "type": "u64"
  2712. },
  2713. {
  2714. "name": "emissionsPerSecondX64",
  2715. "docs": [
  2716. "Token reward per second are earned per unit of liquidity"
  2717. ],
  2718. "type": "u128"
  2719. }
  2720. ]
  2721. }
  2722. },
  2723. {
  2724. "name": "Observation",
  2725. "docs": ["The element of observations in ObservationState"],
  2726. "type": {
  2727. "kind": "struct",
  2728. "fields": [
  2729. {
  2730. "name": "blockTimestamp",
  2731. "docs": ["The block timestamp of the observation"],
  2732. "type": "u32"
  2733. },
  2734. {
  2735. "name": "tickCumulative",
  2736. "docs": ["the cumulative of tick during the duration time"],
  2737. "type": "i64"
  2738. },
  2739. {
  2740. "name": "padding",
  2741. "docs": ["padding for feature update"],
  2742. "type": {
  2743. "array": ["u64", 4]
  2744. }
  2745. }
  2746. ]
  2747. }
  2748. },
  2749. {
  2750. "name": "PositionRewardInfo",
  2751. "type": {
  2752. "kind": "struct",
  2753. "fields": [
  2754. {
  2755. "name": "growthInsideLastX64",
  2756. "type": "u128"
  2757. },
  2758. {
  2759. "name": "rewardAmountOwed",
  2760. "type": "u64"
  2761. }
  2762. ]
  2763. }
  2764. },
  2765. {
  2766. "name": "RewardInfo",
  2767. "type": {
  2768. "kind": "struct",
  2769. "fields": [
  2770. {
  2771. "name": "rewardState",
  2772. "docs": ["Reward state"],
  2773. "type": "u8"
  2774. },
  2775. {
  2776. "name": "openTime",
  2777. "docs": ["Reward open time"],
  2778. "type": "u64"
  2779. },
  2780. {
  2781. "name": "endTime",
  2782. "docs": ["Reward end time"],
  2783. "type": "u64"
  2784. },
  2785. {
  2786. "name": "lastUpdateTime",
  2787. "docs": ["Reward last update time"],
  2788. "type": "u64"
  2789. },
  2790. {
  2791. "name": "emissionsPerSecondX64",
  2792. "docs": [
  2793. "Q64.64 number indicates how many tokens per second are earned per unit of liquidity."
  2794. ],
  2795. "type": "u128"
  2796. },
  2797. {
  2798. "name": "rewardTotalEmissioned",
  2799. "docs": ["The total amount of reward emissioned"],
  2800. "type": "u64"
  2801. },
  2802. {
  2803. "name": "rewardClaimed",
  2804. "docs": ["The total amount of claimed reward"],
  2805. "type": "u64"
  2806. },
  2807. {
  2808. "name": "tokenMint",
  2809. "docs": ["Reward token mint."],
  2810. "type": "publicKey"
  2811. },
  2812. {
  2813. "name": "tokenVault",
  2814. "docs": ["Reward vault token account."],
  2815. "type": "publicKey"
  2816. },
  2817. {
  2818. "name": "authority",
  2819. "docs": ["The owner that has permission to set reward param"],
  2820. "type": "publicKey"
  2821. },
  2822. {
  2823. "name": "rewardGrowthGlobalX64",
  2824. "docs": [
  2825. "Q64.64 number that tracks the total tokens earned per unit of liquidity since the reward",
  2826. "emissions were turned on."
  2827. ],
  2828. "type": "u128"
  2829. }
  2830. ]
  2831. }
  2832. },
  2833. {
  2834. "name": "TickState",
  2835. "type": {
  2836. "kind": "struct",
  2837. "fields": [
  2838. {
  2839. "name": "tick",
  2840. "type": "i32"
  2841. },
  2842. {
  2843. "name": "liquidityNet",
  2844. "docs": [
  2845. "Amount of net liquidity added (subtracted) when tick is crossed from left to right (right to left)"
  2846. ],
  2847. "type": "i128"
  2848. },
  2849. {
  2850. "name": "liquidityGross",
  2851. "docs": ["The total position liquidity that references this tick"],
  2852. "type": "u128"
  2853. },
  2854. {
  2855. "name": "feeGrowthOutside0X64",
  2856. "docs": [
  2857. "Fee growth per unit of liquidity on the _other_ side of this tick (relative to the current tick)",
  2858. "only has relative meaning, not absolute — the value depends on when the tick is initialized"
  2859. ],
  2860. "type": "u128"
  2861. },
  2862. {
  2863. "name": "feeGrowthOutside1X64",
  2864. "type": "u128"
  2865. },
  2866. {
  2867. "name": "rewardGrowthsOutsideX64",
  2868. "type": {
  2869. "array": ["u128", 3]
  2870. }
  2871. },
  2872. {
  2873. "name": "padding",
  2874. "type": {
  2875. "array": ["u32", 13]
  2876. }
  2877. }
  2878. ]
  2879. }
  2880. },
  2881. {
  2882. "name": "PoolStatusBitIndex",
  2883. "type": {
  2884. "kind": "enum",
  2885. "variants": [
  2886. {
  2887. "name": "OpenPositionOrIncreaseLiquidity"
  2888. },
  2889. {
  2890. "name": "DecreaseLiquidity"
  2891. },
  2892. {
  2893. "name": "CollectFee"
  2894. },
  2895. {
  2896. "name": "CollectReward"
  2897. },
  2898. {
  2899. "name": "Swap"
  2900. }
  2901. ]
  2902. }
  2903. },
  2904. {
  2905. "name": "PoolStatusBitFlag",
  2906. "type": {
  2907. "kind": "enum",
  2908. "variants": [
  2909. {
  2910. "name": "Enable"
  2911. },
  2912. {
  2913. "name": "Disable"
  2914. }
  2915. ]
  2916. }
  2917. },
  2918. {
  2919. "name": "RewardState",
  2920. "docs": ["State of reward"],
  2921. "type": {
  2922. "kind": "enum",
  2923. "variants": [
  2924. {
  2925. "name": "Uninitialized"
  2926. },
  2927. {
  2928. "name": "Initialized"
  2929. },
  2930. {
  2931. "name": "Opening"
  2932. },
  2933. {
  2934. "name": "Ended"
  2935. }
  2936. ]
  2937. }
  2938. },
  2939. {
  2940. "name": "TickArryBitmap",
  2941. "type": {
  2942. "kind": "alias",
  2943. "value": {
  2944. "array": ["u64", 8]
  2945. }
  2946. }
  2947. }
  2948. ],
  2949. "events": [
  2950. {
  2951. "name": "ConfigChangeEvent",
  2952. "fields": [
  2953. {
  2954. "name": "index",
  2955. "type": "u16",
  2956. "index": false
  2957. },
  2958. {
  2959. "name": "owner",
  2960. "type": "publicKey",
  2961. "index": true
  2962. },
  2963. {
  2964. "name": "protocolFeeRate",
  2965. "type": "u32",
  2966. "index": false
  2967. },
  2968. {
  2969. "name": "tradeFeeRate",
  2970. "type": "u32",
  2971. "index": false
  2972. },
  2973. {
  2974. "name": "tickSpacing",
  2975. "type": "u16",
  2976. "index": false
  2977. },
  2978. {
  2979. "name": "fundFeeRate",
  2980. "type": "u32",
  2981. "index": false
  2982. },
  2983. {
  2984. "name": "fundOwner",
  2985. "type": "publicKey",
  2986. "index": false
  2987. }
  2988. ]
  2989. },
  2990. {
  2991. "name": "CreatePersonalPositionEvent",
  2992. "fields": [
  2993. {
  2994. "name": "poolState",
  2995. "type": "publicKey",
  2996. "index": false
  2997. },
  2998. {
  2999. "name": "minter",
  3000. "type": "publicKey",
  3001. "index": false
  3002. },
  3003. {
  3004. "name": "nftOwner",
  3005. "type": "publicKey",
  3006. "index": false
  3007. },
  3008. {
  3009. "name": "tickLowerIndex",
  3010. "type": "i32",
  3011. "index": false
  3012. },
  3013. {
  3014. "name": "tickUpperIndex",
  3015. "type": "i32",
  3016. "index": false
  3017. },
  3018. {
  3019. "name": "liquidity",
  3020. "type": "u128",
  3021. "index": false
  3022. },
  3023. {
  3024. "name": "depositAmount0",
  3025. "type": "u64",
  3026. "index": false
  3027. },
  3028. {
  3029. "name": "depositAmount1",
  3030. "type": "u64",
  3031. "index": false
  3032. },
  3033. {
  3034. "name": "depositAmount0TransferFee",
  3035. "type": "u64",
  3036. "index": false
  3037. },
  3038. {
  3039. "name": "depositAmount1TransferFee",
  3040. "type": "u64",
  3041. "index": false
  3042. }
  3043. ]
  3044. },
  3045. {
  3046. "name": "IncreaseLiquidityEvent",
  3047. "fields": [
  3048. {
  3049. "name": "positionNftMint",
  3050. "type": "publicKey",
  3051. "index": false
  3052. },
  3053. {
  3054. "name": "liquidity",
  3055. "type": "u128",
  3056. "index": false
  3057. },
  3058. {
  3059. "name": "amount0",
  3060. "type": "u64",
  3061. "index": false
  3062. },
  3063. {
  3064. "name": "amount1",
  3065. "type": "u64",
  3066. "index": false
  3067. },
  3068. {
  3069. "name": "amount0TransferFee",
  3070. "type": "u64",
  3071. "index": false
  3072. },
  3073. {
  3074. "name": "amount1TransferFee",
  3075. "type": "u64",
  3076. "index": false
  3077. }
  3078. ]
  3079. },
  3080. {
  3081. "name": "DecreaseLiquidityEvent",
  3082. "fields": [
  3083. {
  3084. "name": "positionNftMint",
  3085. "type": "publicKey",
  3086. "index": false
  3087. },
  3088. {
  3089. "name": "liquidity",
  3090. "type": "u128",
  3091. "index": false
  3092. },
  3093. {
  3094. "name": "decreaseAmount0",
  3095. "type": "u64",
  3096. "index": false
  3097. },
  3098. {
  3099. "name": "decreaseAmount1",
  3100. "type": "u64",
  3101. "index": false
  3102. },
  3103. {
  3104. "name": "feeAmount0",
  3105. "type": "u64",
  3106. "index": false
  3107. },
  3108. {
  3109. "name": "feeAmount1",
  3110. "type": "u64",
  3111. "index": false
  3112. },
  3113. {
  3114. "name": "rewardAmounts",
  3115. "type": {
  3116. "array": ["u64", 3]
  3117. },
  3118. "index": false
  3119. },
  3120. {
  3121. "name": "transferFee0",
  3122. "type": "u64",
  3123. "index": false
  3124. },
  3125. {
  3126. "name": "transferFee1",
  3127. "type": "u64",
  3128. "index": false
  3129. }
  3130. ]
  3131. },
  3132. {
  3133. "name": "LiquidityCalculateEvent",
  3134. "fields": [
  3135. {
  3136. "name": "poolLiquidity",
  3137. "type": "u128",
  3138. "index": false
  3139. },
  3140. {
  3141. "name": "poolSqrtPriceX64",
  3142. "type": "u128",
  3143. "index": false
  3144. },
  3145. {
  3146. "name": "poolTick",
  3147. "type": "i32",
  3148. "index": false
  3149. },
  3150. {
  3151. "name": "calcAmount0",
  3152. "type": "u64",
  3153. "index": false
  3154. },
  3155. {
  3156. "name": "calcAmount1",
  3157. "type": "u64",
  3158. "index": false
  3159. },
  3160. {
  3161. "name": "tradeFeeOwed0",
  3162. "type": "u64",
  3163. "index": false
  3164. },
  3165. {
  3166. "name": "tradeFeeOwed1",
  3167. "type": "u64",
  3168. "index": false
  3169. },
  3170. {
  3171. "name": "transferFee0",
  3172. "type": "u64",
  3173. "index": false
  3174. },
  3175. {
  3176. "name": "transferFee1",
  3177. "type": "u64",
  3178. "index": false
  3179. }
  3180. ]
  3181. },
  3182. {
  3183. "name": "CollectPersonalFeeEvent",
  3184. "fields": [
  3185. {
  3186. "name": "positionNftMint",
  3187. "type": "publicKey",
  3188. "index": false
  3189. },
  3190. {
  3191. "name": "recipientTokenAccount0",
  3192. "type": "publicKey",
  3193. "index": false
  3194. },
  3195. {
  3196. "name": "recipientTokenAccount1",
  3197. "type": "publicKey",
  3198. "index": false
  3199. },
  3200. {
  3201. "name": "amount0",
  3202. "type": "u64",
  3203. "index": false
  3204. },
  3205. {
  3206. "name": "amount1",
  3207. "type": "u64",
  3208. "index": false
  3209. }
  3210. ]
  3211. },
  3212. {
  3213. "name": "UpdateRewardInfosEvent",
  3214. "fields": [
  3215. {
  3216. "name": "rewardGrowthGlobalX64",
  3217. "type": {
  3218. "array": ["u128", 3]
  3219. },
  3220. "index": false
  3221. }
  3222. ]
  3223. },
  3224. {
  3225. "name": "PoolCreatedEvent",
  3226. "fields": [
  3227. {
  3228. "name": "tokenMint0",
  3229. "type": "publicKey",
  3230. "index": false
  3231. },
  3232. {
  3233. "name": "tokenMint1",
  3234. "type": "publicKey",
  3235. "index": false
  3236. },
  3237. {
  3238. "name": "tickSpacing",
  3239. "type": "u16",
  3240. "index": false
  3241. },
  3242. {
  3243. "name": "poolState",
  3244. "type": "publicKey",
  3245. "index": false
  3246. },
  3247. {
  3248. "name": "sqrtPriceX64",
  3249. "type": "u128",
  3250. "index": false
  3251. },
  3252. {
  3253. "name": "tick",
  3254. "type": "i32",
  3255. "index": false
  3256. },
  3257. {
  3258. "name": "tokenVault0",
  3259. "type": "publicKey",
  3260. "index": false
  3261. },
  3262. {
  3263. "name": "tokenVault1",
  3264. "type": "publicKey",
  3265. "index": false
  3266. }
  3267. ]
  3268. },
  3269. {
  3270. "name": "CollectProtocolFeeEvent",
  3271. "fields": [
  3272. {
  3273. "name": "poolState",
  3274. "type": "publicKey",
  3275. "index": false
  3276. },
  3277. {
  3278. "name": "recipientTokenAccount0",
  3279. "type": "publicKey",
  3280. "index": false
  3281. },
  3282. {
  3283. "name": "recipientTokenAccount1",
  3284. "type": "publicKey",
  3285. "index": false
  3286. },
  3287. {
  3288. "name": "amount0",
  3289. "type": "u64",
  3290. "index": false
  3291. },
  3292. {
  3293. "name": "amount1",
  3294. "type": "u64",
  3295. "index": false
  3296. }
  3297. ]
  3298. },
  3299. {
  3300. "name": "SwapEvent",
  3301. "fields": [
  3302. {
  3303. "name": "poolState",
  3304. "type": "publicKey",
  3305. "index": false
  3306. },
  3307. {
  3308. "name": "sender",
  3309. "type": "publicKey",
  3310. "index": false
  3311. },
  3312. {
  3313. "name": "tokenAccount0",
  3314. "type": "publicKey",
  3315. "index": false
  3316. },
  3317. {
  3318. "name": "tokenAccount1",
  3319. "type": "publicKey",
  3320. "index": false
  3321. },
  3322. {
  3323. "name": "amount0",
  3324. "type": "u64",
  3325. "index": false
  3326. },
  3327. {
  3328. "name": "transferFee0",
  3329. "type": "u64",
  3330. "index": false
  3331. },
  3332. {
  3333. "name": "amount1",
  3334. "type": "u64",
  3335. "index": false
  3336. },
  3337. {
  3338. "name": "transferFee1",
  3339. "type": "u64",
  3340. "index": false
  3341. },
  3342. {
  3343. "name": "zeroForOne",
  3344. "type": "bool",
  3345. "index": false
  3346. },
  3347. {
  3348. "name": "sqrtPriceX64",
  3349. "type": "u128",
  3350. "index": false
  3351. },
  3352. {
  3353. "name": "liquidity",
  3354. "type": "u128",
  3355. "index": false
  3356. },
  3357. {
  3358. "name": "tick",
  3359. "type": "i32",
  3360. "index": false
  3361. }
  3362. ]
  3363. },
  3364. {
  3365. "name": "LiquidityChangeEvent",
  3366. "fields": [
  3367. {
  3368. "name": "poolState",
  3369. "type": "publicKey",
  3370. "index": false
  3371. },
  3372. {
  3373. "name": "tick",
  3374. "type": "i32",
  3375. "index": false
  3376. },
  3377. {
  3378. "name": "tickLower",
  3379. "type": "i32",
  3380. "index": false
  3381. },
  3382. {
  3383. "name": "tickUpper",
  3384. "type": "i32",
  3385. "index": false
  3386. },
  3387. {
  3388. "name": "liquidityBefore",
  3389. "type": "u128",
  3390. "index": false
  3391. },
  3392. {
  3393. "name": "liquidityAfter",
  3394. "type": "u128",
  3395. "index": false
  3396. }
  3397. ]
  3398. }
  3399. ],
  3400. "errors": [
  3401. {
  3402. "code": 6000,
  3403. "name": "LOK",
  3404. "msg": "LOK"
  3405. },
  3406. {
  3407. "code": 6001,
  3408. "name": "NotApproved",
  3409. "msg": "Not approved"
  3410. },
  3411. {
  3412. "code": 6002,
  3413. "name": "InvalidUpdateConfigFlag",
  3414. "msg": "invalid update amm config flag"
  3415. },
  3416. {
  3417. "code": 6003,
  3418. "name": "AccountLack",
  3419. "msg": "Account lack"
  3420. },
  3421. {
  3422. "code": 6004,
  3423. "name": "ClosePositionErr",
  3424. "msg": "Remove liquitity, collect fees owed and reward then you can close position account"
  3425. },
  3426. {
  3427. "code": 6005,
  3428. "name": "ZeroMintAmount",
  3429. "msg": "Minting amount should be greater than 0"
  3430. },
  3431. {
  3432. "code": 6006,
  3433. "name": "InvaildTickIndex",
  3434. "msg": "Tick out of range"
  3435. },
  3436. {
  3437. "code": 6007,
  3438. "name": "TickInvaildOrder",
  3439. "msg": "The lower tick must be below the upper tick"
  3440. },
  3441. {
  3442. "code": 6008,
  3443. "name": "TickLowerOverflow",
  3444. "msg": "The tick must be greater, or equal to the minimum tick(-443636)"
  3445. },
  3446. {
  3447. "code": 6009,
  3448. "name": "TickUpperOverflow",
  3449. "msg": "The tick must be lesser than, or equal to the maximum tick(443636)"
  3450. },
  3451. {
  3452. "code": 6010,
  3453. "name": "TickAndSpacingNotMatch",
  3454. "msg": "tick % tick_spacing must be zero"
  3455. },
  3456. {
  3457. "code": 6011,
  3458. "name": "InvalidTickArray",
  3459. "msg": "Invaild tick array account"
  3460. },
  3461. {
  3462. "code": 6012,
  3463. "name": "InvalidTickArrayBoundary",
  3464. "msg": "Invaild tick array boundary"
  3465. },
  3466. {
  3467. "code": 6013,
  3468. "name": "SqrtPriceLimitOverflow",
  3469. "msg": "Square root price limit overflow"
  3470. },
  3471. {
  3472. "code": 6014,
  3473. "name": "SqrtPriceX64",
  3474. "msg": "sqrt_price_x64 out of range"
  3475. },
  3476. {
  3477. "code": 6015,
  3478. "name": "LiquiditySubValueErr",
  3479. "msg": "Liquidity sub delta L must be smaller than before"
  3480. },
  3481. {
  3482. "code": 6016,
  3483. "name": "LiquidityAddValueErr",
  3484. "msg": "Liquidity add delta L must be greater, or equal to before"
  3485. },
  3486. {
  3487. "code": 6017,
  3488. "name": "InvaildLiquidity",
  3489. "msg": "Invaild liquidity when update position"
  3490. },
  3491. {
  3492. "code": 6018,
  3493. "name": "ForbidBothZeroForSupplyLiquidity",
  3494. "msg": "Both token amount must not be zero while supply liquidity"
  3495. },
  3496. {
  3497. "code": 6019,
  3498. "name": "LiquidityInsufficient",
  3499. "msg": "Liquidity insufficient"
  3500. },
  3501. {
  3502. "code": 6020,
  3503. "name": "TransactionTooOld",
  3504. "msg": "Transaction too old"
  3505. },
  3506. {
  3507. "code": 6021,
  3508. "name": "PriceSlippageCheck",
  3509. "msg": "Price slippage check"
  3510. },
  3511. {
  3512. "code": 6022,
  3513. "name": "TooLittleOutputReceived",
  3514. "msg": "Too little output received"
  3515. },
  3516. {
  3517. "code": 6023,
  3518. "name": "TooMuchInputPaid",
  3519. "msg": "Too much input paid"
  3520. },
  3521. {
  3522. "code": 6024,
  3523. "name": "ZeroAmountSpecified",
  3524. "msg": "Swap special amount can not be zero"
  3525. },
  3526. {
  3527. "code": 6025,
  3528. "name": "InvalidInputPoolVault",
  3529. "msg": "Input pool vault is invalid"
  3530. },
  3531. {
  3532. "code": 6026,
  3533. "name": "TooSmallInputOrOutputAmount",
  3534. "msg": "Swap input or output amount is too small"
  3535. },
  3536. {
  3537. "code": 6027,
  3538. "name": "NotEnoughTickArrayAccount",
  3539. "msg": "Not enought tick array account"
  3540. },
  3541. {
  3542. "code": 6028,
  3543. "name": "InvalidFirstTickArrayAccount",
  3544. "msg": "Invaild first tick array account"
  3545. },
  3546. {
  3547. "code": 6029,
  3548. "name": "InvalidRewardIndex",
  3549. "msg": "Invalid reward index"
  3550. },
  3551. {
  3552. "code": 6030,
  3553. "name": "FullRewardInfo",
  3554. "msg": "The init reward token reach to the max"
  3555. },
  3556. {
  3557. "code": 6031,
  3558. "name": "RewardTokenAlreadyInUse",
  3559. "msg": "The init reward token already in use"
  3560. },
  3561. {
  3562. "code": 6032,
  3563. "name": "ExceptPoolVaultMint",
  3564. "msg": "The reward tokens must contain one of pool vault mint except the last reward"
  3565. },
  3566. {
  3567. "code": 6033,
  3568. "name": "InvalidRewardInitParam",
  3569. "msg": "Invalid reward init param"
  3570. },
  3571. {
  3572. "code": 6034,
  3573. "name": "InvalidRewardDesiredAmount",
  3574. "msg": "Invalid collect reward desired amount"
  3575. },
  3576. {
  3577. "code": 6035,
  3578. "name": "InvalidRewardInputAccountNumber",
  3579. "msg": "Invalid collect reward input account number"
  3580. },
  3581. {
  3582. "code": 6036,
  3583. "name": "InvalidRewardPeriod",
  3584. "msg": "Invalid reward period"
  3585. },
  3586. {
  3587. "code": 6037,
  3588. "name": "NotApproveUpdateRewardEmissiones",
  3589. "msg": "Modification of emissiones is allowed within 72 hours from the end of the previous cycle"
  3590. },
  3591. {
  3592. "code": 6038,
  3593. "name": "UnInitializedRewardInfo",
  3594. "msg": "uninitialized reward info"
  3595. },
  3596. {
  3597. "code": 6039,
  3598. "name": "NotSupportMint",
  3599. "msg": "Not support token_2022 mint extension"
  3600. },
  3601. {
  3602. "code": 6040,
  3603. "name": "MissingTickArrayBitmapExtensionAccount",
  3604. "msg": "Missing tickarray bitmap extension account"
  3605. },
  3606. {
  3607. "code": 6041,
  3608. "name": "InsufficientLiquidityForDirection",
  3609. "msg": "Insufficient liquidity for this direction"
  3610. },
  3611. {
  3612. "code": 6042,
  3613. "name": "MaxTokenOverflow",
  3614. "msg": "Max token overflow"
  3615. },
  3616. {
  3617. "code": 6043,
  3618. "name": "CalculateOverflow",
  3619. "msg": "calculate overflow"
  3620. }
  3621. ],
  3622. "metadata": {
  3623. "address": "CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK"
  3624. }
  3625. }