diff --git a/idl/meteora_amm.json b/idl/meteora_amm.json new file mode 100644 index 0000000..b04521e --- /dev/null +++ b/idl/meteora_amm.json @@ -0,0 +1,2483 @@ +{ + "version": "0.4.12", + "name": "amm", + "docs": ["Program for AMM"], + "instructions": [ + { + "name": "initializePermissionedPool", + "docs": ["Initialize a new permissioned pool."], + "accounts": [ + { + "name": "pool", + "isMut": true, + "isSigner": true, + "docs": ["Pool account (arbitrary address)"] + }, + { + "name": "lpMint", + "isMut": true, + "isSigner": false, + "docs": ["LP token mint of the pool"] + }, + { + "name": "tokenAMint", + "isMut": false, + "isSigner": false, + "docs": ["Token A mint of the pool. Eg: USDT"] + }, + { + "name": "tokenBMint", + "isMut": false, + "isSigner": false, + "docs": ["Token B mint of the pool. Eg: USDC"] + }, + { + "name": "aVault", + "isMut": true, + "isSigner": false, + "docs": [ + "Vault account for token A. Token A of the pool will be deposit / withdraw from this vault account." + ] + }, + { + "name": "bVault", + "isMut": true, + "isSigner": false, + "docs": [ + "Vault account for token B. Token B of the pool will be deposit / withdraw from this vault account." + ] + }, + { + "name": "aVaultLpMint", + "isMut": true, + "isSigner": false, + "docs": ["LP token mint of vault A"] + }, + { + "name": "bVaultLpMint", + "isMut": true, + "isSigner": false, + "docs": ["LP token mint of vault B"] + }, + { + "name": "aVaultLp", + "isMut": true, + "isSigner": false, + "docs": [ + "LP token account of vault A. Used to receive/burn the vault LP upon deposit/withdraw from the vault." + ] + }, + { + "name": "bVaultLp", + "isMut": true, + "isSigner": false, + "docs": [ + "LP token account of vault B. Used to receive/burn vault LP upon deposit/withdraw from the vault." + ] + }, + { + "name": "adminTokenA", + "isMut": true, + "isSigner": false, + "docs": [ + "Admin token account for pool token A mint. Used to bootstrap the pool with initial liquidity." + ] + }, + { + "name": "adminTokenB", + "isMut": true, + "isSigner": false, + "docs": [ + "Admin token account for pool token B mint. Used to bootstrap the pool with initial liquidity." + ] + }, + { + "name": "adminPoolLp", + "isMut": true, + "isSigner": false, + "docs": [ + "Admin pool LP token account. Used to receive LP during first deposit (initialize pool)", + "Admin pool LP token account. Used to receive LP during first deposit (initialize pool)" + ] + }, + { + "name": "adminTokenAFee", + "isMut": true, + "isSigner": false, + "docs": [ + "Admin fee token account for token A. Used to receive trading fee." + ] + }, + { + "name": "adminTokenBFee", + "isMut": true, + "isSigner": false, + "docs": [ + "Admin fee token account for token B. Used to receive trading fee." + ] + }, + { + "name": "admin", + "isMut": true, + "isSigner": true, + "docs": [ + "Admin account. This account will be the admin of the pool, and the payer for PDA during initialize pool." + ] + }, + { "name": "feeOwner", "isMut": false, "isSigner": false }, + { + "name": "rent", + "isMut": false, + "isSigner": false, + "docs": ["Rent account."] + }, + { "name": "mintMetadata", "isMut": true, "isSigner": false }, + { "name": "metadataProgram", "isMut": false, "isSigner": false }, + { + "name": "vaultProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "Vault program. The pool will deposit/withdraw liquidity from the vault." + ] + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": ["Token program."] + }, + { + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false, + "docs": ["Associated token program."] + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": ["System program."] + } + ], + "args": [{ "name": "curveType", "type": { "defined": "CurveType" } }] + }, + { + "name": "initializePermissionlessPool", + "docs": ["Initialize a new permissionless pool."], + "accounts": [ + { + "name": "pool", + "isMut": true, + "isSigner": false, + "docs": ["Pool account (PDA address)"] + }, + { + "name": "lpMint", + "isMut": true, + "isSigner": false, + "docs": ["LP token mint of the pool"] + }, + { + "name": "tokenAMint", + "isMut": false, + "isSigner": false, + "docs": ["Token A mint of the pool. Eg: USDT"] + }, + { + "name": "tokenBMint", + "isMut": false, + "isSigner": false, + "docs": ["Token B mint of the pool. Eg: USDC"] + }, + { + "name": "aVault", + "isMut": true, + "isSigner": false, + "docs": [ + "Vault account for token A. Token A of the pool will be deposit / withdraw from this vault account." + ] + }, + { + "name": "bVault", + "isMut": true, + "isSigner": false, + "docs": [ + "Vault account for token B. Token B of the pool will be deposit / withdraw from this vault account." + ] + }, + { + "name": "aTokenVault", + "isMut": true, + "isSigner": false, + "docs": ["Token vault account of vault A"] + }, + { + "name": "bTokenVault", + "isMut": true, + "isSigner": false, + "docs": ["Token vault account of vault B"] + }, + { + "name": "aVaultLpMint", + "isMut": true, + "isSigner": false, + "docs": ["LP token mint of vault A"] + }, + { + "name": "bVaultLpMint", + "isMut": true, + "isSigner": false, + "docs": ["LP token mint of vault B"] + }, + { + "name": "aVaultLp", + "isMut": true, + "isSigner": false, + "docs": [ + "LP token account of vault A. Used to receive/burn the vault LP upon deposit/withdraw from the vault." + ] + }, + { + "name": "bVaultLp", + "isMut": true, + "isSigner": false, + "docs": [ + "LP token account of vault B. Used to receive/burn vault LP upon deposit/withdraw from the vault." + ] + }, + { + "name": "payerTokenA", + "isMut": true, + "isSigner": false, + "docs": [ + "Payer token account for pool token A mint. Used to bootstrap the pool with initial liquidity." + ] + }, + { + "name": "payerTokenB", + "isMut": true, + "isSigner": false, + "docs": [ + "Admin token account for pool token B mint. Used to bootstrap the pool with initial liquidity." + ] + }, + { "name": "payerPoolLp", "isMut": true, "isSigner": false }, + { + "name": "adminTokenAFee", + "isMut": true, + "isSigner": false, + "docs": [ + "Admin fee token account for token A. Used to receive trading fee." + ] + }, + { + "name": "adminTokenBFee", + "isMut": true, + "isSigner": false, + "docs": [ + "Admin fee token account for token B. Used to receive trading fee." + ] + }, + { + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "Admin account. This account will be the admin of the pool, and the payer for PDA during initialize pool." + ] + }, + { "name": "feeOwner", "isMut": false, "isSigner": false }, + { + "name": "rent", + "isMut": false, + "isSigner": false, + "docs": ["Rent account."] + }, + { "name": "mintMetadata", "isMut": true, "isSigner": false }, + { "name": "metadataProgram", "isMut": false, "isSigner": false }, + { + "name": "vaultProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "Vault program. The pool will deposit/withdraw liquidity from the vault." + ] + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": ["Token program."] + }, + { + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false, + "docs": ["Associated token program."] + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": ["System program."] + } + ], + "args": [ + { "name": "curveType", "type": { "defined": "CurveType" } }, + { "name": "tokenAAmount", "type": "u64" }, + { "name": "tokenBAmount", "type": "u64" } + ] + }, + { + "name": "initializePermissionlessPoolWithFeeTier", + "docs": ["Initialize a new permissionless pool with customized fee tier"], + "accounts": [ + { + "name": "pool", + "isMut": true, + "isSigner": false, + "docs": ["Pool account (PDA address)"] + }, + { + "name": "lpMint", + "isMut": true, + "isSigner": false, + "docs": ["LP token mint of the pool"] + }, + { + "name": "tokenAMint", + "isMut": false, + "isSigner": false, + "docs": ["Token A mint of the pool. Eg: USDT"] + }, + { + "name": "tokenBMint", + "isMut": false, + "isSigner": false, + "docs": ["Token B mint of the pool. Eg: USDC"] + }, + { + "name": "aVault", + "isMut": true, + "isSigner": false, + "docs": [ + "Vault account for token A. Token A of the pool will be deposit / withdraw from this vault account." + ] + }, + { + "name": "bVault", + "isMut": true, + "isSigner": false, + "docs": [ + "Vault account for token B. Token B of the pool will be deposit / withdraw from this vault account." + ] + }, + { + "name": "aTokenVault", + "isMut": true, + "isSigner": false, + "docs": ["Token vault account of vault A"] + }, + { + "name": "bTokenVault", + "isMut": true, + "isSigner": false, + "docs": ["Token vault account of vault B"] + }, + { + "name": "aVaultLpMint", + "isMut": true, + "isSigner": false, + "docs": ["LP token mint of vault A"] + }, + { + "name": "bVaultLpMint", + "isMut": true, + "isSigner": false, + "docs": ["LP token mint of vault B"] + }, + { + "name": "aVaultLp", + "isMut": true, + "isSigner": false, + "docs": [ + "LP token account of vault A. Used to receive/burn the vault LP upon deposit/withdraw from the vault." + ] + }, + { + "name": "bVaultLp", + "isMut": true, + "isSigner": false, + "docs": [ + "LP token account of vault B. Used to receive/burn vault LP upon deposit/withdraw from the vault." + ] + }, + { + "name": "payerTokenA", + "isMut": true, + "isSigner": false, + "docs": [ + "Payer token account for pool token A mint. Used to bootstrap the pool with initial liquidity." + ] + }, + { + "name": "payerTokenB", + "isMut": true, + "isSigner": false, + "docs": [ + "Admin token account for pool token B mint. Used to bootstrap the pool with initial liquidity." + ] + }, + { "name": "payerPoolLp", "isMut": true, "isSigner": false }, + { + "name": "adminTokenAFee", + "isMut": true, + "isSigner": false, + "docs": [ + "Admin fee token account for token A. Used to receive trading fee." + ] + }, + { + "name": "adminTokenBFee", + "isMut": true, + "isSigner": false, + "docs": [ + "Admin fee token account for token B. Used to receive trading fee." + ] + }, + { + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "Admin account. This account will be the admin of the pool, and the payer for PDA during initialize pool." + ] + }, + { "name": "feeOwner", "isMut": false, "isSigner": false }, + { + "name": "rent", + "isMut": false, + "isSigner": false, + "docs": ["Rent account."] + }, + { "name": "mintMetadata", "isMut": true, "isSigner": false }, + { "name": "metadataProgram", "isMut": false, "isSigner": false }, + { + "name": "vaultProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "Vault program. The pool will deposit/withdraw liquidity from the vault." + ] + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": ["Token program."] + }, + { + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false, + "docs": ["Associated token program."] + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": ["System program."] + } + ], + "args": [ + { "name": "curveType", "type": { "defined": "CurveType" } }, + { "name": "tradeFeeBps", "type": "u64" }, + { "name": "tokenAAmount", "type": "u64" }, + { "name": "tokenBAmount", "type": "u64" } + ] + }, + { + "name": "enableOrDisablePool", + "docs": [ + "Enable or disable a pool. A disabled pool allow only remove balanced liquidity operation." + ], + "accounts": [ + { + "name": "pool", + "isMut": true, + "isSigner": false, + "docs": ["Pool account (PDA)"] + }, + { + "name": "admin", + "isMut": false, + "isSigner": true, + "docs": ["Admin account. Must be owner of the pool."] + } + ], + "args": [{ "name": "enable", "type": "bool" }] + }, + { + "name": "swap", + "docs": [ + "Swap token A to B, or vice versa. An amount of trading fee will be charged for liquidity provider, and the admin of the pool." + ], + "accounts": [ + { + "name": "pool", + "isMut": true, + "isSigner": false, + "docs": ["Pool account (PDA)"] + }, + { + "name": "userSourceToken", + "isMut": true, + "isSigner": false, + "docs": [ + "User token account. Token from this account will be transfer into the vault by the pool in exchange for another token of the pool." + ] + }, + { + "name": "userDestinationToken", + "isMut": true, + "isSigner": false, + "docs": [ + "User token account. The exchanged token will be transfer into this account from the pool." + ] + }, + { + "name": "aVault", + "isMut": true, + "isSigner": false, + "docs": [ + "Vault account for token a. token a of the pool will be deposit / withdraw from this vault account." + ] + }, + { + "name": "bVault", + "isMut": true, + "isSigner": false, + "docs": [ + "Vault account for token b. token b of the pool will be deposit / withdraw from this vault account." + ] + }, + { + "name": "aTokenVault", + "isMut": true, + "isSigner": false, + "docs": ["Token vault account of vault A"] + }, + { + "name": "bTokenVault", + "isMut": true, + "isSigner": false, + "docs": ["Token vault account of vault B"] + }, + { + "name": "aVaultLpMint", + "isMut": true, + "isSigner": false, + "docs": ["Lp token mint of vault a"] + }, + { + "name": "bVaultLpMint", + "isMut": true, + "isSigner": false, + "docs": ["Lp token mint of vault b"] + }, + { + "name": "aVaultLp", + "isMut": true, + "isSigner": false, + "docs": [ + "LP token account of vault A. Used to receive/burn the vault LP upon deposit/withdraw from the vault." + ] + }, + { + "name": "bVaultLp", + "isMut": true, + "isSigner": false, + "docs": [ + "LP token account of vault B. Used to receive/burn the vault LP upon deposit/withdraw from the vault." + ] + }, + { + "name": "adminTokenFee", + "isMut": true, + "isSigner": false, + "docs": [ + "Admin fee token account. Used to receive trading fee. It's mint field must matched with user_source_token mint field." + ] + }, + { + "name": "user", + "isMut": false, + "isSigner": true, + "docs": ["User account. Must be owner of user_source_token."] + }, + { + "name": "vaultProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "Vault program. the pool will deposit/withdraw liquidity from the vault." + ] + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": ["Token program."] + } + ], + "args": [ + { "name": "inAmount", "type": "u64" }, + { "name": "minimumOutAmount", "type": "u64" } + ] + }, + { + "name": "removeLiquiditySingleSide", + "docs": [ + "Withdraw only single token from the pool. Only supported by pool with stable swap curve." + ], + "accounts": [ + { + "name": "pool", + "isMut": true, + "isSigner": false, + "docs": ["Pool account (PDA)"] + }, + { + "name": "lpMint", + "isMut": true, + "isSigner": false, + "docs": ["LP token mint of the pool"] + }, + { + "name": "userPoolLp", + "isMut": true, + "isSigner": false, + "docs": [ + "User pool lp token account. LP will be burned from this account upon success liquidity removal." + ] + }, + { + "name": "aVaultLp", + "isMut": true, + "isSigner": false, + "docs": [ + "LP token account of vault A. Used to receive/burn the vault LP upon deposit/withdraw from the vault." + ] + }, + { + "name": "bVaultLp", + "isMut": true, + "isSigner": false, + "docs": [ + "LP token account of vault B. Used to receive/burn the vault LP upon deposit/withdraw from the vault." + ] + }, + { + "name": "aVault", + "isMut": true, + "isSigner": false, + "docs": [ + "Vault account for token A. Token A of the pool will be deposit / withdraw from this vault account." + ] + }, + { + "name": "bVault", + "isMut": true, + "isSigner": false, + "docs": [ + "Vault account for token B. Token B of the pool will be deposit / withdraw from this vault account." + ] + }, + { + "name": "aVaultLpMint", + "isMut": true, + "isSigner": false, + "docs": ["LP token mint of vault A"] + }, + { + "name": "bVaultLpMint", + "isMut": true, + "isSigner": false, + "docs": ["LP token mint of vault B"] + }, + { + "name": "aTokenVault", + "isMut": true, + "isSigner": false, + "docs": ["Token vault account of vault A"] + }, + { + "name": "bTokenVault", + "isMut": true, + "isSigner": false, + "docs": ["Token vault account of vault B"] + }, + { + "name": "userDestinationToken", + "isMut": true, + "isSigner": false, + "docs": [ + "User token account to receive token upon success liquidity removal." + ] + }, + { + "name": "user", + "isMut": false, + "isSigner": true, + "docs": ["User account. Must be owner of the user_pool_lp account."] + }, + { + "name": "vaultProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "Vault program. The pool will deposit/withdraw liquidity from the vault." + ] + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": ["Token program."] + } + ], + "args": [ + { "name": "poolTokenAmount", "type": "u64" }, + { "name": "minimumOutAmount", "type": "u64" } + ] + }, + { + "name": "addImbalanceLiquidity", + "docs": [ + "Deposit tokens to the pool in an imbalance ratio. Only supported by pool with stable swap curve." + ], + "accounts": [ + { + "name": "pool", + "isMut": true, + "isSigner": false, + "docs": ["Pool account (PDA)"] + }, + { + "name": "lpMint", + "isMut": true, + "isSigner": false, + "docs": ["LP token mint of the pool"] + }, + { + "name": "userPoolLp", + "isMut": true, + "isSigner": false, + "docs": [ + "user pool lp token account. lp will be burned from this account upon success liquidity removal." + ] + }, + { + "name": "aVaultLp", + "isMut": true, + "isSigner": false, + "docs": [ + "LP token account of vault A. Used to receive/burn the vault LP upon deposit/withdraw from the vault." + ] + }, + { + "name": "bVaultLp", + "isMut": true, + "isSigner": false, + "docs": [ + "LP token account of vault B. Used to receive/burn the vault LP upon deposit/withdraw from the vault." + ] + }, + { + "name": "aVault", + "isMut": true, + "isSigner": false, + "docs": [ + "Vault account for token a. token a of the pool will be deposit / withdraw from this vault account." + ] + }, + { + "name": "bVault", + "isMut": true, + "isSigner": false, + "docs": [ + "Vault account for token b. token b of the pool will be deposit / withdraw from this vault account." + ] + }, + { + "name": "aVaultLpMint", + "isMut": true, + "isSigner": false, + "docs": ["LP token mint of vault a"] + }, + { + "name": "bVaultLpMint", + "isMut": true, + "isSigner": false, + "docs": ["LP token mint of vault b"] + }, + { + "name": "aTokenVault", + "isMut": true, + "isSigner": false, + "docs": ["Token vault account of vault A"] + }, + { + "name": "bTokenVault", + "isMut": true, + "isSigner": false, + "docs": ["Token vault account of vault B"] + }, + { + "name": "userAToken", + "isMut": true, + "isSigner": false, + "docs": [ + "User token A account. Token will be transfer from this account if it is add liquidity operation. Else, token will be transfer into this account." + ] + }, + { + "name": "userBToken", + "isMut": true, + "isSigner": false, + "docs": [ + "User token B account. Token will be transfer from this account if it is add liquidity operation. Else, token will be transfer into this account." + ] + }, + { + "name": "user", + "isMut": false, + "isSigner": true, + "docs": [ + "User account. Must be owner of user_a_token, and user_b_token." + ] + }, + { + "name": "vaultProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "Vault program. the pool will deposit/withdraw liquidity from the vault." + ] + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": ["Token program."] + } + ], + "args": [ + { "name": "minimumPoolTokenAmount", "type": "u64" }, + { "name": "tokenAAmount", "type": "u64" }, + { "name": "tokenBAmount", "type": "u64" } + ] + }, + { + "name": "removeBalanceLiquidity", + "docs": [ + "Withdraw tokens from the pool in a balanced ratio. User will still able to withdraw from pool even the pool is disabled. This allow user to exit their liquidity when there's some unforeseen event happen." + ], + "accounts": [ + { + "name": "pool", + "isMut": true, + "isSigner": false, + "docs": ["Pool account (PDA)"] + }, + { + "name": "lpMint", + "isMut": true, + "isSigner": false, + "docs": ["LP token mint of the pool"] + }, + { + "name": "userPoolLp", + "isMut": true, + "isSigner": false, + "docs": [ + "user pool lp token account. lp will be burned from this account upon success liquidity removal." + ] + }, + { + "name": "aVaultLp", + "isMut": true, + "isSigner": false, + "docs": [ + "LP token account of vault A. Used to receive/burn the vault LP upon deposit/withdraw from the vault." + ] + }, + { + "name": "bVaultLp", + "isMut": true, + "isSigner": false, + "docs": [ + "LP token account of vault B. Used to receive/burn the vault LP upon deposit/withdraw from the vault." + ] + }, + { + "name": "aVault", + "isMut": true, + "isSigner": false, + "docs": [ + "Vault account for token a. token a of the pool will be deposit / withdraw from this vault account." + ] + }, + { + "name": "bVault", + "isMut": true, + "isSigner": false, + "docs": [ + "Vault account for token b. token b of the pool will be deposit / withdraw from this vault account." + ] + }, + { + "name": "aVaultLpMint", + "isMut": true, + "isSigner": false, + "docs": ["LP token mint of vault a"] + }, + { + "name": "bVaultLpMint", + "isMut": true, + "isSigner": false, + "docs": ["LP token mint of vault b"] + }, + { + "name": "aTokenVault", + "isMut": true, + "isSigner": false, + "docs": ["Token vault account of vault A"] + }, + { + "name": "bTokenVault", + "isMut": true, + "isSigner": false, + "docs": ["Token vault account of vault B"] + }, + { + "name": "userAToken", + "isMut": true, + "isSigner": false, + "docs": [ + "User token A account. Token will be transfer from this account if it is add liquidity operation. Else, token will be transfer into this account." + ] + }, + { + "name": "userBToken", + "isMut": true, + "isSigner": false, + "docs": [ + "User token B account. Token will be transfer from this account if it is add liquidity operation. Else, token will be transfer into this account." + ] + }, + { + "name": "user", + "isMut": false, + "isSigner": true, + "docs": [ + "User account. Must be owner of user_a_token, and user_b_token." + ] + }, + { + "name": "vaultProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "Vault program. the pool will deposit/withdraw liquidity from the vault." + ] + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": ["Token program."] + } + ], + "args": [ + { "name": "poolTokenAmount", "type": "u64" }, + { "name": "minimumATokenOut", "type": "u64" }, + { "name": "minimumBTokenOut", "type": "u64" } + ] + }, + { + "name": "addBalanceLiquidity", + "docs": ["Deposit tokens to the pool in a balanced ratio."], + "accounts": [ + { + "name": "pool", + "isMut": true, + "isSigner": false, + "docs": ["Pool account (PDA)"] + }, + { + "name": "lpMint", + "isMut": true, + "isSigner": false, + "docs": ["LP token mint of the pool"] + }, + { + "name": "userPoolLp", + "isMut": true, + "isSigner": false, + "docs": [ + "user pool lp token account. lp will be burned from this account upon success liquidity removal." + ] + }, + { + "name": "aVaultLp", + "isMut": true, + "isSigner": false, + "docs": [ + "LP token account of vault A. Used to receive/burn the vault LP upon deposit/withdraw from the vault." + ] + }, + { + "name": "bVaultLp", + "isMut": true, + "isSigner": false, + "docs": [ + "LP token account of vault B. Used to receive/burn the vault LP upon deposit/withdraw from the vault." + ] + }, + { + "name": "aVault", + "isMut": true, + "isSigner": false, + "docs": [ + "Vault account for token a. token a of the pool will be deposit / withdraw from this vault account." + ] + }, + { + "name": "bVault", + "isMut": true, + "isSigner": false, + "docs": [ + "Vault account for token b. token b of the pool will be deposit / withdraw from this vault account." + ] + }, + { + "name": "aVaultLpMint", + "isMut": true, + "isSigner": false, + "docs": ["LP token mint of vault a"] + }, + { + "name": "bVaultLpMint", + "isMut": true, + "isSigner": false, + "docs": ["LP token mint of vault b"] + }, + { + "name": "aTokenVault", + "isMut": true, + "isSigner": false, + "docs": ["Token vault account of vault A"] + }, + { + "name": "bTokenVault", + "isMut": true, + "isSigner": false, + "docs": ["Token vault account of vault B"] + }, + { + "name": "userAToken", + "isMut": true, + "isSigner": false, + "docs": [ + "User token A account. Token will be transfer from this account if it is add liquidity operation. Else, token will be transfer into this account." + ] + }, + { + "name": "userBToken", + "isMut": true, + "isSigner": false, + "docs": [ + "User token B account. Token will be transfer from this account if it is add liquidity operation. Else, token will be transfer into this account." + ] + }, + { + "name": "user", + "isMut": false, + "isSigner": true, + "docs": [ + "User account. Must be owner of user_a_token, and user_b_token." + ] + }, + { + "name": "vaultProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "Vault program. the pool will deposit/withdraw liquidity from the vault." + ] + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": ["Token program."] + } + ], + "args": [ + { "name": "poolTokenAmount", "type": "u64" }, + { "name": "maximumTokenAAmount", "type": "u64" }, + { "name": "maximumTokenBAmount", "type": "u64" } + ] + }, + { + "name": "setPoolFees", + "docs": ["Update trading fee charged for liquidity provider, and admin."], + "accounts": [ + { + "name": "pool", + "isMut": true, + "isSigner": false, + "docs": ["Pool account (PDA)"] + }, + { + "name": "admin", + "isMut": false, + "isSigner": true, + "docs": ["Admin account. Must be owner of the pool."] + } + ], + "args": [{ "name": "fees", "type": { "defined": "PoolFees" } }] + }, + { + "name": "overrideCurveParam", + "docs": [ + "Update swap curve parameters. This function do not allow update of curve type. For example: stable swap curve to constant product curve. Only supported by pool with stable swap curve.", + "Only amp is allowed to be override. The other attributes of stable swap curve will be ignored." + ], + "accounts": [ + { + "name": "pool", + "isMut": true, + "isSigner": false, + "docs": ["Pool account (PDA)"] + }, + { + "name": "admin", + "isMut": false, + "isSigner": true, + "docs": ["Admin account. Must be owner of the pool."] + } + ], + "args": [{ "name": "curveType", "type": { "defined": "CurveType" } }] + }, + { + "name": "transferAdmin", + "docs": ["Transfer the admin of the pool to new admin."], + "accounts": [ + { + "name": "pool", + "isMut": true, + "isSigner": false, + "docs": ["Pool account (PDA)"] + }, + { + "name": "admin", + "isMut": false, + "isSigner": true, + "docs": ["Admin account. Must be owner of the pool."] + }, + { + "name": "newAdmin", + "isMut": false, + "isSigner": true, + "docs": ["New admin account."] + } + ], + "args": [] + }, + { + "name": "getPoolInfo", + "docs": ["Get the general information of the pool."], + "accounts": [ + { + "name": "pool", + "isMut": false, + "isSigner": false, + "docs": ["Pool account (PDA)"] + }, + { + "name": "lpMint", + "isMut": false, + "isSigner": false, + "docs": ["LP token mint of the pool"] + }, + { + "name": "aVaultLp", + "isMut": false, + "isSigner": false, + "docs": [ + "LP token account of vault A. Used to receive/burn the vault LP upon deposit/withdraw from the vault." + ] + }, + { + "name": "bVaultLp", + "isMut": false, + "isSigner": false, + "docs": [ + "LP token account of vault B. Used to receive/burn the vault LP upon deposit/withdraw from the vault." + ] + }, + { + "name": "aVault", + "isMut": false, + "isSigner": false, + "docs": [ + "Vault account for token a. token a of the pool will be deposit / withdraw from this vault account." + ] + }, + { + "name": "bVault", + "isMut": false, + "isSigner": false, + "docs": [ + "Vault account for token b. token b of the pool will be deposit / withdraw from this vault account." + ] + }, + { + "name": "aVaultLpMint", + "isMut": false, + "isSigner": false, + "docs": ["LP token mint of vault a"] + }, + { + "name": "bVaultLpMint", + "isMut": false, + "isSigner": false, + "docs": ["LP token mint of vault b"] + } + ], + "args": [] + }, + { + "name": "bootstrapLiquidity", + "docs": ["Bootstrap the pool when liquidity is depleted."], + "accounts": [ + { + "name": "pool", + "isMut": true, + "isSigner": false, + "docs": ["Pool account (PDA)"] + }, + { + "name": "lpMint", + "isMut": true, + "isSigner": false, + "docs": ["LP token mint of the pool"] + }, + { + "name": "userPoolLp", + "isMut": true, + "isSigner": false, + "docs": [ + "user pool lp token account. lp will be burned from this account upon success liquidity removal." + ] + }, + { + "name": "aVaultLp", + "isMut": true, + "isSigner": false, + "docs": [ + "LP token account of vault A. Used to receive/burn the vault LP upon deposit/withdraw from the vault." + ] + }, + { + "name": "bVaultLp", + "isMut": true, + "isSigner": false, + "docs": [ + "LP token account of vault B. Used to receive/burn the vault LP upon deposit/withdraw from the vault." + ] + }, + { + "name": "aVault", + "isMut": true, + "isSigner": false, + "docs": [ + "Vault account for token a. token a of the pool will be deposit / withdraw from this vault account." + ] + }, + { + "name": "bVault", + "isMut": true, + "isSigner": false, + "docs": [ + "Vault account for token b. token b of the pool will be deposit / withdraw from this vault account." + ] + }, + { + "name": "aVaultLpMint", + "isMut": true, + "isSigner": false, + "docs": ["LP token mint of vault a"] + }, + { + "name": "bVaultLpMint", + "isMut": true, + "isSigner": false, + "docs": ["LP token mint of vault b"] + }, + { + "name": "aTokenVault", + "isMut": true, + "isSigner": false, + "docs": ["Token vault account of vault A"] + }, + { + "name": "bTokenVault", + "isMut": true, + "isSigner": false, + "docs": ["Token vault account of vault B"] + }, + { + "name": "userAToken", + "isMut": true, + "isSigner": false, + "docs": [ + "User token A account. Token will be transfer from this account if it is add liquidity operation. Else, token will be transfer into this account." + ] + }, + { + "name": "userBToken", + "isMut": true, + "isSigner": false, + "docs": [ + "User token B account. Token will be transfer from this account if it is add liquidity operation. Else, token will be transfer into this account." + ] + }, + { + "name": "user", + "isMut": false, + "isSigner": true, + "docs": [ + "User account. Must be owner of user_a_token, and user_b_token." + ] + }, + { + "name": "vaultProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "Vault program. the pool will deposit/withdraw liquidity from the vault." + ] + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": ["Token program."] + } + ], + "args": [ + { "name": "tokenAAmount", "type": "u64" }, + { "name": "tokenBAmount", "type": "u64" } + ] + }, + { + "name": "migrateFeeAccount", + "docs": ["Migrate old token fee owner to PDA"], + "accounts": [ + { + "name": "pool", + "isMut": true, + "isSigner": false, + "docs": ["Pool account"] + }, + { + "name": "aVaultLp", + "isMut": false, + "isSigner": false, + "docs": ["A vault LP token account of the pool."] + }, + { + "name": "adminTokenAFee", + "isMut": true, + "isSigner": false, + "docs": [ + "Admin fee token account for token A. Used to receive trading fee." + ] + }, + { + "name": "adminTokenBFee", + "isMut": true, + "isSigner": false, + "docs": [ + "Admin fee token account for token B. Used to receive trading fee." + ] + }, + { + "name": "tokenAMint", + "isMut": false, + "isSigner": false, + "docs": ["Token A mint"] + }, + { + "name": "tokenBMint", + "isMut": false, + "isSigner": false, + "docs": ["Token B mint"] + }, + { + "name": "newAdminTokenAFee", + "isMut": true, + "isSigner": false, + "docs": ["Token fee account. Controlled by pool a_vault_lp PDA."] + }, + { + "name": "newAdminTokenBFee", + "isMut": true, + "isSigner": false, + "docs": ["Token fee account. Controlled by pool a_vault_lp PDA."] + }, + { + "name": "admin", + "isMut": true, + "isSigner": true, + "docs": ["Admin account. Must be owner of the pool."] + }, + { + "name": "treasuryTokenAFee", + "isMut": true, + "isSigner": false, + "docs": ["Treasury token a fee ATA."] + }, + { + "name": "treasuryTokenBFee", + "isMut": true, + "isSigner": false, + "docs": ["Treasury token b fee ATA."] + }, + { + "name": "treasury", + "isMut": false, + "isSigner": true, + "docs": ["Treasury signer"] + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": ["Token program."] + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": ["System program."] + } + ], + "args": [] + }, + { + "name": "createMintMetadata", + "docs": ["Create mint metadata account for old pools"], + "accounts": [ + { + "name": "pool", + "isMut": false, + "isSigner": false, + "docs": ["Pool account"] + }, + { + "name": "lpMint", + "isMut": false, + "isSigner": false, + "docs": ["LP mint account of the pool"] + }, + { + "name": "aVaultLp", + "isMut": false, + "isSigner": false, + "docs": ["Vault A LP account of the pool"] + }, + { "name": "mintMetadata", "isMut": true, "isSigner": false }, + { "name": "metadataProgram", "isMut": false, "isSigner": false }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": ["System program."] + }, + { "name": "payer", "isMut": true, "isSigner": true, "docs": ["Payer"] } + ], + "args": [] + }, + { + "name": "createLockEscrow", + "docs": ["Create lock account"], + "accounts": [ + { + "name": "pool", + "isMut": false, + "isSigner": false, + "docs": ["Pool account"] + }, + { + "name": "lockEscrow", + "isMut": true, + "isSigner": false, + "docs": ["Lock account"] + }, + { "name": "owner", "isMut": false, "isSigner": false }, + { + "name": "lpMint", + "isMut": false, + "isSigner": false, + "docs": ["LP token mint of the pool"] + }, + { + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": ["Payer account"] + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": ["System program."] + } + ], + "args": [] + }, + { + "name": "lock", + "docs": ["Lock Lp token"], + "accounts": [ + { + "name": "pool", + "isMut": true, + "isSigner": false, + "docs": ["Pool account"] + }, + { + "name": "lpMint", + "isMut": false, + "isSigner": false, + "docs": ["LP token mint of the pool"] + }, + { + "name": "lockEscrow", + "isMut": true, + "isSigner": false, + "docs": ["Lock account"] + }, + { + "name": "owner", + "isMut": true, + "isSigner": true, + "docs": ["Owner of lock account"] + }, + { + "name": "sourceTokens", + "isMut": true, + "isSigner": false, + "docs": ["owner lp token account"] + }, + { + "name": "escrowVault", + "isMut": true, + "isSigner": false, + "docs": ["Escrow vault"] + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": ["Token program."] + }, + { + "name": "aVault", + "isMut": false, + "isSigner": false, + "docs": [ + "Vault account for token a. token a of the pool will be deposit / withdraw from this vault account." + ] + }, + { + "name": "bVault", + "isMut": false, + "isSigner": false, + "docs": [ + "Vault account for token b. token b of the pool will be deposit / withdraw from this vault account." + ] + }, + { + "name": "aVaultLp", + "isMut": false, + "isSigner": false, + "docs": [ + "LP token account of vault A. Used to receive/burn the vault LP upon deposit/withdraw from the vault." + ] + }, + { + "name": "bVaultLp", + "isMut": false, + "isSigner": false, + "docs": [ + "LP token account of vault B. Used to receive/burn the vault LP upon deposit/withdraw from the vault." + ] + }, + { + "name": "aVaultLpMint", + "isMut": false, + "isSigner": false, + "docs": ["LP token mint of vault a"] + }, + { + "name": "bVaultLpMint", + "isMut": false, + "isSigner": false, + "docs": ["LP token mint of vault b"] + } + ], + "args": [{ "name": "amount", "type": "u64" }] + }, + { + "name": "claimFee", + "docs": ["Claim fee"], + "accounts": [ + { + "name": "pool", + "isMut": true, + "isSigner": false, + "docs": ["Pool account"] + }, + { + "name": "lpMint", + "isMut": true, + "isSigner": false, + "docs": ["LP token mint of the pool"] + }, + { + "name": "lockEscrow", + "isMut": true, + "isSigner": false, + "docs": ["Lock account"] + }, + { + "name": "owner", + "isMut": true, + "isSigner": true, + "docs": ["Owner of lock account"] + }, + { + "name": "sourceTokens", + "isMut": true, + "isSigner": false, + "docs": ["owner lp token account"] + }, + { + "name": "escrowVault", + "isMut": true, + "isSigner": false, + "docs": ["Escrow vault"] + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": ["Token program."] + }, + { + "name": "aTokenVault", + "isMut": true, + "isSigner": false, + "docs": ["Token vault account of vault A"] + }, + { + "name": "bTokenVault", + "isMut": true, + "isSigner": false, + "docs": ["Token vault account of vault B"] + }, + { + "name": "aVault", + "isMut": true, + "isSigner": false, + "docs": [ + "Vault account for token a. token a of the pool will be deposit / withdraw from this vault account." + ] + }, + { + "name": "bVault", + "isMut": true, + "isSigner": false, + "docs": [ + "Vault account for token b. token b of the pool will be deposit / withdraw from this vault account." + ] + }, + { + "name": "aVaultLp", + "isMut": true, + "isSigner": false, + "docs": [ + "LP token account of vault A. Used to receive/burn the vault LP upon deposit/withdraw from the vault." + ] + }, + { + "name": "bVaultLp", + "isMut": true, + "isSigner": false, + "docs": [ + "LP token account of vault B. Used to receive/burn the vault LP upon deposit/withdraw from the vault." + ] + }, + { + "name": "aVaultLpMint", + "isMut": true, + "isSigner": false, + "docs": ["LP token mint of vault a"] + }, + { + "name": "bVaultLpMint", + "isMut": true, + "isSigner": false, + "docs": ["LP token mint of vault b"] + }, + { + "name": "userAToken", + "isMut": true, + "isSigner": false, + "docs": [ + "User token A account. Token will be transfer from this account if it is add liquidity operation. Else, token will be transfer into this account." + ] + }, + { + "name": "userBToken", + "isMut": true, + "isSigner": false, + "docs": [ + "User token B account. Token will be transfer from this account if it is add liquidity operation. Else, token will be transfer into this account." + ] + }, + { + "name": "vaultProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "Vault program. the pool will deposit/withdraw liquidity from the vault." + ] + } + ], + "args": [{ "name": "maxAmount", "type": "u64" }] + } + ], + "accounts": [ + { + "name": "Pool", + "docs": ["State of pool account"], + "type": { + "kind": "struct", + "fields": [ + { + "name": "lpMint", + "docs": ["LP token mint of the pool"], + "type": "publicKey" + }, + { + "name": "tokenAMint", + "docs": ["Token A mint of the pool. Eg: USDT"], + "type": "publicKey" + }, + { + "name": "tokenBMint", + "docs": ["Token B mint of the pool. Eg: USDC"], + "type": "publicKey" + }, + { + "name": "aVault", + "docs": [ + "Vault account for token A. Token A of the pool will be deposit / withdraw from this vault account." + ], + "type": "publicKey" + }, + { + "name": "bVault", + "docs": [ + "Vault account for token B. Token B of the pool will be deposit / withdraw from this vault account." + ], + "type": "publicKey" + }, + { + "name": "aVaultLp", + "docs": [ + "LP token account of vault A. Used to receive/burn the vault LP upon deposit/withdraw from the vault." + ], + "type": "publicKey" + }, + { + "name": "bVaultLp", + "docs": [ + "LP token account of vault B. Used to receive/burn the vault LP upon deposit/withdraw from the vault." + ], + "type": "publicKey" + }, + { + "name": "aVaultLpBump", + "docs": ["\"A\" vault lp bump. Used to create signer seeds."], + "type": "u8" + }, + { + "name": "enabled", + "docs": [ + "Flag to determine whether the pool is enabled, or disabled." + ], + "type": "bool" + }, + { + "name": "adminTokenAFee", + "docs": [ + "Admin fee token account for token A. Used to receive trading fee." + ], + "type": "publicKey" + }, + { + "name": "adminTokenBFee", + "docs": [ + "Admin fee token account for token B. Used to receive trading fee." + ], + "type": "publicKey" + }, + { + "name": "admin", + "docs": ["Owner of the pool."], + "type": "publicKey" + }, + { + "name": "fees", + "docs": ["Store the fee charges setting."], + "type": { "defined": "PoolFees" } + }, + { + "name": "poolType", + "docs": ["Pool type"], + "type": { "defined": "PoolType" } + }, + { + "name": "stake", + "docs": ["Stake pubkey of SPL stake pool"], + "type": "publicKey" + }, + { + "name": "totalLockedLp", + "docs": ["Total locked lp token"], + "type": "u64" + }, + { + "name": "padding", + "docs": ["Padding for future pool field"], + "type": { "defined": "Padding" } + }, + { + "name": "curveType", + "docs": ["The type of the swap curve supported by the pool."], + "type": { "defined": "CurveType" } + } + ] + } + }, + { + "name": "LockEscrow", + "docs": ["State of lock escrow account"], + "type": { + "kind": "struct", + "fields": [ + { "name": "pool", "docs": ["Pool address"], "type": "publicKey" }, + { "name": "owner", "docs": ["Owner address"], "type": "publicKey" }, + { + "name": "escrowVault", + "docs": ["Vault address, store the lock user lock"], + "type": "publicKey" + }, + { "name": "bump", "docs": ["bump, used to sign"], "type": "u8" }, + { + "name": "totalLockedAmount", + "docs": ["Total locked amount"], + "type": "u64" + }, + { + "name": "lpPerToken", + "docs": ["Lp per token, virtual price of lp token"], + "type": "u128" + }, + { + "name": "unclaimedFeePending", + "docs": ["Unclaimed fee pending"], + "type": "u64" + }, + { + "name": "aFee", + "docs": ["Total a fee claimed so far"], + "type": "u64" + }, + { + "name": "bFee", + "docs": ["Total b fee claimed so far"], + "type": "u64" + } + ] + } + } + ], + "types": [ + { + "name": "TokenMultiplier", + "docs": [ + "Multiplier for the pool token. Used to normalized token with different decimal into the same precision." + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "tokenAMultiplier", + "docs": ["Multiplier for token A of the pool."], + "type": "u64" + }, + { + "name": "tokenBMultiplier", + "docs": ["Multiplier for token B of the pool."], + "type": "u64" + }, + { + "name": "precisionFactor", + "docs": [ + "Record the highest token decimal in the pool. For example, Token A is 6 decimal, token B is 9 decimal. This will save value of 9." + ], + "type": "u8" + } + ] + } + }, + { + "name": "PoolFees", + "docs": ["Information regarding fee charges"], + "type": { + "kind": "struct", + "fields": [ + { + "name": "tradeFeeNumerator", + "docs": [ + "Trade fees are extra token amounts that are held inside the token", + "accounts during a trade, making the value of liquidity tokens rise.", + "Trade fee numerator" + ], + "type": "u64" + }, + { + "name": "tradeFeeDenominator", + "docs": ["Trade fee denominator"], + "type": "u64" + }, + { + "name": "ownerTradeFeeNumerator", + "docs": [ + "Owner trading fees are extra token amounts that are held inside the token", + "accounts during a trade, with the equivalent in pool tokens minted to", + "the owner of the program.", + "Owner trade fee numerator" + ], + "type": "u64" + }, + { + "name": "ownerTradeFeeDenominator", + "docs": ["Owner trade fee denominator"], + "type": "u64" + } + ] + } + }, + { + "name": "Depeg", + "docs": ["Contains information for depeg pool"], + "type": { + "kind": "struct", + "fields": [ + { + "name": "baseVirtualPrice", + "docs": ["The virtual price of staking / interest bearing token"], + "type": "u64" + }, + { + "name": "baseCacheUpdated", + "docs": ["The virtual price of staking / interest bearing token"], + "type": "u64" + }, + { + "name": "depegType", + "docs": ["Type of the depeg pool"], + "type": { "defined": "DepegType" } + } + ] + } + }, + { + "name": "Padding", + "docs": ["Padding for future pool fields"], + "type": { + "kind": "struct", + "fields": [ + { + "name": "padding0", + "docs": ["Padding 0"], + "type": { "array": ["u8", 7] } + }, + { + "name": "padding", + "docs": ["Padding 1"], + "type": { "array": ["u128", 29] } + } + ] + } + }, + { + "name": "RoundDirection", + "docs": ["Rounding direction"], + "type": { + "kind": "enum", + "variants": [{ "name": "Floor" }, { "name": "Ceiling" }] + } + }, + { + "name": "TradeDirection", + "docs": ["Trade (swap) direction"], + "type": { + "kind": "enum", + "variants": [{ "name": "AtoB" }, { "name": "BtoA" }] + } + }, + { + "name": "NewCurveType", + "docs": ["Type of the swap curve"], + "type": { + "kind": "enum", + "variants": [ + { "name": "ConstantProduct" }, + { + "name": "Stable", + "fields": [ + { + "name": "amp", + "docs": ["Amplification coefficient"], + "type": "u64" + }, + { + "name": "token_multiplier", + "docs": [ + "Multiplier for the pool token. Used to normalized token with different decimal into the same precision." + ], + "type": { "defined": "TokenMultiplier" } + }, + { + "name": "depeg", + "docs": [ + "Depeg pool information. Contains functions to allow token amount to be repeg using stake / interest bearing token virtual price" + ], + "type": { "defined": "Depeg" } + }, + { + "name": "last_amp_updated_timestamp", + "docs": [ + "The last amp updated timestamp. Used to prevent update_curve_info called infinitely many times within a short period" + ], + "type": "u64" + } + ] + }, + { + "name": "NewCurve", + "fields": [ + { "name": "field_one", "type": "u64" }, + { "name": "field_two", "type": "u64" } + ] + } + ] + } + }, + { + "name": "CurveType", + "docs": ["Type of the swap curve"], + "type": { + "kind": "enum", + "variants": [ + { "name": "ConstantProduct" }, + { + "name": "Stable", + "fields": [ + { + "name": "amp", + "docs": ["Amplification coefficient"], + "type": "u64" + }, + { + "name": "token_multiplier", + "docs": [ + "Multiplier for the pool token. Used to normalized token with different decimal into the same precision." + ], + "type": { "defined": "TokenMultiplier" } + }, + { + "name": "depeg", + "docs": [ + "Depeg pool information. Contains functions to allow token amount to be repeg using stake / interest bearing token virtual price" + ], + "type": { "defined": "Depeg" } + }, + { + "name": "last_amp_updated_timestamp", + "docs": [ + "The last amp updated timestamp. Used to prevent update_curve_info called infinitely many times within a short period" + ], + "type": "u64" + } + ] + } + ] + } + }, + { + "name": "DepegType", + "docs": ["Type of depeg pool"], + "type": { + "kind": "enum", + "variants": [ + { "name": "None" }, + { "name": "Marinade" }, + { "name": "Lido" }, + { "name": "SplStake" } + ] + } + }, + { + "name": "Rounding", + "docs": ["Round up, down"], + "type": { + "kind": "enum", + "variants": [{ "name": "Up" }, { "name": "Down" }] + } + }, + { + "name": "PoolType", + "docs": ["Pool type"], + "type": { + "kind": "enum", + "variants": [{ "name": "Permissioned" }, { "name": "Permissionless" }] + } + } + ], + "events": [ + { + "name": "AddLiquidity", + "fields": [ + { "name": "lpMintAmount", "type": "u64", "index": false }, + { "name": "tokenAAmount", "type": "u64", "index": false }, + { "name": "tokenBAmount", "type": "u64", "index": false } + ] + }, + { + "name": "RemoveLiquidity", + "fields": [ + { "name": "lpUnmintAmount", "type": "u64", "index": false }, + { "name": "tokenAOutAmount", "type": "u64", "index": false }, + { "name": "tokenBOutAmount", "type": "u64", "index": false } + ] + }, + { + "name": "BootstrapLiquidity", + "fields": [ + { "name": "lpMintAmount", "type": "u64", "index": false }, + { "name": "tokenAAmount", "type": "u64", "index": false }, + { "name": "tokenBAmount", "type": "u64", "index": false }, + { "name": "pool", "type": "publicKey", "index": false } + ] + }, + { + "name": "Swap", + "fields": [ + { "name": "inAmount", "type": "u64", "index": false }, + { "name": "outAmount", "type": "u64", "index": false }, + { "name": "tradeFee", "type": "u64", "index": false }, + { "name": "adminFee", "type": "u64", "index": false }, + { "name": "hostFee", "type": "u64", "index": false } + ] + }, + { + "name": "SetPoolFees", + "fields": [ + { "name": "tradeFeeNumerator", "type": "u64", "index": false }, + { "name": "tradeFeeDenominator", "type": "u64", "index": false }, + { "name": "ownerTradeFeeNumerator", "type": "u64", "index": false }, + { "name": "ownerTradeFeeDenominator", "type": "u64", "index": false }, + { "name": "pool", "type": "publicKey", "index": false } + ] + }, + { + "name": "PoolInfo", + "fields": [ + { "name": "tokenAAmount", "type": "u64", "index": false }, + { "name": "tokenBAmount", "type": "u64", "index": false }, + { "name": "virtualPrice", "type": "f64", "index": false }, + { "name": "currentTimestamp", "type": "u64", "index": false } + ] + }, + { + "name": "TransferAdmin", + "fields": [ + { "name": "admin", "type": "publicKey", "index": false }, + { "name": "newAdmin", "type": "publicKey", "index": false }, + { "name": "pool", "type": "publicKey", "index": false } + ] + }, + { + "name": "SetAdminFeeAccount", + "fields": [ + { "name": "adminTokenAFee", "type": "publicKey", "index": false }, + { "name": "adminTokenBFee", "type": "publicKey", "index": false }, + { "name": "newAdminTokenAFee", "type": "publicKey", "index": false }, + { "name": "newAdminTokenBFee", "type": "publicKey", "index": false } + ] + }, + { + "name": "OverrideCurveParam", + "fields": [ + { "name": "newAmp", "type": "u64", "index": false }, + { "name": "updatedTimestamp", "type": "u64", "index": false }, + { "name": "pool", "type": "publicKey", "index": false } + ] + }, + { + "name": "PoolCreated", + "fields": [ + { "name": "lpMint", "type": "publicKey", "index": false }, + { "name": "tokenAMint", "type": "publicKey", "index": false }, + { "name": "tokenBMint", "type": "publicKey", "index": false }, + { + "name": "poolType", + "type": { "defined": "PoolType" }, + "index": false + }, + { "name": "pool", "type": "publicKey", "index": false } + ] + }, + { + "name": "PoolEnabled", + "fields": [ + { "name": "pool", "type": "publicKey", "index": false }, + { "name": "enabled", "type": "bool", "index": false } + ] + }, + { + "name": "MigrateFeeAccount", + "fields": [ + { "name": "pool", "type": "publicKey", "index": false }, + { "name": "newAdminTokenAFee", "type": "publicKey", "index": false }, + { "name": "newAdminTokenBFee", "type": "publicKey", "index": false }, + { "name": "tokenAAmount", "type": "u64", "index": false }, + { "name": "tokenBAmount", "type": "u64", "index": false } + ] + }, + { + "name": "CreateLockEscrow", + "fields": [ + { "name": "pool", "type": "publicKey", "index": false }, + { "name": "owner", "type": "publicKey", "index": false } + ] + }, + { + "name": "Lock", + "fields": [ + { "name": "pool", "type": "publicKey", "index": false }, + { "name": "owner", "type": "publicKey", "index": false }, + { "name": "amount", "type": "u64", "index": false } + ] + }, + { + "name": "ClaimFee", + "fields": [ + { "name": "pool", "type": "publicKey", "index": false }, + { "name": "owner", "type": "publicKey", "index": false }, + { "name": "amount", "type": "u64", "index": false }, + { "name": "aFee", "type": "u64", "index": false }, + { "name": "bFee", "type": "u64", "index": false } + ] + } + ], + "errors": [ + { "code": 6000, "name": "MathOverflow", "msg": "Math operation overflow" }, + { "code": 6001, "name": "InvalidFee", "msg": "Invalid fee setup" }, + { "code": 6002, "name": "InvalidInvariant", "msg": "Invalid invariant d" }, + { + "code": 6003, + "name": "FeeCalculationFailure", + "msg": "Fee calculation failure" + }, + { + "code": 6004, + "name": "ExceededSlippage", + "msg": "Exceeded slippage tolerance" + }, + { + "code": 6005, + "name": "InvalidCalculation", + "msg": "Invalid curve calculation" + }, + { + "code": 6006, + "name": "ZeroTradingTokens", + "msg": "Given pool token amount results in zero trading tokens" + }, + { + "code": 6007, + "name": "ConversionError", + "msg": "Math conversion overflow" + }, + { + "code": 6008, + "name": "FaultyLpMint", + "msg": "LP mint authority must be 'A' vault lp, without freeze authority, and 0 supply" + }, + { + "code": 6009, + "name": "MismatchedTokenMint", + "msg": "Token mint mismatched" + }, + { "code": 6010, "name": "MismatchedLpMint", "msg": "LP mint mismatched" }, + { + "code": 6011, + "name": "MismatchedOwner", + "msg": "Invalid lp token owner" + }, + { + "code": 6012, + "name": "InvalidVaultAccount", + "msg": "Invalid vault account" + }, + { + "code": 6013, + "name": "InvalidVaultLpAccount", + "msg": "Invalid vault lp account" + }, + { + "code": 6014, + "name": "InvalidPoolLpMintAccount", + "msg": "Invalid pool lp mint account" + }, + { "code": 6015, "name": "PoolDisabled", "msg": "Pool disabled" }, + { + "code": 6016, + "name": "InvalidAdminAccount", + "msg": "Invalid admin account" + }, + { + "code": 6017, + "name": "InvalidAdminFeeAccount", + "msg": "Invalid admin fee account" + }, + { "code": 6018, "name": "SameAdminAccount", "msg": "Same admin account" }, + { + "code": 6019, + "name": "IdenticalSourceDestination", + "msg": "Identical user source and destination token account" + }, + { + "code": 6020, + "name": "ApyCalculationError", + "msg": "Apy calculation error" + }, + { + "code": 6021, + "name": "InsufficientSnapshot", + "msg": "Insufficient virtual price snapshot" + }, + { + "code": 6022, + "name": "NonUpdatableCurve", + "msg": "Current curve is non-updatable" + }, + { + "code": 6023, + "name": "MisMatchedCurve", + "msg": "New curve is mismatched with old curve" + }, + { + "code": 6024, + "name": "InvalidAmplification", + "msg": "Amplification is invalid" + }, + { + "code": 6025, + "name": "UnsupportedOperation", + "msg": "Operation is not supported" + }, + { + "code": 6026, + "name": "ExceedMaxAChanges", + "msg": "Exceed max amplification changes" + }, + { + "code": 6027, + "name": "InvalidRemainingAccountsLen", + "msg": "Invalid remaining accounts length" + }, + { + "code": 6028, + "name": "InvalidRemainingAccounts", + "msg": "Invalid remaining account" + }, + { + "code": 6029, + "name": "MismatchedDepegMint", + "msg": "Token mint B doesn't matches depeg type token mint" + }, + { "code": 6030, "name": "InvalidApyAccount", "msg": "Invalid APY account" }, + { + "code": 6031, + "name": "InvalidTokenMultiplier", + "msg": "Invalid token multiplier" + }, + { + "code": 6032, + "name": "InvalidDepegInformation", + "msg": "Invalid depeg information" + }, + { + "code": 6033, + "name": "UpdateTimeConstraint", + "msg": "Update time constraint violated" + }, + { "code": 6034, "name": "ExceedMaxFeeBps", "msg": "Exceeded max fee bps" }, + { + "code": 6035, + "name": "OwnerFeeOverHalfOfTradeFee", + "msg": "Owner fee exceed half of trade fee" + }, + { "code": 6036, "name": "InvalidAdmin", "msg": "Invalid admin" }, + { + "code": 6037, + "name": "PoolIsNotPermissioned", + "msg": "Pool is not permissioned" + }, + { + "code": 6038, + "name": "InvalidDepositAmount", + "msg": "Invalid deposit amount" + }, + { "code": 6039, "name": "InvalidFeeOwner", "msg": "Invalid fee owner" }, + { "code": 6040, "name": "NonDepletedPool", "msg": "Pool is not depleted" }, + { "code": 6041, "name": "AmountNotPeg", "msg": "Token amount is not 1:1" }, + { "code": 6042, "name": "AmountIsZero", "msg": "Amount is zero" }, + { "code": 6043, "name": "TypeCastFailed", "msg": "Type cast error" }, + { "code": 6044, "name": "AmountIsNotEnough", "msg": "Amount is not enough" } + ] +} diff --git a/idl/meteora_damm_v2.json b/idl/meteora_damm_v2.json new file mode 100644 index 0000000..9bdcd11 --- /dev/null +++ b/idl/meteora_damm_v2.json @@ -0,0 +1,7671 @@ +{ + "address": "cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG", + "metadata": { + "name": "cp_amm", + "version": "0.1.7", + "spec": "0.1.0", + "description": "Created with Anchor" + }, + "instructions": [ + { + "name": "add_liquidity", + "discriminator": [ + 181, + 157, + 89, + 67, + 143, + 182, + 52, + 72 + ], + "accounts": [ + { + "name": "pool", + "writable": true, + "relations": [ + "position" + ] + }, + { + "name": "position", + "writable": true + }, + { + "name": "token_a_account", + "docs": [ + "The user token a account" + ], + "writable": true + }, + { + "name": "token_b_account", + "docs": [ + "The user token b account" + ], + "writable": true + }, + { + "name": "token_a_vault", + "docs": [ + "The vault token account for input token" + ], + "writable": true, + "relations": [ + "pool" + ] + }, + { + "name": "token_b_vault", + "docs": [ + "The vault token account for output token" + ], + "writable": true, + "relations": [ + "pool" + ] + }, + { + "name": "token_a_mint", + "docs": [ + "The mint of token a" + ], + "relations": [ + "pool" + ] + }, + { + "name": "token_b_mint", + "docs": [ + "The mint of token b" + ], + "relations": [ + "pool" + ] + }, + { + "name": "position_nft_account", + "docs": [ + "The token account for nft" + ] + }, + { + "name": "owner", + "docs": [ + "owner of position" + ], + "signer": true + }, + { + "name": "token_a_program", + "docs": [ + "Token a program" + ] + }, + { + "name": "token_b_program", + "docs": [ + "Token b program" + ] + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "params", + "type": { + "defined": { + "name": "AddLiquidityParameters" + } + } + } + ] + }, + { + "name": "claim_partner_fee", + "discriminator": [ + 97, + 206, + 39, + 105, + 94, + 94, + 126, + 148 + ], + "accounts": [ + { + "name": "pool_authority", + "address": "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC" + }, + { + "name": "pool", + "writable": true + }, + { + "name": "token_a_account", + "docs": [ + "The treasury token a account" + ], + "writable": true + }, + { + "name": "token_b_account", + "docs": [ + "The treasury token b account" + ], + "writable": true + }, + { + "name": "token_a_vault", + "docs": [ + "The vault token account for input token" + ], + "writable": true, + "relations": [ + "pool" + ] + }, + { + "name": "token_b_vault", + "docs": [ + "The vault token account for output token" + ], + "writable": true, + "relations": [ + "pool" + ] + }, + { + "name": "token_a_mint", + "docs": [ + "The mint of token a" + ], + "relations": [ + "pool" + ] + }, + { + "name": "token_b_mint", + "docs": [ + "The mint of token b" + ], + "relations": [ + "pool" + ] + }, + { + "name": "partner", + "signer": true, + "relations": [ + "pool" + ] + }, + { + "name": "token_a_program", + "docs": [ + "Token a program" + ] + }, + { + "name": "token_b_program", + "docs": [ + "Token b program" + ] + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "max_amount_a", + "type": "u64" + }, + { + "name": "max_amount_b", + "type": "u64" + } + ] + }, + { + "name": "claim_position_fee", + "discriminator": [ + 180, + 38, + 154, + 17, + 133, + 33, + 162, + 211 + ], + "accounts": [ + { + "name": "pool_authority", + "address": "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC" + }, + { + "name": "pool", + "relations": [ + "position" + ] + }, + { + "name": "position", + "writable": true + }, + { + "name": "token_a_account", + "docs": [ + "The user token a account" + ], + "writable": true + }, + { + "name": "token_b_account", + "docs": [ + "The user token b account" + ], + "writable": true + }, + { + "name": "token_a_vault", + "docs": [ + "The vault token account for input token" + ], + "writable": true, + "relations": [ + "pool" + ] + }, + { + "name": "token_b_vault", + "docs": [ + "The vault token account for output token" + ], + "writable": true, + "relations": [ + "pool" + ] + }, + { + "name": "token_a_mint", + "docs": [ + "The mint of token a" + ], + "relations": [ + "pool" + ] + }, + { + "name": "token_b_mint", + "docs": [ + "The mint of token b" + ], + "relations": [ + "pool" + ] + }, + { + "name": "position_nft_account", + "docs": [ + "The token account for nft" + ] + }, + { + "name": "owner", + "docs": [ + "owner of position" + ], + "signer": true + }, + { + "name": "token_a_program", + "docs": [ + "Token a program" + ] + }, + { + "name": "token_b_program", + "docs": [ + "Token b program" + ] + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [] + }, + { + "name": "claim_protocol_fee", + "discriminator": [ + 165, + 228, + 133, + 48, + 99, + 249, + 255, + 33 + ], + "accounts": [ + { + "name": "pool_authority", + "address": "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC" + }, + { + "name": "pool", + "writable": true + }, + { + "name": "token_a_vault", + "docs": [ + "The vault token account for input token" + ], + "writable": true, + "relations": [ + "pool" + ] + }, + { + "name": "token_b_vault", + "docs": [ + "The vault token account for output token" + ], + "writable": true, + "relations": [ + "pool" + ] + }, + { + "name": "token_a_mint", + "docs": [ + "The mint of token a" + ], + "relations": [ + "pool" + ] + }, + { + "name": "token_b_mint", + "docs": [ + "The mint of token b" + ], + "relations": [ + "pool" + ] + }, + { + "name": "token_a_account", + "writable": true + }, + { + "name": "token_b_account", + "writable": true + }, + { + "name": "operator", + "docs": [ + "Claim fee operator" + ] + }, + { + "name": "signer", + "docs": [ + "Operator" + ], + "signer": true + }, + { + "name": "token_a_program", + "docs": [ + "Token a program" + ] + }, + { + "name": "token_b_program", + "docs": [ + "Token b program" + ] + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "max_amount_a", + "type": "u64" + }, + { + "name": "max_amount_b", + "type": "u64" + } + ] + }, + { + "name": "claim_reward", + "discriminator": [ + 149, + 95, + 181, + 242, + 94, + 90, + 158, + 162 + ], + "accounts": [ + { + "name": "pool_authority", + "address": "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC" + }, + { + "name": "pool", + "writable": true, + "relations": [ + "position" + ] + }, + { + "name": "position", + "writable": true + }, + { + "name": "reward_vault", + "docs": [ + "The vault token account for reward token" + ], + "writable": true + }, + { + "name": "reward_mint" + }, + { + "name": "user_token_account", + "writable": true + }, + { + "name": "position_nft_account", + "docs": [ + "The token account for nft" + ] + }, + { + "name": "owner", + "docs": [ + "owner of position" + ], + "signer": true + }, + { + "name": "token_program" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "reward_index", + "type": "u8" + }, + { + "name": "skip_reward", + "type": "u8" + } + ] + }, + { + "name": "close_config", + "discriminator": [ + 145, + 9, + 72, + 157, + 95, + 125, + 61, + 85 + ], + "accounts": [ + { + "name": "config", + "writable": true + }, + { + "name": "operator" + }, + { + "name": "signer", + "signer": true + }, + { + "name": "rent_receiver", + "writable": true + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [] + }, + { + "name": "close_operator_account", + "discriminator": [ + 171, + 9, + 213, + 74, + 120, + 23, + 3, + 29 + ], + "accounts": [ + { + "name": "operator", + "writable": true + }, + { + "name": "signer", + "signer": true + }, + { + "name": "rent_receiver", + "writable": true + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [] + }, + { + "name": "close_position", + "discriminator": [ + 123, + 134, + 81, + 0, + 49, + 68, + 98, + 98 + ], + "accounts": [ + { + "name": "position_nft_mint", + "docs": [ + "position_nft_mint" + ], + "writable": true + }, + { + "name": "position_nft_account", + "docs": [ + "The token account for nft" + ], + "writable": true + }, + { + "name": "pool", + "writable": true, + "relations": [ + "position" + ] + }, + { + "name": "position", + "writable": true + }, + { + "name": "pool_authority", + "address": "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC" + }, + { + "name": "rent_receiver", + "writable": true + }, + { + "name": "owner", + "docs": [ + "Owner of position" + ], + "signer": true + }, + { + "name": "token_program", + "docs": [ + "Program to create NFT mint/token account and transfer for token22 account" + ], + "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [] + }, + { + "name": "close_token_badge", + "discriminator": [ + 108, + 146, + 86, + 110, + 179, + 254, + 10, + 104 + ], + "accounts": [ + { + "name": "token_badge", + "writable": true + }, + { + "name": "operator" + }, + { + "name": "signer", + "signer": true + }, + { + "name": "rent_receiver", + "writable": true + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [] + }, + { + "name": "create_config", + "docs": [ + "OPERATOR FUNCTIONS /////" + ], + "discriminator": [ + 201, + 207, + 243, + 114, + 75, + 111, + 47, + 189 + ], + "accounts": [ + { + "name": "config", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 99, + 111, + 110, + 102, + 105, + 103 + ] + }, + { + "kind": "arg", + "path": "index" + } + ] + } + }, + { + "name": "operator" + }, + { + "name": "signer", + "signer": true + }, + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "index", + "type": "u64" + }, + { + "name": "config_parameters", + "type": { + "defined": { + "name": "StaticConfigParameters" + } + } + } + ] + }, + { + "name": "create_dynamic_config", + "discriminator": [ + 81, + 251, + 122, + 78, + 66, + 57, + 208, + 82 + ], + "accounts": [ + { + "name": "config", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 99, + 111, + 110, + 102, + 105, + 103 + ] + }, + { + "kind": "arg", + "path": "index" + } + ] + } + }, + { + "name": "operator" + }, + { + "name": "signer", + "signer": true + }, + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "index", + "type": "u64" + }, + { + "name": "config_parameters", + "type": { + "defined": { + "name": "DynamicConfigParameters" + } + } + } + ] + }, + { + "name": "create_operator_account", + "docs": [ + "ADMIN FUNCTIONS /////" + ], + "discriminator": [ + 221, + 64, + 246, + 149, + 240, + 153, + 229, + 163 + ], + "accounts": [ + { + "name": "operator", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 111, + 112, + 101, + 114, + 97, + 116, + 111, + 114 + ] + }, + { + "kind": "account", + "path": "whitelisted_address" + } + ] + } + }, + { + "name": "whitelisted_address" + }, + { + "name": "signer", + "signer": true + }, + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "permission", + "type": "u128" + } + ] + }, + { + "name": "create_position", + "discriminator": [ + 48, + 215, + 197, + 153, + 96, + 203, + 180, + 133 + ], + "accounts": [ + { + "name": "owner" + }, + { + "name": "position_nft_mint", + "docs": [ + "position_nft_mint" + ], + "writable": true, + "signer": true + }, + { + "name": "position_nft_account", + "docs": [ + "position nft account" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 115, + 105, + 116, + 105, + 111, + 110, + 95, + 110, + 102, + 116, + 95, + 97, + 99, + 99, + 111, + 117, + 110, + 116 + ] + }, + { + "kind": "account", + "path": "position_nft_mint" + } + ] + } + }, + { + "name": "pool", + "writable": true + }, + { + "name": "position", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 115, + 105, + 116, + 105, + 111, + 110 + ] + }, + { + "kind": "account", + "path": "position_nft_mint" + } + ] + } + }, + { + "name": "pool_authority", + "address": "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC" + }, + { + "name": "payer", + "docs": [ + "Address paying to create the position. Can be anyone" + ], + "writable": true, + "signer": true + }, + { + "name": "token_program", + "docs": [ + "Program to create NFT mint/token account and transfer for token22 account" + ], + "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [] + }, + { + "name": "create_token_badge", + "discriminator": [ + 88, + 206, + 0, + 91, + 60, + 175, + 151, + 118 + ], + "accounts": [ + { + "name": "token_badge", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 116, + 111, + 107, + 101, + 110, + 95, + 98, + 97, + 100, + 103, + 101 + ] + }, + { + "kind": "account", + "path": "token_mint" + } + ] + } + }, + { + "name": "token_mint" + }, + { + "name": "operator" + }, + { + "name": "signer", + "signer": true + }, + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [] + }, + { + "name": "dummy_ix", + "discriminator": [ + 234, + 95, + 176, + 185, + 7, + 42, + 35, + 159 + ], + "accounts": [ + { + "name": "pod_aligned_fee_time_scheduler" + }, + { + "name": "pod_aligned_fee_rate_limiter" + }, + { + "name": "pod_aligned_fee_market_cap_scheduler" + } + ], + "args": [ + { + "name": "_ixs", + "type": { + "defined": { + "name": "DummyParams" + } + } + } + ] + }, + { + "name": "fund_reward", + "discriminator": [ + 188, + 50, + 249, + 165, + 93, + 151, + 38, + 63 + ], + "accounts": [ + { + "name": "pool", + "writable": true + }, + { + "name": "reward_vault", + "writable": true + }, + { + "name": "reward_mint" + }, + { + "name": "funder_token_account", + "writable": true + }, + { + "name": "funder", + "signer": true + }, + { + "name": "token_program" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "reward_index", + "type": "u8" + }, + { + "name": "amount", + "type": "u64" + }, + { + "name": "carry_forward", + "type": "bool" + } + ] + }, + { + "name": "initialize_customizable_pool", + "discriminator": [ + 20, + 161, + 241, + 24, + 189, + 221, + 180, + 2 + ], + "accounts": [ + { + "name": "creator" + }, + { + "name": "position_nft_mint", + "docs": [ + "position_nft_mint" + ], + "writable": true, + "signer": true + }, + { + "name": "position_nft_account", + "docs": [ + "position nft account" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 115, + 105, + 116, + 105, + 111, + 110, + 95, + 110, + 102, + 116, + 95, + 97, + 99, + 99, + 111, + 117, + 110, + 116 + ] + }, + { + "kind": "account", + "path": "position_nft_mint" + } + ] + } + }, + { + "name": "payer", + "docs": [ + "Address paying to create the pool. Can be anyone" + ], + "writable": true, + "signer": true + }, + { + "name": "pool_authority", + "address": "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC" + }, + { + "name": "pool", + "docs": [ + "Initialize an account to store the pool state" + ], + "writable": true + }, + { + "name": "position", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 115, + 105, + 116, + 105, + 111, + 110 + ] + }, + { + "kind": "account", + "path": "position_nft_mint" + } + ] + } + }, + { + "name": "token_a_mint", + "docs": [ + "Token a mint" + ] + }, + { + "name": "token_b_mint", + "docs": [ + "Token b mint" + ] + }, + { + "name": "token_a_vault", + "docs": [ + "Token a vault for the pool" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 116, + 111, + 107, + 101, + 110, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "token_a_mint" + }, + { + "kind": "account", + "path": "pool" + } + ] + } + }, + { + "name": "token_b_vault", + "docs": [ + "Token b vault for the pool" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 116, + 111, + 107, + 101, + 110, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "token_b_mint" + }, + { + "kind": "account", + "path": "pool" + } + ] + } + }, + { + "name": "payer_token_a", + "docs": [ + "payer token a account" + ], + "writable": true + }, + { + "name": "payer_token_b", + "docs": [ + "creator token b account" + ], + "writable": true + }, + { + "name": "token_a_program", + "docs": [ + "Program to create mint account and mint tokens" + ] + }, + { + "name": "token_b_program", + "docs": [ + "Program to create mint account and mint tokens" + ] + }, + { + "name": "token_2022_program", + "docs": [ + "Program to create NFT mint/token account and transfer for token22 account" + ], + "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "params", + "type": { + "defined": { + "name": "InitializeCustomizablePoolParameters" + } + } + } + ] + }, + { + "name": "initialize_pool", + "docs": [ + "USER FUNCTIONS ////" + ], + "discriminator": [ + 95, + 180, + 10, + 172, + 84, + 174, + 232, + 40 + ], + "accounts": [ + { + "name": "creator" + }, + { + "name": "position_nft_mint", + "docs": [ + "position_nft_mint" + ], + "writable": true, + "signer": true + }, + { + "name": "position_nft_account", + "docs": [ + "position nft account" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 115, + 105, + 116, + 105, + 111, + 110, + 95, + 110, + 102, + 116, + 95, + 97, + 99, + 99, + 111, + 117, + 110, + 116 + ] + }, + { + "kind": "account", + "path": "position_nft_mint" + } + ] + } + }, + { + "name": "payer", + "docs": [ + "Address paying to create the pool. Can be anyone" + ], + "writable": true, + "signer": true + }, + { + "name": "config", + "docs": [ + "Which config the pool belongs to." + ] + }, + { + "name": "pool_authority", + "address": "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC" + }, + { + "name": "pool", + "docs": [ + "Initialize an account to store the pool state" + ], + "writable": true + }, + { + "name": "position", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 115, + 105, + 116, + 105, + 111, + 110 + ] + }, + { + "kind": "account", + "path": "position_nft_mint" + } + ] + } + }, + { + "name": "token_a_mint", + "docs": [ + "Token a mint" + ] + }, + { + "name": "token_b_mint", + "docs": [ + "Token b mint" + ] + }, + { + "name": "token_a_vault", + "docs": [ + "Token a vault for the pool" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 116, + 111, + 107, + 101, + 110, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "token_a_mint" + }, + { + "kind": "account", + "path": "pool" + } + ] + } + }, + { + "name": "token_b_vault", + "docs": [ + "Token b vault for the pool" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 116, + 111, + 107, + 101, + 110, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "token_b_mint" + }, + { + "kind": "account", + "path": "pool" + } + ] + } + }, + { + "name": "payer_token_a", + "docs": [ + "payer token a account" + ], + "writable": true + }, + { + "name": "payer_token_b", + "docs": [ + "creator token b account" + ], + "writable": true + }, + { + "name": "token_a_program", + "docs": [ + "Program to create mint account and mint tokens" + ] + }, + { + "name": "token_b_program", + "docs": [ + "Program to create mint account and mint tokens" + ] + }, + { + "name": "token_2022_program", + "docs": [ + "Program to create NFT mint/token account and transfer for token22 account" + ], + "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "params", + "type": { + "defined": { + "name": "InitializePoolParameters" + } + } + } + ] + }, + { + "name": "initialize_pool_with_dynamic_config", + "discriminator": [ + 149, + 82, + 72, + 197, + 253, + 252, + 68, + 15 + ], + "accounts": [ + { + "name": "creator" + }, + { + "name": "position_nft_mint", + "docs": [ + "position_nft_mint" + ], + "writable": true, + "signer": true + }, + { + "name": "position_nft_account", + "docs": [ + "position nft account" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 115, + 105, + 116, + 105, + 111, + 110, + 95, + 110, + 102, + 116, + 95, + 97, + 99, + 99, + 111, + 117, + 110, + 116 + ] + }, + { + "kind": "account", + "path": "position_nft_mint" + } + ] + } + }, + { + "name": "payer", + "docs": [ + "Address paying to create the pool. Can be anyone" + ], + "writable": true, + "signer": true + }, + { + "name": "pool_creator_authority", + "signer": true, + "relations": [ + "config" + ] + }, + { + "name": "config", + "docs": [ + "Which config the pool belongs to." + ] + }, + { + "name": "pool_authority", + "address": "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC" + }, + { + "name": "pool", + "docs": [ + "Initialize an account to store the pool state" + ], + "writable": true + }, + { + "name": "position", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 115, + 105, + 116, + 105, + 111, + 110 + ] + }, + { + "kind": "account", + "path": "position_nft_mint" + } + ] + } + }, + { + "name": "token_a_mint", + "docs": [ + "Token a mint" + ] + }, + { + "name": "token_b_mint", + "docs": [ + "Token b mint" + ] + }, + { + "name": "token_a_vault", + "docs": [ + "Token a vault for the pool" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 116, + 111, + 107, + 101, + 110, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "token_a_mint" + }, + { + "kind": "account", + "path": "pool" + } + ] + } + }, + { + "name": "token_b_vault", + "docs": [ + "Token b vault for the pool" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 116, + 111, + 107, + 101, + 110, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "token_b_mint" + }, + { + "kind": "account", + "path": "pool" + } + ] + } + }, + { + "name": "payer_token_a", + "docs": [ + "payer token a account" + ], + "writable": true + }, + { + "name": "payer_token_b", + "docs": [ + "creator token b account" + ], + "writable": true + }, + { + "name": "token_a_program", + "docs": [ + "Program to create mint account and mint tokens" + ] + }, + { + "name": "token_b_program", + "docs": [ + "Program to create mint account and mint tokens" + ] + }, + { + "name": "token_2022_program", + "docs": [ + "Program to create NFT mint/token account and transfer for token22 account" + ], + "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "params", + "type": { + "defined": { + "name": "InitializeCustomizablePoolParameters" + } + } + } + ] + }, + { + "name": "initialize_reward", + "discriminator": [ + 95, + 135, + 192, + 196, + 242, + 129, + 230, + 68 + ], + "accounts": [ + { + "name": "pool_authority", + "address": "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC" + }, + { + "name": "pool", + "writable": true + }, + { + "name": "reward_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 114, + 101, + 119, + 97, + 114, + 100, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "pool" + }, + { + "kind": "arg", + "path": "reward_index" + } + ] + } + }, + { + "name": "reward_mint" + }, + { + "name": "signer", + "signer": true + }, + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "token_program" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "reward_index", + "type": "u8" + }, + { + "name": "reward_duration", + "type": "u64" + }, + { + "name": "funder", + "type": "pubkey" + } + ] + }, + { + "name": "lock_position", + "discriminator": [ + 227, + 62, + 2, + 252, + 247, + 10, + 171, + 185 + ], + "accounts": [ + { + "name": "pool", + "relations": [ + "position" + ] + }, + { + "name": "position", + "writable": true + }, + { + "name": "vesting", + "writable": true, + "signer": true + }, + { + "name": "position_nft_account", + "docs": [ + "The token account for nft" + ] + }, + { + "name": "owner", + "docs": [ + "owner of position" + ], + "signer": true + }, + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "params", + "type": { + "defined": { + "name": "VestingParameters" + } + } + } + ] + }, + { + "name": "permanent_lock_position", + "discriminator": [ + 165, + 176, + 125, + 6, + 231, + 171, + 186, + 213 + ], + "accounts": [ + { + "name": "pool", + "writable": true, + "relations": [ + "position" + ] + }, + { + "name": "position", + "writable": true + }, + { + "name": "position_nft_account", + "docs": [ + "The token account for nft" + ] + }, + { + "name": "owner", + "docs": [ + "owner of position" + ], + "signer": true + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "permanent_lock_liquidity", + "type": "u128" + } + ] + }, + { + "name": "refresh_vesting", + "discriminator": [ + 9, + 94, + 216, + 14, + 116, + 204, + 247, + 0 + ], + "accounts": [ + { + "name": "pool", + "relations": [ + "position" + ] + }, + { + "name": "position", + "writable": true + }, + { + "name": "position_nft_account", + "docs": [ + "The token account for nft" + ] + }, + { + "name": "owner" + } + ], + "args": [] + }, + { + "name": "remove_all_liquidity", + "discriminator": [ + 10, + 51, + 61, + 35, + 112, + 105, + 24, + 85 + ], + "accounts": [ + { + "name": "pool_authority", + "address": "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC" + }, + { + "name": "pool", + "writable": true, + "relations": [ + "position" + ] + }, + { + "name": "position", + "writable": true + }, + { + "name": "token_a_account", + "docs": [ + "The user token a account" + ], + "writable": true + }, + { + "name": "token_b_account", + "docs": [ + "The user token b account" + ], + "writable": true + }, + { + "name": "token_a_vault", + "docs": [ + "The vault token account for input token" + ], + "writable": true, + "relations": [ + "pool" + ] + }, + { + "name": "token_b_vault", + "docs": [ + "The vault token account for output token" + ], + "writable": true, + "relations": [ + "pool" + ] + }, + { + "name": "token_a_mint", + "docs": [ + "The mint of token a" + ], + "relations": [ + "pool" + ] + }, + { + "name": "token_b_mint", + "docs": [ + "The mint of token b" + ], + "relations": [ + "pool" + ] + }, + { + "name": "position_nft_account", + "docs": [ + "The token account for nft" + ] + }, + { + "name": "owner", + "docs": [ + "owner of position" + ], + "signer": true + }, + { + "name": "token_a_program", + "docs": [ + "Token a program" + ] + }, + { + "name": "token_b_program", + "docs": [ + "Token b program" + ] + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "token_a_amount_threshold", + "type": "u64" + }, + { + "name": "token_b_amount_threshold", + "type": "u64" + } + ] + }, + { + "name": "remove_liquidity", + "discriminator": [ + 80, + 85, + 209, + 72, + 24, + 206, + 177, + 108 + ], + "accounts": [ + { + "name": "pool_authority", + "address": "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC" + }, + { + "name": "pool", + "writable": true, + "relations": [ + "position" + ] + }, + { + "name": "position", + "writable": true + }, + { + "name": "token_a_account", + "docs": [ + "The user token a account" + ], + "writable": true + }, + { + "name": "token_b_account", + "docs": [ + "The user token b account" + ], + "writable": true + }, + { + "name": "token_a_vault", + "docs": [ + "The vault token account for input token" + ], + "writable": true, + "relations": [ + "pool" + ] + }, + { + "name": "token_b_vault", + "docs": [ + "The vault token account for output token" + ], + "writable": true, + "relations": [ + "pool" + ] + }, + { + "name": "token_a_mint", + "docs": [ + "The mint of token a" + ], + "relations": [ + "pool" + ] + }, + { + "name": "token_b_mint", + "docs": [ + "The mint of token b" + ], + "relations": [ + "pool" + ] + }, + { + "name": "position_nft_account", + "docs": [ + "The token account for nft" + ] + }, + { + "name": "owner", + "docs": [ + "owner of position" + ], + "signer": true + }, + { + "name": "token_a_program", + "docs": [ + "Token a program" + ] + }, + { + "name": "token_b_program", + "docs": [ + "Token b program" + ] + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "params", + "type": { + "defined": { + "name": "RemoveLiquidityParameters" + } + } + } + ] + }, + { + "name": "set_pool_status", + "discriminator": [ + 112, + 87, + 135, + 223, + 83, + 204, + 132, + 53 + ], + "accounts": [ + { + "name": "pool", + "writable": true + }, + { + "name": "operator" + }, + { + "name": "signer", + "signer": true + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "status", + "type": "u8" + } + ] + }, + { + "name": "split_position", + "discriminator": [ + 172, + 241, + 221, + 138, + 161, + 29, + 253, + 42 + ], + "accounts": [ + { + "name": "pool", + "writable": true, + "relations": [ + "first_position", + "second_position" + ] + }, + { + "name": "first_position", + "docs": [ + "The first position" + ], + "writable": true + }, + { + "name": "first_position_nft_account", + "docs": [ + "The token account for position nft" + ] + }, + { + "name": "second_position", + "docs": [ + "The second position" + ], + "writable": true + }, + { + "name": "second_position_nft_account", + "docs": [ + "The token account for position nft" + ] + }, + { + "name": "first_owner", + "docs": [ + "Owner of first position" + ], + "signer": true + }, + { + "name": "second_owner", + "docs": [ + "Owner of second position" + ], + "signer": true + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "params", + "type": { + "defined": { + "name": "SplitPositionParameters" + } + } + } + ] + }, + { + "name": "split_position2", + "discriminator": [ + 221, + 147, + 228, + 207, + 140, + 212, + 17, + 119 + ], + "accounts": [ + { + "name": "pool", + "writable": true, + "relations": [ + "first_position", + "second_position" + ] + }, + { + "name": "first_position", + "docs": [ + "The first position" + ], + "writable": true + }, + { + "name": "first_position_nft_account", + "docs": [ + "The token account for position nft" + ] + }, + { + "name": "second_position", + "docs": [ + "The second position" + ], + "writable": true + }, + { + "name": "second_position_nft_account", + "docs": [ + "The token account for position nft" + ] + }, + { + "name": "first_owner", + "docs": [ + "Owner of first position" + ], + "signer": true + }, + { + "name": "second_owner", + "docs": [ + "Owner of second position" + ], + "signer": true + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "numerator", + "type": "u32" + } + ] + }, + { + "name": "swap", + "discriminator": [ + 248, + 198, + 158, + 145, + 225, + 117, + 135, + 200 + ], + "accounts": [ + { + "name": "pool_authority", + "address": "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC" + }, + { + "name": "pool", + "docs": [ + "Pool account" + ], + "writable": true + }, + { + "name": "input_token_account", + "docs": [ + "The user token account for input token" + ], + "writable": true + }, + { + "name": "output_token_account", + "docs": [ + "The user token account for output token" + ], + "writable": true + }, + { + "name": "token_a_vault", + "docs": [ + "The vault token account for input token" + ], + "writable": true, + "relations": [ + "pool" + ] + }, + { + "name": "token_b_vault", + "docs": [ + "The vault token account for output token" + ], + "writable": true, + "relations": [ + "pool" + ] + }, + { + "name": "token_a_mint", + "docs": [ + "The mint of token a" + ] + }, + { + "name": "token_b_mint", + "docs": [ + "The mint of token b" + ] + }, + { + "name": "payer", + "docs": [ + "The user performing the swap" + ], + "signer": true + }, + { + "name": "token_a_program", + "docs": [ + "Token a program" + ] + }, + { + "name": "token_b_program", + "docs": [ + "Token b program" + ] + }, + { + "name": "referral_token_account", + "docs": [ + "referral token account" + ], + "writable": true, + "optional": true + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "_params", + "type": { + "defined": { + "name": "SwapParameters" + } + } + } + ] + }, + { + "name": "swap2", + "discriminator": [ + 65, + 75, + 63, + 76, + 235, + 91, + 91, + 136 + ], + "accounts": [ + { + "name": "pool_authority", + "address": "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC" + }, + { + "name": "pool", + "docs": [ + "Pool account" + ], + "writable": true + }, + { + "name": "input_token_account", + "docs": [ + "The user token account for input token" + ], + "writable": true + }, + { + "name": "output_token_account", + "docs": [ + "The user token account for output token" + ], + "writable": true + }, + { + "name": "token_a_vault", + "docs": [ + "The vault token account for input token" + ], + "writable": true, + "relations": [ + "pool" + ] + }, + { + "name": "token_b_vault", + "docs": [ + "The vault token account for output token" + ], + "writable": true, + "relations": [ + "pool" + ] + }, + { + "name": "token_a_mint", + "docs": [ + "The mint of token a" + ] + }, + { + "name": "token_b_mint", + "docs": [ + "The mint of token b" + ] + }, + { + "name": "payer", + "docs": [ + "The user performing the swap" + ], + "signer": true + }, + { + "name": "token_a_program", + "docs": [ + "Token a program" + ] + }, + { + "name": "token_b_program", + "docs": [ + "Token b program" + ] + }, + { + "name": "referral_token_account", + "docs": [ + "referral token account" + ], + "writable": true, + "optional": true + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "_params", + "type": { + "defined": { + "name": "SwapParameters2" + } + } + } + ] + }, + { + "name": "update_pool_fees", + "discriminator": [ + 118, + 217, + 203, + 179, + 60, + 8, + 70, + 89 + ], + "accounts": [ + { + "name": "pool", + "writable": true + }, + { + "name": "operator" + }, + { + "name": "signer", + "signer": true + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "params", + "type": { + "defined": { + "name": "UpdatePoolFeesParameters" + } + } + } + ] + }, + { + "name": "update_reward_duration", + "discriminator": [ + 138, + 174, + 196, + 169, + 213, + 235, + 254, + 107 + ], + "accounts": [ + { + "name": "pool", + "writable": true + }, + { + "name": "signer", + "signer": true + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "reward_index", + "type": "u8" + }, + { + "name": "new_duration", + "type": "u64" + } + ] + }, + { + "name": "update_reward_funder", + "discriminator": [ + 211, + 28, + 48, + 32, + 215, + 160, + 35, + 23 + ], + "accounts": [ + { + "name": "pool", + "writable": true + }, + { + "name": "signer", + "signer": true + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "reward_index", + "type": "u8" + }, + { + "name": "new_funder", + "type": "pubkey" + } + ] + }, + { + "name": "withdraw_ineligible_reward", + "discriminator": [ + 148, + 206, + 42, + 195, + 247, + 49, + 103, + 8 + ], + "accounts": [ + { + "name": "pool_authority", + "address": "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC" + }, + { + "name": "pool", + "writable": true + }, + { + "name": "reward_vault", + "writable": true + }, + { + "name": "reward_mint" + }, + { + "name": "funder_token_account", + "writable": true + }, + { + "name": "funder", + "signer": true + }, + { + "name": "token_program" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "reward_index", + "type": "u8" + } + ] + }, + { + "name": "zap_protocol_fee", + "discriminator": [ + 213, + 155, + 187, + 34, + 56, + 182, + 91, + 240 + ], + "accounts": [ + { + "name": "pool_authority", + "address": "HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC" + }, + { + "name": "pool", + "writable": true + }, + { + "name": "token_vault", + "writable": true + }, + { + "name": "token_mint" + }, + { + "name": "receiver_token", + "writable": true + }, + { + "name": "operator", + "docs": [ + "zap claim fee operator" + ] + }, + { + "name": "signer", + "docs": [ + "Operator" + ], + "signer": true + }, + { + "name": "token_program", + "docs": [ + "Token program" + ] + }, + { + "name": "sysvar_instructions", + "address": "Sysvar1nstructions1111111111111111111111111" + } + ], + "args": [ + { + "name": "max_amount", + "type": "u64" + } + ] + } + ], + "accounts": [ + { + "name": "Config", + "discriminator": [ + 155, + 12, + 170, + 224, + 30, + 250, + 204, + 130 + ] + }, + { + "name": "Operator", + "discriminator": [ + 219, + 31, + 188, + 145, + 69, + 139, + 204, + 117 + ] + }, + { + "name": "PodAlignedFeeMarketCapScheduler", + "discriminator": [ + 251, + 130, + 208, + 253, + 245, + 27, + 145, + 203 + ] + }, + { + "name": "PodAlignedFeeRateLimiter", + "discriminator": [ + 160, + 219, + 8, + 251, + 179, + 7, + 16, + 117 + ] + }, + { + "name": "PodAlignedFeeTimeScheduler", + "discriminator": [ + 239, + 132, + 138, + 213, + 67, + 154, + 130, + 70 + ] + }, + { + "name": "Pool", + "discriminator": [ + 241, + 154, + 109, + 4, + 17, + 177, + 109, + 188 + ] + }, + { + "name": "Position", + "discriminator": [ + 170, + 188, + 143, + 228, + 122, + 64, + 247, + 208 + ] + }, + { + "name": "TokenBadge", + "discriminator": [ + 116, + 219, + 204, + 229, + 249, + 116, + 255, + 150 + ] + }, + { + "name": "Vesting", + "discriminator": [ + 100, + 149, + 66, + 138, + 95, + 200, + 128, + 241 + ] + } + ], + "events": [ + { + "name": "EvtClaimPartnerFee", + "discriminator": [ + 118, + 99, + 77, + 10, + 226, + 1, + 1, + 87 + ] + }, + { + "name": "EvtClaimPositionFee", + "discriminator": [ + 198, + 182, + 183, + 52, + 97, + 12, + 49, + 56 + ] + }, + { + "name": "EvtClaimProtocolFee", + "discriminator": [ + 186, + 244, + 75, + 251, + 188, + 13, + 25, + 33 + ] + }, + { + "name": "EvtClaimReward", + "discriminator": [ + 218, + 86, + 147, + 200, + 235, + 188, + 215, + 231 + ] + }, + { + "name": "EvtCloseConfig", + "discriminator": [ + 36, + 30, + 239, + 45, + 58, + 132, + 14, + 5 + ] + }, + { + "name": "EvtClosePosition", + "discriminator": [ + 20, + 145, + 144, + 68, + 143, + 142, + 214, + 178 + ] + }, + { + "name": "EvtCreateConfig", + "discriminator": [ + 131, + 207, + 180, + 174, + 180, + 73, + 165, + 54 + ] + }, + { + "name": "EvtCreateDynamicConfig", + "discriminator": [ + 231, + 197, + 13, + 164, + 248, + 213, + 133, + 152 + ] + }, + { + "name": "EvtCreatePosition", + "discriminator": [ + 156, + 15, + 119, + 198, + 29, + 181, + 221, + 55 + ] + }, + { + "name": "EvtCreateTokenBadge", + "discriminator": [ + 141, + 120, + 134, + 116, + 34, + 28, + 114, + 160 + ] + }, + { + "name": "EvtFundReward", + "discriminator": [ + 104, + 233, + 237, + 122, + 199, + 191, + 121, + 85 + ] + }, + { + "name": "EvtInitializePool", + "discriminator": [ + 228, + 50, + 246, + 85, + 203, + 66, + 134, + 37 + ] + }, + { + "name": "EvtInitializeReward", + "discriminator": [ + 129, + 91, + 188, + 3, + 246, + 52, + 185, + 249 + ] + }, + { + "name": "EvtLiquidityChange", + "discriminator": [ + 197, + 171, + 78, + 127, + 224, + 211, + 87, + 13 + ] + }, + { + "name": "EvtLockPosition", + "discriminator": [ + 168, + 63, + 108, + 83, + 219, + 82, + 2, + 200 + ] + }, + { + "name": "EvtPermanentLockPosition", + "discriminator": [ + 145, + 143, + 162, + 218, + 218, + 80, + 67, + 11 + ] + }, + { + "name": "EvtSetPoolStatus", + "discriminator": [ + 100, + 213, + 74, + 3, + 95, + 91, + 228, + 146 + ] + }, + { + "name": "EvtSplitPosition2", + "discriminator": [ + 165, + 32, + 203, + 174, + 72, + 100, + 233, + 103 + ] + }, + { + "name": "EvtSwap2", + "discriminator": [ + 189, + 66, + 51, + 168, + 38, + 80, + 117, + 153 + ] + }, + { + "name": "EvtUpdatePoolFees", + "discriminator": [ + 76, + 165, + 246, + 102, + 102, + 217, + 156, + 44 + ] + }, + { + "name": "EvtUpdateRewardDuration", + "discriminator": [ + 149, + 135, + 65, + 231, + 129, + 153, + 65, + 57 + ] + }, + { + "name": "EvtUpdateRewardFunder", + "discriminator": [ + 76, + 154, + 208, + 13, + 40, + 115, + 246, + 146 + ] + }, + { + "name": "EvtWithdrawIneligibleReward", + "discriminator": [ + 248, + 215, + 184, + 78, + 31, + 180, + 179, + 168 + ] + } + ], + "errors": [ + { + "code": 6000, + "name": "MathOverflow", + "msg": "Math operation overflow" + }, + { + "code": 6001, + "name": "InvalidFee", + "msg": "Invalid fee setup" + }, + { + "code": 6002, + "name": "ExceededSlippage", + "msg": "Exceeded slippage tolerance" + }, + { + "code": 6003, + "name": "PoolDisabled", + "msg": "Pool disabled" + }, + { + "code": 6004, + "name": "ExceedMaxFeeBps", + "msg": "Exceeded max fee bps" + }, + { + "code": 6005, + "name": "InvalidAdmin", + "msg": "Invalid admin" + }, + { + "code": 6006, + "name": "AmountIsZero", + "msg": "Amount is zero" + }, + { + "code": 6007, + "name": "TypeCastFailed", + "msg": "Type cast error" + }, + { + "code": 6008, + "name": "UnableToModifyActivationPoint", + "msg": "Unable to modify activation point" + }, + { + "code": 6009, + "name": "InvalidAuthorityToCreateThePool", + "msg": "Invalid authority to create the pool" + }, + { + "code": 6010, + "name": "InvalidActivationType", + "msg": "Invalid activation type" + }, + { + "code": 6011, + "name": "InvalidActivationPoint", + "msg": "Invalid activation point" + }, + { + "code": 6012, + "name": "InvalidQuoteMint", + "msg": "Quote token must be SOL,USDC" + }, + { + "code": 6013, + "name": "InvalidFeeCurve", + "msg": "Invalid fee curve" + }, + { + "code": 6014, + "name": "InvalidPriceRange", + "msg": "Invalid Price Range" + }, + { + "code": 6015, + "name": "PriceRangeViolation", + "msg": "Trade is over price range" + }, + { + "code": 6016, + "name": "InvalidParameters", + "msg": "Invalid parameters" + }, + { + "code": 6017, + "name": "InvalidCollectFeeMode", + "msg": "Invalid collect fee mode" + }, + { + "code": 6018, + "name": "InvalidInput", + "msg": "Invalid input" + }, + { + "code": 6019, + "name": "CannotCreateTokenBadgeOnSupportedMint", + "msg": "Cannot create token badge on supported mint" + }, + { + "code": 6020, + "name": "InvalidTokenBadge", + "msg": "Invalid token badge" + }, + { + "code": 6021, + "name": "InvalidMinimumLiquidity", + "msg": "Invalid minimum liquidity" + }, + { + "code": 6022, + "name": "InvalidVestingInfo", + "msg": "Invalid vesting information" + }, + { + "code": 6023, + "name": "InsufficientLiquidity", + "msg": "Insufficient liquidity" + }, + { + "code": 6024, + "name": "InvalidVestingAccount", + "msg": "Invalid vesting account" + }, + { + "code": 6025, + "name": "InvalidPoolStatus", + "msg": "Invalid pool status" + }, + { + "code": 6026, + "name": "UnsupportNativeMintToken2022", + "msg": "Unsupported native mint token2022" + }, + { + "code": 6027, + "name": "InvalidRewardIndex", + "msg": "Invalid reward index" + }, + { + "code": 6028, + "name": "InvalidRewardDuration", + "msg": "Invalid reward duration" + }, + { + "code": 6029, + "name": "RewardInitialized", + "msg": "Reward already initialized" + }, + { + "code": 6030, + "name": "RewardUninitialized", + "msg": "Reward not initialized" + }, + { + "code": 6031, + "name": "InvalidRewardVault", + "msg": "Invalid reward vault" + }, + { + "code": 6032, + "name": "MustWithdrawnIneligibleReward", + "msg": "Must withdraw ineligible reward" + }, + { + "code": 6033, + "name": "IdenticalRewardDuration", + "msg": "Reward duration is the same" + }, + { + "code": 6034, + "name": "RewardCampaignInProgress", + "msg": "Reward campaign in progress" + }, + { + "code": 6035, + "name": "IdenticalFunder", + "msg": "Identical funder" + }, + { + "code": 6036, + "name": "InvalidFunder", + "msg": "Invalid funder" + }, + { + "code": 6037, + "name": "RewardNotEnded", + "msg": "Reward not ended" + }, + { + "code": 6038, + "name": "FeeInverseIsIncorrect", + "msg": "Fee inverse is incorrect" + }, + { + "code": 6039, + "name": "PositionIsNotEmpty", + "msg": "Position is not empty" + }, + { + "code": 6040, + "name": "InvalidPoolCreatorAuthority", + "msg": "Invalid pool creator authority" + }, + { + "code": 6041, + "name": "InvalidConfigType", + "msg": "Invalid config type" + }, + { + "code": 6042, + "name": "InvalidPoolCreator", + "msg": "Invalid pool creator" + }, + { + "code": 6043, + "name": "RewardVaultFrozenSkipRequired", + "msg": "Reward vault is frozen, must skip reward to proceed" + }, + { + "code": 6044, + "name": "InvalidSplitPositionParameters", + "msg": "Invalid parameters for split position" + }, + { + "code": 6045, + "name": "UnsupportPositionHasVestingLock", + "msg": "Unsupported split position has vesting lock" + }, + { + "code": 6046, + "name": "SamePosition", + "msg": "Same position" + }, + { + "code": 6047, + "name": "InvalidBaseFeeMode", + "msg": "Invalid base fee mode" + }, + { + "code": 6048, + "name": "InvalidFeeRateLimiter", + "msg": "Invalid fee rate limiter" + }, + { + "code": 6049, + "name": "FailToValidateSingleSwapInstruction", + "msg": "Fail to validate single swap instruction in rate limiter" + }, + { + "code": 6050, + "name": "InvalidFeeTimeScheduler", + "msg": "Invalid fee scheduler" + }, + { + "code": 6051, + "name": "UndeterminedError", + "msg": "Undetermined error" + }, + { + "code": 6052, + "name": "InvalidPoolVersion", + "msg": "Invalid pool version" + }, + { + "code": 6053, + "name": "InvalidAuthority", + "msg": "Invalid authority to do that action" + }, + { + "code": 6054, + "name": "InvalidPermission", + "msg": "Invalid permission" + }, + { + "code": 6055, + "name": "InvalidFeeMarketCapScheduler", + "msg": "Invalid fee market cap scheduler" + }, + { + "code": 6056, + "name": "CannotUpdateBaseFee", + "msg": "Cannot update base fee" + }, + { + "code": 6057, + "name": "InvalidDynamicFeeParameters", + "msg": "Invalid dynamic fee parameters" + }, + { + "code": 6058, + "name": "InvalidUpdatePoolFeesParameters", + "msg": "Invalid update pool fees parameters" + }, + { + "code": 6059, + "name": "MissingOperatorAccount", + "msg": "Missing operator account" + }, + { + "code": 6060, + "name": "IncorrectATA", + "msg": "Incorrect ATA" + }, + { + "code": 6061, + "name": "InvalidZapOutParameters", + "msg": "Invalid zap out parameters" + }, + { + "code": 6062, + "name": "InvalidWithdrawProtocolFeeZapAccounts", + "msg": "Invalid withdraw protocol fee zap accounts" + }, + { + "code": 6063, + "name": "MintRestrictedFromZap", + "msg": "SOL,USDC protocol fee cannot be withdrawn via zap" + }, + { + "code": 6064, + "name": "CpiDisabled", + "msg": "CPI disabled" + }, + { + "code": 6065, + "name": "MissingZapOutInstruction", + "msg": "Missing zap out instruction" + }, + { + "code": 6066, + "name": "InvalidZapAccounts", + "msg": "Invalid zap accounts" + } + ], + "types": [ + { + "name": "AddLiquidityParameters", + "type": { + "kind": "struct", + "fields": [ + { + "name": "liquidity_delta", + "docs": [ + "delta liquidity" + ], + "type": "u128" + }, + { + "name": "token_a_amount_threshold", + "docs": [ + "maximum token a amount" + ], + "type": "u64" + }, + { + "name": "token_b_amount_threshold", + "docs": [ + "maximum token b amount" + ], + "type": "u64" + } + ] + } + }, + { + "name": "BaseFeeInfo", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "data", + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] + } + }, + { + "name": "BaseFeeParameters", + "type": { + "kind": "struct", + "fields": [ + { + "name": "data", + "type": { + "array": [ + "u8", + 30 + ] + } + } + ] + } + }, + { + "name": "BaseFeeStruct", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "base_fee_info", + "type": { + "defined": { + "name": "BaseFeeInfo" + } + } + }, + { + "name": "padding_1", + "type": "u64" + } + ] + } + }, + { + "name": "BorshFeeMarketCapScheduler", + "type": { + "kind": "struct", + "fields": [ + { + "name": "cliff_fee_numerator", + "type": "u64" + }, + { + "name": "number_of_period", + "type": "u16" + }, + { + "name": "sqrt_price_step_bps", + "type": "u32" + }, + { + "name": "scheduler_expiration_duration", + "type": "u32" + }, + { + "name": "reduction_factor", + "type": "u64" + }, + { + "name": "base_fee_mode", + "type": "u8" + }, + { + "name": "padding", + "type": { + "array": [ + "u8", + 3 + ] + } + } + ] + } + }, + { + "name": "BorshFeeRateLimiter", + "docs": [ + "we denote reference_amount = x0, cliff_fee_numerator = c, fee_increment = i", + "if input_amount <= x0, then fee = input_amount * c", + "", + "if input_amount > x0, then input_amount = x0 + (a * x0 + b)", + "if a < max_index", + "then fee = x0 * c + x0 * (c + i) + .... + x0 * (c + i*a) + b * (c + i * (a+1))", + "then fee = x0 * (c + c*a + i*a*(a+1)/2) + b * (c + i * (a+1))", + "", + "if a >= max_index", + "if a = max_index + d, input_amount = x0 + max_index * x0 + (d * x0 + b)", + "then fee = x0 * (c + c*max_index + i*max_index*(max_index+1)/2) + (d * x0 + b) * MAX_FEE" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "cliff_fee_numerator", + "type": "u64" + }, + { + "name": "fee_increment_bps", + "type": "u16" + }, + { + "name": "max_limiter_duration", + "type": "u32" + }, + { + "name": "max_fee_bps", + "type": "u32" + }, + { + "name": "reference_amount", + "type": "u64" + }, + { + "name": "base_fee_mode", + "type": "u8" + }, + { + "name": "padding", + "type": { + "array": [ + "u8", + 3 + ] + } + } + ] + } + }, + { + "name": "BorshFeeTimeScheduler", + "type": { + "kind": "struct", + "fields": [ + { + "name": "cliff_fee_numerator", + "type": "u64" + }, + { + "name": "number_of_period", + "type": "u16" + }, + { + "name": "period_frequency", + "type": "u64" + }, + { + "name": "reduction_factor", + "type": "u64" + }, + { + "name": "base_fee_mode", + "type": "u8" + }, + { + "name": "padding", + "type": { + "array": [ + "u8", + 3 + ] + } + } + ] + } + }, + { + "name": "Config", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "vault_config_key", + "docs": [ + "Vault config key" + ], + "type": "pubkey" + }, + { + "name": "pool_creator_authority", + "docs": [ + "Only pool_creator_authority can use the current config to initialize new pool. When it's Pubkey::default, it's a public config." + ], + "type": "pubkey" + }, + { + "name": "pool_fees", + "docs": [ + "Pool fee" + ], + "type": { + "defined": { + "name": "PoolFeesConfig" + } + } + }, + { + "name": "activation_type", + "docs": [ + "Activation type" + ], + "type": "u8" + }, + { + "name": "collect_fee_mode", + "docs": [ + "Collect fee mode" + ], + "type": "u8" + }, + { + "name": "config_type", + "docs": [ + "Config type mode, 0 for static, 1 for dynamic" + ], + "type": "u8" + }, + { + "name": "_padding_0", + "docs": [ + "padding 0" + ], + "type": { + "array": [ + "u8", + 5 + ] + } + }, + { + "name": "index", + "docs": [ + "config index" + ], + "type": "u64" + }, + { + "name": "sqrt_min_price", + "docs": [ + "sqrt min price" + ], + "type": "u128" + }, + { + "name": "sqrt_max_price", + "docs": [ + "sqrt max price" + ], + "type": "u128" + }, + { + "name": "_padding_1", + "docs": [ + "Fee curve point", + "Padding for further use" + ], + "type": { + "array": [ + "u64", + 10 + ] + } + } + ] + } + }, + { + "name": "DummyParams", + "type": { + "kind": "struct", + "fields": [ + { + "name": "borsh_fee_time_scheduler_params", + "type": { + "defined": { + "name": "BorshFeeTimeScheduler" + } + } + }, + { + "name": "borsh_fee_rate_limiter_params", + "type": { + "defined": { + "name": "BorshFeeRateLimiter" + } + } + }, + { + "name": "borsh_fee_market_cap_scheduler_params", + "type": { + "defined": { + "name": "BorshFeeMarketCapScheduler" + } + } + } + ] + } + }, + { + "name": "DynamicConfigParameters", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool_creator_authority", + "type": "pubkey" + } + ] + } + }, + { + "name": "DynamicFeeConfig", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "initialized", + "type": "u8" + }, + { + "name": "padding", + "type": { + "array": [ + "u8", + 7 + ] + } + }, + { + "name": "max_volatility_accumulator", + "type": "u32" + }, + { + "name": "variable_fee_control", + "type": "u32" + }, + { + "name": "bin_step", + "type": "u16" + }, + { + "name": "filter_period", + "type": "u16" + }, + { + "name": "decay_period", + "type": "u16" + }, + { + "name": "reduction_factor", + "type": "u16" + }, + { + "name": "padding_1", + "type": { + "array": [ + "u8", + 8 + ] + } + }, + { + "name": "bin_step_u128", + "type": "u128" + } + ] + } + }, + { + "name": "DynamicFeeParameters", + "type": { + "kind": "struct", + "fields": [ + { + "name": "bin_step", + "type": "u16" + }, + { + "name": "bin_step_u128", + "type": "u128" + }, + { + "name": "filter_period", + "type": "u16" + }, + { + "name": "decay_period", + "type": "u16" + }, + { + "name": "reduction_factor", + "type": "u16" + }, + { + "name": "max_volatility_accumulator", + "type": "u32" + }, + { + "name": "variable_fee_control", + "type": "u32" + } + ] + } + }, + { + "name": "DynamicFeeStruct", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "initialized", + "type": "u8" + }, + { + "name": "padding", + "type": { + "array": [ + "u8", + 7 + ] + } + }, + { + "name": "max_volatility_accumulator", + "type": "u32" + }, + { + "name": "variable_fee_control", + "type": "u32" + }, + { + "name": "bin_step", + "type": "u16" + }, + { + "name": "filter_period", + "type": "u16" + }, + { + "name": "decay_period", + "type": "u16" + }, + { + "name": "reduction_factor", + "type": "u16" + }, + { + "name": "last_update_timestamp", + "type": "u64" + }, + { + "name": "bin_step_u128", + "type": "u128" + }, + { + "name": "sqrt_price_reference", + "type": "u128" + }, + { + "name": "volatility_accumulator", + "type": "u128" + }, + { + "name": "volatility_reference", + "type": "u128" + } + ] + } + }, + { + "name": "EvtClaimPartnerFee", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool", + "type": "pubkey" + }, + { + "name": "token_a_amount", + "type": "u64" + }, + { + "name": "token_b_amount", + "type": "u64" + } + ] + } + }, + { + "name": "EvtClaimPositionFee", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool", + "type": "pubkey" + }, + { + "name": "position", + "type": "pubkey" + }, + { + "name": "owner", + "type": "pubkey" + }, + { + "name": "fee_a_claimed", + "type": "u64" + }, + { + "name": "fee_b_claimed", + "type": "u64" + } + ] + } + }, + { + "name": "EvtClaimProtocolFee", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool", + "type": "pubkey" + }, + { + "name": "token_a_amount", + "type": "u64" + }, + { + "name": "token_b_amount", + "type": "u64" + } + ] + } + }, + { + "name": "EvtClaimReward", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool", + "type": "pubkey" + }, + { + "name": "position", + "type": "pubkey" + }, + { + "name": "owner", + "type": "pubkey" + }, + { + "name": "mint_reward", + "type": "pubkey" + }, + { + "name": "reward_index", + "type": "u8" + }, + { + "name": "total_reward", + "type": "u64" + } + ] + } + }, + { + "name": "EvtCloseConfig", + "docs": [ + "Close config" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "config", + "docs": [ + "Config pubkey" + ], + "type": "pubkey" + }, + { + "name": "admin", + "docs": [ + "admin pk" + ], + "type": "pubkey" + } + ] + } + }, + { + "name": "EvtClosePosition", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool", + "type": "pubkey" + }, + { + "name": "owner", + "type": "pubkey" + }, + { + "name": "position", + "type": "pubkey" + }, + { + "name": "position_nft_mint", + "type": "pubkey" + } + ] + } + }, + { + "name": "EvtCreateConfig", + "docs": [ + "Create static config" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool_fees", + "type": { + "defined": { + "name": "PoolFeeParameters" + } + } + }, + { + "name": "vault_config_key", + "type": "pubkey" + }, + { + "name": "pool_creator_authority", + "type": "pubkey" + }, + { + "name": "activation_type", + "type": "u8" + }, + { + "name": "sqrt_min_price", + "type": "u128" + }, + { + "name": "sqrt_max_price", + "type": "u128" + }, + { + "name": "collect_fee_mode", + "type": "u8" + }, + { + "name": "index", + "type": "u64" + }, + { + "name": "config", + "type": "pubkey" + } + ] + } + }, + { + "name": "EvtCreateDynamicConfig", + "docs": [ + "Create dynamic config" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "config", + "type": "pubkey" + }, + { + "name": "pool_creator_authority", + "type": "pubkey" + }, + { + "name": "index", + "type": "u64" + } + ] + } + }, + { + "name": "EvtCreatePosition", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool", + "type": "pubkey" + }, + { + "name": "owner", + "type": "pubkey" + }, + { + "name": "position", + "type": "pubkey" + }, + { + "name": "position_nft_mint", + "type": "pubkey" + } + ] + } + }, + { + "name": "EvtCreateTokenBadge", + "docs": [ + "Create token badge" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "token_mint", + "type": "pubkey" + } + ] + } + }, + { + "name": "EvtFundReward", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool", + "type": "pubkey" + }, + { + "name": "funder", + "type": "pubkey" + }, + { + "name": "mint_reward", + "type": "pubkey" + }, + { + "name": "reward_index", + "type": "u8" + }, + { + "name": "amount", + "type": "u64" + }, + { + "name": "transfer_fee_excluded_amount_in", + "type": "u64" + }, + { + "name": "reward_duration_end", + "type": "u64" + }, + { + "name": "pre_reward_rate", + "type": "u128" + }, + { + "name": "post_reward_rate", + "type": "u128" + } + ] + } + }, + { + "name": "EvtInitializePool", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool", + "type": "pubkey" + }, + { + "name": "token_a_mint", + "type": "pubkey" + }, + { + "name": "token_b_mint", + "type": "pubkey" + }, + { + "name": "creator", + "type": "pubkey" + }, + { + "name": "payer", + "type": "pubkey" + }, + { + "name": "alpha_vault", + "type": "pubkey" + }, + { + "name": "pool_fees", + "type": { + "defined": { + "name": "PoolFeeParameters" + } + } + }, + { + "name": "sqrt_min_price", + "type": "u128" + }, + { + "name": "sqrt_max_price", + "type": "u128" + }, + { + "name": "activation_type", + "type": "u8" + }, + { + "name": "collect_fee_mode", + "type": "u8" + }, + { + "name": "liquidity", + "type": "u128" + }, + { + "name": "sqrt_price", + "type": "u128" + }, + { + "name": "activation_point", + "type": "u64" + }, + { + "name": "token_a_flag", + "type": "u8" + }, + { + "name": "token_b_flag", + "type": "u8" + }, + { + "name": "token_a_amount", + "type": "u64" + }, + { + "name": "token_b_amount", + "type": "u64" + }, + { + "name": "total_amount_a", + "type": "u64" + }, + { + "name": "total_amount_b", + "type": "u64" + }, + { + "name": "pool_type", + "type": "u8" + } + ] + } + }, + { + "name": "EvtInitializeReward", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool", + "type": "pubkey" + }, + { + "name": "reward_mint", + "type": "pubkey" + }, + { + "name": "funder", + "type": "pubkey" + }, + { + "name": "creator", + "type": "pubkey" + }, + { + "name": "reward_index", + "type": "u8" + }, + { + "name": "reward_duration", + "type": "u64" + } + ] + } + }, + { + "name": "EvtLiquidityChange", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool", + "type": "pubkey" + }, + { + "name": "position", + "type": "pubkey" + }, + { + "name": "owner", + "type": "pubkey" + }, + { + "name": "token_a_amount", + "type": "u64" + }, + { + "name": "token_b_amount", + "type": "u64" + }, + { + "name": "transfer_fee_included_token_a_amount", + "type": "u64" + }, + { + "name": "transfer_fee_included_token_b_amount", + "type": "u64" + }, + { + "name": "reserve_a_amount", + "type": "u64" + }, + { + "name": "reserve_b_amount", + "type": "u64" + }, + { + "name": "liquidity_delta", + "type": "u128" + }, + { + "name": "token_a_amount_threshold", + "type": "u64" + }, + { + "name": "token_b_amount_threshold", + "type": "u64" + }, + { + "name": "change_type", + "type": "u8" + } + ] + } + }, + { + "name": "EvtLockPosition", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool", + "type": "pubkey" + }, + { + "name": "position", + "type": "pubkey" + }, + { + "name": "owner", + "type": "pubkey" + }, + { + "name": "vesting", + "type": "pubkey" + }, + { + "name": "cliff_point", + "type": "u64" + }, + { + "name": "period_frequency", + "type": "u64" + }, + { + "name": "cliff_unlock_liquidity", + "type": "u128" + }, + { + "name": "liquidity_per_period", + "type": "u128" + }, + { + "name": "number_of_period", + "type": "u16" + } + ] + } + }, + { + "name": "EvtPermanentLockPosition", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool", + "type": "pubkey" + }, + { + "name": "position", + "type": "pubkey" + }, + { + "name": "lock_liquidity_amount", + "type": "u128" + }, + { + "name": "total_permanent_locked_liquidity", + "type": "u128" + } + ] + } + }, + { + "name": "EvtSetPoolStatus", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool", + "type": "pubkey" + }, + { + "name": "status", + "type": "u8" + } + ] + } + }, + { + "name": "EvtSplitPosition2", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool", + "type": "pubkey" + }, + { + "name": "first_owner", + "type": "pubkey" + }, + { + "name": "second_owner", + "type": "pubkey" + }, + { + "name": "first_position", + "type": "pubkey" + }, + { + "name": "second_position", + "type": "pubkey" + }, + { + "name": "current_sqrt_price", + "type": "u128" + }, + { + "name": "amount_splits", + "type": { + "defined": { + "name": "SplitAmountInfo" + } + } + }, + { + "name": "first_position_info", + "type": { + "defined": { + "name": "SplitPositionInfo" + } + } + }, + { + "name": "second_position_info", + "type": { + "defined": { + "name": "SplitPositionInfo" + } + } + }, + { + "name": "split_position_parameters", + "type": { + "defined": { + "name": "SplitPositionParameters2" + } + } + } + ] + } + }, + { + "name": "EvtSwap2", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool", + "type": "pubkey" + }, + { + "name": "trade_direction", + "type": "u8" + }, + { + "name": "collect_fee_mode", + "type": "u8" + }, + { + "name": "has_referral", + "type": "bool" + }, + { + "name": "params", + "type": { + "defined": { + "name": "SwapParameters2" + } + } + }, + { + "name": "swap_result", + "type": { + "defined": { + "name": "SwapResult2" + } + } + }, + { + "name": "included_transfer_fee_amount_in", + "type": "u64" + }, + { + "name": "included_transfer_fee_amount_out", + "type": "u64" + }, + { + "name": "excluded_transfer_fee_amount_out", + "type": "u64" + }, + { + "name": "current_timestamp", + "type": "u64" + }, + { + "name": "reserve_a_amount", + "type": "u64" + }, + { + "name": "reserve_b_amount", + "type": "u64" + } + ] + } + }, + { + "name": "EvtUpdatePoolFees", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool", + "type": "pubkey" + }, + { + "name": "operator", + "type": "pubkey" + }, + { + "name": "params", + "type": { + "defined": { + "name": "UpdatePoolFeesParameters" + } + } + } + ] + } + }, + { + "name": "EvtUpdateRewardDuration", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool", + "type": "pubkey" + }, + { + "name": "reward_index", + "type": "u8" + }, + { + "name": "old_reward_duration", + "type": "u64" + }, + { + "name": "new_reward_duration", + "type": "u64" + } + ] + } + }, + { + "name": "EvtUpdateRewardFunder", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool", + "type": "pubkey" + }, + { + "name": "reward_index", + "type": "u8" + }, + { + "name": "old_funder", + "type": "pubkey" + }, + { + "name": "new_funder", + "type": "pubkey" + } + ] + } + }, + { + "name": "EvtWithdrawIneligibleReward", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool", + "type": "pubkey" + }, + { + "name": "reward_mint", + "type": "pubkey" + }, + { + "name": "amount", + "type": "u64" + } + ] + } + }, + { + "name": "InitializeCustomizablePoolParameters", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool_fees", + "docs": [ + "pool fees" + ], + "type": { + "defined": { + "name": "PoolFeeParameters" + } + } + }, + { + "name": "sqrt_min_price", + "docs": [ + "sqrt min price" + ], + "type": "u128" + }, + { + "name": "sqrt_max_price", + "docs": [ + "sqrt max price" + ], + "type": "u128" + }, + { + "name": "has_alpha_vault", + "docs": [ + "has alpha vault" + ], + "type": "bool" + }, + { + "name": "liquidity", + "docs": [ + "initialize liquidity" + ], + "type": "u128" + }, + { + "name": "sqrt_price", + "docs": [ + "The init price of the pool as a sqrt(token_b/token_a) Q64.64 value. Market cap fee scheduler minimum price will be derived from this value" + ], + "type": "u128" + }, + { + "name": "activation_type", + "docs": [ + "activation type" + ], + "type": "u8" + }, + { + "name": "collect_fee_mode", + "docs": [ + "collect fee mode" + ], + "type": "u8" + }, + { + "name": "activation_point", + "docs": [ + "activation point" + ], + "type": { + "option": "u64" + } + } + ] + } + }, + { + "name": "InitializePoolParameters", + "type": { + "kind": "struct", + "fields": [ + { + "name": "liquidity", + "docs": [ + "initialize liquidity" + ], + "type": "u128" + }, + { + "name": "sqrt_price", + "docs": [ + "The init price of the pool as a sqrt(token_b/token_a) Q64.64 value" + ], + "type": "u128" + }, + { + "name": "activation_point", + "docs": [ + "activation point" + ], + "type": { + "option": "u64" + } + } + ] + } + }, + { + "name": "Operator", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "whitelisted_address", + "type": "pubkey" + }, + { + "name": "permission", + "type": "u128" + }, + { + "name": "padding", + "type": { + "array": [ + "u64", + 2 + ] + } + } + ] + } + }, + { + "name": "PodAlignedFeeMarketCapScheduler", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "cliff_fee_numerator", + "type": "u64" + }, + { + "name": "base_fee_mode", + "type": "u8" + }, + { + "name": "padding", + "type": { + "array": [ + "u8", + 5 + ] + } + }, + { + "name": "number_of_period", + "type": "u16" + }, + { + "name": "sqrt_price_step_bps", + "type": "u32" + }, + { + "name": "scheduler_expiration_duration", + "type": "u32" + }, + { + "name": "reduction_factor", + "type": "u64" + } + ] + } + }, + { + "name": "PodAlignedFeeRateLimiter", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "cliff_fee_numerator", + "type": "u64" + }, + { + "name": "base_fee_mode", + "type": "u8" + }, + { + "name": "padding", + "type": { + "array": [ + "u8", + 5 + ] + } + }, + { + "name": "fee_increment_bps", + "type": "u16" + }, + { + "name": "max_limiter_duration", + "type": "u32" + }, + { + "name": "max_fee_bps", + "type": "u32" + }, + { + "name": "reference_amount", + "type": "u64" + } + ] + } + }, + { + "name": "PodAlignedFeeTimeScheduler", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "cliff_fee_numerator", + "type": "u64" + }, + { + "name": "base_fee_mode", + "type": "u8" + }, + { + "name": "padding", + "type": { + "array": [ + "u8", + 5 + ] + } + }, + { + "name": "number_of_period", + "type": "u16" + }, + { + "name": "period_frequency", + "type": "u64" + }, + { + "name": "reduction_factor", + "type": "u64" + } + ] + } + }, + { + "name": "Pool", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool_fees", + "docs": [ + "Pool fee" + ], + "type": { + "defined": { + "name": "PoolFeesStruct" + } + } + }, + { + "name": "token_a_mint", + "docs": [ + "token a mint" + ], + "type": "pubkey" + }, + { + "name": "token_b_mint", + "docs": [ + "token b mint" + ], + "type": "pubkey" + }, + { + "name": "token_a_vault", + "docs": [ + "token a vault" + ], + "type": "pubkey" + }, + { + "name": "token_b_vault", + "docs": [ + "token b vault" + ], + "type": "pubkey" + }, + { + "name": "whitelisted_vault", + "docs": [ + "Whitelisted vault to be able to buy pool before activation_point" + ], + "type": "pubkey" + }, + { + "name": "partner", + "docs": [ + "partner" + ], + "type": "pubkey" + }, + { + "name": "liquidity", + "docs": [ + "liquidity share" + ], + "type": "u128" + }, + { + "name": "_padding", + "docs": [ + "padding, previous reserve amount, be careful to use that field" + ], + "type": "u128" + }, + { + "name": "protocol_a_fee", + "docs": [ + "protocol a fee" + ], + "type": "u64" + }, + { + "name": "protocol_b_fee", + "docs": [ + "protocol b fee" + ], + "type": "u64" + }, + { + "name": "partner_a_fee", + "docs": [ + "partner a fee" + ], + "type": "u64" + }, + { + "name": "partner_b_fee", + "docs": [ + "partner b fee" + ], + "type": "u64" + }, + { + "name": "sqrt_min_price", + "docs": [ + "min price" + ], + "type": "u128" + }, + { + "name": "sqrt_max_price", + "docs": [ + "max price" + ], + "type": "u128" + }, + { + "name": "sqrt_price", + "docs": [ + "current price" + ], + "type": "u128" + }, + { + "name": "activation_point", + "docs": [ + "Activation point, can be slot or timestamp" + ], + "type": "u64" + }, + { + "name": "activation_type", + "docs": [ + "Activation type, 0 means by slot, 1 means by timestamp" + ], + "type": "u8" + }, + { + "name": "pool_status", + "docs": [ + "pool status, 0: enable, 1 disable" + ], + "type": "u8" + }, + { + "name": "token_a_flag", + "docs": [ + "token a flag" + ], + "type": "u8" + }, + { + "name": "token_b_flag", + "docs": [ + "token b flag" + ], + "type": "u8" + }, + { + "name": "collect_fee_mode", + "docs": [ + "0 is collect fee in both token, 1 only collect fee only in token b" + ], + "type": "u8" + }, + { + "name": "pool_type", + "docs": [ + "pool type" + ], + "type": "u8" + }, + { + "name": "version", + "docs": [ + "pool version, 0: max_fee is still capped at 50%, 1: max_fee is capped at 99%" + ], + "type": "u8" + }, + { + "name": "_padding_0", + "docs": [ + "padding" + ], + "type": "u8" + }, + { + "name": "fee_a_per_liquidity", + "docs": [ + "cumulative" + ], + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "fee_b_per_liquidity", + "docs": [ + "cumulative" + ], + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "permanent_lock_liquidity", + "type": "u128" + }, + { + "name": "metrics", + "docs": [ + "metrics" + ], + "type": { + "defined": { + "name": "PoolMetrics" + } + } + }, + { + "name": "creator", + "docs": [ + "pool creator" + ], + "type": "pubkey" + }, + { + "name": "_padding_1", + "docs": [ + "Padding for further use" + ], + "type": { + "array": [ + "u64", + 6 + ] + } + }, + { + "name": "reward_infos", + "docs": [ + "Farming reward information" + ], + "type": { + "array": [ + { + "defined": { + "name": "RewardInfo" + } + }, + 2 + ] + } + } + ] + } + }, + { + "name": "PoolFeeParameters", + "docs": [ + "Information regarding fee charges" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "base_fee", + "docs": [ + "Base fee" + ], + "type": { + "defined": { + "name": "BaseFeeParameters" + } + } + }, + { + "name": "dynamic_fee", + "docs": [ + "dynamic fee" + ], + "type": { + "option": { + "defined": { + "name": "DynamicFeeParameters" + } + } + } + } + ] + } + }, + { + "name": "PoolFeesConfig", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "base_fee", + "type": { + "defined": { + "name": "BaseFeeInfo" + } + } + }, + { + "name": "dynamic_fee", + "type": { + "defined": { + "name": "DynamicFeeConfig" + } + } + }, + { + "name": "protocol_fee_percent", + "type": "u8" + }, + { + "name": "partner_fee_percent", + "type": "u8" + }, + { + "name": "referral_fee_percent", + "type": "u8" + }, + { + "name": "padding_0", + "type": { + "array": [ + "u8", + 5 + ] + } + }, + { + "name": "padding_1", + "type": { + "array": [ + "u64", + 5 + ] + } + } + ] + } + }, + { + "name": "PoolFeesStruct", + "docs": [ + "Information regarding fee charges", + "trading_fee = amount * trade_fee_numerator / denominator", + "protocol_fee = trading_fee * protocol_fee_percentage / 100", + "referral_fee = protocol_fee * referral_percentage / 100", + "partner_fee = (protocol_fee - referral_fee) * partner_fee_percentage / denominator" + ], + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "base_fee", + "docs": [ + "Trade fees are extra token amounts that are held inside the token", + "accounts during a trade, making the value of liquidity tokens rise.", + "Trade fee numerator" + ], + "type": { + "defined": { + "name": "BaseFeeStruct" + } + } + }, + { + "name": "protocol_fee_percent", + "docs": [ + "Protocol trading fees are extra token amounts that are held inside the token", + "accounts during a trade, with the equivalent in pool tokens minted to", + "the protocol of the program.", + "Protocol trade fee numerator" + ], + "type": "u8" + }, + { + "name": "partner_fee_percent", + "docs": [ + "partner fee" + ], + "type": "u8" + }, + { + "name": "referral_fee_percent", + "docs": [ + "referral fee" + ], + "type": "u8" + }, + { + "name": "padding_0", + "docs": [ + "padding" + ], + "type": { + "array": [ + "u8", + 5 + ] + } + }, + { + "name": "dynamic_fee", + "docs": [ + "dynamic fee" + ], + "type": { + "defined": { + "name": "DynamicFeeStruct" + } + } + }, + { + "name": "init_sqrt_price", + "type": "u128" + } + ] + } + }, + { + "name": "PoolMetrics", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "total_lp_a_fee", + "type": "u128" + }, + { + "name": "total_lp_b_fee", + "type": "u128" + }, + { + "name": "total_protocol_a_fee", + "type": "u64" + }, + { + "name": "total_protocol_b_fee", + "type": "u64" + }, + { + "name": "total_partner_a_fee", + "type": "u64" + }, + { + "name": "total_partner_b_fee", + "type": "u64" + }, + { + "name": "total_position", + "type": "u64" + }, + { + "name": "padding", + "type": "u64" + } + ] + } + }, + { + "name": "Position", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool", + "type": "pubkey" + }, + { + "name": "nft_mint", + "docs": [ + "nft mint" + ], + "type": "pubkey" + }, + { + "name": "fee_a_per_token_checkpoint", + "docs": [ + "fee a checkpoint" + ], + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "fee_b_per_token_checkpoint", + "docs": [ + "fee b checkpoint" + ], + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "fee_a_pending", + "docs": [ + "fee a pending" + ], + "type": "u64" + }, + { + "name": "fee_b_pending", + "docs": [ + "fee b pending" + ], + "type": "u64" + }, + { + "name": "unlocked_liquidity", + "docs": [ + "unlock liquidity" + ], + "type": "u128" + }, + { + "name": "vested_liquidity", + "docs": [ + "vesting liquidity" + ], + "type": "u128" + }, + { + "name": "permanent_locked_liquidity", + "docs": [ + "permanent locked liquidity" + ], + "type": "u128" + }, + { + "name": "metrics", + "docs": [ + "metrics" + ], + "type": { + "defined": { + "name": "PositionMetrics" + } + } + }, + { + "name": "reward_infos", + "docs": [ + "Farming reward information" + ], + "type": { + "array": [ + { + "defined": { + "name": "UserRewardInfo" + } + }, + 2 + ] + } + }, + { + "name": "padding", + "docs": [ + "padding for future usage" + ], + "type": { + "array": [ + "u128", + 6 + ] + } + } + ] + } + }, + { + "name": "PositionMetrics", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "total_claimed_a_fee", + "type": "u64" + }, + { + "name": "total_claimed_b_fee", + "type": "u64" + } + ] + } + }, + { + "name": "RemoveLiquidityParameters", + "type": { + "kind": "struct", + "fields": [ + { + "name": "liquidity_delta", + "docs": [ + "delta liquidity" + ], + "type": "u128" + }, + { + "name": "token_a_amount_threshold", + "docs": [ + "minimum token a amount" + ], + "type": "u64" + }, + { + "name": "token_b_amount_threshold", + "docs": [ + "minimum token b amount" + ], + "type": "u64" + } + ] + } + }, + { + "name": "RewardInfo", + "docs": [ + "Stores the state relevant for tracking liquidity mining rewards" + ], + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "initialized", + "docs": [ + "Indicates if the reward has been initialized" + ], + "type": "u8" + }, + { + "name": "reward_token_flag", + "docs": [ + "reward token flag" + ], + "type": "u8" + }, + { + "name": "_padding_0", + "docs": [ + "padding" + ], + "type": { + "array": [ + "u8", + 6 + ] + } + }, + { + "name": "_padding_1", + "docs": [ + "Padding to ensure `reward_rate: u128` is 16-byte aligned" + ], + "type": { + "array": [ + "u8", + 8 + ] + } + }, + { + "name": "mint", + "docs": [ + "Reward token mint." + ], + "type": "pubkey" + }, + { + "name": "vault", + "docs": [ + "Reward vault token account." + ], + "type": "pubkey" + }, + { + "name": "funder", + "docs": [ + "Authority account that allows to fund rewards" + ], + "type": "pubkey" + }, + { + "name": "reward_duration", + "docs": [ + "reward duration" + ], + "type": "u64" + }, + { + "name": "reward_duration_end", + "docs": [ + "reward duration end" + ], + "type": "u64" + }, + { + "name": "reward_rate", + "docs": [ + "reward rate" + ], + "type": "u128" + }, + { + "name": "reward_per_token_stored", + "docs": [ + "Reward per token stored" + ], + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "last_update_time", + "docs": [ + "The last time reward states were updated." + ], + "type": "u64" + }, + { + "name": "cumulative_seconds_with_empty_liquidity_reward", + "docs": [ + "Accumulated seconds when the farm distributed rewards but the bin was empty.", + "These rewards will be carried over to the next reward time window." + ], + "type": "u64" + } + ] + } + }, + { + "name": "SplitAmountInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "permanent_locked_liquidity", + "type": "u128" + }, + { + "name": "unlocked_liquidity", + "type": "u128" + }, + { + "name": "fee_a", + "type": "u64" + }, + { + "name": "fee_b", + "type": "u64" + }, + { + "name": "reward_0", + "type": "u64" + }, + { + "name": "reward_1", + "type": "u64" + } + ] + } + }, + { + "name": "SplitPositionInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "liquidity", + "type": "u128" + }, + { + "name": "fee_a", + "type": "u64" + }, + { + "name": "fee_b", + "type": "u64" + }, + { + "name": "reward_0", + "type": "u64" + }, + { + "name": "reward_1", + "type": "u64" + } + ] + } + }, + { + "name": "SplitPositionParameters", + "type": { + "kind": "struct", + "fields": [ + { + "name": "unlocked_liquidity_percentage", + "docs": [ + "Percentage of unlocked liquidity to split to the second position" + ], + "type": "u8" + }, + { + "name": "permanent_locked_liquidity_percentage", + "docs": [ + "Percentage of permanent locked liquidity to split to the second position" + ], + "type": "u8" + }, + { + "name": "fee_a_percentage", + "docs": [ + "Percentage of fee A pending to split to the second position" + ], + "type": "u8" + }, + { + "name": "fee_b_percentage", + "docs": [ + "Percentage of fee B pending to split to the second position" + ], + "type": "u8" + }, + { + "name": "reward_0_percentage", + "docs": [ + "Percentage of reward 0 pending to split to the second position" + ], + "type": "u8" + }, + { + "name": "reward_1_percentage", + "docs": [ + "Percentage of reward 1 pending to split to the second position" + ], + "type": "u8" + }, + { + "name": "padding", + "docs": [ + "padding for future" + ], + "type": { + "array": [ + "u8", + 16 + ] + } + } + ] + } + }, + { + "name": "SplitPositionParameters2", + "type": { + "kind": "struct", + "fields": [ + { + "name": "unlocked_liquidity_numerator", + "type": "u32" + }, + { + "name": "permanent_locked_liquidity_numerator", + "type": "u32" + }, + { + "name": "fee_a_numerator", + "type": "u32" + }, + { + "name": "fee_b_numerator", + "type": "u32" + }, + { + "name": "reward_0_numerator", + "type": "u32" + }, + { + "name": "reward_1_numerator", + "type": "u32" + } + ] + } + }, + { + "name": "StaticConfigParameters", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool_fees", + "type": { + "defined": { + "name": "PoolFeeParameters" + } + } + }, + { + "name": "sqrt_min_price", + "type": "u128" + }, + { + "name": "sqrt_max_price", + "type": "u128" + }, + { + "name": "vault_config_key", + "type": "pubkey" + }, + { + "name": "pool_creator_authority", + "type": "pubkey" + }, + { + "name": "activation_type", + "type": "u8" + }, + { + "name": "collect_fee_mode", + "type": "u8" + } + ] + } + }, + { + "name": "SwapParameters", + "type": { + "kind": "struct", + "fields": [ + { + "name": "amount_in", + "type": "u64" + }, + { + "name": "minimum_amount_out", + "type": "u64" + } + ] + } + }, + { + "name": "SwapParameters2", + "type": { + "kind": "struct", + "fields": [ + { + "name": "amount_0", + "docs": [ + "When it's exact in, partial fill, this will be amount_in. When it's exact out, this will be amount_out" + ], + "type": "u64" + }, + { + "name": "amount_1", + "docs": [ + "When it's exact in, partial fill, this will be minimum_amount_out. When it's exact out, this will be maximum_amount_in" + ], + "type": "u64" + }, + { + "name": "swap_mode", + "docs": [ + "Swap mode, refer [SwapMode]" + ], + "type": "u8" + } + ] + } + }, + { + "name": "SwapResult2", + "type": { + "kind": "struct", + "fields": [ + { + "name": "included_fee_input_amount", + "type": "u64" + }, + { + "name": "excluded_fee_input_amount", + "type": "u64" + }, + { + "name": "amount_left", + "type": "u64" + }, + { + "name": "output_amount", + "type": "u64" + }, + { + "name": "next_sqrt_price", + "type": "u128" + }, + { + "name": "trading_fee", + "type": "u64" + }, + { + "name": "protocol_fee", + "type": "u64" + }, + { + "name": "partner_fee", + "type": "u64" + }, + { + "name": "referral_fee", + "type": "u64" + } + ] + } + }, + { + "name": "TokenBadge", + "docs": [ + "Parameter that set by the protocol" + ], + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "token_mint", + "docs": [ + "token mint" + ], + "type": "pubkey" + }, + { + "name": "_padding", + "docs": [ + "Reserve" + ], + "type": { + "array": [ + "u8", + 128 + ] + } + } + ] + } + }, + { + "name": "UpdatePoolFeesParameters", + "type": { + "kind": "struct", + "fields": [ + { + "name": "cliff_fee_numerator", + "docs": [ + "Base fee update mode:", + "- None: skip base fee update", + "- Some: update new cliff_fee_numerator if base fee is static" + ], + "type": { + "option": "u64" + } + }, + { + "name": "dynamic_fee", + "docs": [ + "Dynamic fee update mode:", + "- None: skip dynamic fee update", + "- Some(with default value): disable dynamic fee", + "- Some(with non default value): enable dynamic fee if disabled or update dynamic fee if enabled" + ], + "type": { + "option": { + "defined": { + "name": "DynamicFeeParameters" + } + } + } + } + ] + } + }, + { + "name": "UserRewardInfo", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "reward_per_token_checkpoint", + "docs": [ + "The latest update reward checkpoint" + ], + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "reward_pendings", + "docs": [ + "Current pending rewards" + ], + "type": "u64" + }, + { + "name": "total_claimed_rewards", + "docs": [ + "Total claimed rewards" + ], + "type": "u64" + } + ] + } + }, + { + "name": "Vesting", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "position", + "type": "pubkey" + }, + { + "name": "cliff_point", + "type": "u64" + }, + { + "name": "period_frequency", + "type": "u64" + }, + { + "name": "cliff_unlock_liquidity", + "type": "u128" + }, + { + "name": "liquidity_per_period", + "type": "u128" + }, + { + "name": "total_released_liquidity", + "type": "u128" + }, + { + "name": "number_of_period", + "type": "u16" + }, + { + "name": "padding", + "type": { + "array": [ + "u8", + 14 + ] + } + }, + { + "name": "padding2", + "type": { + "array": [ + "u128", + 4 + ] + } + } + ] + } + }, + { + "name": "VestingParameters", + "type": { + "kind": "struct", + "fields": [ + { + "name": "cliff_point", + "type": { + "option": "u64" + } + }, + { + "name": "period_frequency", + "type": "u64" + }, + { + "name": "cliff_unlock_liquidity", + "type": "u128" + }, + { + "name": "liquidity_per_period", + "type": "u128" + }, + { + "name": "number_of_period", + "type": "u16" + } + ] + } + } + ], + "constants": [ + { + "name": "BIN_STEP_BPS_DEFAULT", + "type": "u16", + "value": "1" + }, + { + "name": "BIN_STEP_U128_DEFAULT_LE_BYTES", + "type": { + "array": [ + "u8", + 16 + ] + }, + "value": "[203, 16, 199, 186, 184, 141, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0]" + }, + { + "name": "CUSTOMIZABLE_POOL_PREFIX", + "type": "bytes", + "value": "[99, 112, 111, 111, 108]" + }, + { + "name": "FEE_DENOMINATOR", + "docs": [ + "Default fee denominator. DO NOT simply update it as it will break logic that depends on it as default value." + ], + "type": "u64", + "value": "1000000000" + }, + { + "name": "MAX_BASIS_POINT", + "docs": [ + "Max basis point. 100% in pct" + ], + "type": "u64", + "value": "10000" + }, + { + "name": "MAX_SQRT_PRICE_LE_BYTES", + "type": { + "array": [ + "u8", + 16 + ] + }, + "value": "[155, 87, 105, 78, 169, 26, 92, 132, 177, 196, 254, 255, 0, 0, 0, 0]" + }, + { + "name": "MIN_SQRT_PRICE_LE_BYTES", + "type": { + "array": [ + "u8", + 16 + ] + }, + "value": "[80, 59, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]" + }, + { + "name": "POOL_AUTHORITY_PREFIX", + "type": "bytes", + "value": "[112, 111, 111, 108, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121]" + }, + { + "name": "POOL_PREFIX", + "type": "bytes", + "value": "[112, 111, 111, 108]" + }, + { + "name": "POSITION_NFT_ACCOUNT_PREFIX", + "type": "bytes", + "value": "[112, 111, 115, 105, 116, 105, 111, 110, 95, 110, 102, 116, 95, 97, 99, 99, 111, 117, 110, 116]" + }, + { + "name": "POSITION_PREFIX", + "type": "bytes", + "value": "[112, 111, 115, 105, 116, 105, 111, 110]" + }, + { + "name": "SPLIT_POSITION_DENOMINATOR", + "type": "u32", + "value": "1000000000" + }, + { + "name": "TOKEN_VAULT_PREFIX", + "type": "bytes", + "value": "[116, 111, 107, 101, 110, 95, 118, 97, 117, 108, 116]" + } + ] +} diff --git a/idl/meteora_dlmm.json b/idl/meteora_dlmm.json new file mode 100644 index 0000000..052baa0 --- /dev/null +++ b/idl/meteora_dlmm.json @@ -0,0 +1,7369 @@ +{ + "version": "0.9.0", + "name": "lb_clmm", + "constants": [ + { + "name": "BASIS_POINT_MAX", + "type": "i32", + "value": "10000" + }, + { + "name": "MAX_BIN_PER_ARRAY", + "type": { + "defined": "usize" + }, + "value": "70" + }, + { + "name": "MAX_BIN_PER_POSITION", + "type": { + "defined": "usize" + }, + "value": "70" + }, + { + "name": "MAX_RESIZE_LENGTH", + "type": { + "defined": "usize" + }, + "value": "70" + }, + { + "name": "POSITION_MAX_LENGTH", + "type": { + "defined": "usize" + }, + "value": "1400" + }, + { + "name": "MIN_BIN_ID", + "type": "i32", + "value": "- 443636" + }, + { + "name": "MAX_BIN_ID", + "type": "i32", + "value": "443636" + }, + { + "name": "MAX_FEE_RATE", + "type": "u64", + "value": "100_000_000" + }, + { + "name": "FEE_PRECISION", + "type": "u64", + "value": "1_000_000_000" + }, + { + "name": "MAX_PROTOCOL_SHARE", + "type": "u16", + "value": "2_500" + }, + { + "name": "HOST_FEE_BPS", + "type": "u16", + "value": "2_000" + }, + { + "name": "NUM_REWARDS", + "type": { + "defined": "usize" + }, + "value": "2" + }, + { + "name": "MIN_REWARD_DURATION", + "type": "u64", + "value": "1" + }, + { + "name": "MAX_REWARD_DURATION", + "type": "u64", + "value": "31536000" + }, + { + "name": "EXTENSION_BINARRAY_BITMAP_SIZE", + "type": { + "defined": "usize" + }, + "value": "12" + }, + { + "name": "BIN_ARRAY_BITMAP_SIZE", + "type": "i32", + "value": "512" + }, + { + "name": "MAX_REWARD_BIN_SPLIT", + "type": { + "defined": "usize" + }, + "value": "15" + }, + { + "name": "ILM_PROTOCOL_SHARE", + "type": "u16", + "value": "2000" + }, + { + "name": "PROTOCOL_SHARE", + "type": "u16", + "value": "500" + }, + { + "name": "MAX_BIN_STEP", + "type": "u16", + "value": "400" + }, + { + "name": "MAX_BASE_FEE", + "type": "u128", + "value": "100_000_000" + }, + { + "name": "MIN_BASE_FEE", + "type": "u128", + "value": "100_000" + }, + { + "name": "MINIMUM_LIQUIDITY", + "type": "u128", + "value": "1_000_000" + }, + { + "name": "BIN_ARRAY", + "type": "bytes", + "value": "[98, 105, 110, 95, 97, 114, 114, 97, 121]" + }, + { + "name": "ORACLE", + "type": "bytes", + "value": "[111, 114, 97, 99, 108, 101]" + }, + { + "name": "BIN_ARRAY_BITMAP_SEED", + "type": "bytes", + "value": "[98, 105, 116, 109, 97, 112]" + }, + { + "name": "PRESET_PARAMETER", + "type": "bytes", + "value": "[112, 114, 101, 115, 101, 116, 95, 112, 97, 114, 97, 109, 101, 116, 101, 114]" + }, + { + "name": "PRESET_PARAMETER2", + "type": "bytes", + "value": "[112, 114, 101, 115, 101, 116, 95, 112, 97, 114, 97, 109, 101, 116, 101, 114, 50]" + }, + { + "name": "POSITION", + "type": "bytes", + "value": "[112, 111, 115, 105, 116, 105, 111, 110]" + }, + { + "name": "CLAIM_PROTOCOL_FEE_OPERATOR", + "type": "bytes", + "value": "[99, 102, 95, 111, 112, 101, 114, 97, 116, 111, 114]" + } + ], + "instructions": [ + { + "name": "initializeLbPair", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "tokenMintX", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintY", + "isMut": false, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "oracle", + "isMut": true, + "isSigner": false + }, + { + "name": "presetParameter", + "isMut": false, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "activeId", + "type": "i32" + }, + { + "name": "binStep", + "type": "u16" + } + ] + }, + { + "name": "initializePermissionLbPair", + "accounts": [ + { + "name": "base", + "isMut": false, + "isSigner": true + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "tokenMintX", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintY", + "isMut": false, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "oracle", + "isMut": true, + "isSigner": false + }, + { + "name": "admin", + "isMut": true, + "isSigner": true + }, + { + "name": "tokenBadgeX", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "tokenBadgeY", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "tokenProgramX", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgramY", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "ixData", + "type": { + "defined": "InitPermissionPairIx" + } + } + ] + }, + { + "name": "initializeCustomizablePermissionlessLbPair", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "tokenMintX", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintY", + "isMut": false, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "oracle", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenX", + "isMut": false, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "userTokenY", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "params", + "type": { + "defined": "CustomizableParams" + } + } + ] + }, + { + "name": "initializeBinArrayBitmapExtension", + "accounts": [ + { + "name": "lbPair", + "isMut": false, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "docs": [ + "Initialize an account to store if a bin array is initialized." + ] + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "initializeBinArray", + "accounts": [ + { + "name": "lbPair", + "isMut": false, + "isSigner": false + }, + { + "name": "binArray", + "isMut": true, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "index", + "type": "i64" + } + ] + }, + { + "name": "addLiquidity", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "userTokenX", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenY", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "binArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayUpper", + "isMut": true, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidityParameter", + "type": { + "defined": "LiquidityParameter" + } + } + ] + }, + { + "name": "addLiquidityByWeight", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "userTokenX", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenY", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "binArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayUpper", + "isMut": true, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidityParameter", + "type": { + "defined": "LiquidityParameterByWeight" + } + } + ] + }, + { + "name": "addLiquidityByStrategy", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "userTokenX", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenY", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "binArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayUpper", + "isMut": true, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidityParameter", + "type": { + "defined": "LiquidityParameterByStrategy" + } + } + ] + }, + { + "name": "addLiquidityByStrategyOneSide", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "userToken", + "isMut": true, + "isSigner": false + }, + { + "name": "reserve", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenMint", + "isMut": false, + "isSigner": false + }, + { + "name": "binArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayUpper", + "isMut": true, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidityParameter", + "type": { + "defined": "LiquidityParameterByStrategyOneSide" + } + } + ] + }, + { + "name": "addLiquidityOneSide", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "userToken", + "isMut": true, + "isSigner": false + }, + { + "name": "reserve", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenMint", + "isMut": false, + "isSigner": false + }, + { + "name": "binArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayUpper", + "isMut": true, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidityParameter", + "type": { + "defined": "LiquidityOneSideParameter" + } + } + ] + }, + { + "name": "removeLiquidity", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "userTokenX", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenY", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "binArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayUpper", + "isMut": true, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "binLiquidityRemoval", + "type": { + "vec": { + "defined": "BinLiquidityReduction" + } + } + } + ] + }, + { + "name": "initializePosition", + "accounts": [ + { + "name": "payer", + "isMut": true, + "isSigner": true + }, + { + "name": "position", + "isMut": true, + "isSigner": true + }, + { + "name": "lbPair", + "isMut": false, + "isSigner": false + }, + { + "name": "owner", + "isMut": false, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "lowerBinId", + "type": "i32" + }, + { + "name": "width", + "type": "i32" + } + ] + }, + { + "name": "initializePositionPda", + "accounts": [ + { + "name": "payer", + "isMut": true, + "isSigner": true + }, + { + "name": "base", + "isMut": false, + "isSigner": true + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": false, + "isSigner": false + }, + { + "name": "owner", + "isMut": false, + "isSigner": true, + "docs": [ + "owner" + ] + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "lowerBinId", + "type": "i32" + }, + { + "name": "width", + "type": "i32" + } + ] + }, + { + "name": "initializePositionByOperator", + "accounts": [ + { + "name": "payer", + "isMut": true, + "isSigner": true + }, + { + "name": "base", + "isMut": false, + "isSigner": true + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": false, + "isSigner": false + }, + { + "name": "owner", + "isMut": false, + "isSigner": false + }, + { + "name": "operator", + "isMut": false, + "isSigner": true, + "docs": [ + "operator" + ] + }, + { + "name": "operatorTokenX", + "isMut": false, + "isSigner": false + }, + { + "name": "ownerTokenX", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "lowerBinId", + "type": "i32" + }, + { + "name": "width", + "type": "i32" + }, + { + "name": "feeOwner", + "type": "publicKey" + }, + { + "name": "lockReleasePoint", + "type": "u64" + } + ] + }, + { + "name": "updatePositionOperator", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "owner", + "isMut": false, + "isSigner": true + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "operator", + "type": "publicKey" + } + ] + }, + { + "name": "swap", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenIn", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenOut", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "oracle", + "isMut": true, + "isSigner": false + }, + { + "name": "hostFeeIn", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "user", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "amountIn", + "type": "u64" + }, + { + "name": "minAmountOut", + "type": "u64" + } + ] + }, + { + "name": "swapExactOut", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenIn", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenOut", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "oracle", + "isMut": true, + "isSigner": false + }, + { + "name": "hostFeeIn", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "user", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "maxInAmount", + "type": "u64" + }, + { + "name": "outAmount", + "type": "u64" + } + ] + }, + { + "name": "swapWithPriceImpact", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenIn", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenOut", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "oracle", + "isMut": true, + "isSigner": false + }, + { + "name": "hostFeeIn", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "user", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "amountIn", + "type": "u64" + }, + { + "name": "activeId", + "type": { + "option": "i32" + } + }, + { + "name": "maxPriceImpactBps", + "type": "u16" + } + ] + }, + { + "name": "withdrawProtocolFee", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "receiverTokenX", + "isMut": true, + "isSigner": false + }, + { + "name": "receiverTokenY", + "isMut": true, + "isSigner": false + }, + { + "name": "claimFeeOperator", + "isMut": false, + "isSigner": false + }, + { + "name": "operator", + "isMut": false, + "isSigner": true, + "docs": [ + "operator" + ] + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "amountX", + "type": "u64" + }, + { + "name": "amountY", + "type": "u64" + }, + { + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } + } + ] + }, + { + "name": "initializeReward", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardVault", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenBadge", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "admin", + "isMut": true, + "isSigner": true + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u64" + }, + { + "name": "rewardDuration", + "type": "u64" + }, + { + "name": "funder", + "type": "publicKey" + } + ] + }, + { + "name": "fundReward", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardVault", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardMint", + "isMut": false, + "isSigner": false + }, + { + "name": "funderTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "funder", + "isMut": false, + "isSigner": true + }, + { + "name": "binArray", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u64" + }, + { + "name": "amount", + "type": "u64" + }, + { + "name": "carryForward", + "type": "bool" + }, + { + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } + } + ] + }, + { + "name": "updateRewardFunder", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "admin", + "isMut": false, + "isSigner": true + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u64" + }, + { + "name": "newFunder", + "type": "publicKey" + } + ] + }, + { + "name": "updateRewardDuration", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "admin", + "isMut": false, + "isSigner": true + }, + { + "name": "binArray", + "isMut": true, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u64" + }, + { + "name": "newDuration", + "type": "u64" + } + ] + }, + { + "name": "claimReward", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayUpper", + "isMut": true, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "rewardVault", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardMint", + "isMut": false, + "isSigner": false + }, + { + "name": "userTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u64" + } + ] + }, + { + "name": "claimFee", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayUpper", + "isMut": true, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenX", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenY", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "closePosition", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayUpper", + "isMut": true, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "rentReceiver", + "isMut": true, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "updateBaseFeeParameters", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "admin", + "isMut": false, + "isSigner": true + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "feeParameter", + "type": { + "defined": "BaseFeeParameter" + } + } + ] + }, + { + "name": "updateDynamicFeeParameters", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "admin", + "isMut": false, + "isSigner": true + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "feeParameter", + "type": { + "defined": "DynamicFeeParameter" + } + } + ] + }, + { + "name": "increaseOracleLength", + "accounts": [ + { + "name": "oracle", + "isMut": true, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "lengthToAdd", + "type": "u64" + } + ] + }, + { + "name": "initializePresetParameter", + "accounts": [ + { + "name": "presetParameter", + "isMut": true, + "isSigner": false + }, + { + "name": "admin", + "isMut": true, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "ix", + "type": { + "defined": "InitPresetParametersIx" + } + } + ] + }, + { + "name": "closePresetParameter", + "accounts": [ + { + "name": "presetParameter", + "isMut": true, + "isSigner": false + }, + { + "name": "admin", + "isMut": true, + "isSigner": true + }, + { + "name": "rentReceiver", + "isMut": true, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "closePresetParameter2", + "accounts": [ + { + "name": "presetParameter", + "isMut": true, + "isSigner": false + }, + { + "name": "admin", + "isMut": true, + "isSigner": true + }, + { + "name": "rentReceiver", + "isMut": true, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "removeAllLiquidity", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "userTokenX", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenY", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "binArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayUpper", + "isMut": true, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "setPairStatus", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "admin", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "status", + "type": "u8" + } + ] + }, + { + "name": "migratePosition", + "accounts": [ + { + "name": "positionV2", + "isMut": true, + "isSigner": true + }, + { + "name": "positionV1", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": false, + "isSigner": false + }, + { + "name": "binArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayUpper", + "isMut": true, + "isSigner": false + }, + { + "name": "owner", + "isMut": true, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rentReceiver", + "isMut": true, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "migrateBinArray", + "accounts": [ + { + "name": "lbPair", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "updateFeesAndRewards", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayUpper", + "isMut": true, + "isSigner": false + }, + { + "name": "owner", + "isMut": false, + "isSigner": true + } + ], + "args": [] + }, + { + "name": "withdrawIneligibleReward", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardVault", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardMint", + "isMut": false, + "isSigner": false + }, + { + "name": "funderTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "funder", + "isMut": false, + "isSigner": true + }, + { + "name": "binArray", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u64" + }, + { + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } + } + ] + }, + { + "name": "setActivationPoint", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "admin", + "isMut": true, + "isSigner": true + } + ], + "args": [ + { + "name": "activationPoint", + "type": "u64" + } + ] + }, + { + "name": "removeLiquidityByRange", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "userTokenX", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenY", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "binArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayUpper", + "isMut": true, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "fromBinId", + "type": "i32" + }, + { + "name": "toBinId", + "type": "i32" + }, + { + "name": "bpsToRemove", + "type": "u16" + } + ] + }, + { + "name": "addLiquidityOneSidePrecise", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "userToken", + "isMut": true, + "isSigner": false + }, + { + "name": "reserve", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenMint", + "isMut": false, + "isSigner": false + }, + { + "name": "binArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayUpper", + "isMut": true, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "parameter", + "type": { + "defined": "AddLiquiditySingleSidePreciseParameter" + } + } + ] + }, + { + "name": "goToABin", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "fromBinArray", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "toBinArray", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "binId", + "type": "i32" + } + ] + }, + { + "name": "setPreActivationDuration", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "creator", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "preActivationDuration", + "type": "u64" + } + ] + }, + { + "name": "setPreActivationSwapAddress", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "creator", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "preActivationSwapAddress", + "type": "publicKey" + } + ] + }, + { + "name": "setPairStatusPermissionless", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "creator", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "status", + "type": "u8" + } + ] + }, + { + "name": "initializeTokenBadge", + "accounts": [ + { + "name": "tokenMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenBadge", + "isMut": true, + "isSigner": false + }, + { + "name": "admin", + "isMut": true, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "createClaimProtocolFeeOperator", + "accounts": [ + { + "name": "claimFeeOperator", + "isMut": true, + "isSigner": false + }, + { + "name": "operator", + "isMut": false, + "isSigner": false + }, + { + "name": "admin", + "isMut": true, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "closeClaimProtocolFeeOperator", + "accounts": [ + { + "name": "claimFeeOperator", + "isMut": true, + "isSigner": false + }, + { + "name": "rentReceiver", + "isMut": true, + "isSigner": false + }, + { + "name": "admin", + "isMut": false, + "isSigner": true + } + ], + "args": [] + }, + { + "name": "initializePresetParameter2", + "accounts": [ + { + "name": "presetParameter", + "isMut": true, + "isSigner": false + }, + { + "name": "admin", + "isMut": true, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "ix", + "type": { + "defined": "InitPresetParameters2Ix" + } + } + ] + }, + { + "name": "initializeLbPair2", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "tokenMintX", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintY", + "isMut": false, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "oracle", + "isMut": true, + "isSigner": false + }, + { + "name": "presetParameter", + "isMut": false, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "tokenBadgeX", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "tokenBadgeY", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "tokenProgramX", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgramY", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "params", + "type": { + "defined": "InitializeLbPair2Params" + } + } + ] + }, + { + "name": "initializeCustomizablePermissionlessLbPair2", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "tokenMintX", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintY", + "isMut": false, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "oracle", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenX", + "isMut": false, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "tokenBadgeX", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "tokenBadgeY", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "tokenProgramX", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgramY", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "userTokenY", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "params", + "type": { + "defined": "CustomizableParams" + } + } + ] + }, + { + "name": "claimFee2", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenX", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenY", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgramX", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgramY", + "isMut": false, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "minBinId", + "type": "i32" + }, + { + "name": "maxBinId", + "type": "i32" + }, + { + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } + } + ] + }, + { + "name": "claimReward2", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "rewardVault", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardMint", + "isMut": false, + "isSigner": false + }, + { + "name": "userTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u64" + }, + { + "name": "minBinId", + "type": "i32" + }, + { + "name": "maxBinId", + "type": "i32" + }, + { + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } + } + ] + }, + { + "name": "addLiquidity2", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "userTokenX", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenY", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidityParameter", + "type": { + "defined": "LiquidityParameter" + } + }, + { + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } + } + ] + }, + { + "name": "addLiquidityByStrategy2", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "userTokenX", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenY", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidityParameter", + "type": { + "defined": "LiquidityParameterByStrategy" + } + }, + { + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } + } + ] + }, + { + "name": "addLiquidityOneSidePrecise2", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "userToken", + "isMut": true, + "isSigner": false + }, + { + "name": "reserve", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenMint", + "isMut": false, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidityParameter", + "type": { + "defined": "AddLiquiditySingleSidePreciseParameter2" + } + }, + { + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } + } + ] + }, + { + "name": "removeLiquidity2", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "userTokenX", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenY", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "binLiquidityRemoval", + "type": { + "vec": { + "defined": "BinLiquidityReduction" + } + } + }, + { + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } + } + ] + }, + { + "name": "removeLiquidityByRange2", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "userTokenX", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenY", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "fromBinId", + "type": "i32" + }, + { + "name": "toBinId", + "type": "i32" + }, + { + "name": "bpsToRemove", + "type": "u16" + }, + { + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } + } + ] + }, + { + "name": "swap2", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenIn", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenOut", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "oracle", + "isMut": true, + "isSigner": false + }, + { + "name": "hostFeeIn", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "user", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "amountIn", + "type": "u64" + }, + { + "name": "minAmountOut", + "type": "u64" + }, + { + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } + } + ] + }, + { + "name": "swapExactOut2", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenIn", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenOut", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "oracle", + "isMut": true, + "isSigner": false + }, + { + "name": "hostFeeIn", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "user", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "maxInAmount", + "type": "u64" + }, + { + "name": "outAmount", + "type": "u64" + }, + { + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } + } + ] + }, + { + "name": "swapWithPriceImpact2", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenIn", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenOut", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "oracle", + "isMut": true, + "isSigner": false + }, + { + "name": "hostFeeIn", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "user", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "amountIn", + "type": "u64" + }, + { + "name": "activeId", + "type": { + "option": "i32" + } + }, + { + "name": "maxPriceImpactBps", + "type": "u16" + }, + { + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } + } + ] + }, + { + "name": "closePosition2", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "rentReceiver", + "isMut": true, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "updateFeesAndReward2", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "owner", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "minBinId", + "type": "i32" + }, + { + "name": "maxBinId", + "type": "i32" + } + ] + }, + { + "name": "closePositionIfEmpty", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "rentReceiver", + "isMut": true, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [] + } + ], + "accounts": [ + { + "name": "BinArrayBitmapExtension", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lbPair", + "type": "publicKey" + }, + { + "name": "positiveBinArrayBitmap", + "docs": [ + "Packed initialized bin array state for start_bin_index is positive" + ], + "type": { + "array": [ + { + "array": [ + "u64", + 8 + ] + }, + 12 + ] + } + }, + { + "name": "negativeBinArrayBitmap", + "docs": [ + "Packed initialized bin array state for start_bin_index is negative" + ], + "type": { + "array": [ + { + "array": [ + "u64", + 8 + ] + }, + 12 + ] + } + } + ] + } + }, + { + "name": "BinArray", + "docs": [ + "An account to contain a range of bin. For example: Bin 100 <-> 200.", + "For example:", + "BinArray index: 0 contains bin 0 <-> 599", + "index: 2 contains bin 600 <-> 1199, ..." + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "index", + "type": "i64" + }, + { + "name": "version", + "docs": [ + "Version of binArray" + ], + "type": "u8" + }, + { + "name": "padding", + "type": { + "array": [ + "u8", + 7 + ] + } + }, + { + "name": "lbPair", + "type": "publicKey" + }, + { + "name": "bins", + "type": { + "array": [ + { + "defined": "Bin" + }, + 70 + ] + } + } + ] + } + }, + { + "name": "ClaimFeeOperator", + "docs": [ + "Parameter that set by the protocol" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "operator", + "docs": [ + "operator" + ], + "type": "publicKey" + }, + { + "name": "padding", + "docs": [ + "Reserve" + ], + "type": { + "array": [ + "u8", + 128 + ] + } + } + ] + } + }, + { + "name": "LbPair", + "type": { + "kind": "struct", + "fields": [ + { + "name": "parameters", + "type": { + "defined": "StaticParameters" + } + }, + { + "name": "vParameters", + "type": { + "defined": "VariableParameters" + } + }, + { + "name": "bumpSeed", + "type": { + "array": [ + "u8", + 1 + ] + } + }, + { + "name": "binStepSeed", + "docs": [ + "Bin step signer seed" + ], + "type": { + "array": [ + "u8", + 2 + ] + } + }, + { + "name": "pairType", + "docs": [ + "Type of the pair" + ], + "type": "u8" + }, + { + "name": "activeId", + "docs": [ + "Active bin id" + ], + "type": "i32" + }, + { + "name": "binStep", + "docs": [ + "Bin step. Represent the price increment / decrement." + ], + "type": "u16" + }, + { + "name": "status", + "docs": [ + "Status of the pair. Check PairStatus enum." + ], + "type": "u8" + }, + { + "name": "requireBaseFactorSeed", + "docs": [ + "Require base factor seed" + ], + "type": "u8" + }, + { + "name": "baseFactorSeed", + "docs": [ + "Base factor seed" + ], + "type": { + "array": [ + "u8", + 2 + ] + } + }, + { + "name": "activationType", + "docs": [ + "Activation type" + ], + "type": "u8" + }, + { + "name": "creatorPoolOnOffControl", + "docs": [ + "Allow pool creator to enable/disable pool with restricted validation. Only applicable for customizable permissionless pair type." + ], + "type": "u8" + }, + { + "name": "tokenXMint", + "docs": [ + "Token X mint" + ], + "type": "publicKey" + }, + { + "name": "tokenYMint", + "docs": [ + "Token Y mint" + ], + "type": "publicKey" + }, + { + "name": "reserveX", + "docs": [ + "LB token X vault" + ], + "type": "publicKey" + }, + { + "name": "reserveY", + "docs": [ + "LB token Y vault" + ], + "type": "publicKey" + }, + { + "name": "protocolFee", + "docs": [ + "Uncollected protocol fee" + ], + "type": { + "defined": "ProtocolFee" + } + }, + { + "name": "padding1", + "docs": [ + "_padding_1, previous Fee owner, BE CAREFUL FOR TOMBSTONE WHEN REUSE !!" + ], + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "rewardInfos", + "docs": [ + "Farming reward information" + ], + "type": { + "array": [ + { + "defined": "RewardInfo" + }, + 2 + ] + } + }, + { + "name": "oracle", + "docs": [ + "Oracle pubkey" + ], + "type": "publicKey" + }, + { + "name": "binArrayBitmap", + "docs": [ + "Packed initialized bin array state" + ], + "type": { + "array": [ + "u64", + 16 + ] + } + }, + { + "name": "lastUpdatedAt", + "docs": [ + "Last time the pool fee parameter was updated" + ], + "type": "i64" + }, + { + "name": "padding2", + "docs": [ + "_padding_2, previous whitelisted_wallet, BE CAREFUL FOR TOMBSTONE WHEN REUSE !!" + ], + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "preActivationSwapAddress", + "docs": [ + "Address allowed to swap when the current point is greater than or equal to the pre-activation point. The pre-activation point is calculated as `activation_point - pre_activation_duration`." + ], + "type": "publicKey" + }, + { + "name": "baseKey", + "docs": [ + "Base keypair. Only required for permission pair" + ], + "type": "publicKey" + }, + { + "name": "activationPoint", + "docs": [ + "Time point to enable the pair. Only applicable for permission pair." + ], + "type": "u64" + }, + { + "name": "preActivationDuration", + "docs": [ + "Duration before activation activation_point. Used to calculate pre-activation time point for pre_activation_swap_address" + ], + "type": "u64" + }, + { + "name": "padding3", + "docs": [ + "_padding 3 is reclaimed free space from swap_cap_deactivate_point and swap_cap_amount before, BE CAREFUL FOR TOMBSTONE WHEN REUSE !!" + ], + "type": { + "array": [ + "u8", + 8 + ] + } + }, + { + "name": "padding4", + "docs": [ + "_padding_4, previous lock_duration, BE CAREFUL FOR TOMBSTONE WHEN REUSE !!" + ], + "type": "u64" + }, + { + "name": "creator", + "docs": [ + "Pool creator" + ], + "type": "publicKey" + }, + { + "name": "tokenMintXProgramFlag", + "docs": [ + "token_mint_x_program_flag" + ], + "type": "u8" + }, + { + "name": "tokenMintYProgramFlag", + "docs": [ + "token_mint_y_program_flag" + ], + "type": "u8" + }, + { + "name": "reserved", + "docs": [ + "Reserved space for future use" + ], + "type": { + "array": [ + "u8", + 22 + ] + } + } + ] + } + }, + { + "name": "Oracle", + "type": { + "kind": "struct", + "fields": [ + { + "name": "idx", + "docs": [ + "Index of latest observation" + ], + "type": "u64" + }, + { + "name": "activeSize", + "docs": [ + "Size of active sample. Active sample is initialized observation." + ], + "type": "u64" + }, + { + "name": "length", + "docs": [ + "Number of observations" + ], + "type": "u64" + } + ] + } + }, + { + "name": "Position", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lbPair", + "docs": [ + "The LB pair of this position" + ], + "type": "publicKey" + }, + { + "name": "owner", + "docs": [ + "Owner of the position. Client rely on this to to fetch their positions." + ], + "type": "publicKey" + }, + { + "name": "liquidityShares", + "docs": [ + "Liquidity shares of this position in bins (lower_bin_id <-> upper_bin_id). This is the same as LP concept." + ], + "type": { + "array": [ + "u64", + 70 + ] + } + }, + { + "name": "rewardInfos", + "docs": [ + "Farming reward information" + ], + "type": { + "array": [ + { + "defined": "UserRewardInfo" + }, + 70 + ] + } + }, + { + "name": "feeInfos", + "docs": [ + "Swap fee to claim information" + ], + "type": { + "array": [ + { + "defined": "FeeInfo" + }, + 70 + ] + } + }, + { + "name": "lowerBinId", + "docs": [ + "Lower bin ID" + ], + "type": "i32" + }, + { + "name": "upperBinId", + "docs": [ + "Upper bin ID" + ], + "type": "i32" + }, + { + "name": "lastUpdatedAt", + "docs": [ + "Last updated timestamp" + ], + "type": "i64" + }, + { + "name": "totalClaimedFeeXAmount", + "docs": [ + "Total claimed token fee X" + ], + "type": "u64" + }, + { + "name": "totalClaimedFeeYAmount", + "docs": [ + "Total claimed token fee Y" + ], + "type": "u64" + }, + { + "name": "totalClaimedRewards", + "docs": [ + "Total claimed rewards" + ], + "type": { + "array": [ + "u64", + 2 + ] + } + }, + { + "name": "reserved", + "docs": [ + "Reserved space for future use" + ], + "type": { + "array": [ + "u8", + 160 + ] + } + } + ] + } + }, + { + "name": "PositionV2", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lbPair", + "docs": [ + "The LB pair of this position" + ], + "type": "publicKey" + }, + { + "name": "owner", + "docs": [ + "Owner of the position. Client rely on this to to fetch their positions." + ], + "type": "publicKey" + }, + { + "name": "liquidityShares", + "docs": [ + "Liquidity shares of this position in bins (lower_bin_id <-> upper_bin_id). This is the same as LP concept." + ], + "type": { + "array": [ + "u128", + 70 + ] + } + }, + { + "name": "rewardInfos", + "docs": [ + "Farming reward information" + ], + "type": { + "array": [ + { + "defined": "UserRewardInfo" + }, + 70 + ] + } + }, + { + "name": "feeInfos", + "docs": [ + "Swap fee to claim information" + ], + "type": { + "array": [ + { + "defined": "FeeInfo" + }, + 70 + ] + } + }, + { + "name": "lowerBinId", + "docs": [ + "Lower bin ID" + ], + "type": "i32" + }, + { + "name": "upperBinId", + "docs": [ + "Upper bin ID" + ], + "type": "i32" + }, + { + "name": "lastUpdatedAt", + "docs": [ + "Last updated timestamp" + ], + "type": "i64" + }, + { + "name": "totalClaimedFeeXAmount", + "docs": [ + "Total claimed token fee X" + ], + "type": "u64" + }, + { + "name": "totalClaimedFeeYAmount", + "docs": [ + "Total claimed token fee Y" + ], + "type": "u64" + }, + { + "name": "totalClaimedRewards", + "docs": [ + "Total claimed rewards" + ], + "type": { + "array": [ + "u64", + 2 + ] + } + }, + { + "name": "operator", + "docs": [ + "Operator of position" + ], + "type": "publicKey" + }, + { + "name": "lockReleasePoint", + "docs": [ + "Time point which the locked liquidity can be withdraw" + ], + "type": "u64" + }, + { + "name": "padding0", + "docs": [ + "_padding_0, previous subjected_to_bootstrap_liquidity_locking, BE CAREFUL FOR TOMBSTONE WHEN REUSE !!" + ], + "type": "u8" + }, + { + "name": "feeOwner", + "docs": [ + "Address is able to claim fee in this position, only valid for bootstrap_liquidity_position" + ], + "type": "publicKey" + }, + { + "name": "reserved", + "docs": [ + "Reserved space for future use" + ], + "type": { + "array": [ + "u8", + 87 + ] + } + } + ] + } + }, + { + "name": "PresetParameter2", + "type": { + "kind": "struct", + "fields": [ + { + "name": "binStep", + "docs": [ + "Bin step. Represent the price increment / decrement." + ], + "type": "u16" + }, + { + "name": "baseFactor", + "docs": [ + "Used for base fee calculation. base_fee_rate = base_factor * bin_step * 10 * 10^base_fee_power_factor" + ], + "type": "u16" + }, + { + "name": "filterPeriod", + "docs": [ + "Filter period determine high frequency trading time window." + ], + "type": "u16" + }, + { + "name": "decayPeriod", + "docs": [ + "Decay period determine when the volatile fee start decay / decrease." + ], + "type": "u16" + }, + { + "name": "variableFeeControl", + "docs": [ + "Used to scale the variable fee component depending on the dynamic of the market" + ], + "type": "u32" + }, + { + "name": "maxVolatilityAccumulator", + "docs": [ + "Maximum number of bin crossed can be accumulated. Used to cap volatile fee rate." + ], + "type": "u32" + }, + { + "name": "reductionFactor", + "docs": [ + "Reduction factor controls the volatile fee rate decrement rate." + ], + "type": "u16" + }, + { + "name": "protocolShare", + "docs": [ + "Portion of swap fees retained by the protocol by controlling protocol_share parameter. protocol_swap_fee = protocol_share * total_swap_fee" + ], + "type": "u16" + }, + { + "name": "index", + "docs": [ + "index" + ], + "type": "u16" + }, + { + "name": "baseFeePowerFactor", + "docs": [ + "Base fee power factor" + ], + "type": "u8" + }, + { + "name": "padding0", + "docs": [ + "Padding 0 for future use" + ], + "type": "u8" + }, + { + "name": "padding1", + "docs": [ + "Padding 1 for future use" + ], + "type": { + "array": [ + "u64", + 20 + ] + } + } + ] + } + }, + { + "name": "PresetParameter", + "type": { + "kind": "struct", + "fields": [ + { + "name": "binStep", + "docs": [ + "Bin step. Represent the price increment / decrement." + ], + "type": "u16" + }, + { + "name": "baseFactor", + "docs": [ + "Used for base fee calculation. base_fee_rate = base_factor * bin_step * 10 * 10^base_fee_power_factor" + ], + "type": "u16" + }, + { + "name": "filterPeriod", + "docs": [ + "Filter period determine high frequency trading time window." + ], + "type": "u16" + }, + { + "name": "decayPeriod", + "docs": [ + "Decay period determine when the volatile fee start decay / decrease." + ], + "type": "u16" + }, + { + "name": "reductionFactor", + "docs": [ + "Reduction factor controls the volatile fee rate decrement rate." + ], + "type": "u16" + }, + { + "name": "variableFeeControl", + "docs": [ + "Used to scale the variable fee component depending on the dynamic of the market" + ], + "type": "u32" + }, + { + "name": "maxVolatilityAccumulator", + "docs": [ + "Maximum number of bin crossed can be accumulated. Used to cap volatile fee rate." + ], + "type": "u32" + }, + { + "name": "minBinId", + "docs": [ + "Min bin id supported by the pool based on the configured bin step." + ], + "type": "i32" + }, + { + "name": "maxBinId", + "docs": [ + "Max bin id supported by the pool based on the configured bin step." + ], + "type": "i32" + }, + { + "name": "protocolShare", + "docs": [ + "Portion of swap fees retained by the protocol by controlling protocol_share parameter. protocol_swap_fee = protocol_share * total_swap_fee" + ], + "type": "u16" + } + ] + } + }, + { + "name": "TokenBadge", + "docs": [ + "Parameter that set by the protocol" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "tokenMint", + "docs": [ + "token mint" + ], + "type": "publicKey" + }, + { + "name": "padding", + "docs": [ + "Reserve" + ], + "type": { + "array": [ + "u8", + 128 + ] + } + } + ] + } + } + ], + "types": [ + { + "name": "InitPresetParameters2Ix", + "type": { + "kind": "struct", + "fields": [ + { + "name": "index", + "type": "u16" + }, + { + "name": "binStep", + "docs": [ + "Bin step. Represent the price increment / decrement." + ], + "type": "u16" + }, + { + "name": "baseFactor", + "docs": [ + "Used for base fee calculation. base_fee_rate = base_factor * bin_step * 10 * 10^base_fee_power_factor" + ], + "type": "u16" + }, + { + "name": "filterPeriod", + "docs": [ + "Filter period determine high frequency trading time window." + ], + "type": "u16" + }, + { + "name": "decayPeriod", + "docs": [ + "Decay period determine when the volatile fee start decay / decrease." + ], + "type": "u16" + }, + { + "name": "reductionFactor", + "docs": [ + "Reduction factor controls the volatile fee rate decrement rate." + ], + "type": "u16" + }, + { + "name": "variableFeeControl", + "docs": [ + "Used to scale the variable fee component depending on the dynamic of the market" + ], + "type": "u32" + }, + { + "name": "maxVolatilityAccumulator", + "docs": [ + "Maximum number of bin crossed can be accumulated. Used to cap volatile fee rate." + ], + "type": "u32" + }, + { + "name": "protocolShare", + "docs": [ + "Portion of swap fees retained by the protocol by controlling protocol_share parameter. protocol_swap_fee = protocol_share * total_swap_fee" + ], + "type": "u16" + }, + { + "name": "baseFeePowerFactor", + "docs": [ + "Base fee power factor" + ], + "type": "u8" + } + ] + } + }, + { + "name": "InitPresetParametersIx", + "type": { + "kind": "struct", + "fields": [ + { + "name": "binStep", + "docs": [ + "Bin step. Represent the price increment / decrement." + ], + "type": "u16" + }, + { + "name": "baseFactor", + "docs": [ + "Used for base fee calculation. base_fee_rate = base_factor * bin_step * 10 * 10^base_fee_power_factor" + ], + "type": "u16" + }, + { + "name": "filterPeriod", + "docs": [ + "Filter period determine high frequency trading time window." + ], + "type": "u16" + }, + { + "name": "decayPeriod", + "docs": [ + "Decay period determine when the volatile fee start decay / decrease." + ], + "type": "u16" + }, + { + "name": "reductionFactor", + "docs": [ + "Reduction factor controls the volatile fee rate decrement rate." + ], + "type": "u16" + }, + { + "name": "variableFeeControl", + "docs": [ + "Used to scale the variable fee component depending on the dynamic of the market" + ], + "type": "u32" + }, + { + "name": "maxVolatilityAccumulator", + "docs": [ + "Maximum number of bin crossed can be accumulated. Used to cap volatile fee rate." + ], + "type": "u32" + }, + { + "name": "protocolShare", + "docs": [ + "Portion of swap fees retained by the protocol by controlling protocol_share parameter. protocol_swap_fee = protocol_share * total_swap_fee" + ], + "type": "u16" + } + ] + } + }, + { + "name": "BaseFeeParameter", + "type": { + "kind": "struct", + "fields": [ + { + "name": "protocolShare", + "docs": [ + "Portion of swap fees retained by the protocol by controlling protocol_share parameter. protocol_swap_fee = protocol_share * total_swap_fee" + ], + "type": "u16" + }, + { + "name": "baseFactor", + "docs": [ + "Base factor for base fee rate" + ], + "type": "u16" + }, + { + "name": "baseFeePowerFactor", + "docs": [ + "Base fee power factor" + ], + "type": "u8" + } + ] + } + }, + { + "name": "DynamicFeeParameter", + "type": { + "kind": "struct", + "fields": [ + { + "name": "filterPeriod", + "docs": [ + "Filter period determine high frequency trading time window." + ], + "type": "u16" + }, + { + "name": "decayPeriod", + "docs": [ + "Decay period determine when the volatile fee start decay / decrease." + ], + "type": "u16" + }, + { + "name": "reductionFactor", + "docs": [ + "Reduction factor controls the volatile fee rate decrement rate." + ], + "type": "u16" + }, + { + "name": "variableFeeControl", + "docs": [ + "Used to scale the variable fee component depending on the dynamic of the market" + ], + "type": "u32" + }, + { + "name": "maxVolatilityAccumulator", + "docs": [ + "Maximum number of bin crossed can be accumulated. Used to cap volatile fee rate." + ], + "type": "u32" + } + ] + } + }, + { + "name": "LiquidityParameterByStrategyOneSide", + "type": { + "kind": "struct", + "fields": [ + { + "name": "amount", + "docs": [ + "Amount of X token or Y token to deposit" + ], + "type": "u64" + }, + { + "name": "activeId", + "docs": [ + "Active bin that integrator observe off-chain" + ], + "type": "i32" + }, + { + "name": "maxActiveBinSlippage", + "docs": [ + "max active bin slippage allowed" + ], + "type": "i32" + }, + { + "name": "strategyParameters", + "docs": [ + "strategy parameters" + ], + "type": { + "defined": "StrategyParameters" + } + } + ] + } + }, + { + "name": "LiquidityParameterByStrategy", + "type": { + "kind": "struct", + "fields": [ + { + "name": "amountX", + "docs": [ + "Amount of X token to deposit" + ], + "type": "u64" + }, + { + "name": "amountY", + "docs": [ + "Amount of Y token to deposit" + ], + "type": "u64" + }, + { + "name": "activeId", + "docs": [ + "Active bin that integrator observe off-chain" + ], + "type": "i32" + }, + { + "name": "maxActiveBinSlippage", + "docs": [ + "max active bin slippage allowed" + ], + "type": "i32" + }, + { + "name": "strategyParameters", + "docs": [ + "strategy parameters" + ], + "type": { + "defined": "StrategyParameters" + } + } + ] + } + }, + { + "name": "StrategyParameters", + "type": { + "kind": "struct", + "fields": [ + { + "name": "minBinId", + "docs": [ + "min bin id" + ], + "type": "i32" + }, + { + "name": "maxBinId", + "docs": [ + "max bin id" + ], + "type": "i32" + }, + { + "name": "strategyType", + "docs": [ + "strategy type" + ], + "type": { + "defined": "StrategyType" + } + }, + { + "name": "parameteres", + "docs": [ + "parameters" + ], + "type": { + "array": [ + "u8", + 64 + ] + } + } + ] + } + }, + { + "name": "LiquidityOneSideParameter", + "type": { + "kind": "struct", + "fields": [ + { + "name": "amount", + "docs": [ + "Amount of X token or Y token to deposit" + ], + "type": "u64" + }, + { + "name": "activeId", + "docs": [ + "Active bin that integrator observe off-chain" + ], + "type": "i32" + }, + { + "name": "maxActiveBinSlippage", + "docs": [ + "max active bin slippage allowed" + ], + "type": "i32" + }, + { + "name": "binLiquidityDist", + "docs": [ + "Liquidity distribution to each bins" + ], + "type": { + "vec": { + "defined": "BinLiquidityDistributionByWeight" + } + } + } + ] + } + }, + { + "name": "BinLiquidityDistributionByWeight", + "type": { + "kind": "struct", + "fields": [ + { + "name": "binId", + "docs": [ + "Define the bin ID wish to deposit to." + ], + "type": "i32" + }, + { + "name": "weight", + "docs": [ + "weight of liquidity distributed for this bin id" + ], + "type": "u16" + } + ] + } + }, + { + "name": "LiquidityParameterByWeight", + "type": { + "kind": "struct", + "fields": [ + { + "name": "amountX", + "docs": [ + "Amount of X token to deposit" + ], + "type": "u64" + }, + { + "name": "amountY", + "docs": [ + "Amount of Y token to deposit" + ], + "type": "u64" + }, + { + "name": "activeId", + "docs": [ + "Active bin that integrator observe off-chain" + ], + "type": "i32" + }, + { + "name": "maxActiveBinSlippage", + "docs": [ + "max active bin slippage allowed" + ], + "type": "i32" + }, + { + "name": "binLiquidityDist", + "docs": [ + "Liquidity distribution to each bins" + ], + "type": { + "vec": { + "defined": "BinLiquidityDistributionByWeight" + } + } + } + ] + } + }, + { + "name": "AddLiquiditySingleSidePreciseParameter", + "type": { + "kind": "struct", + "fields": [ + { + "name": "bins", + "type": { + "vec": { + "defined": "CompressedBinDepositAmount" + } + } + }, + { + "name": "decompressMultiplier", + "type": "u64" + } + ] + } + }, + { + "name": "CompressedBinDepositAmount", + "type": { + "kind": "struct", + "fields": [ + { + "name": "binId", + "type": "i32" + }, + { + "name": "amount", + "type": "u32" + } + ] + } + }, + { + "name": "BinLiquidityDistribution", + "type": { + "kind": "struct", + "fields": [ + { + "name": "binId", + "docs": [ + "Define the bin ID wish to deposit to." + ], + "type": "i32" + }, + { + "name": "distributionX", + "docs": [ + "DistributionX (or distributionY) is the percentages of amountX (or amountY) you want to add to each bin." + ], + "type": "u16" + }, + { + "name": "distributionY", + "docs": [ + "DistributionX (or distributionY) is the percentages of amountX (or amountY) you want to add to each bin." + ], + "type": "u16" + } + ] + } + }, + { + "name": "LiquidityParameter", + "type": { + "kind": "struct", + "fields": [ + { + "name": "amountX", + "docs": [ + "Amount of X token to deposit" + ], + "type": "u64" + }, + { + "name": "amountY", + "docs": [ + "Amount of Y token to deposit" + ], + "type": "u64" + }, + { + "name": "binLiquidityDist", + "docs": [ + "Liquidity distribution to each bins" + ], + "type": { + "vec": { + "defined": "BinLiquidityDistribution" + } + } + } + ] + } + }, + { + "name": "CustomizableParams", + "type": { + "kind": "struct", + "fields": [ + { + "name": "activeId", + "docs": [ + "Pool price" + ], + "type": "i32" + }, + { + "name": "binStep", + "docs": [ + "Bin step" + ], + "type": "u16" + }, + { + "name": "baseFactor", + "docs": [ + "Base factor" + ], + "type": "u16" + }, + { + "name": "activationType", + "docs": [ + "Activation type. 0 = Slot, 1 = Time. Check ActivationType enum" + ], + "type": "u8" + }, + { + "name": "hasAlphaVault", + "docs": [ + "Whether the pool has an alpha vault" + ], + "type": "bool" + }, + { + "name": "activationPoint", + "docs": [ + "Decide when does the pool start trade. None = Now" + ], + "type": { + "option": "u64" + } + }, + { + "name": "creatorPoolOnOffControl", + "docs": [ + "Pool creator have permission to enable/disable pool with restricted program validation. Only applicable for customizable permissionless pool." + ], + "type": "bool" + }, + { + "name": "baseFeePowerFactor", + "docs": [ + "Base fee power factor" + ], + "type": "u8" + }, + { + "name": "padding", + "docs": [ + "Padding, for future use" + ], + "type": { + "array": [ + "u8", + 62 + ] + } + } + ] + } + }, + { + "name": "InitPermissionPairIx", + "type": { + "kind": "struct", + "fields": [ + { + "name": "activeId", + "type": "i32" + }, + { + "name": "binStep", + "type": "u16" + }, + { + "name": "baseFactor", + "type": "u16" + }, + { + "name": "baseFeePowerFactor", + "type": "u8" + }, + { + "name": "activationType", + "type": "u8" + }, + { + "name": "protocolShare", + "type": "u16" + } + ] + } + }, + { + "name": "AddLiquiditySingleSidePreciseParameter2", + "type": { + "kind": "struct", + "fields": [ + { + "name": "bins", + "type": { + "vec": { + "defined": "CompressedBinDepositAmount" + } + } + }, + { + "name": "decompressMultiplier", + "type": "u64" + }, + { + "name": "maxAmount", + "type": "u64" + } + ] + } + }, + { + "name": "CompressedBinDepositAmount2", + "type": { + "kind": "struct", + "fields": [ + { + "name": "binId", + "type": "i32" + }, + { + "name": "amount", + "type": "u32" + } + ] + } + }, + { + "name": "InitializeLbPair2Params", + "type": { + "kind": "struct", + "fields": [ + { + "name": "activeId", + "docs": [ + "Pool price" + ], + "type": "i32" + }, + { + "name": "padding", + "docs": [ + "Padding, for future use" + ], + "type": { + "array": [ + "u8", + 96 + ] + } + } + ] + } + }, + { + "name": "BinLiquidityReduction", + "type": { + "kind": "struct", + "fields": [ + { + "name": "binId", + "type": "i32" + }, + { + "name": "bpsToRemove", + "type": "u16" + } + ] + } + }, + { + "name": "Bin", + "type": { + "kind": "struct", + "fields": [ + { + "name": "amountX", + "docs": [ + "Amount of token X in the bin. This already excluded protocol fees." + ], + "type": "u64" + }, + { + "name": "amountY", + "docs": [ + "Amount of token Y in the bin. This already excluded protocol fees." + ], + "type": "u64" + }, + { + "name": "price", + "docs": [ + "Bin price" + ], + "type": "u128" + }, + { + "name": "liquiditySupply", + "docs": [ + "Liquidities of the bin. This is the same as LP mint supply. q-number" + ], + "type": "u128" + }, + { + "name": "rewardPerTokenStored", + "docs": [ + "reward_a_per_token_stored" + ], + "type": { + "array": [ + "u128", + 2 + ] + } + }, + { + "name": "feeAmountXPerTokenStored", + "docs": [ + "Swap fee amount of token X per liquidity deposited." + ], + "type": "u128" + }, + { + "name": "feeAmountYPerTokenStored", + "docs": [ + "Swap fee amount of token Y per liquidity deposited." + ], + "type": "u128" + }, + { + "name": "amountXIn", + "docs": [ + "Total token X swap into the bin. Only used for tracking purpose." + ], + "type": "u128" + }, + { + "name": "amountYIn", + "docs": [ + "Total token Y swap into he bin. Only used for tracking purpose." + ], + "type": "u128" + } + ] + } + }, + { + "name": "ProtocolFee", + "type": { + "kind": "struct", + "fields": [ + { + "name": "amountX", + "type": "u64" + }, + { + "name": "amountY", + "type": "u64" + } + ] + } + }, + { + "name": "RewardInfo", + "docs": [ + "Stores the state relevant for tracking liquidity mining rewards" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "mint", + "docs": [ + "Reward token mint." + ], + "type": "publicKey" + }, + { + "name": "vault", + "docs": [ + "Reward vault token account." + ], + "type": "publicKey" + }, + { + "name": "funder", + "docs": [ + "Authority account that allows to fund rewards" + ], + "type": "publicKey" + }, + { + "name": "rewardDuration", + "docs": [ + "TODO check whether we need to store it in pool" + ], + "type": "u64" + }, + { + "name": "rewardDurationEnd", + "docs": [ + "TODO check whether we need to store it in pool" + ], + "type": "u64" + }, + { + "name": "rewardRate", + "docs": [ + "TODO check whether we need to store it in pool" + ], + "type": "u128" + }, + { + "name": "lastUpdateTime", + "docs": [ + "The last time reward states were updated." + ], + "type": "u64" + }, + { + "name": "cumulativeSecondsWithEmptyLiquidityReward", + "docs": [ + "Accumulated seconds where when farm distribute rewards, but the bin is empty. The reward will be accumulated for next reward time window." + ], + "type": "u64" + } + ] + } + }, + { + "name": "Observation", + "type": { + "kind": "struct", + "fields": [ + { + "name": "cumulativeActiveBinId", + "docs": [ + "Cumulative active bin ID" + ], + "type": "i128" + }, + { + "name": "createdAt", + "docs": [ + "Observation sample created timestamp" + ], + "type": "i64" + }, + { + "name": "lastUpdatedAt", + "docs": [ + "Observation sample last updated timestamp" + ], + "type": "i64" + } + ] + } + }, + { + "name": "StaticParameters", + "docs": [ + "Parameter that set by the protocol" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "baseFactor", + "docs": [ + "Used for base fee calculation. base_fee_rate = base_factor * bin_step * 10 * 10^base_fee_power_factor" + ], + "type": "u16" + }, + { + "name": "filterPeriod", + "docs": [ + "Filter period determine high frequency trading time window." + ], + "type": "u16" + }, + { + "name": "decayPeriod", + "docs": [ + "Decay period determine when the volatile fee start decay / decrease." + ], + "type": "u16" + }, + { + "name": "reductionFactor", + "docs": [ + "Reduction factor controls the volatile fee rate decrement rate." + ], + "type": "u16" + }, + { + "name": "variableFeeControl", + "docs": [ + "Used to scale the variable fee component depending on the dynamic of the market" + ], + "type": "u32" + }, + { + "name": "maxVolatilityAccumulator", + "docs": [ + "Maximum number of bin crossed can be accumulated. Used to cap volatile fee rate." + ], + "type": "u32" + }, + { + "name": "minBinId", + "docs": [ + "Min bin id supported by the pool based on the configured bin step." + ], + "type": "i32" + }, + { + "name": "maxBinId", + "docs": [ + "Max bin id supported by the pool based on the configured bin step." + ], + "type": "i32" + }, + { + "name": "protocolShare", + "docs": [ + "Portion of swap fees retained by the protocol by controlling protocol_share parameter. protocol_swap_fee = protocol_share * total_swap_fee" + ], + "type": "u16" + }, + { + "name": "baseFeePowerFactor", + "docs": [ + "Base fee power factor" + ], + "type": "u8" + }, + { + "name": "padding", + "docs": [ + "Padding for bytemuck safe alignment" + ], + "type": { + "array": [ + "u8", + 5 + ] + } + } + ] + } + }, + { + "name": "VariableParameters", + "docs": [ + "Parameters that changes based on dynamic of the market" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "volatilityAccumulator", + "docs": [ + "Volatility accumulator measure the number of bin crossed since reference bin ID. Normally (without filter period taken into consideration), reference bin ID is the active bin of last swap.", + "It affects the variable fee rate" + ], + "type": "u32" + }, + { + "name": "volatilityReference", + "docs": [ + "Volatility reference is decayed volatility accumulator. It is always <= volatility_accumulator" + ], + "type": "u32" + }, + { + "name": "indexReference", + "docs": [ + "Active bin id of last swap." + ], + "type": "i32" + }, + { + "name": "padding", + "docs": [ + "Padding for bytemuck safe alignment" + ], + "type": { + "array": [ + "u8", + 4 + ] + } + }, + { + "name": "lastUpdateTimestamp", + "docs": [ + "Last timestamp the variable parameters was updated" + ], + "type": "i64" + }, + { + "name": "padding1", + "docs": [ + "Padding for bytemuck safe alignment" + ], + "type": { + "array": [ + "u8", + 8 + ] + } + } + ] + } + }, + { + "name": "FeeInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "feeXPerTokenComplete", + "type": "u128" + }, + { + "name": "feeYPerTokenComplete", + "type": "u128" + }, + { + "name": "feeXPending", + "type": "u64" + }, + { + "name": "feeYPending", + "type": "u64" + } + ] + } + }, + { + "name": "UserRewardInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "rewardPerTokenCompletes", + "type": { + "array": [ + "u128", + 2 + ] + } + }, + { + "name": "rewardPendings", + "type": { + "array": [ + "u64", + 2 + ] + } + } + ] + } + }, + { + "name": "RemainingAccountsSlice", + "type": { + "kind": "struct", + "fields": [ + { + "name": "accountsType", + "type": { + "defined": "AccountsType" + } + }, + { + "name": "length", + "type": "u8" + } + ] + } + }, + { + "name": "RemainingAccountsInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "slices", + "type": { + "vec": { + "defined": "RemainingAccountsSlice" + } + } + } + ] + } + }, + { + "name": "StrategyType", + "type": { + "kind": "enum", + "variants": [ + { + "name": "SpotOneSide" + }, + { + "name": "CurveOneSide" + }, + { + "name": "BidAskOneSide" + }, + { + "name": "SpotBalanced" + }, + { + "name": "CurveBalanced" + }, + { + "name": "BidAskBalanced" + }, + { + "name": "SpotImBalanced" + }, + { + "name": "CurveImBalanced" + }, + { + "name": "BidAskImBalanced" + } + ] + } + }, + { + "name": "Rounding", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Up" + }, + { + "name": "Down" + } + ] + } + }, + { + "name": "ActivationType", + "docs": [ + "Type of the activation" + ], + "type": { + "kind": "enum", + "variants": [ + { + "name": "Slot" + }, + { + "name": "Timestamp" + } + ] + } + }, + { + "name": "LayoutVersion", + "docs": [ + "Layout version" + ], + "type": { + "kind": "enum", + "variants": [ + { + "name": "V0" + }, + { + "name": "V1" + } + ] + } + }, + { + "name": "PairType", + "docs": [ + "Type of the Pair. 0 = Permissionless, 1 = Permission, 2 = CustomizablePermissionless. Putting 0 as permissionless for backward compatibility." + ], + "type": { + "kind": "enum", + "variants": [ + { + "name": "Permissionless" + }, + { + "name": "Permission" + }, + { + "name": "CustomizablePermissionless" + }, + { + "name": "PermissionlessV2" + } + ] + } + }, + { + "name": "PairStatus", + "docs": [ + "Pair status. 0 = Enabled, 1 = Disabled. Putting 0 as enabled for backward compatibility." + ], + "type": { + "kind": "enum", + "variants": [ + { + "name": "Enabled" + }, + { + "name": "Disabled" + } + ] + } + }, + { + "name": "TokenProgramFlags", + "type": { + "kind": "enum", + "variants": [ + { + "name": "TokenProgram" + }, + { + "name": "TokenProgram2022" + } + ] + } + }, + { + "name": "AccountsType", + "type": { + "kind": "enum", + "variants": [ + { + "name": "TransferHookX" + }, + { + "name": "TransferHookY" + }, + { + "name": "TransferHookReward" + } + ] + } + } + ], + "events": [ + { + "name": "CompositionFee", + "fields": [ + { + "name": "from", + "type": "publicKey", + "index": false + }, + { + "name": "binId", + "type": "i16", + "index": false + }, + { + "name": "tokenXFeeAmount", + "type": "u64", + "index": false + }, + { + "name": "tokenYFeeAmount", + "type": "u64", + "index": false + }, + { + "name": "protocolTokenXFeeAmount", + "type": "u64", + "index": false + }, + { + "name": "protocolTokenYFeeAmount", + "type": "u64", + "index": false + } + ] + }, + { + "name": "AddLiquidity", + "fields": [ + { + "name": "lbPair", + "type": "publicKey", + "index": false + }, + { + "name": "from", + "type": "publicKey", + "index": false + }, + { + "name": "position", + "type": "publicKey", + "index": false + }, + { + "name": "amounts", + "type": { + "array": [ + "u64", + 2 + ] + }, + "index": false + }, + { + "name": "activeBinId", + "type": "i32", + "index": false + } + ] + }, + { + "name": "RemoveLiquidity", + "fields": [ + { + "name": "lbPair", + "type": "publicKey", + "index": false + }, + { + "name": "from", + "type": "publicKey", + "index": false + }, + { + "name": "position", + "type": "publicKey", + "index": false + }, + { + "name": "amounts", + "type": { + "array": [ + "u64", + 2 + ] + }, + "index": false + }, + { + "name": "activeBinId", + "type": "i32", + "index": false + } + ] + }, + { + "name": "Swap", + "fields": [ + { + "name": "lbPair", + "type": "publicKey", + "index": false + }, + { + "name": "from", + "type": "publicKey", + "index": false + }, + { + "name": "startBinId", + "type": "i32", + "index": false + }, + { + "name": "endBinId", + "type": "i32", + "index": false + }, + { + "name": "amountIn", + "type": "u64", + "index": false + }, + { + "name": "amountOut", + "type": "u64", + "index": false + }, + { + "name": "swapForY", + "type": "bool", + "index": false + }, + { + "name": "fee", + "type": "u64", + "index": false + }, + { + "name": "protocolFee", + "type": "u64", + "index": false + }, + { + "name": "feeBps", + "type": "u128", + "index": false + }, + { + "name": "hostFee", + "type": "u64", + "index": false + } + ] + }, + { + "name": "ClaimReward", + "fields": [ + { + "name": "lbPair", + "type": "publicKey", + "index": false + }, + { + "name": "position", + "type": "publicKey", + "index": false + }, + { + "name": "owner", + "type": "publicKey", + "index": false + }, + { + "name": "rewardIndex", + "type": "u64", + "index": false + }, + { + "name": "totalReward", + "type": "u64", + "index": false + } + ] + }, + { + "name": "FundReward", + "fields": [ + { + "name": "lbPair", + "type": "publicKey", + "index": false + }, + { + "name": "funder", + "type": "publicKey", + "index": false + }, + { + "name": "rewardIndex", + "type": "u64", + "index": false + }, + { + "name": "amount", + "type": "u64", + "index": false + } + ] + }, + { + "name": "InitializeReward", + "fields": [ + { + "name": "lbPair", + "type": "publicKey", + "index": false + }, + { + "name": "rewardMint", + "type": "publicKey", + "index": false + }, + { + "name": "funder", + "type": "publicKey", + "index": false + }, + { + "name": "rewardIndex", + "type": "u64", + "index": false + }, + { + "name": "rewardDuration", + "type": "u64", + "index": false + } + ] + }, + { + "name": "UpdateRewardDuration", + "fields": [ + { + "name": "lbPair", + "type": "publicKey", + "index": false + }, + { + "name": "rewardIndex", + "type": "u64", + "index": false + }, + { + "name": "oldRewardDuration", + "type": "u64", + "index": false + }, + { + "name": "newRewardDuration", + "type": "u64", + "index": false + } + ] + }, + { + "name": "UpdateRewardFunder", + "fields": [ + { + "name": "lbPair", + "type": "publicKey", + "index": false + }, + { + "name": "rewardIndex", + "type": "u64", + "index": false + }, + { + "name": "oldFunder", + "type": "publicKey", + "index": false + }, + { + "name": "newFunder", + "type": "publicKey", + "index": false + } + ] + }, + { + "name": "PositionClose", + "fields": [ + { + "name": "position", + "type": "publicKey", + "index": false + }, + { + "name": "owner", + "type": "publicKey", + "index": false + } + ] + }, + { + "name": "ClaimFee", + "fields": [ + { + "name": "lbPair", + "type": "publicKey", + "index": false + }, + { + "name": "position", + "type": "publicKey", + "index": false + }, + { + "name": "owner", + "type": "publicKey", + "index": false + }, + { + "name": "feeX", + "type": "u64", + "index": false + }, + { + "name": "feeY", + "type": "u64", + "index": false + } + ] + }, + { + "name": "LbPairCreate", + "fields": [ + { + "name": "lbPair", + "type": "publicKey", + "index": false + }, + { + "name": "binStep", + "type": "u16", + "index": false + }, + { + "name": "tokenX", + "type": "publicKey", + "index": false + }, + { + "name": "tokenY", + "type": "publicKey", + "index": false + } + ] + }, + { + "name": "PositionCreate", + "fields": [ + { + "name": "lbPair", + "type": "publicKey", + "index": false + }, + { + "name": "position", + "type": "publicKey", + "index": false + }, + { + "name": "owner", + "type": "publicKey", + "index": false + } + ] + }, + { + "name": "IncreasePositionLength", + "fields": [ + { + "name": "lbPair", + "type": "publicKey", + "index": false + }, + { + "name": "position", + "type": "publicKey", + "index": false + }, + { + "name": "owner", + "type": "publicKey", + "index": false + }, + { + "name": "lengthToAdd", + "type": "u16", + "index": false + }, + { + "name": "side", + "type": "u8", + "index": false + } + ] + }, + { + "name": "DecreasePositionLength", + "fields": [ + { + "name": "lbPair", + "type": "publicKey", + "index": false + }, + { + "name": "position", + "type": "publicKey", + "index": false + }, + { + "name": "owner", + "type": "publicKey", + "index": false + }, + { + "name": "lengthToRemove", + "type": "u16", + "index": false + }, + { + "name": "side", + "type": "u8", + "index": false + } + ] + }, + { + "name": "FeeParameterUpdate", + "fields": [ + { + "name": "lbPair", + "type": "publicKey", + "index": false + }, + { + "name": "protocolShare", + "type": "u16", + "index": false + }, + { + "name": "baseFactor", + "type": "u16", + "index": false + } + ] + }, + { + "name": "DynamicFeeParameterUpdate", + "fields": [ + { + "name": "lbPair", + "type": "publicKey", + "index": false + }, + { + "name": "filterPeriod", + "type": "u16", + "index": false + }, + { + "name": "decayPeriod", + "type": "u16", + "index": false + }, + { + "name": "reductionFactor", + "type": "u16", + "index": false + }, + { + "name": "variableFeeControl", + "type": "u32", + "index": false + }, + { + "name": "maxVolatilityAccumulator", + "type": "u32", + "index": false + } + ] + }, + { + "name": "IncreaseObservation", + "fields": [ + { + "name": "oracle", + "type": "publicKey", + "index": false + }, + { + "name": "newObservationLength", + "type": "u64", + "index": false + } + ] + }, + { + "name": "WithdrawIneligibleReward", + "fields": [ + { + "name": "lbPair", + "type": "publicKey", + "index": false + }, + { + "name": "rewardMint", + "type": "publicKey", + "index": false + }, + { + "name": "amount", + "type": "u64", + "index": false + } + ] + }, + { + "name": "UpdatePositionOperator", + "fields": [ + { + "name": "position", + "type": "publicKey", + "index": false + }, + { + "name": "oldOperator", + "type": "publicKey", + "index": false + }, + { + "name": "newOperator", + "type": "publicKey", + "index": false + } + ] + }, + { + "name": "UpdatePositionLockReleasePoint", + "fields": [ + { + "name": "position", + "type": "publicKey", + "index": false + }, + { + "name": "currentPoint", + "type": "u64", + "index": false + }, + { + "name": "newLockReleasePoint", + "type": "u64", + "index": false + }, + { + "name": "oldLockReleasePoint", + "type": "u64", + "index": false + }, + { + "name": "sender", + "type": "publicKey", + "index": false + } + ] + }, + { + "name": "GoToABin", + "fields": [ + { + "name": "lbPair", + "type": "publicKey", + "index": false + }, + { + "name": "fromBinId", + "type": "i32", + "index": false + }, + { + "name": "toBinId", + "type": "i32", + "index": false + } + ] + } + ], + "errors": [ + { + "code": 6000, + "name": "InvalidStartBinIndex", + "msg": "Invalid start bin index" + }, + { + "code": 6001, + "name": "InvalidBinId", + "msg": "Invalid bin id" + }, + { + "code": 6002, + "name": "InvalidInput", + "msg": "Invalid input data" + }, + { + "code": 6003, + "name": "ExceededAmountSlippageTolerance", + "msg": "Exceeded amount slippage tolerance" + }, + { + "code": 6004, + "name": "ExceededBinSlippageTolerance", + "msg": "Exceeded bin slippage tolerance" + }, + { + "code": 6005, + "name": "CompositionFactorFlawed", + "msg": "Composition factor flawed" + }, + { + "code": 6006, + "name": "NonPresetBinStep", + "msg": "Non preset bin step" + }, + { + "code": 6007, + "name": "ZeroLiquidity", + "msg": "Zero liquidity" + }, + { + "code": 6008, + "name": "InvalidPosition", + "msg": "Invalid position" + }, + { + "code": 6009, + "name": "BinArrayNotFound", + "msg": "Bin array not found" + }, + { + "code": 6010, + "name": "InvalidTokenMint", + "msg": "Invalid token mint" + }, + { + "code": 6011, + "name": "InvalidAccountForSingleDeposit", + "msg": "Invalid account for single deposit" + }, + { + "code": 6012, + "name": "PairInsufficientLiquidity", + "msg": "Pair insufficient liquidity" + }, + { + "code": 6013, + "name": "InvalidFeeOwner", + "msg": "Invalid fee owner" + }, + { + "code": 6014, + "name": "InvalidFeeWithdrawAmount", + "msg": "Invalid fee withdraw amount" + }, + { + "code": 6015, + "name": "InvalidAdmin", + "msg": "Invalid admin" + }, + { + "code": 6016, + "name": "IdenticalFeeOwner", + "msg": "Identical fee owner" + }, + { + "code": 6017, + "name": "InvalidBps", + "msg": "Invalid basis point" + }, + { + "code": 6018, + "name": "MathOverflow", + "msg": "Math operation overflow" + }, + { + "code": 6019, + "name": "TypeCastFailed", + "msg": "Type cast error" + }, + { + "code": 6020, + "name": "InvalidRewardIndex", + "msg": "Invalid reward index" + }, + { + "code": 6021, + "name": "InvalidRewardDuration", + "msg": "Invalid reward duration" + }, + { + "code": 6022, + "name": "RewardInitialized", + "msg": "Reward already initialized" + }, + { + "code": 6023, + "name": "RewardUninitialized", + "msg": "Reward not initialized" + }, + { + "code": 6024, + "name": "IdenticalFunder", + "msg": "Identical funder" + }, + { + "code": 6025, + "name": "RewardCampaignInProgress", + "msg": "Reward campaign in progress" + }, + { + "code": 6026, + "name": "IdenticalRewardDuration", + "msg": "Reward duration is the same" + }, + { + "code": 6027, + "name": "InvalidBinArray", + "msg": "Invalid bin array" + }, + { + "code": 6028, + "name": "NonContinuousBinArrays", + "msg": "Bin arrays must be continuous" + }, + { + "code": 6029, + "name": "InvalidRewardVault", + "msg": "Invalid reward vault" + }, + { + "code": 6030, + "name": "NonEmptyPosition", + "msg": "Position is not empty" + }, + { + "code": 6031, + "name": "UnauthorizedAccess", + "msg": "Unauthorized access" + }, + { + "code": 6032, + "name": "InvalidFeeParameter", + "msg": "Invalid fee parameter" + }, + { + "code": 6033, + "name": "MissingOracle", + "msg": "Missing oracle account" + }, + { + "code": 6034, + "name": "InsufficientSample", + "msg": "Insufficient observation sample" + }, + { + "code": 6035, + "name": "InvalidLookupTimestamp", + "msg": "Invalid lookup timestamp" + }, + { + "code": 6036, + "name": "BitmapExtensionAccountIsNotProvided", + "msg": "Bitmap extension account is not provided" + }, + { + "code": 6037, + "name": "CannotFindNonZeroLiquidityBinArrayId", + "msg": "Cannot find non-zero liquidity binArrayId" + }, + { + "code": 6038, + "name": "BinIdOutOfBound", + "msg": "Bin id out of bound" + }, + { + "code": 6039, + "name": "InsufficientOutAmount", + "msg": "Insufficient amount in for minimum out" + }, + { + "code": 6040, + "name": "InvalidPositionWidth", + "msg": "Invalid position width" + }, + { + "code": 6041, + "name": "ExcessiveFeeUpdate", + "msg": "Excessive fee update" + }, + { + "code": 6042, + "name": "PoolDisabled", + "msg": "Pool disabled" + }, + { + "code": 6043, + "name": "InvalidPoolType", + "msg": "Invalid pool type" + }, + { + "code": 6044, + "name": "ExceedMaxWhitelist", + "msg": "Whitelist for wallet is full" + }, + { + "code": 6045, + "name": "InvalidIndex", + "msg": "Invalid index" + }, + { + "code": 6046, + "name": "RewardNotEnded", + "msg": "Reward not ended" + }, + { + "code": 6047, + "name": "MustWithdrawnIneligibleReward", + "msg": "Must withdraw ineligible reward" + }, + { + "code": 6048, + "name": "UnauthorizedAddress", + "msg": "Unauthorized address" + }, + { + "code": 6049, + "name": "OperatorsAreTheSame", + "msg": "Cannot update because operators are the same" + }, + { + "code": 6050, + "name": "WithdrawToWrongTokenAccount", + "msg": "Withdraw to wrong token account" + }, + { + "code": 6051, + "name": "WrongRentReceiver", + "msg": "Wrong rent receiver" + }, + { + "code": 6052, + "name": "AlreadyPassActivationPoint", + "msg": "Already activated" + }, + { + "code": 6053, + "name": "ExceedMaxSwappedAmount", + "msg": "Swapped amount is exceeded max swapped amount" + }, + { + "code": 6054, + "name": "InvalidStrategyParameters", + "msg": "Invalid strategy parameters" + }, + { + "code": 6055, + "name": "LiquidityLocked", + "msg": "Liquidity locked" + }, + { + "code": 6056, + "name": "BinRangeIsNotEmpty", + "msg": "Bin range is not empty" + }, + { + "code": 6057, + "name": "NotExactAmountOut", + "msg": "Amount out is not matched with exact amount out" + }, + { + "code": 6058, + "name": "InvalidActivationType", + "msg": "Invalid activation type" + }, + { + "code": 6059, + "name": "InvalidActivationDuration", + "msg": "Invalid activation duration" + }, + { + "code": 6060, + "name": "MissingTokenAmountAsTokenLaunchProof", + "msg": "Missing token amount as token launch owner proof" + }, + { + "code": 6061, + "name": "InvalidQuoteToken", + "msg": "Quote token must be SOL or USDC" + }, + { + "code": 6062, + "name": "InvalidBinStep", + "msg": "Invalid bin step" + }, + { + "code": 6063, + "name": "InvalidBaseFee", + "msg": "Invalid base fee" + }, + { + "code": 6064, + "name": "InvalidPreActivationDuration", + "msg": "Invalid pre-activation duration" + }, + { + "code": 6065, + "name": "AlreadyPassPreActivationSwapPoint", + "msg": "Already pass pre-activation swap point" + }, + { + "code": 6066, + "name": "InvalidStatus", + "msg": "Invalid status" + }, + { + "code": 6067, + "name": "ExceededMaxOracleLength", + "msg": "Exceed max oracle length" + }, + { + "code": 6068, + "name": "InvalidMinimumLiquidity", + "msg": "Invalid minimum liquidity" + }, + { + "code": 6069, + "name": "NotSupportMint", + "msg": "Not support token_2022 mint extension" + }, + { + "code": 6070, + "name": "UnsupportedMintExtension", + "msg": "Unsupported mint extension" + }, + { + "code": 6071, + "name": "UnsupportNativeMintToken2022", + "msg": "Unsupported native mint token2022" + }, + { + "code": 6072, + "name": "UnmatchTokenMint", + "msg": "Unmatch token mint" + }, + { + "code": 6073, + "name": "UnsupportedTokenMint", + "msg": "Unsupported token mint" + }, + { + "code": 6074, + "name": "InsufficientRemainingAccounts", + "msg": "Insufficient remaining accounts" + }, + { + "code": 6075, + "name": "InvalidRemainingAccountSlice", + "msg": "Invalid remaining account slice" + }, + { + "code": 6076, + "name": "DuplicatedRemainingAccountTypes", + "msg": "Duplicated remaining account types" + }, + { + "code": 6077, + "name": "MissingRemainingAccountForTransferHook", + "msg": "Missing remaining account for transfer hook" + }, + { + "code": 6078, + "name": "NoTransferHookProgram", + "msg": "Remaining account was passed for transfer hook but there's no hook program" + }, + { + "code": 6079, + "name": "ZeroFundedAmount", + "msg": "Zero funded amount" + }, + { + "code": 6080, + "name": "InvalidSide", + "msg": "Invalid side" + }, + { + "code": 6081, + "name": "InvalidResizeLength", + "msg": "Invalid resize length" + }, + { + "code": 6082, + "name": "NotSupportAtTheMoment", + "msg": "Not support at the moment" + } + ] +} \ No newline at end of file diff --git a/idl/orca_whirlpool.json b/idl/orca_whirlpool.json new file mode 100644 index 0000000..b2be540 --- /dev/null +++ b/idl/orca_whirlpool.json @@ -0,0 +1,4326 @@ +{ + "version": "0.3.6", + "name": "whirlpool", + "instructions": [ + { + "name": "initializeConfig", + "accounts": [ + { + "name": "config", + "isMut": true, + "isSigner": true + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "feeAuthority", + "type": "publicKey" + }, + { + "name": "collectProtocolFeesAuthority", + "type": "publicKey" + }, + { + "name": "rewardEmissionsSuperAuthority", + "type": "publicKey" + }, + { + "name": "defaultProtocolFeeRate", + "type": "u16" + } + ] + }, + { + "name": "initializePool", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintA", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintB", + "isMut": false, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": true + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": true + }, + { + "name": "feeTier", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "bumps", + "type": { + "defined": "WhirlpoolBumps" + } + }, + { + "name": "tickSpacing", + "type": "u16" + }, + { + "name": "initialSqrtPrice", + "type": "u128" + } + ] + }, + { + "name": "initializeTickArray", + "accounts": [ + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "tickArray", + "isMut": true, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "startTickIndex", + "type": "i32" + } + ] + }, + { + "name": "initializeFeeTier", + "accounts": [ + { + "name": "config", + "isMut": false, + "isSigner": false + }, + { + "name": "feeTier", + "isMut": true, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "tickSpacing", + "type": "u16" + }, + { + "name": "defaultFeeRate", + "type": "u16" + } + ] + }, + { + "name": "initializeReward", + "accounts": [ + { + "name": "rewardAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardMint", + "isMut": false, + "isSigner": false + }, + { + "name": "rewardVault", + "isMut": true, + "isSigner": true + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u8" + } + ] + }, + { + "name": "setRewardEmissions", + "accounts": [ + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "rewardVault", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u8" + }, + { + "name": "emissionsPerSecondX64", + "type": "u128" + } + ] + }, + { + "name": "openPosition", + "accounts": [ + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "owner", + "isMut": false, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionMint", + "isMut": true, + "isSigner": true + }, + { + "name": "positionTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "bumps", + "type": { + "defined": "OpenPositionBumps" + } + }, + { + "name": "tickLowerIndex", + "type": "i32" + }, + { + "name": "tickUpperIndex", + "type": "i32" + } + ] + }, + { + "name": "openPositionWithMetadata", + "accounts": [ + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "owner", + "isMut": false, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionMint", + "isMut": true, + "isSigner": true + }, + { + "name": "positionMetadataAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "metadataProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "metadataUpdateAuth", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "bumps", + "type": { + "defined": "OpenPositionWithMetadataBumps" + } + }, + { + "name": "tickLowerIndex", + "type": "i32" + }, + { + "name": "tickUpperIndex", + "type": "i32" + } + ] + }, + { + "name": "increaseLiquidity", + "accounts": [ + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenOwnerAccountA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayUpper", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidityAmount", + "type": "u128" + }, + { + "name": "tokenMaxA", + "type": "u64" + }, + { + "name": "tokenMaxB", + "type": "u64" + } + ] + }, + { + "name": "decreaseLiquidity", + "accounts": [ + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenOwnerAccountA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayUpper", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidityAmount", + "type": "u128" + }, + { + "name": "tokenMinA", + "type": "u64" + }, + { + "name": "tokenMinB", + "type": "u64" + } + ] + }, + { + "name": "updateFeesAndRewards", + "accounts": [ + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayLower", + "isMut": false, + "isSigner": false + }, + { + "name": "tickArrayUpper", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "collectFees", + "accounts": [ + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenOwnerAccountA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "collectReward", + "accounts": [ + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "rewardOwnerAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardVault", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u8" + } + ] + }, + { + "name": "collectProtocolFees", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "collectProtocolFeesAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenDestinationA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenDestinationB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "swap", + "accounts": [ + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArray0", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArray1", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArray2", + "isMut": true, + "isSigner": false + }, + { + "name": "oracle", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + }, + { + "name": "otherAmountThreshold", + "type": "u64" + }, + { + "name": "sqrtPriceLimit", + "type": "u128" + }, + { + "name": "amountSpecifiedIsInput", + "type": "bool" + }, + { + "name": "aToB", + "type": "bool" + } + ] + }, + { + "name": "closePosition", + "accounts": [ + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "receiver", + "isMut": true, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionMint", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "setDefaultFeeRate", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "feeTier", + "isMut": true, + "isSigner": false + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "defaultFeeRate", + "type": "u16" + } + ] + }, + { + "name": "setDefaultProtocolFeeRate", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": true, + "isSigner": false + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "defaultProtocolFeeRate", + "type": "u16" + } + ] + }, + { + "name": "setFeeRate", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "feeRate", + "type": "u16" + } + ] + }, + { + "name": "setProtocolFeeRate", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "protocolFeeRate", + "type": "u16" + } + ] + }, + { + "name": "setFeeAuthority", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": true, + "isSigner": false + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "newFeeAuthority", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "setCollectProtocolFeesAuthority", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": true, + "isSigner": false + }, + { + "name": "collectProtocolFeesAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "newCollectProtocolFeesAuthority", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "setRewardAuthority", + "accounts": [ + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "newRewardAuthority", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u8" + } + ] + }, + { + "name": "setRewardAuthorityBySuperAuthority", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardEmissionsSuperAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "newRewardAuthority", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u8" + } + ] + }, + { + "name": "setRewardEmissionsSuperAuthority", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardEmissionsSuperAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "newRewardEmissionsSuperAuthority", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "twoHopSwap", + "accounts": [ + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "whirlpoolOne", + "isMut": true, + "isSigner": false + }, + { + "name": "whirlpoolTwo", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountOneA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultOneA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountOneB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultOneB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountTwoA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultTwoA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountTwoB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultTwoB", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayOne0", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayOne1", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayOne2", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayTwo0", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayTwo1", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayTwo2", + "isMut": true, + "isSigner": false + }, + { + "name": "oracleOne", + "isMut": false, + "isSigner": false + }, + { + "name": "oracleTwo", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + }, + { + "name": "otherAmountThreshold", + "type": "u64" + }, + { + "name": "amountSpecifiedIsInput", + "type": "bool" + }, + { + "name": "aToBOne", + "type": "bool" + }, + { + "name": "aToBTwo", + "type": "bool" + }, + { + "name": "sqrtPriceLimitOne", + "type": "u128" + }, + { + "name": "sqrtPriceLimitTwo", + "type": "u128" + } + ] + }, + { + "name": "initializePositionBundle", + "accounts": [ + { + "name": "positionBundle", + "isMut": true, + "isSigner": false + }, + { + "name": "positionBundleMint", + "isMut": true, + "isSigner": true + }, + { + "name": "positionBundleTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "positionBundleOwner", + "isMut": false, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "initializePositionBundleWithMetadata", + "accounts": [ + { + "name": "positionBundle", + "isMut": true, + "isSigner": false + }, + { + "name": "positionBundleMint", + "isMut": true, + "isSigner": true + }, + { + "name": "positionBundleMetadata", + "isMut": true, + "isSigner": false + }, + { + "name": "positionBundleTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "positionBundleOwner", + "isMut": false, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "metadataUpdateAuth", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "metadataProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "deletePositionBundle", + "accounts": [ + { + "name": "positionBundle", + "isMut": true, + "isSigner": false + }, + { + "name": "positionBundleMint", + "isMut": true, + "isSigner": false + }, + { + "name": "positionBundleTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "positionBundleOwner", + "isMut": false, + "isSigner": true + }, + { + "name": "receiver", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "openBundledPosition", + "accounts": [ + { + "name": "bundledPosition", + "isMut": true, + "isSigner": false + }, + { + "name": "positionBundle", + "isMut": true, + "isSigner": false + }, + { + "name": "positionBundleTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "positionBundleAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "bundleIndex", + "type": "u16" + }, + { + "name": "tickLowerIndex", + "type": "i32" + }, + { + "name": "tickUpperIndex", + "type": "i32" + } + ] + }, + { + "name": "closeBundledPosition", + "accounts": [ + { + "name": "bundledPosition", + "isMut": true, + "isSigner": false + }, + { + "name": "positionBundle", + "isMut": true, + "isSigner": false + }, + { + "name": "positionBundleTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "positionBundleAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "receiver", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "bundleIndex", + "type": "u16" + } + ] + }, + { + "name": "openPositionWithTokenExtensions", + "accounts": [ + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "owner", + "isMut": false, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionMint", + "isMut": true, + "isSigner": true + }, + { + "name": "positionTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "token2022Program", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "metadataUpdateAuth", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "tickLowerIndex", + "type": "i32" + }, + { + "name": "tickUpperIndex", + "type": "i32" + }, + { + "name": "withTokenMetadataExtension", + "type": "bool" + } + ] + }, + { + "name": "closePositionWithTokenExtensions", + "accounts": [ + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "receiver", + "isMut": true, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionMint", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "token2022Program", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "lockPosition", + "accounts": [ + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "position", + "isMut": false, + "isSigner": false + }, + { + "name": "positionMint", + "isMut": false, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "lockConfig", + "isMut": true, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "token2022Program", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "lockType", + "type": { + "defined": "LockType" + } + } + ] + }, + { + "name": "resetPositionRange", + "accounts": [ + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "newTickLowerIndex", + "type": "i32" + }, + { + "name": "newTickUpperIndex", + "type": "i32" + } + ] + }, + { + "name": "transferLockedPosition", + "accounts": [ + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "receiver", + "isMut": true, + "isSigner": false + }, + { + "name": "position", + "isMut": false, + "isSigner": false + }, + { + "name": "positionMint", + "isMut": false, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "destinationTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "lockConfig", + "isMut": true, + "isSigner": false + }, + { + "name": "token2022Program", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "initializeAdaptiveFeeTier", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "adaptiveFeeTier", + "isMut": true, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "feeTierIndex", + "type": "u16" + }, + { + "name": "tickSpacing", + "type": "u16" + }, + { + "name": "initializePoolAuthority", + "type": "publicKey" + }, + { + "name": "delegatedFeeAuthority", + "type": "publicKey" + }, + { + "name": "defaultBaseFeeRate", + "type": "u16" + }, + { + "name": "filterPeriod", + "type": "u16" + }, + { + "name": "decayPeriod", + "type": "u16" + }, + { + "name": "reductionFactor", + "type": "u16" + }, + { + "name": "adaptiveFeeControlFactor", + "type": "u32" + }, + { + "name": "maxVolatilityAccumulator", + "type": "u32" + }, + { + "name": "tickGroupSize", + "type": "u16" + }, + { + "name": "majorSwapThresholdTicks", + "type": "u16" + } + ] + }, + { + "name": "setDefaultBaseFeeRate", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "adaptiveFeeTier", + "isMut": true, + "isSigner": false + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "defaultBaseFeeRate", + "type": "u16" + } + ] + }, + { + "name": "setDelegatedFeeAuthority", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "adaptiveFeeTier", + "isMut": true, + "isSigner": false + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "newDelegatedFeeAuthority", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "setInitializePoolAuthority", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "adaptiveFeeTier", + "isMut": true, + "isSigner": false + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "newInitializePoolAuthority", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "setPresetAdaptiveFeeConstants", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "adaptiveFeeTier", + "isMut": true, + "isSigner": false + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "filterPeriod", + "type": "u16" + }, + { + "name": "decayPeriod", + "type": "u16" + }, + { + "name": "reductionFactor", + "type": "u16" + }, + { + "name": "adaptiveFeeControlFactor", + "type": "u32" + }, + { + "name": "maxVolatilityAccumulator", + "type": "u32" + }, + { + "name": "tickGroupSize", + "type": "u16" + }, + { + "name": "majorSwapThresholdTicks", + "type": "u16" + } + ] + }, + { + "name": "initializePoolWithAdaptiveFee", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintA", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintB", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenBadgeA", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenBadgeB", + "isMut": false, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "initializePoolAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "oracle", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": true + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": true + }, + { + "name": "adaptiveFeeTier", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgramA", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgramB", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "initialSqrtPrice", + "type": "u128" + }, + { + "name": "tradeEnableTimestamp", + "type": { + "option": "u64" + } + } + ] + }, + { + "name": "setFeeRateByDelegatedFeeAuthority", + "accounts": [ + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "adaptiveFeeTier", + "isMut": false, + "isSigner": false + }, + { + "name": "delegatedFeeAuthority", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "feeRate", + "type": "u16" + } + ] + }, + { + "name": "collectFeesV2", + "accounts": [ + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintA", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintB", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenOwnerAccountA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgramA", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgramB", + "isMut": false, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "remainingAccountsInfo", + "type": { + "option": { + "defined": "RemainingAccountsInfo" + } + } + } + ] + }, + { + "name": "collectProtocolFeesV2", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "collectProtocolFeesAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenMintA", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintB", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenDestinationA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenDestinationB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgramA", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgramB", + "isMut": false, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "remainingAccountsInfo", + "type": { + "option": { + "defined": "RemainingAccountsInfo" + } + } + } + ] + }, + { + "name": "collectRewardV2", + "accounts": [ + { + "name": "whirlpool", + "isMut": false, + "isSigner": false + }, + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "rewardOwnerAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardMint", + "isMut": false, + "isSigner": false + }, + { + "name": "rewardVault", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardTokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u8" + }, + { + "name": "remainingAccountsInfo", + "type": { + "option": { + "defined": "RemainingAccountsInfo" + } + } + } + ] + }, + { + "name": "decreaseLiquidityV2", + "accounts": [ + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgramA", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgramB", + "isMut": false, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintA", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintB", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenOwnerAccountA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayUpper", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidityAmount", + "type": "u128" + }, + { + "name": "tokenMinA", + "type": "u64" + }, + { + "name": "tokenMinB", + "type": "u64" + }, + { + "name": "remainingAccountsInfo", + "type": { + "option": { + "defined": "RemainingAccountsInfo" + } + } + } + ] + }, + { + "name": "increaseLiquidityV2", + "accounts": [ + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgramA", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgramB", + "isMut": false, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "positionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "positionTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintA", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintB", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenOwnerAccountA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayUpper", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidityAmount", + "type": "u128" + }, + { + "name": "tokenMaxA", + "type": "u64" + }, + { + "name": "tokenMaxB", + "type": "u64" + }, + { + "name": "remainingAccountsInfo", + "type": { + "option": { + "defined": "RemainingAccountsInfo" + } + } + } + ] + }, + { + "name": "initializePoolV2", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintA", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintB", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenBadgeA", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenBadgeB", + "isMut": false, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": true + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": true + }, + { + "name": "feeTier", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgramA", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgramB", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "tickSpacing", + "type": "u16" + }, + { + "name": "initialSqrtPrice", + "type": "u128" + } + ] + }, + { + "name": "initializeRewardV2", + "accounts": [ + { + "name": "rewardAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardMint", + "isMut": false, + "isSigner": false + }, + { + "name": "rewardTokenBadge", + "isMut": false, + "isSigner": false + }, + { + "name": "rewardVault", + "isMut": true, + "isSigner": true + }, + { + "name": "rewardTokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u8" + } + ] + }, + { + "name": "setRewardEmissionsV2", + "accounts": [ + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "rewardVault", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u8" + }, + { + "name": "emissionsPerSecondX64", + "type": "u128" + } + ] + }, + { + "name": "swapV2", + "accounts": [ + { + "name": "tokenProgramA", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgramB", + "isMut": false, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "whirlpool", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenMintA", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintB", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenOwnerAccountA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultA", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultB", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArray0", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArray1", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArray2", + "isMut": true, + "isSigner": false + }, + { + "name": "oracle", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + }, + { + "name": "otherAmountThreshold", + "type": "u64" + }, + { + "name": "sqrtPriceLimit", + "type": "u128" + }, + { + "name": "amountSpecifiedIsInput", + "type": "bool" + }, + { + "name": "aToB", + "type": "bool" + }, + { + "name": "remainingAccountsInfo", + "type": { + "option": { + "defined": "RemainingAccountsInfo" + } + } + } + ] + }, + { + "name": "twoHopSwapV2", + "accounts": [ + { + "name": "whirlpoolOne", + "isMut": true, + "isSigner": false + }, + { + "name": "whirlpoolTwo", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenMintInput", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintIntermediate", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintOutput", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgramInput", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgramIntermediate", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgramOutput", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenOwnerAccountInput", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultOneInput", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultOneIntermediate", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultTwoIntermediate", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVaultTwoOutput", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenOwnerAccountOutput", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "tickArrayOne0", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayOne1", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayOne2", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayTwo0", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayTwo1", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayTwo2", + "isMut": true, + "isSigner": false + }, + { + "name": "oracleOne", + "isMut": true, + "isSigner": false + }, + { + "name": "oracleTwo", + "isMut": true, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + }, + { + "name": "otherAmountThreshold", + "type": "u64" + }, + { + "name": "amountSpecifiedIsInput", + "type": "bool" + }, + { + "name": "aToBOne", + "type": "bool" + }, + { + "name": "aToBTwo", + "type": "bool" + }, + { + "name": "sqrtPriceLimitOne", + "type": "u128" + }, + { + "name": "sqrtPriceLimitTwo", + "type": "u128" + }, + { + "name": "remainingAccountsInfo", + "type": { + "option": { + "defined": "RemainingAccountsInfo" + } + } + } + ] + }, + { + "name": "initializeConfigExtension", + "accounts": [ + { + "name": "config", + "isMut": false, + "isSigner": false + }, + { + "name": "configExtension", + "isMut": true, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "feeAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "setConfigExtensionAuthority", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "whirlpoolsConfigExtension", + "isMut": true, + "isSigner": false + }, + { + "name": "configExtensionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "newConfigExtensionAuthority", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "setTokenBadgeAuthority", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "whirlpoolsConfigExtension", + "isMut": true, + "isSigner": false + }, + { + "name": "configExtensionAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "newTokenBadgeAuthority", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "initializeTokenBadge", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "whirlpoolsConfigExtension", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenBadgeAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenBadge", + "isMut": true, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "deleteTokenBadge", + "accounts": [ + { + "name": "whirlpoolsConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "whirlpoolsConfigExtension", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenBadgeAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenBadge", + "isMut": true, + "isSigner": false + }, + { + "name": "receiver", + "isMut": true, + "isSigner": false + } + ], + "args": [] + } + ], + "accounts": [ + { + "name": "AdaptiveFeeTier", + "type": { + "kind": "struct", + "fields": [ + { + "name": "whirlpoolsConfig", + "type": "publicKey" + }, + { + "name": "feeTierIndex", + "type": "u16" + }, + { + "name": "tickSpacing", + "type": "u16" + }, + { + "name": "initializePoolAuthority", + "type": "publicKey" + }, + { + "name": "delegatedFeeAuthority", + "type": "publicKey" + }, + { + "name": "defaultBaseFeeRate", + "type": "u16" + }, + { + "name": "filterPeriod", + "type": "u16" + }, + { + "name": "decayPeriod", + "type": "u16" + }, + { + "name": "reductionFactor", + "type": "u16" + }, + { + "name": "adaptiveFeeControlFactor", + "type": "u32" + }, + { + "name": "maxVolatilityAccumulator", + "type": "u32" + }, + { + "name": "tickGroupSize", + "type": "u16" + }, + { + "name": "majorSwapThresholdTicks", + "type": "u16" + } + ] + } + }, + { + "name": "WhirlpoolsConfig", + "type": { + "kind": "struct", + "fields": [ + { + "name": "feeAuthority", + "type": "publicKey" + }, + { + "name": "collectProtocolFeesAuthority", + "type": "publicKey" + }, + { + "name": "rewardEmissionsSuperAuthority", + "type": "publicKey" + }, + { + "name": "defaultProtocolFeeRate", + "type": "u16" + } + ] + } + }, + { + "name": "WhirlpoolsConfigExtension", + "type": { + "kind": "struct", + "fields": [ + { + "name": "whirlpoolsConfig", + "type": "publicKey" + }, + { + "name": "configExtensionAuthority", + "type": "publicKey" + }, + { + "name": "tokenBadgeAuthority", + "type": "publicKey" + } + ] + } + }, + { + "name": "FeeTier", + "type": { + "kind": "struct", + "fields": [ + { + "name": "whirlpoolsConfig", + "type": "publicKey" + }, + { + "name": "tickSpacing", + "type": "u16" + }, + { + "name": "defaultFeeRate", + "type": "u16" + } + ] + } + }, + { + "name": "LockConfig", + "type": { + "kind": "struct", + "fields": [ + { + "name": "position", + "type": "publicKey" + }, + { + "name": "positionOwner", + "type": "publicKey" + }, + { + "name": "whirlpool", + "type": "publicKey" + }, + { + "name": "lockedTimestamp", + "type": "u64" + }, + { + "name": "lockType", + "type": { + "defined": "LockTypeLabel" + } + } + ] + } + }, + { + "name": "Oracle", + "type": { + "kind": "struct", + "fields": [ + { + "name": "whirlpool", + "type": "publicKey" + }, + { + "name": "tradeEnableTimestamp", + "type": "u64" + }, + { + "name": "adaptiveFeeConstants", + "type": { + "defined": "AdaptiveFeeConstants" + } + }, + { + "name": "adaptiveFeeVariables", + "type": { + "defined": "AdaptiveFeeVariables" + } + }, + { + "name": "reserved", + "type": { + "array": [ + "u8", + 128 + ] + } + } + ] + } + }, + { + "name": "Position", + "type": { + "kind": "struct", + "fields": [ + { + "name": "whirlpool", + "type": "publicKey" + }, + { + "name": "positionMint", + "type": "publicKey" + }, + { + "name": "liquidity", + "type": "u128" + }, + { + "name": "tickLowerIndex", + "type": "i32" + }, + { + "name": "tickUpperIndex", + "type": "i32" + }, + { + "name": "feeGrowthCheckpointA", + "type": "u128" + }, + { + "name": "feeOwedA", + "type": "u64" + }, + { + "name": "feeGrowthCheckpointB", + "type": "u128" + }, + { + "name": "feeOwedB", + "type": "u64" + }, + { + "name": "rewardInfos", + "type": { + "array": [ + { + "defined": "PositionRewardInfo" + }, + 3 + ] + } + } + ] + } + }, + { + "name": "PositionBundle", + "type": { + "kind": "struct", + "fields": [ + { + "name": "positionBundleMint", + "type": "publicKey" + }, + { + "name": "positionBitmap", + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] + } + }, + { + "name": "TickArray", + "type": { + "kind": "struct", + "fields": [ + { + "name": "startTickIndex", + "type": "i32" + }, + { + "name": "ticks", + "type": { + "array": [ + { + "defined": "Tick" + }, + 88 + ] + } + }, + { + "name": "whirlpool", + "type": "publicKey" + } + ] + } + }, + { + "name": "TokenBadge", + "type": { + "kind": "struct", + "fields": [ + { + "name": "whirlpoolsConfig", + "type": "publicKey" + }, + { + "name": "tokenMint", + "type": "publicKey" + } + ] + } + }, + { + "name": "Whirlpool", + "type": { + "kind": "struct", + "fields": [ + { + "name": "whirlpoolsConfig", + "type": "publicKey" + }, + { + "name": "whirlpoolBump", + "type": { + "array": [ + "u8", + 1 + ] + } + }, + { + "name": "tickSpacing", + "type": "u16" + }, + { + "name": "feeTierIndexSeed", + "type": { + "array": [ + "u8", + 2 + ] + } + }, + { + "name": "feeRate", + "type": "u16" + }, + { + "name": "protocolFeeRate", + "type": "u16" + }, + { + "name": "liquidity", + "type": "u128" + }, + { + "name": "sqrtPrice", + "type": "u128" + }, + { + "name": "tickCurrentIndex", + "type": "i32" + }, + { + "name": "protocolFeeOwedA", + "type": "u64" + }, + { + "name": "protocolFeeOwedB", + "type": "u64" + }, + { + "name": "tokenMintA", + "type": "publicKey" + }, + { + "name": "tokenVaultA", + "type": "publicKey" + }, + { + "name": "feeGrowthGlobalA", + "type": "u128" + }, + { + "name": "tokenMintB", + "type": "publicKey" + }, + { + "name": "tokenVaultB", + "type": "publicKey" + }, + { + "name": "feeGrowthGlobalB", + "type": "u128" + }, + { + "name": "rewardLastUpdatedTimestamp", + "type": "u64" + }, + { + "name": "rewardInfos", + "type": { + "array": [ + { + "defined": "WhirlpoolRewardInfo" + }, + 3 + ] + } + } + ] + } + } + ], + "types": [ + { + "name": "LockType", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Permanent" + } + ] + } + }, + { + "name": "LockTypeLabel", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Permanent" + } + ] + } + }, + { + "name": "AdaptiveFeeConstants", + "type": { + "kind": "struct", + "fields": [ + { + "name": "filterPeriod", + "type": "u16" + }, + { + "name": "decayPeriod", + "type": "u16" + }, + { + "name": "reductionFactor", + "type": "u16" + }, + { + "name": "adaptiveFeeControlFactor", + "type": "u32" + }, + { + "name": "maxVolatilityAccumulator", + "type": "u32" + }, + { + "name": "tickGroupSize", + "type": "u16" + }, + { + "name": "majorSwapThresholdTicks", + "type": "u16" + }, + { + "name": "reserved", + "type": { + "array": [ + "u8", + 16 + ] + } + } + ] + } + }, + { + "name": "AdaptiveFeeVariables", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lastReferenceUpdateTimestamp", + "type": "u64" + }, + { + "name": "lastMajorSwapTimestamp", + "type": "u64" + }, + { + "name": "volatilityReference", + "type": "u32" + }, + { + "name": "tickGroupIndexReference", + "type": "i32" + }, + { + "name": "volatilityAccumulator", + "type": "u32" + }, + { + "name": "reserved", + "type": { + "array": [ + "u8", + 16 + ] + } + } + ] + } + }, + { + "name": "OpenPositionBumps", + "type": { + "kind": "struct", + "fields": [ + { + "name": "positionBump", + "type": "u8" + } + ] + } + }, + { + "name": "OpenPositionWithMetadataBumps", + "type": { + "kind": "struct", + "fields": [ + { + "name": "positionBump", + "type": "u8" + }, + { + "name": "metadataBump", + "type": "u8" + } + ] + } + }, + { + "name": "PositionRewardInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "growthInsideCheckpoint", + "type": "u128" + }, + { + "name": "amountOwed", + "type": "u64" + } + ] + } + }, + { + "name": "Tick", + "type": { + "kind": "struct", + "fields": [ + { + "name": "initialized", + "type": "bool" + }, + { + "name": "liquidityNet", + "type": "i128" + }, + { + "name": "liquidityGross", + "type": "u128" + }, + { + "name": "feeGrowthOutsideA", + "type": "u128" + }, + { + "name": "feeGrowthOutsideB", + "type": "u128" + }, + { + "name": "rewardGrowthsOutside", + "type": { + "array": [ + "u128", + 3 + ] + } + } + ] + } + }, + { + "name": "WhirlpoolBumps", + "type": { + "kind": "struct", + "fields": [ + { + "name": "whirlpoolBump", + "type": "u8" + } + ] + } + }, + { + "name": "WhirlpoolRewardInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "mint", + "type": "publicKey" + }, + { + "name": "vault", + "type": "publicKey" + }, + { + "name": "authority", + "type": "publicKey" + }, + { + "name": "emissionsPerSecondX64", + "type": "u128" + }, + { + "name": "growthGlobalX64", + "type": "u128" + } + ] + } + }, + { + "name": "AccountsType", + "type": { + "kind": "enum", + "variants": [ + { + "name": "TransferHookA" + }, + { + "name": "TransferHookB" + }, + { + "name": "TransferHookReward" + }, + { + "name": "TransferHookInput" + }, + { + "name": "TransferHookIntermediate" + }, + { + "name": "TransferHookOutput" + }, + { + "name": "SupplementalTickArrays" + }, + { + "name": "SupplementalTickArraysOne" + }, + { + "name": "SupplementalTickArraysTwo" + } + ] + } + }, + { + "name": "RemainingAccountsInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "slices", + "type": { + "vec": { + "defined": "RemainingAccountsSlice" + } + } + } + ] + } + }, + { + "name": "RemainingAccountsSlice", + "type": { + "kind": "struct", + "fields": [ + { + "name": "accountsType", + "type": { + "defined": "AccountsType" + } + }, + { + "name": "length", + "type": "u8" + } + ] + } + } + ], + "events": [ + { + "name": "LiquidityDecreased", + "fields": [ + { + "name": "whirlpool", + "type": "publicKey", + "index": false + }, + { + "name": "position", + "type": "publicKey", + "index": false + }, + { + "name": "tickLowerIndex", + "type": "i32", + "index": false + }, + { + "name": "tickUpperIndex", + "type": "i32", + "index": false + }, + { + "name": "liquidity", + "type": "u128", + "index": false + }, + { + "name": "tokenAAmount", + "type": "u64", + "index": false + }, + { + "name": "tokenBAmount", + "type": "u64", + "index": false + }, + { + "name": "tokenATransferFee", + "type": "u64", + "index": false + }, + { + "name": "tokenBTransferFee", + "type": "u64", + "index": false + } + ] + }, + { + "name": "LiquidityIncreased", + "fields": [ + { + "name": "whirlpool", + "type": "publicKey", + "index": false + }, + { + "name": "position", + "type": "publicKey", + "index": false + }, + { + "name": "tickLowerIndex", + "type": "i32", + "index": false + }, + { + "name": "tickUpperIndex", + "type": "i32", + "index": false + }, + { + "name": "liquidity", + "type": "u128", + "index": false + }, + { + "name": "tokenAAmount", + "type": "u64", + "index": false + }, + { + "name": "tokenBAmount", + "type": "u64", + "index": false + }, + { + "name": "tokenATransferFee", + "type": "u64", + "index": false + }, + { + "name": "tokenBTransferFee", + "type": "u64", + "index": false + } + ] + }, + { + "name": "PoolInitialized", + "fields": [ + { + "name": "whirlpool", + "type": "publicKey", + "index": false + }, + { + "name": "whirlpoolsConfig", + "type": "publicKey", + "index": false + }, + { + "name": "tokenMintA", + "type": "publicKey", + "index": false + }, + { + "name": "tokenMintB", + "type": "publicKey", + "index": false + }, + { + "name": "tickSpacing", + "type": "u16", + "index": false + }, + { + "name": "tokenProgramA", + "type": "publicKey", + "index": false + }, + { + "name": "tokenProgramB", + "type": "publicKey", + "index": false + }, + { + "name": "decimalsA", + "type": "u8", + "index": false + }, + { + "name": "decimalsB", + "type": "u8", + "index": false + }, + { + "name": "initialSqrtPrice", + "type": "u128", + "index": false + } + ] + }, + { + "name": "Traded", + "fields": [ + { + "name": "whirlpool", + "type": "publicKey", + "index": false + }, + { + "name": "aToB", + "type": "bool", + "index": false + }, + { + "name": "preSqrtPrice", + "type": "u128", + "index": false + }, + { + "name": "postSqrtPrice", + "type": "u128", + "index": false + }, + { + "name": "inputAmount", + "type": "u64", + "index": false + }, + { + "name": "outputAmount", + "type": "u64", + "index": false + }, + { + "name": "inputTransferFee", + "type": "u64", + "index": false + }, + { + "name": "outputTransferFee", + "type": "u64", + "index": false + }, + { + "name": "lpFee", + "type": "u64", + "index": false + }, + { + "name": "protocolFee", + "type": "u64", + "index": false + } + ] + } + ], + "errors": [ + { + "code": 6000, + "name": "InvalidEnum", + "msg": "Enum value could not be converted" + }, + { + "code": 6001, + "name": "InvalidStartTick", + "msg": "Invalid start tick index provided." + }, + { + "code": 6002, + "name": "TickArrayExistInPool", + "msg": "Tick-array already exists in this whirlpool" + }, + { + "code": 6003, + "name": "TickArrayIndexOutofBounds", + "msg": "Attempt to search for a tick-array failed" + }, + { + "code": 6004, + "name": "InvalidTickSpacing", + "msg": "Tick-spacing is not supported" + }, + { + "code": 6005, + "name": "ClosePositionNotEmpty", + "msg": "Position is not empty It cannot be closed" + }, + { + "code": 6006, + "name": "DivideByZero", + "msg": "Unable to divide by zero" + }, + { + "code": 6007, + "name": "NumberCastError", + "msg": "Unable to cast number into BigInt" + }, + { + "code": 6008, + "name": "NumberDownCastError", + "msg": "Unable to down cast number" + }, + { + "code": 6009, + "name": "TickNotFound", + "msg": "Tick not found within tick array" + }, + { + "code": 6010, + "name": "InvalidTickIndex", + "msg": "Provided tick index is either out of bounds or uninitializable" + }, + { + "code": 6011, + "name": "SqrtPriceOutOfBounds", + "msg": "Provided sqrt price out of bounds" + }, + { + "code": 6012, + "name": "LiquidityZero", + "msg": "Liquidity amount must be greater than zero" + }, + { + "code": 6013, + "name": "LiquidityTooHigh", + "msg": "Liquidity amount must be less than i64::MAX" + }, + { + "code": 6014, + "name": "LiquidityOverflow", + "msg": "Liquidity overflow" + }, + { + "code": 6015, + "name": "LiquidityUnderflow", + "msg": "Liquidity underflow" + }, + { + "code": 6016, + "name": "LiquidityNetError", + "msg": "Tick liquidity net underflowed or overflowed" + }, + { + "code": 6017, + "name": "TokenMaxExceeded", + "msg": "Exceeded token max" + }, + { + "code": 6018, + "name": "TokenMinSubceeded", + "msg": "Did not meet token min" + }, + { + "code": 6019, + "name": "MissingOrInvalidDelegate", + "msg": "Position token account has a missing or invalid delegate" + }, + { + "code": 6020, + "name": "InvalidPositionTokenAmount", + "msg": "Position token amount must be 1" + }, + { + "code": 6021, + "name": "InvalidTimestampConversion", + "msg": "Timestamp should be convertible from i64 to u64" + }, + { + "code": 6022, + "name": "InvalidTimestamp", + "msg": "Timestamp should be greater than the last updated timestamp" + }, + { + "code": 6023, + "name": "InvalidTickArraySequence", + "msg": "Invalid tick array sequence provided for instruction." + }, + { + "code": 6024, + "name": "InvalidTokenMintOrder", + "msg": "Token Mint in wrong order" + }, + { + "code": 6025, + "name": "RewardNotInitialized", + "msg": "Reward not initialized" + }, + { + "code": 6026, + "name": "InvalidRewardIndex", + "msg": "Invalid reward index" + }, + { + "code": 6027, + "name": "RewardVaultAmountInsufficient", + "msg": "Reward vault requires amount to support emissions for at least one day" + }, + { + "code": 6028, + "name": "FeeRateMaxExceeded", + "msg": "Exceeded max fee rate" + }, + { + "code": 6029, + "name": "ProtocolFeeRateMaxExceeded", + "msg": "Exceeded max protocol fee rate" + }, + { + "code": 6030, + "name": "MultiplicationShiftRightOverflow", + "msg": "Multiplication with shift right overflow" + }, + { + "code": 6031, + "name": "MulDivOverflow", + "msg": "Muldiv overflow" + }, + { + "code": 6032, + "name": "MulDivInvalidInput", + "msg": "Invalid div_u256 input" + }, + { + "code": 6033, + "name": "MultiplicationOverflow", + "msg": "Multiplication overflow" + }, + { + "code": 6034, + "name": "InvalidSqrtPriceLimitDirection", + "msg": "Provided SqrtPriceLimit not in the same direction as the swap." + }, + { + "code": 6035, + "name": "ZeroTradableAmount", + "msg": "There are no tradable amount to swap." + }, + { + "code": 6036, + "name": "AmountOutBelowMinimum", + "msg": "Amount out below minimum threshold" + }, + { + "code": 6037, + "name": "AmountInAboveMaximum", + "msg": "Amount in above maximum threshold" + }, + { + "code": 6038, + "name": "TickArraySequenceInvalidIndex", + "msg": "Invalid index for tick array sequence" + }, + { + "code": 6039, + "name": "AmountCalcOverflow", + "msg": "Amount calculated overflows" + }, + { + "code": 6040, + "name": "AmountRemainingOverflow", + "msg": "Amount remaining overflows" + }, + { + "code": 6041, + "name": "InvalidIntermediaryMint", + "msg": "Invalid intermediary mint" + }, + { + "code": 6042, + "name": "DuplicateTwoHopPool", + "msg": "Duplicate two hop pool" + }, + { + "code": 6043, + "name": "InvalidBundleIndex", + "msg": "Bundle index is out of bounds" + }, + { + "code": 6044, + "name": "BundledPositionAlreadyOpened", + "msg": "Position has already been opened" + }, + { + "code": 6045, + "name": "BundledPositionAlreadyClosed", + "msg": "Position has already been closed" + }, + { + "code": 6046, + "name": "PositionBundleNotDeletable", + "msg": "Unable to delete PositionBundle with open positions" + }, + { + "code": 6047, + "name": "UnsupportedTokenMint", + "msg": "Token mint has unsupported attributes" + }, + { + "code": 6048, + "name": "RemainingAccountsInvalidSlice", + "msg": "Invalid remaining accounts" + }, + { + "code": 6049, + "name": "RemainingAccountsInsufficient", + "msg": "Insufficient remaining accounts" + }, + { + "code": 6050, + "name": "NoExtraAccountsForTransferHook", + "msg": "Unable to call transfer hook without extra accounts" + }, + { + "code": 6051, + "name": "IntermediateTokenAmountMismatch", + "msg": "Output and input amount mismatch" + }, + { + "code": 6052, + "name": "TransferFeeCalculationError", + "msg": "Transfer fee calculation failed" + }, + { + "code": 6053, + "name": "RemainingAccountsDuplicatedAccountsType", + "msg": "Same accounts type is provided more than once" + }, + { + "code": 6054, + "name": "FullRangeOnlyPool", + "msg": "This whirlpool only supports full-range positions" + }, + { + "code": 6055, + "name": "TooManySupplementalTickArrays", + "msg": "Too many supplemental tick arrays provided" + }, + { + "code": 6056, + "name": "DifferentWhirlpoolTickArrayAccount", + "msg": "TickArray account for different whirlpool provided" + }, + { + "code": 6057, + "name": "PartialFillError", + "msg": "Trade resulted in partial fill" + }, + { + "code": 6058, + "name": "PositionNotLockable", + "msg": "Position is not lockable" + }, + { + "code": 6059, + "name": "OperationNotAllowedOnLockedPosition", + "msg": "Operation not allowed on locked position" + }, + { + "code": 6060, + "name": "SameTickRangeNotAllowed", + "msg": "Cannot reset position range with same tick range" + }, + { + "code": 6061, + "name": "InvalidAdaptiveFeeConstants", + "msg": "Invalid adaptive fee constants" + }, + { + "code": 6062, + "name": "InvalidFeeTierIndex", + "msg": "Invalid fee tier index" + }, + { + "code": 6063, + "name": "InvalidTradeEnableTimestamp", + "msg": "Invalid trade enable timestamp" + }, + { + "code": 6064, + "name": "TradeIsNotEnabled", + "msg": "Trade is not enabled yet" + } + ] +} diff --git a/idl/pump_amm.json b/idl/pump_amm.json new file mode 100644 index 0000000..a0d4167 --- /dev/null +++ b/idl/pump_amm.json @@ -0,0 +1,5878 @@ +{ + "address": "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA", + "metadata": { + "name": "pump_amm", + "version": "0.1.0", + "spec": "0.1.0", + "description": "Created with Anchor" + }, + "instructions": [ + { + "name": "admin_set_coin_creator", + "docs": [ + "Overrides the coin creator for a canonical pump pool" + ], + "discriminator": [ + 242, + 40, + 117, + 145, + 73, + 96, + 105, + 104 + ], + "accounts": [ + { + "name": "admin_set_coin_creator_authority", + "signer": true, + "relations": [ + "global_config" + ] + }, + { + "name": "global_config" + }, + { + "name": "pool", + "writable": true + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "coin_creator", + "type": "pubkey" + } + ] + }, + { + "name": "admin_update_token_incentives", + "discriminator": [ + 209, + 11, + 115, + 87, + 213, + 23, + 124, + 204 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true, + "relations": [ + "global_config" + ] + }, + { + "name": "global_config", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108, + 95, + 99, + 111, + 110, + 102, + 105, + 103 + ] + } + ] + } + }, + { + "name": "global_volume_accumulator", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108, + 95, + 118, + 111, + 108, + 117, + 109, + 101, + 95, + 97, + 99, + 99, + 117, + 109, + 117, + 108, + 97, + 116, + 111, + 114 + ] + } + ] + } + }, + { + "name": "mint" + }, + { + "name": "global_incentive_token_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "global_volume_accumulator" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "associated_token_program", + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "token_program" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "start_time", + "type": "i64" + }, + { + "name": "end_time", + "type": "i64" + }, + { + "name": "seconds_in_a_day", + "type": "i64" + }, + { + "name": "day_number", + "type": "u64" + }, + { + "name": "token_supply_per_day", + "type": "u64" + } + ] + }, + { + "name": "buy", + "discriminator": [ + 102, + 6, + 61, + 18, + 1, + 218, + 235, + 234 + ], + "accounts": [ + { + "name": "pool", + "writable": true + }, + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "base_mint", + "relations": [ + "pool" + ] + }, + { + "name": "quote_mint", + "relations": [ + "pool" + ] + }, + { + "name": "user_base_token_account", + "writable": true + }, + { + "name": "user_quote_token_account", + "writable": true + }, + { + "name": "pool_base_token_account", + "writable": true, + "relations": [ + "pool" + ] + }, + { + "name": "pool_quote_token_account", + "writable": true, + "relations": [ + "pool" + ] + }, + { + "name": "protocol_fee_recipient" + }, + { + "name": "protocol_fee_recipient_token_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "protocol_fee_recipient" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "base_token_program" + }, + { + "name": "quote_token_program" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "associated_token_program", + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program", + "address": "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA" + }, + { + "name": "coin_creator_vault_ata", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "coin_creator_vault_authority" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "coin_creator_vault_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 99, + 114, + 101, + 97, + 116, + 111, + 114, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "pool.coin_creator", + "account": "Pool" + } + ] + } + }, + { + "name": "global_volume_accumulator", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108, + 95, + 118, + 111, + 108, + 117, + 109, + 101, + 95, + 97, + 99, + 99, + 117, + 109, + 117, + 108, + 97, + 116, + 111, + 114 + ] + } + ] + } + }, + { + "name": "user_volume_accumulator", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 117, + 115, + 101, + 114, + 95, + 118, + 111, + 108, + 117, + 109, + 101, + 95, + 97, + 99, + 99, + 117, + 109, + 117, + 108, + 97, + 116, + 111, + 114 + ] + }, + { + "kind": "account", + "path": "user" + } + ] + } + }, + { + "name": "fee_config", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 102, + 101, + 101, + 95, + 99, + 111, + 110, + 102, + 105, + 103 + ] + }, + { + "kind": "const", + "value": [ + 12, + 20, + 222, + 252, + 130, + 94, + 198, + 118, + 148, + 37, + 8, + 24, + 187, + 101, + 64, + 101, + 244, + 41, + 141, + 49, + 86, + 213, + 113, + 180, + 212, + 248, + 9, + 12, + 24, + 233, + 168, + 99 + ] + } + ], + "program": { + "kind": "account", + "path": "fee_program" + } + } + }, + { + "name": "fee_program", + "address": "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ" + } + ], + "args": [ + { + "name": "base_amount_out", + "type": "u64" + }, + { + "name": "max_quote_amount_in", + "type": "u64" + }, + { + "name": "track_volume", + "type": { + "defined": { + "name": "OptionBool" + } + } + } + ] + }, + { + "name": "buy_exact_quote_in", + "docs": [ + "Given a budget of spendable_quote_in, buy at least min_base_amount_out", + "Fees will be deducted from spendable_quote_in", + "", + "f(quote) = tokens, where tokens >= min_base_amount_out", + "", + "Make sure the payer has enough SOL to cover creation of the following accounts (unless already created):", + "- protocol_fee_recipient_token_account: rent.minimum_balance(TokenAccount::LEN)", + "- coin_creator_vault_ata: rent.minimum_balance(TokenAccount::LEN)", + "- user_volume_accumulator: rent.minimum_balance(UserVolumeAccumulator::LEN)" + ], + "discriminator": [ + 198, + 46, + 21, + 82, + 180, + 217, + 232, + 112 + ], + "accounts": [ + { + "name": "pool", + "writable": true + }, + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "base_mint", + "relations": [ + "pool" + ] + }, + { + "name": "quote_mint", + "relations": [ + "pool" + ] + }, + { + "name": "user_base_token_account", + "writable": true + }, + { + "name": "user_quote_token_account", + "writable": true + }, + { + "name": "pool_base_token_account", + "writable": true, + "relations": [ + "pool" + ] + }, + { + "name": "pool_quote_token_account", + "writable": true, + "relations": [ + "pool" + ] + }, + { + "name": "protocol_fee_recipient" + }, + { + "name": "protocol_fee_recipient_token_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "protocol_fee_recipient" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "base_token_program" + }, + { + "name": "quote_token_program" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "associated_token_program", + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program", + "address": "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA" + }, + { + "name": "coin_creator_vault_ata", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "coin_creator_vault_authority" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "coin_creator_vault_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 99, + 114, + 101, + 97, + 116, + 111, + 114, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "pool.coin_creator", + "account": "Pool" + } + ] + } + }, + { + "name": "global_volume_accumulator", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108, + 95, + 118, + 111, + 108, + 117, + 109, + 101, + 95, + 97, + 99, + 99, + 117, + 109, + 117, + 108, + 97, + 116, + 111, + 114 + ] + } + ] + } + }, + { + "name": "user_volume_accumulator", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 117, + 115, + 101, + 114, + 95, + 118, + 111, + 108, + 117, + 109, + 101, + 95, + 97, + 99, + 99, + 117, + 109, + 117, + 108, + 97, + 116, + 111, + 114 + ] + }, + { + "kind": "account", + "path": "user" + } + ] + } + }, + { + "name": "fee_config", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 102, + 101, + 101, + 95, + 99, + 111, + 110, + 102, + 105, + 103 + ] + }, + { + "kind": "const", + "value": [ + 12, + 20, + 222, + 252, + 130, + 94, + 198, + 118, + 148, + 37, + 8, + 24, + 187, + 101, + 64, + 101, + 244, + 41, + 141, + 49, + 86, + 213, + 113, + 180, + 212, + 248, + 9, + 12, + 24, + 233, + 168, + 99 + ] + } + ], + "program": { + "kind": "account", + "path": "fee_program" + } + } + }, + { + "name": "fee_program", + "address": "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ" + } + ], + "args": [ + { + "name": "spendable_quote_in", + "type": "u64" + }, + { + "name": "min_base_amount_out", + "type": "u64" + }, + { + "name": "track_volume", + "type": { + "defined": { + "name": "OptionBool" + } + } + } + ] + }, + { + "name": "claim_token_incentives", + "discriminator": [ + 16, + 4, + 71, + 28, + 204, + 1, + 40, + 27 + ], + "accounts": [ + { + "name": "user" + }, + { + "name": "user_ata", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "user" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "global_volume_accumulator", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108, + 95, + 118, + 111, + 108, + 117, + 109, + 101, + 95, + 97, + 99, + 99, + 117, + 109, + 117, + 108, + 97, + 116, + 111, + 114 + ] + } + ] + } + }, + { + "name": "global_incentive_token_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "global_volume_accumulator" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "user_volume_accumulator", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 117, + 115, + 101, + 114, + 95, + 118, + 111, + 108, + 117, + 109, + 101, + 95, + 97, + 99, + 99, + 117, + 109, + 117, + 108, + 97, + 116, + 111, + 114 + ] + }, + { + "kind": "account", + "path": "user" + } + ] + } + }, + { + "name": "mint", + "relations": [ + "global_volume_accumulator" + ] + }, + { + "name": "token_program" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "associated_token_program", + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program", + "address": "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA" + }, + { + "name": "payer", + "writable": true, + "signer": true + } + ], + "args": [] + }, + { + "name": "close_user_volume_accumulator", + "discriminator": [ + 249, + 69, + 164, + 218, + 150, + 103, + 84, + 138 + ], + "accounts": [ + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "user_volume_accumulator", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 117, + 115, + 101, + 114, + 95, + 118, + 111, + 108, + 117, + 109, + 101, + 95, + 97, + 99, + 99, + 117, + 109, + 117, + 108, + 97, + 116, + 111, + 114 + ] + }, + { + "kind": "account", + "path": "user" + } + ] + } + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [] + }, + { + "name": "collect_coin_creator_fee", + "discriminator": [ + 160, + 57, + 89, + 42, + 181, + 139, + 43, + 66 + ], + "accounts": [ + { + "name": "quote_mint" + }, + { + "name": "quote_token_program" + }, + { + "name": "coin_creator" + }, + { + "name": "coin_creator_vault_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 99, + 114, + 101, + 97, + 116, + 111, + 114, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "coin_creator" + } + ] + } + }, + { + "name": "coin_creator_vault_ata", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "coin_creator_vault_authority" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "coin_creator_token_account", + "writable": true + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [] + }, + { + "name": "create_config", + "discriminator": [ + 201, + 207, + 243, + 114, + 75, + 111, + 47, + 189 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true, + "address": "8LWu7QM2dGR1G8nKDHthckea57bkCzXyBTAKPJUBDHo8" + }, + { + "name": "global_config", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108, + 95, + 99, + 111, + 110, + 102, + 105, + 103 + ] + } + ] + } + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "lp_fee_basis_points", + "type": "u64" + }, + { + "name": "protocol_fee_basis_points", + "type": "u64" + }, + { + "name": "protocol_fee_recipients", + "type": { + "array": [ + "pubkey", + 8 + ] + } + }, + { + "name": "coin_creator_fee_basis_points", + "type": "u64" + }, + { + "name": "admin_set_coin_creator_authority", + "type": "pubkey" + } + ] + }, + { + "name": "create_pool", + "discriminator": [ + 233, + 146, + 209, + 142, + 207, + 104, + 64, + 188 + ], + "accounts": [ + { + "name": "pool", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 111, + 108 + ] + }, + { + "kind": "arg", + "path": "index" + }, + { + "kind": "account", + "path": "creator" + }, + { + "kind": "account", + "path": "base_mint" + }, + { + "kind": "account", + "path": "quote_mint" + } + ] + } + }, + { + "name": "global_config" + }, + { + "name": "creator", + "writable": true, + "signer": true + }, + { + "name": "base_mint" + }, + { + "name": "quote_mint" + }, + { + "name": "lp_mint", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 111, + 108, + 95, + 108, + 112, + 95, + 109, + 105, + 110, + 116 + ] + }, + { + "kind": "account", + "path": "pool" + } + ] + } + }, + { + "name": "user_base_token_account", + "writable": true + }, + { + "name": "user_quote_token_account", + "writable": true + }, + { + "name": "user_pool_token_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "creator" + }, + { + "kind": "account", + "path": "token_2022_program" + }, + { + "kind": "account", + "path": "lp_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "pool_base_token_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "pool" + }, + { + "kind": "account", + "path": "base_token_program" + }, + { + "kind": "account", + "path": "base_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "pool_quote_token_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "pool" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "token_2022_program", + "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" + }, + { + "name": "base_token_program" + }, + { + "name": "quote_token_program" + }, + { + "name": "associated_token_program", + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "index", + "type": "u16" + }, + { + "name": "base_amount_in", + "type": "u64" + }, + { + "name": "quote_amount_in", + "type": "u64" + }, + { + "name": "coin_creator", + "type": "pubkey" + }, + { + "name": "is_mayhem_mode", + "type": "bool" + } + ] + }, + { + "name": "deposit", + "discriminator": [ + 242, + 35, + 198, + 137, + 82, + 225, + 242, + 182 + ], + "accounts": [ + { + "name": "pool", + "writable": true + }, + { + "name": "global_config" + }, + { + "name": "user", + "signer": true + }, + { + "name": "base_mint", + "relations": [ + "pool" + ] + }, + { + "name": "quote_mint", + "relations": [ + "pool" + ] + }, + { + "name": "lp_mint", + "writable": true, + "relations": [ + "pool" + ] + }, + { + "name": "user_base_token_account", + "writable": true + }, + { + "name": "user_quote_token_account", + "writable": true + }, + { + "name": "user_pool_token_account", + "writable": true + }, + { + "name": "pool_base_token_account", + "writable": true, + "relations": [ + "pool" + ] + }, + { + "name": "pool_quote_token_account", + "writable": true, + "relations": [ + "pool" + ] + }, + { + "name": "token_program", + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "token_2022_program", + "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "lp_token_amount_out", + "type": "u64" + }, + { + "name": "max_base_amount_in", + "type": "u64" + }, + { + "name": "max_quote_amount_in", + "type": "u64" + } + ] + }, + { + "name": "disable", + "discriminator": [ + 185, + 173, + 187, + 90, + 216, + 15, + 238, + 233 + ], + "accounts": [ + { + "name": "admin", + "signer": true, + "relations": [ + "global_config" + ] + }, + { + "name": "global_config", + "writable": true + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "disable_create_pool", + "type": "bool" + }, + { + "name": "disable_deposit", + "type": "bool" + }, + { + "name": "disable_withdraw", + "type": "bool" + }, + { + "name": "disable_buy", + "type": "bool" + }, + { + "name": "disable_sell", + "type": "bool" + } + ] + }, + { + "name": "extend_account", + "discriminator": [ + 234, + 102, + 194, + 203, + 150, + 72, + 62, + 229 + ], + "accounts": [ + { + "name": "account", + "writable": true + }, + { + "name": "user", + "signer": true + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [] + }, + { + "name": "init_user_volume_accumulator", + "discriminator": [ + 94, + 6, + 202, + 115, + 255, + 96, + 232, + 183 + ], + "accounts": [ + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "user" + }, + { + "name": "user_volume_accumulator", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 117, + 115, + 101, + 114, + 95, + 118, + 111, + 108, + 117, + 109, + 101, + 95, + 97, + 99, + 99, + 117, + 109, + 117, + 108, + 97, + 116, + 111, + 114 + ] + }, + { + "kind": "account", + "path": "user" + } + ] + } + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [] + }, + { + "name": "migrate_pool_coin_creator", + "docs": [ + "Migrate Pool Coin Creator to Sharing Config" + ], + "discriminator": [ + 208, + 8, + 159, + 4, + 74, + 175, + 16, + 58 + ], + "accounts": [ + { + "name": "pool", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 111, + 108 + ] + }, + { + "kind": "account", + "path": "pool.index", + "account": "Pool" + }, + { + "kind": "account", + "path": "pool.creator", + "account": "Pool" + }, + { + "kind": "account", + "path": "pool.base_mint", + "account": "Pool" + }, + { + "kind": "account", + "path": "pool.quote_mint", + "account": "Pool" + } + ] + } + }, + { + "name": "sharing_config", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 115, + 104, + 97, + 114, + 105, + 110, + 103, + 45, + 99, + 111, + 110, + 102, + 105, + 103 + ] + }, + { + "kind": "account", + "path": "pool.base_mint", + "account": "Pool" + } + ], + "program": { + "kind": "const", + "value": [ + 12, + 53, + 255, + 169, + 5, + 90, + 142, + 86, + 141, + 168, + 247, + 188, + 7, + 86, + 21, + 39, + 76, + 241, + 201, + 44, + 164, + 31, + 64, + 0, + 156, + 81, + 106, + 164, + 20, + 194, + 124, + 112 + ] + } + } + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [] + }, + { + "name": "sell", + "discriminator": [ + 51, + 230, + 133, + 164, + 1, + 127, + 131, + 173 + ], + "accounts": [ + { + "name": "pool", + "writable": true + }, + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "base_mint", + "relations": [ + "pool" + ] + }, + { + "name": "quote_mint", + "relations": [ + "pool" + ] + }, + { + "name": "user_base_token_account", + "writable": true + }, + { + "name": "user_quote_token_account", + "writable": true + }, + { + "name": "pool_base_token_account", + "writable": true, + "relations": [ + "pool" + ] + }, + { + "name": "pool_quote_token_account", + "writable": true, + "relations": [ + "pool" + ] + }, + { + "name": "protocol_fee_recipient" + }, + { + "name": "protocol_fee_recipient_token_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "protocol_fee_recipient" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "base_token_program" + }, + { + "name": "quote_token_program" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "associated_token_program", + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program", + "address": "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA" + }, + { + "name": "coin_creator_vault_ata", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "coin_creator_vault_authority" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "coin_creator_vault_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 99, + 114, + 101, + 97, + 116, + 111, + 114, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "pool.coin_creator", + "account": "Pool" + } + ] + } + }, + { + "name": "fee_config", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 102, + 101, + 101, + 95, + 99, + 111, + 110, + 102, + 105, + 103 + ] + }, + { + "kind": "const", + "value": [ + 12, + 20, + 222, + 252, + 130, + 94, + 198, + 118, + 148, + 37, + 8, + 24, + 187, + 101, + 64, + 101, + 244, + 41, + 141, + 49, + 86, + 213, + 113, + 180, + 212, + 248, + 9, + 12, + 24, + 233, + 168, + 99 + ] + } + ], + "program": { + "kind": "account", + "path": "fee_program" + } + } + }, + { + "name": "fee_program", + "address": "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ" + } + ], + "args": [ + { + "name": "base_amount_in", + "type": "u64" + }, + { + "name": "min_quote_amount_out", + "type": "u64" + } + ] + }, + { + "name": "set_coin_creator", + "docs": [ + "Sets Pool::coin_creator from Metaplex metadata creator or BondingCurve::creator" + ], + "discriminator": [ + 210, + 149, + 128, + 45, + 188, + 58, + 78, + 175 + ], + "accounts": [ + { + "name": "pool", + "writable": true + }, + { + "name": "metadata", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 109, + 101, + 116, + 97, + 100, + 97, + 116, + 97 + ] + }, + { + "kind": "const", + "value": [ + 11, + 112, + 101, + 177, + 227, + 209, + 124, + 69, + 56, + 157, + 82, + 127, + 107, + 4, + 195, + 205, + 88, + 184, + 108, + 115, + 26, + 160, + 253, + 181, + 73, + 182, + 209, + 188, + 3, + 248, + 41, + 70 + ] + }, + { + "kind": "account", + "path": "pool.base_mint", + "account": "Pool" + } + ], + "program": { + "kind": "const", + "value": [ + 11, + 112, + 101, + 177, + 227, + 209, + 124, + 69, + 56, + 157, + 82, + 127, + 107, + 4, + 195, + 205, + 88, + 184, + 108, + 115, + 26, + 160, + 253, + 181, + 73, + 182, + 209, + 188, + 3, + 248, + 41, + 70 + ] + } + } + }, + { + "name": "bonding_curve", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 98, + 111, + 110, + 100, + 105, + 110, + 103, + 45, + 99, + 117, + 114, + 118, + 101 + ] + }, + { + "kind": "account", + "path": "pool.base_mint", + "account": "Pool" + } + ], + "program": { + "kind": "const", + "value": [ + 1, + 86, + 224, + 246, + 147, + 102, + 90, + 207, + 68, + 219, + 21, + 104, + 191, + 23, + 91, + 170, + 81, + 137, + 203, + 151, + 245, + 210, + 255, + 59, + 101, + 93, + 43, + 182, + 253, + 109, + 24, + 176 + ] + } + } + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [] + }, + { + "name": "set_reserved_fee_recipients", + "discriminator": [ + 111, + 172, + 162, + 232, + 114, + 89, + 213, + 142 + ], + "accounts": [ + { + "name": "global_config", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108, + 95, + 99, + 111, + 110, + 102, + 105, + 103 + ] + } + ] + } + }, + { + "name": "admin", + "signer": true, + "relations": [ + "global_config" + ] + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "whitelist_pda", + "type": "pubkey" + } + ] + }, + { + "name": "sync_user_volume_accumulator", + "discriminator": [ + 86, + 31, + 192, + 87, + 163, + 87, + 79, + 238 + ], + "accounts": [ + { + "name": "user" + }, + { + "name": "global_volume_accumulator", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108, + 95, + 118, + 111, + 108, + 117, + 109, + 101, + 95, + 97, + 99, + 99, + 117, + 109, + 117, + 108, + 97, + 116, + 111, + 114 + ] + } + ] + } + }, + { + "name": "user_volume_accumulator", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 117, + 115, + 101, + 114, + 95, + 118, + 111, + 108, + 117, + 109, + 101, + 95, + 97, + 99, + 99, + 117, + 109, + 117, + 108, + 97, + 116, + 111, + 114 + ] + }, + { + "kind": "account", + "path": "user" + } + ] + } + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [] + }, + { + "name": "toggle_mayhem_mode", + "discriminator": [ + 1, + 9, + 111, + 208, + 100, + 31, + 255, + 163 + ], + "accounts": [ + { + "name": "admin", + "signer": true, + "relations": [ + "global_config" + ] + }, + { + "name": "global_config", + "writable": true + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "transfer_creator_fees_to_pump", + "docs": [ + "Transfer creator fees to pump creator vault", + "If coin creator fees are currently below rent.minimum_balance(TokenAccount::LEN)", + "The transfer will be skipped" + ], + "discriminator": [ + 139, + 52, + 134, + 85, + 228, + 229, + 108, + 241 + ], + "accounts": [ + { + "name": "wsol_mint", + "docs": [ + "Pump Canonical Pool are quoted in wSOL" + ] + }, + { + "name": "token_program" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "associated_token_program", + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "coin_creator" + }, + { + "name": "coin_creator_vault_authority", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 99, + 114, + 101, + 97, + 116, + 111, + 114, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "coin_creator" + } + ] + } + }, + { + "name": "coin_creator_vault_ata", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "coin_creator_vault_authority" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "wsol_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "pump_creator_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 99, + 114, + 101, + 97, + 116, + 111, + 114, + 45, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "coin_creator" + } + ], + "program": { + "kind": "const", + "value": [ + 1, + 86, + 224, + 246, + 147, + 102, + 90, + 207, + 68, + 219, + 21, + 104, + 191, + 23, + 91, + 170, + 81, + 137, + 203, + 151, + 245, + 210, + 255, + 59, + 101, + 93, + 43, + 182, + 253, + 109, + 24, + 176 + ] + } + } + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [] + }, + { + "name": "update_admin", + "discriminator": [ + 161, + 176, + 40, + 213, + 60, + 184, + 179, + 228 + ], + "accounts": [ + { + "name": "admin", + "signer": true, + "relations": [ + "global_config" + ] + }, + { + "name": "global_config", + "writable": true + }, + { + "name": "new_admin" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [] + }, + { + "name": "update_fee_config", + "discriminator": [ + 104, + 184, + 103, + 242, + 88, + 151, + 107, + 20 + ], + "accounts": [ + { + "name": "admin", + "signer": true, + "relations": [ + "global_config" + ] + }, + { + "name": "global_config", + "writable": true + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "lp_fee_basis_points", + "type": "u64" + }, + { + "name": "protocol_fee_basis_points", + "type": "u64" + }, + { + "name": "protocol_fee_recipients", + "type": { + "array": [ + "pubkey", + 8 + ] + } + }, + { + "name": "coin_creator_fee_basis_points", + "type": "u64" + }, + { + "name": "admin_set_coin_creator_authority", + "type": "pubkey" + } + ] + }, + { + "name": "withdraw", + "discriminator": [ + 183, + 18, + 70, + 156, + 148, + 109, + 161, + 34 + ], + "accounts": [ + { + "name": "pool", + "writable": true + }, + { + "name": "global_config" + }, + { + "name": "user", + "signer": true + }, + { + "name": "base_mint", + "relations": [ + "pool" + ] + }, + { + "name": "quote_mint", + "relations": [ + "pool" + ] + }, + { + "name": "lp_mint", + "writable": true, + "relations": [ + "pool" + ] + }, + { + "name": "user_base_token_account", + "writable": true + }, + { + "name": "user_quote_token_account", + "writable": true + }, + { + "name": "user_pool_token_account", + "writable": true + }, + { + "name": "pool_base_token_account", + "writable": true, + "relations": [ + "pool" + ] + }, + { + "name": "pool_quote_token_account", + "writable": true, + "relations": [ + "pool" + ] + }, + { + "name": "token_program", + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "token_2022_program", + "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "lp_token_amount_in", + "type": "u64" + }, + { + "name": "min_base_amount_out", + "type": "u64" + }, + { + "name": "min_quote_amount_out", + "type": "u64" + } + ] + } + ], + "accounts": [ + { + "name": "BondingCurve", + "discriminator": [ + 23, + 183, + 248, + 55, + 96, + 216, + 172, + 96 + ] + }, + { + "name": "FeeConfig", + "discriminator": [ + 143, + 52, + 146, + 187, + 219, + 123, + 76, + 155 + ] + }, + { + "name": "GlobalConfig", + "discriminator": [ + 149, + 8, + 156, + 202, + 160, + 252, + 176, + 217 + ] + }, + { + "name": "GlobalVolumeAccumulator", + "discriminator": [ + 202, + 42, + 246, + 43, + 142, + 190, + 30, + 255 + ] + }, + { + "name": "Pool", + "discriminator": [ + 241, + 154, + 109, + 4, + 17, + 177, + 109, + 188 + ] + }, + { + "name": "SharingConfig", + "discriminator": [ + 216, + 74, + 9, + 0, + 56, + 140, + 93, + 75 + ] + }, + { + "name": "UserVolumeAccumulator", + "discriminator": [ + 86, + 255, + 112, + 14, + 102, + 53, + 154, + 250 + ] + } + ], + "events": [ + { + "name": "AdminSetCoinCreatorEvent", + "discriminator": [ + 45, + 220, + 93, + 24, + 25, + 97, + 172, + 104 + ] + }, + { + "name": "AdminUpdateTokenIncentivesEvent", + "discriminator": [ + 147, + 250, + 108, + 120, + 247, + 29, + 67, + 222 + ] + }, + { + "name": "BuyEvent", + "discriminator": [ + 103, + 244, + 82, + 31, + 44, + 245, + 119, + 119 + ] + }, + { + "name": "ClaimTokenIncentivesEvent", + "discriminator": [ + 79, + 172, + 246, + 49, + 205, + 91, + 206, + 232 + ] + }, + { + "name": "CloseUserVolumeAccumulatorEvent", + "discriminator": [ + 146, + 159, + 189, + 172, + 146, + 88, + 56, + 244 + ] + }, + { + "name": "CollectCoinCreatorFeeEvent", + "discriminator": [ + 232, + 245, + 194, + 238, + 234, + 218, + 58, + 89 + ] + }, + { + "name": "CreateConfigEvent", + "discriminator": [ + 107, + 52, + 89, + 129, + 55, + 226, + 81, + 22 + ] + }, + { + "name": "CreatePoolEvent", + "discriminator": [ + 177, + 49, + 12, + 210, + 160, + 118, + 167, + 116 + ] + }, + { + "name": "DepositEvent", + "discriminator": [ + 120, + 248, + 61, + 83, + 31, + 142, + 107, + 144 + ] + }, + { + "name": "DisableEvent", + "discriminator": [ + 107, + 253, + 193, + 76, + 228, + 202, + 27, + 104 + ] + }, + { + "name": "ExtendAccountEvent", + "discriminator": [ + 97, + 97, + 215, + 144, + 93, + 146, + 22, + 124 + ] + }, + { + "name": "InitUserVolumeAccumulatorEvent", + "discriminator": [ + 134, + 36, + 13, + 72, + 232, + 101, + 130, + 216 + ] + }, + { + "name": "MigratePoolCoinCreatorEvent", + "discriminator": [ + 170, + 221, + 82, + 199, + 147, + 165, + 247, + 46 + ] + }, + { + "name": "ReservedFeeRecipientsEvent", + "discriminator": [ + 43, + 188, + 250, + 18, + 221, + 75, + 187, + 95 + ] + }, + { + "name": "SellEvent", + "discriminator": [ + 62, + 47, + 55, + 10, + 165, + 3, + 220, + 42 + ] + }, + { + "name": "SetBondingCurveCoinCreatorEvent", + "discriminator": [ + 242, + 231, + 235, + 102, + 65, + 99, + 189, + 211 + ] + }, + { + "name": "SetMetaplexCoinCreatorEvent", + "discriminator": [ + 150, + 107, + 199, + 123, + 124, + 207, + 102, + 228 + ] + }, + { + "name": "SyncUserVolumeAccumulatorEvent", + "discriminator": [ + 197, + 122, + 167, + 124, + 116, + 81, + 91, + 255 + ] + }, + { + "name": "UpdateAdminEvent", + "discriminator": [ + 225, + 152, + 171, + 87, + 246, + 63, + 66, + 234 + ] + }, + { + "name": "UpdateFeeConfigEvent", + "discriminator": [ + 90, + 23, + 65, + 35, + 62, + 244, + 188, + 208 + ] + }, + { + "name": "WithdrawEvent", + "discriminator": [ + 22, + 9, + 133, + 26, + 160, + 44, + 71, + 192 + ] + } + ], + "errors": [ + { + "code": 6000, + "name": "FeeBasisPointsExceedsMaximum" + }, + { + "code": 6001, + "name": "ZeroBaseAmount" + }, + { + "code": 6002, + "name": "ZeroQuoteAmount" + }, + { + "code": 6003, + "name": "TooLittlePoolTokenLiquidity" + }, + { + "code": 6004, + "name": "ExceededSlippage" + }, + { + "code": 6005, + "name": "InvalidAdmin" + }, + { + "code": 6006, + "name": "UnsupportedBaseMint" + }, + { + "code": 6007, + "name": "UnsupportedQuoteMint" + }, + { + "code": 6008, + "name": "InvalidBaseMint" + }, + { + "code": 6009, + "name": "InvalidQuoteMint" + }, + { + "code": 6010, + "name": "InvalidLpMint" + }, + { + "code": 6011, + "name": "AllProtocolFeeRecipientsShouldBeNonZero" + }, + { + "code": 6012, + "name": "UnsortedNotUniqueProtocolFeeRecipients" + }, + { + "code": 6013, + "name": "InvalidProtocolFeeRecipient" + }, + { + "code": 6014, + "name": "InvalidPoolBaseTokenAccount" + }, + { + "code": 6015, + "name": "InvalidPoolQuoteTokenAccount" + }, + { + "code": 6016, + "name": "BuyMoreBaseAmountThanPoolReserves" + }, + { + "code": 6017, + "name": "DisabledCreatePool" + }, + { + "code": 6018, + "name": "DisabledDeposit" + }, + { + "code": 6019, + "name": "DisabledWithdraw" + }, + { + "code": 6020, + "name": "DisabledBuy" + }, + { + "code": 6021, + "name": "DisabledSell" + }, + { + "code": 6022, + "name": "SameMint" + }, + { + "code": 6023, + "name": "Overflow" + }, + { + "code": 6024, + "name": "Truncation" + }, + { + "code": 6025, + "name": "DivisionByZero" + }, + { + "code": 6026, + "name": "NewSizeLessThanCurrentSize" + }, + { + "code": 6027, + "name": "AccountTypeNotSupported" + }, + { + "code": 6028, + "name": "OnlyCanonicalPumpPoolsCanHaveCoinCreator" + }, + { + "code": 6029, + "name": "InvalidAdminSetCoinCreatorAuthority" + }, + { + "code": 6030, + "name": "StartTimeInThePast" + }, + { + "code": 6031, + "name": "EndTimeInThePast" + }, + { + "code": 6032, + "name": "EndTimeBeforeStartTime" + }, + { + "code": 6033, + "name": "TimeRangeTooLarge" + }, + { + "code": 6034, + "name": "EndTimeBeforeCurrentDay" + }, + { + "code": 6035, + "name": "SupplyUpdateForFinishedRange" + }, + { + "code": 6036, + "name": "DayIndexAfterEndIndex" + }, + { + "code": 6037, + "name": "DayInActiveRange" + }, + { + "code": 6038, + "name": "InvalidIncentiveMint" + }, + { + "code": 6039, + "name": "BuyNotEnoughQuoteTokensToCoverFees", + "msg": "buy: Not enough quote tokens to cover for fees." + }, + { + "code": 6040, + "name": "BuySlippageBelowMinBaseAmountOut", + "msg": "buy: slippage - would buy less tokens than expected min_base_amount_out" + }, + { + "code": 6041, + "name": "MayhemModeDisabled" + }, + { + "code": 6042, + "name": "OnlyPumpPoolsMayhemMode" + }, + { + "code": 6043, + "name": "MayhemModeInDesiredState" + }, + { + "code": 6044, + "name": "NotEnoughRemainingAccounts" + }, + { + "code": 6045, + "name": "InvalidSharingConfigBaseMint" + }, + { + "code": 6046, + "name": "InvalidSharingConfigCoinCreator" + }, + { + "code": 6047, + "name": "CoinCreatorMigratedToSharingConfig", + "msg": "coin creator has been migrated to sharing config, use pump_fees::reset_fee_sharing_config instead" + }, + { + "code": 6048, + "name": "CreatorVaultMigratedToSharingConfig", + "msg": "creator_vault has been migrated to sharing config, use pump:distribute_creator_fees instead" + } + ], + "types": [ + { + "name": "AdminSetCoinCreatorEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "admin_set_coin_creator_authority", + "type": "pubkey" + }, + { + "name": "base_mint", + "type": "pubkey" + }, + { + "name": "pool", + "type": "pubkey" + }, + { + "name": "old_coin_creator", + "type": "pubkey" + }, + { + "name": "new_coin_creator", + "type": "pubkey" + } + ] + } + }, + { + "name": "AdminUpdateTokenIncentivesEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "start_time", + "type": "i64" + }, + { + "name": "end_time", + "type": "i64" + }, + { + "name": "day_number", + "type": "u64" + }, + { + "name": "token_supply_per_day", + "type": "u64" + }, + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "seconds_in_a_day", + "type": "i64" + }, + { + "name": "timestamp", + "type": "i64" + } + ] + } + }, + { + "name": "BondingCurve", + "type": { + "kind": "struct", + "fields": [ + { + "name": "virtual_token_reserves", + "type": "u64" + }, + { + "name": "virtual_sol_reserves", + "type": "u64" + }, + { + "name": "real_token_reserves", + "type": "u64" + }, + { + "name": "real_sol_reserves", + "type": "u64" + }, + { + "name": "token_total_supply", + "type": "u64" + }, + { + "name": "complete", + "type": "bool" + }, + { + "name": "creator", + "type": "pubkey" + }, + { + "name": "is_mayhem_mode", + "type": "bool" + } + ] + } + }, + { + "name": "BuyEvent", + "docs": [ + "ix_name: \"buy\" | \"buy_exact_quote_in\"" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "base_amount_out", + "type": "u64" + }, + { + "name": "max_quote_amount_in", + "type": "u64" + }, + { + "name": "user_base_token_reserves", + "type": "u64" + }, + { + "name": "user_quote_token_reserves", + "type": "u64" + }, + { + "name": "pool_base_token_reserves", + "type": "u64" + }, + { + "name": "pool_quote_token_reserves", + "type": "u64" + }, + { + "name": "quote_amount_in", + "type": "u64" + }, + { + "name": "lp_fee_basis_points", + "type": "u64" + }, + { + "name": "lp_fee", + "type": "u64" + }, + { + "name": "protocol_fee_basis_points", + "type": "u64" + }, + { + "name": "protocol_fee", + "type": "u64" + }, + { + "name": "quote_amount_in_with_lp_fee", + "type": "u64" + }, + { + "name": "user_quote_amount_in", + "type": "u64" + }, + { + "name": "pool", + "type": "pubkey" + }, + { + "name": "user", + "type": "pubkey" + }, + { + "name": "user_base_token_account", + "type": "pubkey" + }, + { + "name": "user_quote_token_account", + "type": "pubkey" + }, + { + "name": "protocol_fee_recipient", + "type": "pubkey" + }, + { + "name": "protocol_fee_recipient_token_account", + "type": "pubkey" + }, + { + "name": "coin_creator", + "type": "pubkey" + }, + { + "name": "coin_creator_fee_basis_points", + "type": "u64" + }, + { + "name": "coin_creator_fee", + "type": "u64" + }, + { + "name": "track_volume", + "type": "bool" + }, + { + "name": "total_unclaimed_tokens", + "type": "u64" + }, + { + "name": "total_claimed_tokens", + "type": "u64" + }, + { + "name": "current_sol_volume", + "type": "u64" + }, + { + "name": "last_update_timestamp", + "type": "i64" + }, + { + "name": "min_base_amount_out", + "type": "u64" + }, + { + "name": "ix_name", + "type": "string" + } + ] + } + }, + { + "name": "ClaimTokenIncentivesEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "user", + "type": "pubkey" + }, + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "amount", + "type": "u64" + }, + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "total_claimed_tokens", + "type": "u64" + }, + { + "name": "current_sol_volume", + "type": "u64" + } + ] + } + }, + { + "name": "CloseUserVolumeAccumulatorEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "user", + "type": "pubkey" + }, + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "total_unclaimed_tokens", + "type": "u64" + }, + { + "name": "total_claimed_tokens", + "type": "u64" + }, + { + "name": "current_sol_volume", + "type": "u64" + }, + { + "name": "last_update_timestamp", + "type": "i64" + } + ] + } + }, + { + "name": "CollectCoinCreatorFeeEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "coin_creator", + "type": "pubkey" + }, + { + "name": "coin_creator_fee", + "type": "u64" + }, + { + "name": "coin_creator_vault_ata", + "type": "pubkey" + }, + { + "name": "coin_creator_token_account", + "type": "pubkey" + } + ] + } + }, + { + "name": "ConfigStatus", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Paused" + }, + { + "name": "Active" + } + ] + } + }, + { + "name": "CreateConfigEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "admin", + "type": "pubkey" + }, + { + "name": "lp_fee_basis_points", + "type": "u64" + }, + { + "name": "protocol_fee_basis_points", + "type": "u64" + }, + { + "name": "protocol_fee_recipients", + "type": { + "array": [ + "pubkey", + 8 + ] + } + }, + { + "name": "coin_creator_fee_basis_points", + "type": "u64" + }, + { + "name": "admin_set_coin_creator_authority", + "type": "pubkey" + } + ] + } + }, + { + "name": "CreatePoolEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "index", + "type": "u16" + }, + { + "name": "creator", + "type": "pubkey" + }, + { + "name": "base_mint", + "type": "pubkey" + }, + { + "name": "quote_mint", + "type": "pubkey" + }, + { + "name": "base_mint_decimals", + "type": "u8" + }, + { + "name": "quote_mint_decimals", + "type": "u8" + }, + { + "name": "base_amount_in", + "type": "u64" + }, + { + "name": "quote_amount_in", + "type": "u64" + }, + { + "name": "pool_base_amount", + "type": "u64" + }, + { + "name": "pool_quote_amount", + "type": "u64" + }, + { + "name": "minimum_liquidity", + "type": "u64" + }, + { + "name": "initial_liquidity", + "type": "u64" + }, + { + "name": "lp_token_amount_out", + "type": "u64" + }, + { + "name": "pool_bump", + "type": "u8" + }, + { + "name": "pool", + "type": "pubkey" + }, + { + "name": "lp_mint", + "type": "pubkey" + }, + { + "name": "user_base_token_account", + "type": "pubkey" + }, + { + "name": "user_quote_token_account", + "type": "pubkey" + }, + { + "name": "coin_creator", + "type": "pubkey" + }, + { + "name": "is_mayhem_mode", + "type": "bool" + } + ] + } + }, + { + "name": "DepositEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "lp_token_amount_out", + "type": "u64" + }, + { + "name": "max_base_amount_in", + "type": "u64" + }, + { + "name": "max_quote_amount_in", + "type": "u64" + }, + { + "name": "user_base_token_reserves", + "type": "u64" + }, + { + "name": "user_quote_token_reserves", + "type": "u64" + }, + { + "name": "pool_base_token_reserves", + "type": "u64" + }, + { + "name": "pool_quote_token_reserves", + "type": "u64" + }, + { + "name": "base_amount_in", + "type": "u64" + }, + { + "name": "quote_amount_in", + "type": "u64" + }, + { + "name": "lp_mint_supply", + "type": "u64" + }, + { + "name": "pool", + "type": "pubkey" + }, + { + "name": "user", + "type": "pubkey" + }, + { + "name": "user_base_token_account", + "type": "pubkey" + }, + { + "name": "user_quote_token_account", + "type": "pubkey" + }, + { + "name": "user_pool_token_account", + "type": "pubkey" + } + ] + } + }, + { + "name": "DisableEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "admin", + "type": "pubkey" + }, + { + "name": "disable_create_pool", + "type": "bool" + }, + { + "name": "disable_deposit", + "type": "bool" + }, + { + "name": "disable_withdraw", + "type": "bool" + }, + { + "name": "disable_buy", + "type": "bool" + }, + { + "name": "disable_sell", + "type": "bool" + } + ] + } + }, + { + "name": "ExtendAccountEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "account", + "type": "pubkey" + }, + { + "name": "user", + "type": "pubkey" + }, + { + "name": "current_size", + "type": "u64" + }, + { + "name": "new_size", + "type": "u64" + } + ] + } + }, + { + "name": "FeeConfig", + "type": { + "kind": "struct", + "fields": [ + { + "name": "bump", + "type": "u8" + }, + { + "name": "admin", + "type": "pubkey" + }, + { + "name": "flat_fees", + "type": { + "defined": { + "name": "Fees" + } + } + }, + { + "name": "fee_tiers", + "type": { + "vec": { + "defined": { + "name": "FeeTier" + } + } + } + } + ] + } + }, + { + "name": "FeeTier", + "type": { + "kind": "struct", + "fields": [ + { + "name": "market_cap_lamports_threshold", + "type": "u128" + }, + { + "name": "fees", + "type": { + "defined": { + "name": "Fees" + } + } + } + ] + } + }, + { + "name": "Fees", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lp_fee_bps", + "type": "u64" + }, + { + "name": "protocol_fee_bps", + "type": "u64" + }, + { + "name": "creator_fee_bps", + "type": "u64" + } + ] + } + }, + { + "name": "GlobalConfig", + "type": { + "kind": "struct", + "fields": [ + { + "name": "admin", + "docs": [ + "The admin pubkey" + ], + "type": "pubkey" + }, + { + "name": "lp_fee_basis_points", + "type": "u64" + }, + { + "name": "protocol_fee_basis_points", + "type": "u64" + }, + { + "name": "disable_flags", + "docs": [ + "Flags to disable certain functionality", + "bit 0 - Disable create pool", + "bit 1 - Disable deposit", + "bit 2 - Disable withdraw", + "bit 3 - Disable buy", + "bit 4 - Disable sell" + ], + "type": "u8" + }, + { + "name": "protocol_fee_recipients", + "docs": [ + "Addresses of the protocol fee recipients" + ], + "type": { + "array": [ + "pubkey", + 8 + ] + } + }, + { + "name": "coin_creator_fee_basis_points", + "type": "u64" + }, + { + "name": "admin_set_coin_creator_authority", + "docs": [ + "The admin authority for setting coin creators" + ], + "type": "pubkey" + }, + { + "name": "whitelist_pda", + "type": "pubkey" + }, + { + "name": "reserved_fee_recipient", + "type": "pubkey" + }, + { + "name": "mayhem_mode_enabled", + "type": "bool" + }, + { + "name": "reserved_fee_recipients", + "type": { + "array": [ + "pubkey", + 7 + ] + } + } + ] + } + }, + { + "name": "GlobalVolumeAccumulator", + "type": { + "kind": "struct", + "fields": [ + { + "name": "start_time", + "type": "i64" + }, + { + "name": "end_time", + "type": "i64" + }, + { + "name": "seconds_in_a_day", + "type": "i64" + }, + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "total_token_supply", + "type": { + "array": [ + "u64", + 30 + ] + } + }, + { + "name": "sol_volumes", + "type": { + "array": [ + "u64", + 30 + ] + } + } + ] + } + }, + { + "name": "InitUserVolumeAccumulatorEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "payer", + "type": "pubkey" + }, + { + "name": "user", + "type": "pubkey" + }, + { + "name": "timestamp", + "type": "i64" + } + ] + } + }, + { + "name": "MigratePoolCoinCreatorEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "base_mint", + "type": "pubkey" + }, + { + "name": "pool", + "type": "pubkey" + }, + { + "name": "sharing_config", + "type": "pubkey" + }, + { + "name": "old_coin_creator", + "type": "pubkey" + }, + { + "name": "new_coin_creator", + "type": "pubkey" + } + ] + } + }, + { + "name": "OptionBool", + "type": { + "kind": "struct", + "fields": [ + "bool" + ] + } + }, + { + "name": "Pool", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool_bump", + "type": "u8" + }, + { + "name": "index", + "type": "u16" + }, + { + "name": "creator", + "type": "pubkey" + }, + { + "name": "base_mint", + "type": "pubkey" + }, + { + "name": "quote_mint", + "type": "pubkey" + }, + { + "name": "lp_mint", + "type": "pubkey" + }, + { + "name": "pool_base_token_account", + "type": "pubkey" + }, + { + "name": "pool_quote_token_account", + "type": "pubkey" + }, + { + "name": "lp_supply", + "docs": [ + "True circulating supply without burns and lock-ups" + ], + "type": "u64" + }, + { + "name": "coin_creator", + "type": "pubkey" + }, + { + "name": "is_mayhem_mode", + "type": "bool" + } + ] + } + }, + { + "name": "ReservedFeeRecipientsEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "reserved_fee_recipient", + "type": "pubkey" + }, + { + "name": "reserved_fee_recipients", + "type": { + "array": [ + "pubkey", + 7 + ] + } + } + ] + } + }, + { + "name": "SellEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "base_amount_in", + "type": "u64" + }, + { + "name": "min_quote_amount_out", + "type": "u64" + }, + { + "name": "user_base_token_reserves", + "type": "u64" + }, + { + "name": "user_quote_token_reserves", + "type": "u64" + }, + { + "name": "pool_base_token_reserves", + "type": "u64" + }, + { + "name": "pool_quote_token_reserves", + "type": "u64" + }, + { + "name": "quote_amount_out", + "type": "u64" + }, + { + "name": "lp_fee_basis_points", + "type": "u64" + }, + { + "name": "lp_fee", + "type": "u64" + }, + { + "name": "protocol_fee_basis_points", + "type": "u64" + }, + { + "name": "protocol_fee", + "type": "u64" + }, + { + "name": "quote_amount_out_without_lp_fee", + "type": "u64" + }, + { + "name": "user_quote_amount_out", + "type": "u64" + }, + { + "name": "pool", + "type": "pubkey" + }, + { + "name": "user", + "type": "pubkey" + }, + { + "name": "user_base_token_account", + "type": "pubkey" + }, + { + "name": "user_quote_token_account", + "type": "pubkey" + }, + { + "name": "protocol_fee_recipient", + "type": "pubkey" + }, + { + "name": "protocol_fee_recipient_token_account", + "type": "pubkey" + }, + { + "name": "coin_creator", + "type": "pubkey" + }, + { + "name": "coin_creator_fee_basis_points", + "type": "u64" + }, + { + "name": "coin_creator_fee", + "type": "u64" + } + ] + } + }, + { + "name": "SetBondingCurveCoinCreatorEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "base_mint", + "type": "pubkey" + }, + { + "name": "pool", + "type": "pubkey" + }, + { + "name": "bonding_curve", + "type": "pubkey" + }, + { + "name": "coin_creator", + "type": "pubkey" + } + ] + } + }, + { + "name": "SetMetaplexCoinCreatorEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "base_mint", + "type": "pubkey" + }, + { + "name": "pool", + "type": "pubkey" + }, + { + "name": "metadata", + "type": "pubkey" + }, + { + "name": "coin_creator", + "type": "pubkey" + } + ] + } + }, + { + "name": "Shareholder", + "type": { + "kind": "struct", + "fields": [ + { + "name": "address", + "type": "pubkey" + }, + { + "name": "share_bps", + "type": "u16" + } + ] + } + }, + { + "name": "SharingConfig", + "type": { + "kind": "struct", + "fields": [ + { + "name": "bump", + "type": "u8" + }, + { + "name": "version", + "type": "u8" + }, + { + "name": "status", + "type": { + "defined": { + "name": "ConfigStatus" + } + } + }, + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "admin", + "type": "pubkey" + }, + { + "name": "admin_revoked", + "type": "bool" + }, + { + "name": "shareholders", + "type": { + "vec": { + "defined": { + "name": "Shareholder" + } + } + } + } + ] + } + }, + { + "name": "SyncUserVolumeAccumulatorEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "user", + "type": "pubkey" + }, + { + "name": "total_claimed_tokens_before", + "type": "u64" + }, + { + "name": "total_claimed_tokens_after", + "type": "u64" + }, + { + "name": "timestamp", + "type": "i64" + } + ] + } + }, + { + "name": "UpdateAdminEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "admin", + "type": "pubkey" + }, + { + "name": "new_admin", + "type": "pubkey" + } + ] + } + }, + { + "name": "UpdateFeeConfigEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "admin", + "type": "pubkey" + }, + { + "name": "lp_fee_basis_points", + "type": "u64" + }, + { + "name": "protocol_fee_basis_points", + "type": "u64" + }, + { + "name": "protocol_fee_recipients", + "type": { + "array": [ + "pubkey", + 8 + ] + } + }, + { + "name": "coin_creator_fee_basis_points", + "type": "u64" + }, + { + "name": "admin_set_coin_creator_authority", + "type": "pubkey" + } + ] + } + }, + { + "name": "UserVolumeAccumulator", + "type": { + "kind": "struct", + "fields": [ + { + "name": "user", + "type": "pubkey" + }, + { + "name": "needs_claim", + "type": "bool" + }, + { + "name": "total_unclaimed_tokens", + "type": "u64" + }, + { + "name": "total_claimed_tokens", + "type": "u64" + }, + { + "name": "current_sol_volume", + "type": "u64" + }, + { + "name": "last_update_timestamp", + "type": "i64" + }, + { + "name": "has_total_claimed_tokens", + "type": "bool" + } + ] + } + }, + { + "name": "WithdrawEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "lp_token_amount_in", + "type": "u64" + }, + { + "name": "min_base_amount_out", + "type": "u64" + }, + { + "name": "min_quote_amount_out", + "type": "u64" + }, + { + "name": "user_base_token_reserves", + "type": "u64" + }, + { + "name": "user_quote_token_reserves", + "type": "u64" + }, + { + "name": "pool_base_token_reserves", + "type": "u64" + }, + { + "name": "pool_quote_token_reserves", + "type": "u64" + }, + { + "name": "base_amount_out", + "type": "u64" + }, + { + "name": "quote_amount_out", + "type": "u64" + }, + { + "name": "lp_mint_supply", + "type": "u64" + }, + { + "name": "pool", + "type": "pubkey" + }, + { + "name": "user", + "type": "pubkey" + }, + { + "name": "user_base_token_account", + "type": "pubkey" + }, + { + "name": "user_quote_token_account", + "type": "pubkey" + }, + { + "name": "user_pool_token_account", + "type": "pubkey" + } + ] + } + } + ] +} diff --git a/idl/pumpfun.json b/idl/pumpfun.json new file mode 100644 index 0000000..5aff348 --- /dev/null +++ b/idl/pumpfun.json @@ -0,0 +1,6836 @@ +{ + "address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P", + "metadata": { + "name": "pump", + "version": "0.1.0", + "spec": "0.1.0", + "description": "Created with Anchor" + }, + "instructions": [ + { + "name": "admin_set_creator", + "docs": [ + "Allows Global::admin_set_creator_authority to override the bonding curve creator" + ], + "discriminator": [ + 69, + 25, + 171, + 142, + 57, + 239, + 13, + 4 + ], + "accounts": [ + { + "name": "admin_set_creator_authority", + "signer": true, + "relations": [ + "global" + ] + }, + { + "name": "global", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108 + ] + } + ] + } + }, + { + "name": "mint" + }, + { + "name": "bonding_curve", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 98, + 111, + 110, + 100, + 105, + 110, + 103, + 45, + 99, + 117, + 114, + 118, + 101 + ] + }, + { + "kind": "account", + "path": "mint" + } + ] + } + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "creator", + "type": "pubkey" + } + ] + }, + { + "name": "admin_set_idl_authority", + "discriminator": [ + 8, + 217, + 96, + 231, + 144, + 104, + 192, + 5 + ], + "accounts": [ + { + "name": "authority", + "signer": true, + "relations": [ + "global" + ] + }, + { + "name": "global", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108 + ] + } + ] + } + }, + { + "name": "idl_account", + "writable": true + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "program_signer", + "pda": { + "seeds": [] + } + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "idl_authority", + "type": "pubkey" + } + ] + }, + { + "name": "admin_update_token_incentives", + "discriminator": [ + 209, + 11, + 115, + 87, + 213, + 23, + 124, + 204 + ], + "accounts": [ + { + "name": "authority", + "writable": true, + "signer": true, + "relations": [ + "global" + ] + }, + { + "name": "global", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108 + ] + } + ] + } + }, + { + "name": "global_volume_accumulator", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108, + 95, + 118, + 111, + 108, + 117, + 109, + 101, + 95, + 97, + 99, + 99, + 117, + 109, + 117, + 108, + 97, + 116, + 111, + 114 + ] + } + ] + } + }, + { + "name": "mint" + }, + { + "name": "global_incentive_token_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "global_volume_accumulator" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "associated_token_program", + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "token_program" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "start_time", + "type": "i64" + }, + { + "name": "end_time", + "type": "i64" + }, + { + "name": "seconds_in_a_day", + "type": "i64" + }, + { + "name": "day_number", + "type": "u64" + }, + { + "name": "pump_token_supply_per_day", + "type": "u64" + } + ] + }, + { + "name": "buy", + "docs": [ + "Buys tokens from a bonding curve." + ], + "discriminator": [ + 102, + 6, + 61, + 18, + 1, + 218, + 235, + 234 + ], + "accounts": [ + { + "name": "global", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108 + ] + } + ] + } + }, + { + "name": "fee_recipient", + "writable": true + }, + { + "name": "mint" + }, + { + "name": "bonding_curve", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 98, + 111, + 110, + 100, + 105, + 110, + 103, + 45, + 99, + 117, + 114, + 118, + 101 + ] + }, + { + "kind": "account", + "path": "mint" + } + ] + } + }, + { + "name": "associated_bonding_curve", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "bonding_curve" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "associated_user", + "writable": true + }, + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "token_program" + }, + { + "name": "creator_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 99, + 114, + 101, + 97, + 116, + 111, + 114, + 45, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "bonding_curve.creator", + "account": "BondingCurve" + } + ] + } + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program", + "address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P" + }, + { + "name": "global_volume_accumulator", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108, + 95, + 118, + 111, + 108, + 117, + 109, + 101, + 95, + 97, + 99, + 99, + 117, + 109, + 117, + 108, + 97, + 116, + 111, + 114 + ] + } + ] + } + }, + { + "name": "user_volume_accumulator", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 117, + 115, + 101, + 114, + 95, + 118, + 111, + 108, + 117, + 109, + 101, + 95, + 97, + 99, + 99, + 117, + 109, + 117, + 108, + 97, + 116, + 111, + 114 + ] + }, + { + "kind": "account", + "path": "user" + } + ] + } + }, + { + "name": "fee_config", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 102, + 101, + 101, + 95, + 99, + 111, + 110, + 102, + 105, + 103 + ] + }, + { + "kind": "const", + "value": [ + 1, + 86, + 224, + 246, + 147, + 102, + 90, + 207, + 68, + 219, + 21, + 104, + 191, + 23, + 91, + 170, + 81, + 137, + 203, + 151, + 245, + 210, + 255, + 59, + 101, + 93, + 43, + 182, + 253, + 109, + 24, + 176 + ] + } + ], + "program": { + "kind": "account", + "path": "fee_program" + } + } + }, + { + "name": "fee_program", + "address": "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ" + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + }, + { + "name": "max_sol_cost", + "type": "u64" + }, + { + "name": "track_volume", + "type": { + "defined": { + "name": "OptionBool" + } + } + } + ] + }, + { + "name": "buy_exact_sol_in", + "docs": [ + "Given a budget of spendable SOL, buy at least min_tokens_out tokens.", + "Fees are deducted from spendable_sol_in.", + "", + "# Quote formulas", + "Where:", + "- total_fee_bps = protocol_fee_bps + creator_fee_bps (creator_fee_bps is 0 if no creator)", + "- floor(a/b) = a / b (integer division)", + "- ceil(a/b) = (a + b - 1) / b", + "", + "SOL → tokens quote", + "To calculate tokens_out for a given spendable_sol_in:", + "1. net_sol = floor(spendable_sol_in * 10_000 / (10_000 + total_fee_bps))", + "2. fees = ceil(net_sol * protocol_fee_bps / 10_000) + ceil(net_sol * creator_fee_bps / 10_000) (creator_fee_bps is 0 if no creator)", + "3. if net_sol + fees > spendable_sol_in: net_sol = net_sol - (net_sol + fees - spendable_sol_in)", + "4. tokens_out = floor((net_sol - 1) * virtual_token_reserves / (virtual_sol_reserves + net_sol - 1))", + "", + "Reverse quote (tokens → SOL)", + "To calculate spendable_sol_in for a desired number of tokens:", + "1. net_sol = ceil(tokens * virtual_sol_reserves / (virtual_token_reserves - tokens)) + 1", + "2. spendable_sol_in = ceil(net_sol * (10_000 + total_fee_bps) / 10_000)", + "", + "Rent", + "Separately make sure the instruction's payer has enough SOL to cover rent for:", + "- creator_vault: rent.minimum_balance(0)", + "- user_volume_accumulator: rent.minimum_balance(UserVolumeAccumulator::LEN)" + ], + "discriminator": [ + 56, + 252, + 116, + 8, + 158, + 223, + 205, + 95 + ], + "accounts": [ + { + "name": "global", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108 + ] + } + ] + } + }, + { + "name": "fee_recipient", + "writable": true + }, + { + "name": "mint" + }, + { + "name": "bonding_curve", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 98, + 111, + 110, + 100, + 105, + 110, + 103, + 45, + 99, + 117, + 114, + 118, + 101 + ] + }, + { + "kind": "account", + "path": "mint" + } + ] + } + }, + { + "name": "associated_bonding_curve", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "bonding_curve" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "associated_user", + "writable": true + }, + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "token_program" + }, + { + "name": "creator_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 99, + 114, + 101, + 97, + 116, + 111, + 114, + 45, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "bonding_curve.creator", + "account": "BondingCurve" + } + ] + } + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program", + "address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P" + }, + { + "name": "global_volume_accumulator", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108, + 95, + 118, + 111, + 108, + 117, + 109, + 101, + 95, + 97, + 99, + 99, + 117, + 109, + 117, + 108, + 97, + 116, + 111, + 114 + ] + } + ] + } + }, + { + "name": "user_volume_accumulator", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 117, + 115, + 101, + 114, + 95, + 118, + 111, + 108, + 117, + 109, + 101, + 95, + 97, + 99, + 99, + 117, + 109, + 117, + 108, + 97, + 116, + 111, + 114 + ] + }, + { + "kind": "account", + "path": "user" + } + ] + } + }, + { + "name": "fee_config", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 102, + 101, + 101, + 95, + 99, + 111, + 110, + 102, + 105, + 103 + ] + }, + { + "kind": "const", + "value": [ + 1, + 86, + 224, + 246, + 147, + 102, + 90, + 207, + 68, + 219, + 21, + 104, + 191, + 23, + 91, + 170, + 81, + 137, + 203, + 151, + 245, + 210, + 255, + 59, + 101, + 93, + 43, + 182, + 253, + 109, + 24, + 176 + ] + } + ], + "program": { + "kind": "account", + "path": "fee_program" + } + } + }, + { + "name": "fee_program", + "address": "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ" + } + ], + "args": [ + { + "name": "spendable_sol_in", + "type": "u64" + }, + { + "name": "min_tokens_out", + "type": "u64" + }, + { + "name": "track_volume", + "type": { + "defined": { + "name": "OptionBool" + } + } + } + ] + }, + { + "name": "claim_token_incentives", + "discriminator": [ + 16, + 4, + 71, + 28, + 204, + 1, + 40, + 27 + ], + "accounts": [ + { + "name": "user" + }, + { + "name": "user_ata", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "user" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "global_volume_accumulator", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108, + 95, + 118, + 111, + 108, + 117, + 109, + 101, + 95, + 97, + 99, + 99, + 117, + 109, + 117, + 108, + 97, + 116, + 111, + 114 + ] + } + ] + } + }, + { + "name": "global_incentive_token_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "global_volume_accumulator" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "user_volume_accumulator", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 117, + 115, + 101, + 114, + 95, + 118, + 111, + 108, + 117, + 109, + 101, + 95, + 97, + 99, + 99, + 117, + 109, + 117, + 108, + 97, + 116, + 111, + 114 + ] + }, + { + "kind": "account", + "path": "user" + } + ] + } + }, + { + "name": "mint", + "relations": [ + "global_volume_accumulator" + ] + }, + { + "name": "token_program" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "associated_token_program", + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program", + "address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P" + }, + { + "name": "payer", + "writable": true, + "signer": true + } + ], + "args": [] + }, + { + "name": "close_user_volume_accumulator", + "discriminator": [ + 249, + 69, + 164, + 218, + 150, + 103, + 84, + 138 + ], + "accounts": [ + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "user_volume_accumulator", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 117, + 115, + 101, + 114, + 95, + 118, + 111, + 108, + 117, + 109, + 101, + 95, + 97, + 99, + 99, + 117, + 109, + 117, + 108, + 97, + 116, + 111, + 114 + ] + }, + { + "kind": "account", + "path": "user" + } + ] + } + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [] + }, + { + "name": "collect_creator_fee", + "docs": [ + "Collects creator_fee from creator_vault to the coin creator account" + ], + "discriminator": [ + 20, + 22, + 86, + 123, + 198, + 28, + 219, + 132 + ], + "accounts": [ + { + "name": "creator", + "writable": true + }, + { + "name": "creator_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 99, + 114, + 101, + 97, + 116, + 111, + 114, + 45, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "creator" + } + ] + } + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [] + }, + { + "name": "create", + "docs": [ + "Creates a new coin and bonding curve." + ], + "discriminator": [ + 24, + 30, + 200, + 40, + 5, + 28, + 7, + 119 + ], + "accounts": [ + { + "name": "mint", + "writable": true, + "signer": true + }, + { + "name": "mint_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 109, + 105, + 110, + 116, + 45, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "bonding_curve", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 98, + 111, + 110, + 100, + 105, + 110, + 103, + 45, + 99, + 117, + 114, + 118, + 101 + ] + }, + { + "kind": "account", + "path": "mint" + } + ] + } + }, + { + "name": "associated_bonding_curve", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "bonding_curve" + }, + { + "kind": "const", + "value": [ + 6, + 221, + 246, + 225, + 215, + 101, + 161, + 147, + 217, + 203, + 225, + 70, + 206, + 235, + 121, + 172, + 28, + 180, + 133, + 237, + 95, + 91, + 55, + 145, + 58, + 140, + 245, + 133, + 126, + 255, + 0, + 169 + ] + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "global", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108 + ] + } + ] + } + }, + { + "name": "mpl_token_metadata", + "address": "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s" + }, + { + "name": "metadata", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 109, + 101, + 116, + 97, + 100, + 97, + 116, + 97 + ] + }, + { + "kind": "const", + "value": [ + 11, + 112, + 101, + 177, + 227, + 209, + 124, + 69, + 56, + 157, + 82, + 127, + 107, + 4, + 195, + 205, + 88, + 184, + 108, + 115, + 26, + 160, + 253, + 181, + 73, + 182, + 209, + 188, + 3, + 248, + 41, + 70 + ] + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "account", + "path": "mpl_token_metadata" + } + } + }, + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "token_program", + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "associated_token_program", + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "rent", + "address": "SysvarRent111111111111111111111111111111111" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "name", + "type": "string" + }, + { + "name": "symbol", + "type": "string" + }, + { + "name": "uri", + "type": "string" + }, + { + "name": "creator", + "type": "pubkey" + } + ] + }, + { + "name": "create_v2", + "docs": [ + "Creates a new spl-22 coin and bonding curve." + ], + "discriminator": [ + 214, + 144, + 76, + 236, + 95, + 139, + 49, + 180 + ], + "accounts": [ + { + "name": "mint", + "writable": true, + "signer": true + }, + { + "name": "mint_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 109, + 105, + 110, + 116, + 45, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "bonding_curve", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 98, + 111, + 110, + 100, + 105, + 110, + 103, + 45, + 99, + 117, + 114, + 118, + 101 + ] + }, + { + "kind": "account", + "path": "mint" + } + ] + } + }, + { + "name": "associated_bonding_curve", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "bonding_curve" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "global", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108 + ] + } + ] + } + }, + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "token_program", + "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" + }, + { + "name": "associated_token_program", + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "mayhem_program_id", + "writable": true, + "address": "MAyhSmzXzV1pTf7LsNkrNwkWKTo4ougAJ1PPg47MD4e" + }, + { + "name": "global_params", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108, + 45, + 112, + 97, + 114, + 97, + 109, + 115 + ] + } + ], + "program": { + "kind": "const", + "value": [ + 5, + 42, + 229, + 215, + 167, + 218, + 167, + 36, + 166, + 234, + 176, + 167, + 41, + 84, + 145, + 133, + 90, + 212, + 160, + 103, + 22, + 96, + 103, + 76, + 78, + 3, + 69, + 89, + 128, + 61, + 101, + 163 + ] + } + } + }, + { + "name": "sol_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 115, + 111, + 108, + 45, + 118, + 97, + 117, + 108, + 116 + ] + } + ], + "program": { + "kind": "const", + "value": [ + 5, + 42, + 229, + 215, + 167, + 218, + 167, + 36, + 166, + 234, + 176, + 167, + 41, + 84, + 145, + 133, + 90, + 212, + 160, + 103, + 22, + 96, + 103, + 76, + 78, + 3, + 69, + 89, + 128, + 61, + 101, + 163 + ] + } + } + }, + { + "name": "mayhem_state", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 109, + 97, + 121, + 104, + 101, + 109, + 45, + 115, + 116, + 97, + 116, + 101 + ] + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 5, + 42, + 229, + 215, + 167, + 218, + 167, + 36, + 166, + 234, + 176, + 167, + 41, + 84, + 145, + 133, + 90, + 212, + 160, + 103, + 22, + 96, + 103, + 76, + 78, + 3, + 69, + 89, + 128, + 61, + 101, + 163 + ] + } + } + }, + { + "name": "mayhem_token_vault", + "writable": true + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "name", + "type": "string" + }, + { + "name": "symbol", + "type": "string" + }, + { + "name": "uri", + "type": "string" + }, + { + "name": "creator", + "type": "pubkey" + }, + { + "name": "is_mayhem_mode", + "type": "bool" + } + ] + }, + { + "name": "distribute_creator_fees", + "docs": [ + "Distributes creator fees to shareholders based on their share percentages", + "The creator vault needs to have at least the minimum distributable amount to distribute fees", + "This can be checked with the get_minimum_distributable_fee instruction" + ], + "discriminator": [ + 165, + 114, + 103, + 0, + 121, + 206, + 247, + 81 + ], + "accounts": [ + { + "name": "mint", + "relations": [ + "sharing_config" + ] + }, + { + "name": "bonding_curve", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 98, + 111, + 110, + 100, + 105, + 110, + 103, + 45, + 99, + 117, + 114, + 118, + 101 + ] + }, + { + "kind": "account", + "path": "mint" + } + ] + } + }, + { + "name": "sharing_config", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 115, + 104, + 97, + 114, + 105, + 110, + 103, + 45, + 99, + 111, + 110, + 102, + 105, + 103 + ] + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 12, + 53, + 255, + 169, + 5, + 90, + 142, + 86, + 141, + 168, + 247, + 188, + 7, + 86, + 21, + 39, + 76, + 241, + 201, + 44, + 164, + 31, + 64, + 0, + 156, + 81, + 106, + 164, + 20, + 194, + 124, + 112 + ] + } + } + }, + { + "name": "creator_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 99, + 114, + 101, + 97, + 116, + 111, + 114, + 45, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "bonding_curve.creator", + "account": "BondingCurve" + } + ] + } + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program", + "address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P" + } + ], + "args": [], + "returns": { + "defined": { + "name": "DistributeCreatorFeesEvent" + } + } + }, + { + "name": "extend_account", + "docs": [ + "Extends the size of program-owned accounts" + ], + "discriminator": [ + 234, + 102, + 194, + 203, + 150, + 72, + 62, + 229 + ], + "accounts": [ + { + "name": "account", + "writable": true + }, + { + "name": "user", + "signer": true + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [] + }, + { + "name": "get_minimum_distributable_fee", + "docs": [ + "Permissionless instruction to check the minimum required fees for distribution", + "Returns the minimum required balance from the creator_vault and whether distribution can proceed" + ], + "discriminator": [ + 117, + 225, + 127, + 202, + 134, + 95, + 68, + 35 + ], + "accounts": [ + { + "name": "mint", + "relations": [ + "sharing_config" + ] + }, + { + "name": "bonding_curve", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 98, + 111, + 110, + 100, + 105, + 110, + 103, + 45, + 99, + 117, + 114, + 118, + 101 + ] + }, + { + "kind": "account", + "path": "mint" + } + ] + } + }, + { + "name": "sharing_config", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 115, + 104, + 97, + 114, + 105, + 110, + 103, + 45, + 99, + 111, + 110, + 102, + 105, + 103 + ] + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 12, + 53, + 255, + 169, + 5, + 90, + 142, + 86, + 141, + 168, + 247, + 188, + 7, + 86, + 21, + 39, + 76, + 241, + 201, + 44, + 164, + 31, + 64, + 0, + 156, + 81, + 106, + 164, + 20, + 194, + 124, + 112 + ] + } + } + }, + { + "name": "creator_vault", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 99, + 114, + 101, + 97, + 116, + 111, + 114, + 45, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "bonding_curve.creator", + "account": "BondingCurve" + } + ] + } + } + ], + "args": [], + "returns": { + "defined": { + "name": "MinimumDistributableFeeEvent" + } + } + }, + { + "name": "init_user_volume_accumulator", + "discriminator": [ + 94, + 6, + 202, + 115, + 255, + 96, + 232, + 183 + ], + "accounts": [ + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "user" + }, + { + "name": "user_volume_accumulator", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 117, + 115, + 101, + 114, + 95, + 118, + 111, + 108, + 117, + 109, + 101, + 95, + 97, + 99, + 99, + 117, + 109, + 117, + 108, + 97, + 116, + 111, + 114 + ] + }, + { + "kind": "account", + "path": "user" + } + ] + } + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [] + }, + { + "name": "initialize", + "docs": [ + "Creates the global state." + ], + "discriminator": [ + 175, + 175, + 109, + 31, + 13, + 152, + 155, + 237 + ], + "accounts": [ + { + "name": "global", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108 + ] + } + ] + } + }, + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + } + ], + "args": [] + }, + { + "name": "migrate", + "docs": [ + "Migrates liquidity to pump_amm if the bonding curve is complete" + ], + "discriminator": [ + 155, + 234, + 231, + 146, + 236, + 158, + 162, + 30 + ], + "accounts": [ + { + "name": "global", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108 + ] + } + ] + } + }, + { + "name": "withdraw_authority", + "writable": true, + "relations": [ + "global" + ] + }, + { + "name": "mint" + }, + { + "name": "bonding_curve", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 98, + 111, + 110, + 100, + 105, + 110, + 103, + 45, + 99, + 117, + 114, + 118, + 101 + ] + }, + { + "kind": "account", + "path": "mint" + } + ] + } + }, + { + "name": "associated_bonding_curve", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "bonding_curve" + }, + { + "kind": "account", + "path": "mint" + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "user", + "signer": true + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "token_program", + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "pump_amm", + "address": "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA" + }, + { + "name": "pool", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 111, + 108 + ] + }, + { + "kind": "const", + "value": [ + 0, + 0 + ] + }, + { + "kind": "account", + "path": "pool_authority" + }, + { + "kind": "account", + "path": "mint" + }, + { + "kind": "account", + "path": "wsol_mint" + } + ], + "program": { + "kind": "account", + "path": "pump_amm" + } + } + }, + { + "name": "pool_authority", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 111, + 108, + 45, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + }, + { + "kind": "account", + "path": "mint" + } + ] + } + }, + { + "name": "pool_authority_mint_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "pool_authority" + }, + { + "kind": "account", + "path": "mint" + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "account", + "path": "associated_token_program" + } + } + }, + { + "name": "pool_authority_wsol_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "pool_authority" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "wsol_mint" + } + ], + "program": { + "kind": "account", + "path": "associated_token_program" + } + } + }, + { + "name": "amm_global_config", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108, + 95, + 99, + 111, + 110, + 102, + 105, + 103 + ] + } + ], + "program": { + "kind": "account", + "path": "pump_amm" + } + } + }, + { + "name": "wsol_mint", + "address": "So11111111111111111111111111111111111111112" + }, + { + "name": "lp_mint", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 111, + 108, + 95, + 108, + 112, + 95, + 109, + 105, + 110, + 116 + ] + }, + { + "kind": "account", + "path": "pool" + } + ], + "program": { + "kind": "account", + "path": "pump_amm" + } + } + }, + { + "name": "user_pool_token_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "pool_authority" + }, + { + "kind": "account", + "path": "token_2022_program" + }, + { + "kind": "account", + "path": "lp_mint" + } + ], + "program": { + "kind": "account", + "path": "associated_token_program" + } + } + }, + { + "name": "pool_base_token_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "pool" + }, + { + "kind": "account", + "path": "mint" + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "account", + "path": "associated_token_program" + } + } + }, + { + "name": "pool_quote_token_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "pool" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "wsol_mint" + } + ], + "program": { + "kind": "account", + "path": "associated_token_program" + } + } + }, + { + "name": "token_2022_program", + "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" + }, + { + "name": "associated_token_program", + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "pump_amm_event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ], + "program": { + "kind": "account", + "path": "pump_amm" + } + } + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [] + }, + { + "name": "migrate_bonding_curve_creator", + "discriminator": [ + 87, + 124, + 52, + 191, + 52, + 38, + 214, + 232 + ], + "accounts": [ + { + "name": "mint", + "relations": [ + "sharing_config" + ] + }, + { + "name": "bonding_curve", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 98, + 111, + 110, + 100, + 105, + 110, + 103, + 45, + 99, + 117, + 114, + 118, + 101 + ] + }, + { + "kind": "account", + "path": "mint" + } + ] + } + }, + { + "name": "sharing_config", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 115, + 104, + 97, + 114, + 105, + 110, + 103, + 45, + 99, + 111, + 110, + 102, + 105, + 103 + ] + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 12, + 53, + 255, + 169, + 5, + 90, + 142, + 86, + 141, + 168, + 247, + 188, + 7, + 86, + 21, + 39, + 76, + 241, + 201, + 44, + 164, + 31, + 64, + 0, + 156, + 81, + 106, + 164, + 20, + 194, + 124, + 112 + ] + } + } + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [] + }, + { + "name": "sell", + "docs": [ + "Sells tokens into a bonding curve." + ], + "discriminator": [ + 51, + 230, + 133, + 164, + 1, + 127, + 131, + 173 + ], + "accounts": [ + { + "name": "global", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108 + ] + } + ] + } + }, + { + "name": "fee_recipient", + "writable": true + }, + { + "name": "mint" + }, + { + "name": "bonding_curve", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 98, + 111, + 110, + 100, + 105, + 110, + 103, + 45, + 99, + 117, + 114, + 118, + 101 + ] + }, + { + "kind": "account", + "path": "mint" + } + ] + } + }, + { + "name": "associated_bonding_curve", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "bonding_curve" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "associated_user", + "writable": true + }, + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "creator_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 99, + 114, + 101, + 97, + 116, + 111, + 114, + 45, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "bonding_curve.creator", + "account": "BondingCurve" + } + ] + } + }, + { + "name": "token_program" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program", + "address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P" + }, + { + "name": "fee_config", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 102, + 101, + 101, + 95, + 99, + 111, + 110, + 102, + 105, + 103 + ] + }, + { + "kind": "const", + "value": [ + 1, + 86, + 224, + 246, + 147, + 102, + 90, + 207, + 68, + 219, + 21, + 104, + 191, + 23, + 91, + 170, + 81, + 137, + 203, + 151, + 245, + 210, + 255, + 59, + 101, + 93, + 43, + 182, + 253, + 109, + 24, + 176 + ] + } + ], + "program": { + "kind": "account", + "path": "fee_program" + } + } + }, + { + "name": "fee_program", + "address": "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ" + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + }, + { + "name": "min_sol_output", + "type": "u64" + } + ] + }, + { + "name": "set_creator", + "docs": [ + "Allows Global::set_creator_authority to set the bonding curve creator from Metaplex metadata or input argument" + ], + "discriminator": [ + 254, + 148, + 255, + 112, + 207, + 142, + 170, + 165 + ], + "accounts": [ + { + "name": "set_creator_authority", + "signer": true, + "relations": [ + "global" + ] + }, + { + "name": "global", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108 + ] + } + ] + } + }, + { + "name": "mint" + }, + { + "name": "metadata", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 109, + 101, + 116, + 97, + 100, + 97, + 116, + 97 + ] + }, + { + "kind": "const", + "value": [ + 11, + 112, + 101, + 177, + 227, + 209, + 124, + 69, + 56, + 157, + 82, + 127, + 107, + 4, + 195, + 205, + 88, + 184, + 108, + 115, + 26, + 160, + 253, + 181, + 73, + 182, + 209, + 188, + 3, + 248, + 41, + 70 + ] + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 11, + 112, + 101, + 177, + 227, + 209, + 124, + 69, + 56, + 157, + 82, + 127, + 107, + 4, + 195, + 205, + 88, + 184, + 108, + 115, + 26, + 160, + 253, + 181, + 73, + 182, + 209, + 188, + 3, + 248, + 41, + 70 + ] + } + } + }, + { + "name": "bonding_curve", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 98, + 111, + 110, + 100, + 105, + 110, + 103, + 45, + 99, + 117, + 114, + 118, + 101 + ] + }, + { + "kind": "account", + "path": "mint" + } + ] + } + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "creator", + "type": "pubkey" + } + ] + }, + { + "name": "set_mayhem_virtual_params", + "discriminator": [ + 61, + 169, + 188, + 191, + 153, + 149, + 42, + 97 + ], + "accounts": [ + { + "name": "sol_vault_authority", + "writable": true, + "signer": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 115, + 111, + 108, + 45, + 118, + 97, + 117, + 108, + 116 + ] + } + ], + "program": { + "kind": "const", + "value": [ + 5, + 42, + 229, + 215, + 167, + 218, + 167, + 36, + 166, + 234, + 176, + 167, + 41, + 84, + 145, + 133, + 90, + 212, + 160, + 103, + 22, + 96, + 103, + 76, + 78, + 3, + 69, + 89, + 128, + 61, + 101, + 163 + ] + } + } + }, + { + "name": "mayhem_token_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "sol_vault_authority" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "mint" + }, + { + "name": "global", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108 + ] + } + ] + } + }, + { + "name": "bonding_curve", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 98, + 111, + 110, + 100, + 105, + 110, + 103, + 45, + 99, + 117, + 114, + 118, + 101 + ] + }, + { + "kind": "account", + "path": "mint" + } + ] + } + }, + { + "name": "token_program", + "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [] + }, + { + "name": "set_metaplex_creator", + "docs": [ + "Syncs the bonding curve creator with the Metaplex metadata creator if it exists" + ], + "discriminator": [ + 138, + 96, + 174, + 217, + 48, + 85, + 197, + 246 + ], + "accounts": [ + { + "name": "mint" + }, + { + "name": "metadata", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 109, + 101, + 116, + 97, + 100, + 97, + 116, + 97 + ] + }, + { + "kind": "const", + "value": [ + 11, + 112, + 101, + 177, + 227, + 209, + 124, + 69, + 56, + 157, + 82, + 127, + 107, + 4, + 195, + 205, + 88, + 184, + 108, + 115, + 26, + 160, + 253, + 181, + 73, + 182, + 209, + 188, + 3, + 248, + 41, + 70 + ] + }, + { + "kind": "account", + "path": "mint" + } + ], + "program": { + "kind": "const", + "value": [ + 11, + 112, + 101, + 177, + 227, + 209, + 124, + 69, + 56, + 157, + 82, + 127, + 107, + 4, + 195, + 205, + 88, + 184, + 108, + 115, + 26, + 160, + 253, + 181, + 73, + 182, + 209, + 188, + 3, + 248, + 41, + 70 + ] + } + } + }, + { + "name": "bonding_curve", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 98, + 111, + 110, + 100, + 105, + 110, + 103, + 45, + 99, + 117, + 114, + 118, + 101 + ] + }, + { + "kind": "account", + "path": "mint" + } + ] + } + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [] + }, + { + "name": "set_params", + "docs": [ + "Sets the global state parameters." + ], + "discriminator": [ + 27, + 234, + 178, + 52, + 147, + 2, + 187, + 141 + ], + "accounts": [ + { + "name": "global", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108 + ] + } + ] + } + }, + { + "name": "authority", + "writable": true, + "signer": true, + "relations": [ + "global" + ] + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "initial_virtual_token_reserves", + "type": "u64" + }, + { + "name": "initial_virtual_sol_reserves", + "type": "u64" + }, + { + "name": "initial_real_token_reserves", + "type": "u64" + }, + { + "name": "token_total_supply", + "type": "u64" + }, + { + "name": "fee_basis_points", + "type": "u64" + }, + { + "name": "withdraw_authority", + "type": "pubkey" + }, + { + "name": "enable_migrate", + "type": "bool" + }, + { + "name": "pool_migration_fee", + "type": "u64" + }, + { + "name": "creator_fee_basis_points", + "type": "u64" + }, + { + "name": "set_creator_authority", + "type": "pubkey" + }, + { + "name": "admin_set_creator_authority", + "type": "pubkey" + } + ] + }, + { + "name": "set_reserved_fee_recipients", + "discriminator": [ + 111, + 172, + 162, + 232, + 114, + 89, + 213, + 142 + ], + "accounts": [ + { + "name": "global", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108 + ] + } + ] + } + }, + { + "name": "authority", + "signer": true, + "relations": [ + "global" + ] + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "whitelist_pda", + "type": "pubkey" + } + ] + }, + { + "name": "sync_user_volume_accumulator", + "discriminator": [ + 86, + 31, + 192, + 87, + 163, + 87, + 79, + 238 + ], + "accounts": [ + { + "name": "user" + }, + { + "name": "global_volume_accumulator", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108, + 95, + 118, + 111, + 108, + 117, + 109, + 101, + 95, + 97, + 99, + 99, + 117, + 109, + 117, + 108, + 97, + 116, + 111, + 114 + ] + } + ] + } + }, + { + "name": "user_volume_accumulator", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 117, + 115, + 101, + 114, + 95, + 118, + 111, + 108, + 117, + 109, + 101, + 95, + 97, + 99, + 99, + 117, + 109, + 117, + 108, + 97, + 116, + 111, + 114 + ] + }, + { + "kind": "account", + "path": "user" + } + ] + } + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [] + }, + { + "name": "toggle_create_v2", + "discriminator": [ + 28, + 255, + 230, + 240, + 172, + 107, + 203, + 171 + ], + "accounts": [ + { + "name": "global", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108 + ] + } + ] + } + }, + { + "name": "authority", + "writable": true, + "signer": true, + "relations": [ + "global" + ] + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "toggle_mayhem_mode", + "discriminator": [ + 1, + 9, + 111, + 208, + 100, + 31, + 255, + 163 + ], + "accounts": [ + { + "name": "global", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108 + ] + } + ] + } + }, + { + "name": "authority", + "writable": true, + "signer": true, + "relations": [ + "global" + ] + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "enabled", + "type": "bool" + } + ] + }, + { + "name": "update_global_authority", + "discriminator": [ + 227, + 181, + 74, + 196, + 208, + 21, + 97, + 213 + ], + "accounts": [ + { + "name": "global", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108 + ] + } + ] + } + }, + { + "name": "authority", + "signer": true, + "relations": [ + "global" + ] + }, + { + "name": "new_authority" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [] + } + ], + "accounts": [ + { + "name": "BondingCurve", + "discriminator": [ + 23, + 183, + 248, + 55, + 96, + 216, + 172, + 96 + ] + }, + { + "name": "FeeConfig", + "discriminator": [ + 143, + 52, + 146, + 187, + 219, + 123, + 76, + 155 + ] + }, + { + "name": "Global", + "discriminator": [ + 167, + 232, + 232, + 177, + 200, + 108, + 114, + 127 + ] + }, + { + "name": "GlobalVolumeAccumulator", + "discriminator": [ + 202, + 42, + 246, + 43, + 142, + 190, + 30, + 255 + ] + }, + { + "name": "SharingConfig", + "discriminator": [ + 216, + 74, + 9, + 0, + 56, + 140, + 93, + 75 + ] + }, + { + "name": "UserVolumeAccumulator", + "discriminator": [ + 86, + 255, + 112, + 14, + 102, + 53, + 154, + 250 + ] + } + ], + "events": [ + { + "name": "AdminSetCreatorEvent", + "discriminator": [ + 64, + 69, + 192, + 104, + 29, + 30, + 25, + 107 + ] + }, + { + "name": "AdminSetIdlAuthorityEvent", + "discriminator": [ + 245, + 59, + 70, + 34, + 75, + 185, + 109, + 92 + ] + }, + { + "name": "AdminUpdateTokenIncentivesEvent", + "discriminator": [ + 147, + 250, + 108, + 120, + 247, + 29, + 67, + 222 + ] + }, + { + "name": "ClaimTokenIncentivesEvent", + "discriminator": [ + 79, + 172, + 246, + 49, + 205, + 91, + 206, + 232 + ] + }, + { + "name": "CloseUserVolumeAccumulatorEvent", + "discriminator": [ + 146, + 159, + 189, + 172, + 146, + 88, + 56, + 244 + ] + }, + { + "name": "CollectCreatorFeeEvent", + "discriminator": [ + 122, + 2, + 127, + 1, + 14, + 191, + 12, + 175 + ] + }, + { + "name": "CompleteEvent", + "discriminator": [ + 95, + 114, + 97, + 156, + 212, + 46, + 152, + 8 + ] + }, + { + "name": "CompletePumpAmmMigrationEvent", + "discriminator": [ + 189, + 233, + 93, + 185, + 92, + 148, + 234, + 148 + ] + }, + { + "name": "CreateEvent", + "discriminator": [ + 27, + 114, + 169, + 77, + 222, + 235, + 99, + 118 + ] + }, + { + "name": "DistributeCreatorFeesEvent", + "discriminator": [ + 165, + 55, + 129, + 112, + 4, + 179, + 202, + 40 + ] + }, + { + "name": "ExtendAccountEvent", + "discriminator": [ + 97, + 97, + 215, + 144, + 93, + 146, + 22, + 124 + ] + }, + { + "name": "InitUserVolumeAccumulatorEvent", + "discriminator": [ + 134, + 36, + 13, + 72, + 232, + 101, + 130, + 216 + ] + }, + { + "name": "MigrateBondingCurveCreatorEvent", + "discriminator": [ + 155, + 167, + 104, + 220, + 213, + 108, + 243, + 3 + ] + }, + { + "name": "MinimumDistributableFeeEvent", + "discriminator": [ + 168, + 216, + 132, + 239, + 235, + 182, + 49, + 52 + ] + }, + { + "name": "ReservedFeeRecipientsEvent", + "discriminator": [ + 43, + 188, + 250, + 18, + 221, + 75, + 187, + 95 + ] + }, + { + "name": "SetCreatorEvent", + "discriminator": [ + 237, + 52, + 123, + 37, + 245, + 251, + 72, + 210 + ] + }, + { + "name": "SetMetaplexCreatorEvent", + "discriminator": [ + 142, + 203, + 6, + 32, + 127, + 105, + 191, + 162 + ] + }, + { + "name": "SetParamsEvent", + "discriminator": [ + 223, + 195, + 159, + 246, + 62, + 48, + 143, + 131 + ] + }, + { + "name": "SyncUserVolumeAccumulatorEvent", + "discriminator": [ + 197, + 122, + 167, + 124, + 116, + 81, + 91, + 255 + ] + }, + { + "name": "TradeEvent", + "discriminator": [ + 189, + 219, + 127, + 211, + 78, + 230, + 97, + 238 + ] + }, + { + "name": "UpdateGlobalAuthorityEvent", + "discriminator": [ + 182, + 195, + 137, + 42, + 35, + 206, + 207, + 247 + ] + }, + { + "name": "UpdateMayhemVirtualParamsEvent", + "discriminator": [ + 117, + 123, + 228, + 182, + 161, + 168, + 220, + 214 + ] + } + ], + "errors": [ + { + "code": 6000, + "name": "NotAuthorized", + "msg": "The given account is not authorized to execute this instruction." + }, + { + "code": 6001, + "name": "AlreadyInitialized", + "msg": "The program is already initialized." + }, + { + "code": 6002, + "name": "TooMuchSolRequired", + "msg": "slippage: Too much SOL required to buy the given amount of tokens." + }, + { + "code": 6003, + "name": "TooLittleSolReceived", + "msg": "slippage: Too little SOL received to sell the given amount of tokens." + }, + { + "code": 6004, + "name": "MintDoesNotMatchBondingCurve", + "msg": "The mint does not match the bonding curve." + }, + { + "code": 6005, + "name": "BondingCurveComplete", + "msg": "The bonding curve has completed and liquidity migrated to raydium." + }, + { + "code": 6006, + "name": "BondingCurveNotComplete", + "msg": "The bonding curve has not completed." + }, + { + "code": 6007, + "name": "NotInitialized", + "msg": "The program is not initialized." + }, + { + "code": 6008, + "name": "WithdrawTooFrequent", + "msg": "Withdraw too frequent" + }, + { + "code": 6009, + "name": "NewSizeShouldBeGreaterThanCurrentSize", + "msg": "new_size should be > current_size" + }, + { + "code": 6010, + "name": "AccountTypeNotSupported", + "msg": "Account type not supported" + }, + { + "code": 6011, + "name": "InitialRealTokenReservesShouldBeLessThanTokenTotalSupply", + "msg": "initial_real_token_reserves should be less than token_total_supply" + }, + { + "code": 6012, + "name": "InitialVirtualTokenReservesShouldBeGreaterThanInitialRealTokenReserves", + "msg": "initial_virtual_token_reserves should be greater than initial_real_token_reserves" + }, + { + "code": 6013, + "name": "FeeBasisPointsGreaterThanMaximum", + "msg": "fee_basis_points greater than maximum" + }, + { + "code": 6014, + "name": "AllZerosWithdrawAuthority", + "msg": "Withdraw authority cannot be set to System Program ID" + }, + { + "code": 6015, + "name": "PoolMigrationFeeShouldBeLessThanFinalRealSolReserves", + "msg": "pool_migration_fee should be less than final_real_sol_reserves" + }, + { + "code": 6016, + "name": "PoolMigrationFeeShouldBeGreaterThanCreatorFeePlusMaxMigrateFees", + "msg": "pool_migration_fee should be greater than creator_fee + MAX_MIGRATE_FEES" + }, + { + "code": 6017, + "name": "DisabledWithdraw", + "msg": "Migrate instruction is disabled" + }, + { + "code": 6018, + "name": "DisabledMigrate", + "msg": "Migrate instruction is disabled" + }, + { + "code": 6019, + "name": "InvalidCreator", + "msg": "Invalid creator pubkey" + }, + { + "code": 6020, + "name": "BuyZeroAmount", + "msg": "Buy zero amount" + }, + { + "code": 6021, + "name": "NotEnoughTokensToBuy", + "msg": "Not enough tokens to buy" + }, + { + "code": 6022, + "name": "SellZeroAmount", + "msg": "Sell zero amount" + }, + { + "code": 6023, + "name": "NotEnoughTokensToSell", + "msg": "Not enough tokens to sell" + }, + { + "code": 6024, + "name": "Overflow", + "msg": "Overflow" + }, + { + "code": 6025, + "name": "Truncation", + "msg": "Truncation" + }, + { + "code": 6026, + "name": "DivisionByZero", + "msg": "Division by zero" + }, + { + "code": 6027, + "name": "NotEnoughRemainingAccounts", + "msg": "Not enough remaining accounts" + }, + { + "code": 6028, + "name": "AllFeeRecipientsShouldBeNonZero", + "msg": "All fee recipients should be non-zero" + }, + { + "code": 6029, + "name": "UnsortedNotUniqueFeeRecipients", + "msg": "Unsorted or not unique fee recipients" + }, + { + "code": 6030, + "name": "CreatorShouldNotBeZero", + "msg": "Creator should not be zero" + }, + { + "code": 6031, + "name": "StartTimeInThePast" + }, + { + "code": 6032, + "name": "EndTimeInThePast" + }, + { + "code": 6033, + "name": "EndTimeBeforeStartTime" + }, + { + "code": 6034, + "name": "TimeRangeTooLarge" + }, + { + "code": 6035, + "name": "EndTimeBeforeCurrentDay" + }, + { + "code": 6036, + "name": "SupplyUpdateForFinishedRange" + }, + { + "code": 6037, + "name": "DayIndexAfterEndIndex" + }, + { + "code": 6038, + "name": "DayInActiveRange" + }, + { + "code": 6039, + "name": "InvalidIncentiveMint" + }, + { + "code": 6040, + "name": "BuyNotEnoughSolToCoverRent", + "msg": "Buy: Not enough SOL to cover for rent exemption." + }, + { + "code": 6041, + "name": "BuyNotEnoughSolToCoverFees", + "msg": "Buy: Not enough SOL to cover for fees." + }, + { + "code": 6042, + "name": "BuySlippageBelowMinTokensOut", + "msg": "Slippage: Would buy less tokens than expected min_tokens_out" + }, + { + "code": 6043, + "name": "NameTooLong" + }, + { + "code": 6044, + "name": "SymbolTooLong" + }, + { + "code": 6045, + "name": "UriTooLong" + }, + { + "code": 6046, + "name": "CreateV2Disabled" + }, + { + "code": 6047, + "name": "CpitializeMayhemFailed" + }, + { + "code": 6048, + "name": "MayhemModeDisabled" + }, + { + "code": 6049, + "name": "CreatorMigratedToSharingConfig", + "msg": "creator has been migrated to sharing config, use pump_fees::reset_fee_sharing_config instead" + }, + { + "code": 6050, + "name": "UnableToDistributeCreatorVaultMigratedToSharingConfig", + "msg": "creator_vault has been migrated to sharing config, use pump:distribute_creator_fees instead" + }, + { + "code": 6051, + "name": "SharingConfigNotActive", + "msg": "Sharing config is not active" + }, + { + "code": 6052, + "name": "UnableToDistributeCreatorFeesToExecutableRecipient", + "msg": "The recipient account is executable, so it cannot receive lamports, remove it from the team first" + }, + { + "code": 6053, + "name": "BondingCurveAndSharingConfigCreatorMismatch", + "msg": "Bonding curve creator does not match sharing config" + }, + { + "code": 6054, + "name": "ShareholdersAndRemainingAccountsMismatch", + "msg": "Remaining accounts do not match shareholders, make sure to pass exactly the same pubkeys in the same order" + }, + { + "code": 6055, + "name": "InvalidShareBps", + "msg": "Share bps must be greater than 0" + } + ], + "types": [ + { + "name": "AdminSetCreatorEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "admin_set_creator_authority", + "type": "pubkey" + }, + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "bonding_curve", + "type": "pubkey" + }, + { + "name": "old_creator", + "type": "pubkey" + }, + { + "name": "new_creator", + "type": "pubkey" + } + ] + } + }, + { + "name": "AdminSetIdlAuthorityEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "idl_authority", + "type": "pubkey" + } + ] + } + }, + { + "name": "AdminUpdateTokenIncentivesEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "start_time", + "type": "i64" + }, + { + "name": "end_time", + "type": "i64" + }, + { + "name": "day_number", + "type": "u64" + }, + { + "name": "token_supply_per_day", + "type": "u64" + }, + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "seconds_in_a_day", + "type": "i64" + }, + { + "name": "timestamp", + "type": "i64" + } + ] + } + }, + { + "name": "BondingCurve", + "type": { + "kind": "struct", + "fields": [ + { + "name": "virtual_token_reserves", + "type": "u64" + }, + { + "name": "virtual_sol_reserves", + "type": "u64" + }, + { + "name": "real_token_reserves", + "type": "u64" + }, + { + "name": "real_sol_reserves", + "type": "u64" + }, + { + "name": "token_total_supply", + "type": "u64" + }, + { + "name": "complete", + "type": "bool" + }, + { + "name": "creator", + "type": "pubkey" + }, + { + "name": "is_mayhem_mode", + "type": "bool" + } + ] + } + }, + { + "name": "ClaimTokenIncentivesEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "user", + "type": "pubkey" + }, + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "amount", + "type": "u64" + }, + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "total_claimed_tokens", + "type": "u64" + }, + { + "name": "current_sol_volume", + "type": "u64" + } + ] + } + }, + { + "name": "CloseUserVolumeAccumulatorEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "user", + "type": "pubkey" + }, + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "total_unclaimed_tokens", + "type": "u64" + }, + { + "name": "total_claimed_tokens", + "type": "u64" + }, + { + "name": "current_sol_volume", + "type": "u64" + }, + { + "name": "last_update_timestamp", + "type": "i64" + } + ] + } + }, + { + "name": "CollectCreatorFeeEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "creator", + "type": "pubkey" + }, + { + "name": "creator_fee", + "type": "u64" + } + ] + } + }, + { + "name": "CompleteEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "user", + "type": "pubkey" + }, + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "bonding_curve", + "type": "pubkey" + }, + { + "name": "timestamp", + "type": "i64" + } + ] + } + }, + { + "name": "CompletePumpAmmMigrationEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "user", + "type": "pubkey" + }, + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "mint_amount", + "type": "u64" + }, + { + "name": "sol_amount", + "type": "u64" + }, + { + "name": "pool_migration_fee", + "type": "u64" + }, + { + "name": "bonding_curve", + "type": "pubkey" + }, + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "pool", + "type": "pubkey" + } + ] + } + }, + { + "name": "ConfigStatus", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Paused" + }, + { + "name": "Active" + } + ] + } + }, + { + "name": "CreateEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "symbol", + "type": "string" + }, + { + "name": "uri", + "type": "string" + }, + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "bonding_curve", + "type": "pubkey" + }, + { + "name": "user", + "type": "pubkey" + }, + { + "name": "creator", + "type": "pubkey" + }, + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "virtual_token_reserves", + "type": "u64" + }, + { + "name": "virtual_sol_reserves", + "type": "u64" + }, + { + "name": "real_token_reserves", + "type": "u64" + }, + { + "name": "token_total_supply", + "type": "u64" + }, + { + "name": "token_program", + "type": "pubkey" + }, + { + "name": "is_mayhem_mode", + "type": "bool" + } + ] + } + }, + { + "name": "DistributeCreatorFeesEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "bonding_curve", + "type": "pubkey" + }, + { + "name": "sharing_config", + "type": "pubkey" + }, + { + "name": "admin", + "type": "pubkey" + }, + { + "name": "shareholders", + "type": { + "vec": { + "defined": { + "name": "Shareholder" + } + } + } + }, + { + "name": "distributed", + "type": "u64" + } + ] + } + }, + { + "name": "ExtendAccountEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "account", + "type": "pubkey" + }, + { + "name": "user", + "type": "pubkey" + }, + { + "name": "current_size", + "type": "u64" + }, + { + "name": "new_size", + "type": "u64" + }, + { + "name": "timestamp", + "type": "i64" + } + ] + } + }, + { + "name": "FeeConfig", + "type": { + "kind": "struct", + "fields": [ + { + "name": "bump", + "type": "u8" + }, + { + "name": "admin", + "type": "pubkey" + }, + { + "name": "flat_fees", + "type": { + "defined": { + "name": "Fees" + } + } + }, + { + "name": "fee_tiers", + "type": { + "vec": { + "defined": { + "name": "FeeTier" + } + } + } + } + ] + } + }, + { + "name": "FeeTier", + "type": { + "kind": "struct", + "fields": [ + { + "name": "market_cap_lamports_threshold", + "type": "u128" + }, + { + "name": "fees", + "type": { + "defined": { + "name": "Fees" + } + } + } + ] + } + }, + { + "name": "Fees", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lp_fee_bps", + "type": "u64" + }, + { + "name": "protocol_fee_bps", + "type": "u64" + }, + { + "name": "creator_fee_bps", + "type": "u64" + } + ] + } + }, + { + "name": "Global", + "type": { + "kind": "struct", + "fields": [ + { + "name": "initialized", + "docs": [ + "Unused" + ], + "type": "bool" + }, + { + "name": "authority", + "type": "pubkey" + }, + { + "name": "fee_recipient", + "type": "pubkey" + }, + { + "name": "initial_virtual_token_reserves", + "type": "u64" + }, + { + "name": "initial_virtual_sol_reserves", + "type": "u64" + }, + { + "name": "initial_real_token_reserves", + "type": "u64" + }, + { + "name": "token_total_supply", + "type": "u64" + }, + { + "name": "fee_basis_points", + "type": "u64" + }, + { + "name": "withdraw_authority", + "type": "pubkey" + }, + { + "name": "enable_migrate", + "docs": [ + "Unused" + ], + "type": "bool" + }, + { + "name": "pool_migration_fee", + "type": "u64" + }, + { + "name": "creator_fee_basis_points", + "type": "u64" + }, + { + "name": "fee_recipients", + "type": { + "array": [ + "pubkey", + 7 + ] + } + }, + { + "name": "set_creator_authority", + "type": "pubkey" + }, + { + "name": "admin_set_creator_authority", + "type": "pubkey" + }, + { + "name": "create_v2_enabled", + "type": "bool" + }, + { + "name": "whitelist_pda", + "type": "pubkey" + }, + { + "name": "reserved_fee_recipient", + "type": "pubkey" + }, + { + "name": "mayhem_mode_enabled", + "type": "bool" + }, + { + "name": "reserved_fee_recipients", + "type": { + "array": [ + "pubkey", + 7 + ] + } + } + ] + } + }, + { + "name": "GlobalVolumeAccumulator", + "type": { + "kind": "struct", + "fields": [ + { + "name": "start_time", + "type": "i64" + }, + { + "name": "end_time", + "type": "i64" + }, + { + "name": "seconds_in_a_day", + "type": "i64" + }, + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "total_token_supply", + "type": { + "array": [ + "u64", + 30 + ] + } + }, + { + "name": "sol_volumes", + "type": { + "array": [ + "u64", + 30 + ] + } + } + ] + } + }, + { + "name": "InitUserVolumeAccumulatorEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "payer", + "type": "pubkey" + }, + { + "name": "user", + "type": "pubkey" + }, + { + "name": "timestamp", + "type": "i64" + } + ] + } + }, + { + "name": "MigrateBondingCurveCreatorEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "bonding_curve", + "type": "pubkey" + }, + { + "name": "sharing_config", + "type": "pubkey" + }, + { + "name": "old_creator", + "type": "pubkey" + }, + { + "name": "new_creator", + "type": "pubkey" + } + ] + } + }, + { + "name": "MinimumDistributableFeeEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "minimum_required", + "type": "u64" + }, + { + "name": "distributable_fees", + "type": "u64" + }, + { + "name": "can_distribute", + "type": "bool" + } + ] + } + }, + { + "name": "OptionBool", + "type": { + "kind": "struct", + "fields": [ + "bool" + ] + } + }, + { + "name": "ReservedFeeRecipientsEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "reserved_fee_recipient", + "type": "pubkey" + }, + { + "name": "reserved_fee_recipients", + "type": { + "array": [ + "pubkey", + 7 + ] + } + } + ] + } + }, + { + "name": "SetCreatorEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "bonding_curve", + "type": "pubkey" + }, + { + "name": "creator", + "type": "pubkey" + } + ] + } + }, + { + "name": "SetMetaplexCreatorEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "bonding_curve", + "type": "pubkey" + }, + { + "name": "metadata", + "type": "pubkey" + }, + { + "name": "creator", + "type": "pubkey" + } + ] + } + }, + { + "name": "SetParamsEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "initial_virtual_token_reserves", + "type": "u64" + }, + { + "name": "initial_virtual_sol_reserves", + "type": "u64" + }, + { + "name": "initial_real_token_reserves", + "type": "u64" + }, + { + "name": "final_real_sol_reserves", + "type": "u64" + }, + { + "name": "token_total_supply", + "type": "u64" + }, + { + "name": "fee_basis_points", + "type": "u64" + }, + { + "name": "withdraw_authority", + "type": "pubkey" + }, + { + "name": "enable_migrate", + "type": "bool" + }, + { + "name": "pool_migration_fee", + "type": "u64" + }, + { + "name": "creator_fee_basis_points", + "type": "u64" + }, + { + "name": "fee_recipients", + "type": { + "array": [ + "pubkey", + 8 + ] + } + }, + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "set_creator_authority", + "type": "pubkey" + }, + { + "name": "admin_set_creator_authority", + "type": "pubkey" + } + ] + } + }, + { + "name": "Shareholder", + "type": { + "kind": "struct", + "fields": [ + { + "name": "address", + "type": "pubkey" + }, + { + "name": "share_bps", + "type": "u16" + } + ] + } + }, + { + "name": "SharingConfig", + "type": { + "kind": "struct", + "fields": [ + { + "name": "bump", + "type": "u8" + }, + { + "name": "version", + "type": "u8" + }, + { + "name": "status", + "type": { + "defined": { + "name": "ConfigStatus" + } + } + }, + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "admin", + "type": "pubkey" + }, + { + "name": "admin_revoked", + "type": "bool" + }, + { + "name": "shareholders", + "type": { + "vec": { + "defined": { + "name": "Shareholder" + } + } + } + } + ] + } + }, + { + "name": "SyncUserVolumeAccumulatorEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "user", + "type": "pubkey" + }, + { + "name": "total_claimed_tokens_before", + "type": "u64" + }, + { + "name": "total_claimed_tokens_after", + "type": "u64" + }, + { + "name": "timestamp", + "type": "i64" + } + ] + } + }, + { + "name": "TradeEvent", + "docs": [ + "ix_name: \"buy\" | \"sell\" | \"buy_exact_sol_in\"" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "sol_amount", + "type": "u64" + }, + { + "name": "token_amount", + "type": "u64" + }, + { + "name": "is_buy", + "type": "bool" + }, + { + "name": "user", + "type": "pubkey" + }, + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "virtual_sol_reserves", + "type": "u64" + }, + { + "name": "virtual_token_reserves", + "type": "u64" + }, + { + "name": "real_sol_reserves", + "type": "u64" + }, + { + "name": "real_token_reserves", + "type": "u64" + }, + { + "name": "fee_recipient", + "type": "pubkey" + }, + { + "name": "fee_basis_points", + "type": "u64" + }, + { + "name": "fee", + "type": "u64" + }, + { + "name": "creator", + "type": "pubkey" + }, + { + "name": "creator_fee_basis_points", + "type": "u64" + }, + { + "name": "creator_fee", + "type": "u64" + }, + { + "name": "track_volume", + "type": "bool" + }, + { + "name": "total_unclaimed_tokens", + "type": "u64" + }, + { + "name": "total_claimed_tokens", + "type": "u64" + }, + { + "name": "current_sol_volume", + "type": "u64" + }, + { + "name": "last_update_timestamp", + "type": "i64" + }, + { + "name": "ix_name", + "type": "string" + }, + { + "name": "mayhem_mode", + "type": "bool" + } + ] + } + }, + { + "name": "UpdateGlobalAuthorityEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "global", + "type": "pubkey" + }, + { + "name": "authority", + "type": "pubkey" + }, + { + "name": "new_authority", + "type": "pubkey" + }, + { + "name": "timestamp", + "type": "i64" + } + ] + } + }, + { + "name": "UpdateMayhemVirtualParamsEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "virtual_token_reserves", + "type": "u64" + }, + { + "name": "virtual_sol_reserves", + "type": "u64" + }, + { + "name": "new_virtual_token_reserves", + "type": "u64" + }, + { + "name": "new_virtual_sol_reserves", + "type": "u64" + }, + { + "name": "real_token_reserves", + "type": "u64" + }, + { + "name": "real_sol_reserves", + "type": "u64" + } + ] + } + }, + { + "name": "UserVolumeAccumulator", + "type": { + "kind": "struct", + "fields": [ + { + "name": "user", + "type": "pubkey" + }, + { + "name": "needs_claim", + "type": "bool" + }, + { + "name": "total_unclaimed_tokens", + "type": "u64" + }, + { + "name": "total_claimed_tokens", + "type": "u64" + }, + { + "name": "current_sol_volume", + "type": "u64" + }, + { + "name": "last_update_timestamp", + "type": "i64" + }, + { + "name": "has_total_claimed_tokens", + "type": "bool" + } + ] + } + } + ] +} diff --git a/idl/raydium_amm.json b/idl/raydium_amm.json new file mode 100644 index 0000000..b85dcfe --- /dev/null +++ b/idl/raydium_amm.json @@ -0,0 +1,2291 @@ +{ + "version": "0.3.0", + "name": "raydium_amm", + "instructions": [ + { + "name": "initialize", + "accounts": [ + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "amm", + "isMut": true, + "isSigner": false + }, + { + "name": "ammAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "ammOpenOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "lpMintAddress", + "isMut": true, + "isSigner": false + }, + { + "name": "coinMintAddress", + "isMut": false, + "isSigner": false + }, + { + "name": "pcMintAddress", + "isMut": false, + "isSigner": false + }, + { + "name": "poolCoinTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "poolPcTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "poolWithdrawQueue", + "isMut": true, + "isSigner": false + }, + { + "name": "poolTargetOrdersAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "userLpTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "poolTempLpTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "serumProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "serumMarket", + "isMut": false, + "isSigner": false + }, + { + "name": "userWallet", + "isMut": true, + "isSigner": true + } + ], + "args": [ + { + "name": "nonce", + "type": "u8" + }, + { + "name": "openTime", + "type": "u64" + } + ] + }, + { + "name": "initialize2", + "accounts": [ + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "splAssociatedTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "amm", + "isMut": true, + "isSigner": false + }, + { + "name": "ammAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "ammOpenOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "lpMint", + "isMut": true, + "isSigner": false + }, + { + "name": "coinMint", + "isMut": false, + "isSigner": false + }, + { + "name": "pcMint", + "isMut": false, + "isSigner": false + }, + { + "name": "poolCoinTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "poolPcTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "poolWithdrawQueue", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTargetOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "poolTempLp", + "isMut": true, + "isSigner": false + }, + { + "name": "serumProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "serumMarket", + "isMut": false, + "isSigner": false + }, + { + "name": "userWallet", + "isMut": true, + "isSigner": true + }, + { + "name": "userTokenCoin", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenPc", + "isMut": true, + "isSigner": false + }, + { + "name": "userLpTokenAccount", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "nonce", + "type": "u8" + }, + { + "name": "openTime", + "type": "u64" + }, + { + "name": "initPcAmount", + "type": "u64" + }, + { + "name": "initCoinAmount", + "type": "u64" + } + ] + }, + { + "name": "monitorStep", + "accounts": [ + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "clock", + "isMut": false, + "isSigner": false + }, + { + "name": "amm", + "isMut": true, + "isSigner": false + }, + { + "name": "ammAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "ammOpenOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTargetOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "poolCoinTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "poolPcTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "poolWithdrawQueue", + "isMut": true, + "isSigner": false + }, + { + "name": "serumProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "serumMarket", + "isMut": true, + "isSigner": false + }, + { + "name": "serumCoinVaultAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "serumPcVaultAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "serumVaultSigner", + "isMut": false, + "isSigner": false + }, + { + "name": "serumReqQ", + "isMut": true, + "isSigner": false + }, + { + "name": "serumEventQ", + "isMut": true, + "isSigner": false + }, + { + "name": "serumBids", + "isMut": true, + "isSigner": false + }, + { + "name": "serumAsks", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "planOrderLimit", + "type": "u16" + }, + { + "name": "placeOrderLimit", + "type": "u16" + }, + { + "name": "cancelOrderLimit", + "type": "u16" + } + ] + }, + { + "name": "deposit", + "accounts": [ + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "amm", + "isMut": true, + "isSigner": false + }, + { + "name": "ammAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "ammOpenOrders", + "isMut": false, + "isSigner": false + }, + { + "name": "ammTargetOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "lpMintAddress", + "isMut": true, + "isSigner": false + }, + { + "name": "poolCoinTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "poolPcTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "serumMarket", + "isMut": false, + "isSigner": false + }, + { + "name": "userCoinTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "userPcTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "userLpTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "userOwner", + "isMut": false, + "isSigner": true + }, + { + "name": "serumEventQueue", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "maxCoinAmount", + "type": "u64" + }, + { + "name": "maxPcAmount", + "type": "u64" + }, + { + "name": "baseSide", + "type": "u64" + } + ] + }, + { + "name": "withdraw", + "accounts": [ + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "amm", + "isMut": true, + "isSigner": false + }, + { + "name": "ammAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "ammOpenOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTargetOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "lpMintAddress", + "isMut": true, + "isSigner": false + }, + { + "name": "poolCoinTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "poolPcTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "poolWithdrawQueue", + "isMut": true, + "isSigner": false + }, + { + "name": "poolTempLpTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "serumProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "serumMarket", + "isMut": true, + "isSigner": false + }, + { + "name": "serumCoinVaultAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "serumPcVaultAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "serumVaultSigner", + "isMut": false, + "isSigner": false + }, + { + "name": "userLpTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "userCoinTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "userPcTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "userOwner", + "isMut": false, + "isSigner": true + }, + { + "name": "serumEventQ", + "isMut": true, + "isSigner": false + }, + { + "name": "serumBids", + "isMut": true, + "isSigner": false + }, + { + "name": "serumAsks", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + } + ] + }, + { + "name": "migrateToOpenBook", + "accounts": [ + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "amm", + "isMut": true, + "isSigner": false + }, + { + "name": "ammAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "ammOpenOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTokenCoin", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTokenPc", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTargetOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "serumProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "serumMarket", + "isMut": true, + "isSigner": false + }, + { + "name": "serumBids", + "isMut": true, + "isSigner": false + }, + { + "name": "serumAsks", + "isMut": true, + "isSigner": false + }, + { + "name": "serumEventQueue", + "isMut": true, + "isSigner": false + }, + { + "name": "serumCoinVault", + "isMut": true, + "isSigner": false + }, + { + "name": "serumPcVault", + "isMut": true, + "isSigner": false + }, + { + "name": "serumVaultSigner", + "isMut": false, + "isSigner": false + }, + { + "name": "newAmmOpenOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "newSerumProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "newSerumMarket", + "isMut": false, + "isSigner": false + }, + { + "name": "admin", + "isMut": true, + "isSigner": true + } + ], + "args": [] + }, + { + "name": "setParams", + "accounts": [ + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "amm", + "isMut": true, + "isSigner": false + }, + { + "name": "ammAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "ammOpenOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTargetOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "ammCoinVault", + "isMut": true, + "isSigner": false + }, + { + "name": "ammPcVault", + "isMut": true, + "isSigner": false + }, + { + "name": "serumProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "serumMarket", + "isMut": true, + "isSigner": false + }, + { + "name": "serumCoinVault", + "isMut": true, + "isSigner": false + }, + { + "name": "serumPcVault", + "isMut": true, + "isSigner": false + }, + { + "name": "serumVaultSigner", + "isMut": false, + "isSigner": false + }, + { + "name": "serumEventQueue", + "isMut": true, + "isSigner": false + }, + { + "name": "serumBids", + "isMut": true, + "isSigner": false + }, + { + "name": "serumAsks", + "isMut": true, + "isSigner": false + }, + { + "name": "ammAdminAccount", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "param", + "type": "u8" + }, + { + "name": "value", + "type": { + "option": "u64" + } + }, + { + "name": "newPubkey", + "type": { + "option": "publicKey" + } + }, + { + "name": "fees", + "type": { + "option": { + "defined": "Fees" + } + } + }, + { + "name": "lastOrderDistance", + "type": { + "option": { + "defined": "LastOrderDistance" + } + } + }, + { + "name": "needTakeAmounts", + "type": { + "option": { + "defined": "NeedTake" + } + } + } + ] + }, + { + "name": "withdrawPnl", + "accounts": [ + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "amm", + "isMut": true, + "isSigner": false + }, + { + "name": "ammConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "ammAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "ammOpenOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "poolCoinTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "poolPcTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "coinPnlTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "pcPnlTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "pnlOwnerAccount", + "isMut": false, + "isSigner": true + }, + { + "name": "ammTargetOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "serumProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "serumMarket", + "isMut": true, + "isSigner": false + }, + { + "name": "serumEventQueue", + "isMut": false, + "isSigner": false + }, + { + "name": "serumCoinVaultAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "serumPcVaultAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "serumVaultSigner", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "withdrawSrm", + "accounts": [ + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "amm", + "isMut": false, + "isSigner": false + }, + { + "name": "ammOwnerAccount", + "isMut": false, + "isSigner": true + }, + { + "name": "ammAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "srmToken", + "isMut": true, + "isSigner": false + }, + { + "name": "destSrmToken", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + } + ] + }, + { + "name": "swapBaseIn", + "accounts": [ + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "amm", + "isMut": true, + "isSigner": false + }, + { + "name": "ammAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "ammOpenOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTargetOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "poolCoinTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "poolPcTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "serumProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "serumMarket", + "isMut": true, + "isSigner": false + }, + { + "name": "serumBids", + "isMut": true, + "isSigner": false + }, + { + "name": "serumAsks", + "isMut": true, + "isSigner": false + }, + { + "name": "serumEventQueue", + "isMut": true, + "isSigner": false + }, + { + "name": "serumCoinVaultAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "serumPcVaultAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "serumVaultSigner", + "isMut": false, + "isSigner": false + }, + { + "name": "userSourceTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "userDestinationTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "userSourceOwner", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "amountIn", + "type": "u64" + }, + { + "name": "minimumAmountOut", + "type": "u64" + } + ] + }, + { + "name": "preInitialize", + "accounts": [ + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "ammTargetOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "poolWithdrawQueue", + "isMut": true, + "isSigner": false + }, + { + "name": "ammAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "lpMintAddress", + "isMut": true, + "isSigner": false + }, + { + "name": "coinMintAddress", + "isMut": false, + "isSigner": false + }, + { + "name": "pcMintAddress", + "isMut": false, + "isSigner": false + }, + { + "name": "poolCoinTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "poolPcTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "poolTempLpTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "serumMarket", + "isMut": false, + "isSigner": false + }, + { + "name": "userWallet", + "isMut": true, + "isSigner": true + } + ], + "args": [ + { + "name": "nonce", + "type": "u8" + } + ] + }, + { + "name": "swapBaseOut", + "accounts": [ + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "amm", + "isMut": true, + "isSigner": false + }, + { + "name": "ammAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "ammOpenOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTargetOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "poolCoinTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "poolPcTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "serumProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "serumMarket", + "isMut": true, + "isSigner": false + }, + { + "name": "serumBids", + "isMut": true, + "isSigner": false + }, + { + "name": "serumAsks", + "isMut": true, + "isSigner": false + }, + { + "name": "serumEventQueue", + "isMut": true, + "isSigner": false + }, + { + "name": "serumCoinVaultAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "serumPcVaultAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "serumVaultSigner", + "isMut": false, + "isSigner": false + }, + { + "name": "userSourceTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "userDestinationTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "userSourceOwner", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "maxAmountIn", + "type": "u64" + }, + { + "name": "amountOut", + "type": "u64" + } + ] + }, + { + "name": "simulateInfo", + "accounts": [ + { + "name": "amm", + "isMut": false, + "isSigner": false + }, + { + "name": "ammAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "ammOpenOrders", + "isMut": false, + "isSigner": false + }, + { + "name": "poolCoinTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "poolPcTokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "lpMintAddress", + "isMut": false, + "isSigner": false + }, + { + "name": "serumMarket", + "isMut": false, + "isSigner": false + }, + { + "name": "serumEventQueue", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "param", + "type": "u8" + }, + { + "name": "swapBaseInValue", + "type": { + "option": { + "defined": "SwapInstructionBaseIn" + } + } + }, + { + "name": "swapBaseOutValue", + "type": { + "option": { + "defined": "SwapInstructionBaseOut" + } + } + } + ] + }, + { + "name": "adminCancelOrders", + "accounts": [ + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "amm", + "isMut": false, + "isSigner": false + }, + { + "name": "ammAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "ammOpenOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTargetOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "poolCoinTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "poolPcTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "ammOwnerAccount", + "isMut": false, + "isSigner": true + }, + { + "name": "ammConfig", + "isMut": true, + "isSigner": false + }, + { + "name": "serumProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "serumMarket", + "isMut": true, + "isSigner": false + }, + { + "name": "serumCoinVaultAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "serumPcVaultAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "serumVaultSigner", + "isMut": false, + "isSigner": false + }, + { + "name": "serumEventQ", + "isMut": true, + "isSigner": false + }, + { + "name": "serumBids", + "isMut": true, + "isSigner": false + }, + { + "name": "serumAsks", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "limit", + "type": "u16" + } + ] + }, + { + "name": "createConfigAccount", + "accounts": [ + { + "name": "admin", + "isMut": true, + "isSigner": true + }, + { + "name": "ammConfig", + "isMut": true, + "isSigner": false + }, + { + "name": "owner", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "updateConfigAccount", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, + { + "name": "ammConfig", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "param", + "type": "u8" + }, + { + "name": "owner", + "type": "publicKey" + } + ] + } + ], + "accounts": [ + { + "name": "TargetOrders", + "type": { + "kind": "struct", + "fields": [ + { + "name": "owner", + "type": { + "array": ["u64", 4] + } + }, + { + "name": "buyOrders", + "type": { + "array": [ + { + "defined": "TargetOrder" + }, + 50 + ] + } + }, + { + "name": "padding1", + "type": { + "array": ["u64", 8] + } + }, + { + "name": "targetX", + "type": "u128" + }, + { + "name": "targetY", + "type": "u128" + }, + { + "name": "planXBuy", + "type": "u128" + }, + { + "name": "planYBuy", + "type": "u128" + }, + { + "name": "planXSell", + "type": "u128" + }, + { + "name": "planYSell", + "type": "u128" + }, + { + "name": "placedX", + "type": "u128" + }, + { + "name": "placedY", + "type": "u128" + }, + { + "name": "calcPnlX", + "type": "u128" + }, + { + "name": "calcPnlY", + "type": "u128" + }, + { + "name": "sellOrders", + "type": { + "array": [ + { + "defined": "TargetOrder" + }, + 50 + ] + } + }, + { + "name": "padding2", + "type": { + "array": ["u64", 6] + } + }, + { + "name": "replaceBuyClientId", + "type": { + "array": ["u64", 10] + } + }, + { + "name": "replaceSellClientId", + "type": { + "array": ["u64", 10] + } + }, + { + "name": "lastOrderNumerator", + "type": "u64" + }, + { + "name": "lastOrderDenominator", + "type": "u64" + }, + { + "name": "planOrdersCur", + "type": "u64" + }, + { + "name": "placeOrdersCur", + "type": "u64" + }, + { + "name": "validBuyOrderNum", + "type": "u64" + }, + { + "name": "validSellOrderNum", + "type": "u64" + }, + { + "name": "padding3", + "type": { + "array": ["u64", 10] + } + }, + { + "name": "freeSlotBits", + "type": "u128" + } + ] + } + }, + { + "name": "Fees", + "type": { + "kind": "struct", + "fields": [ + { + "name": "minSeparateNumerator", + "type": "u64" + }, + { + "name": "minSeparateDenominator", + "type": "u64" + }, + { + "name": "tradeFeeNumerator", + "type": "u64" + }, + { + "name": "tradeFeeDenominator", + "type": "u64" + }, + { + "name": "pnlNumerator", + "type": "u64" + }, + { + "name": "pnlDenominator", + "type": "u64" + }, + { + "name": "swapFeeNumerator", + "type": "u64" + }, + { + "name": "swapFeeDenominator", + "type": "u64" + } + ] + } + }, + { + "name": "AmmInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "status", + "type": "u64" + }, + { + "name": "nonce", + "type": "u64" + }, + { + "name": "orderNum", + "type": "u64" + }, + { + "name": "depth", + "type": "u64" + }, + { + "name": "coinDecimals", + "type": "u64" + }, + { + "name": "pcDecimals", + "type": "u64" + }, + { + "name": "state", + "type": "u64" + }, + { + "name": "resetFlag", + "type": "u64" + }, + { + "name": "minSize", + "type": "u64" + }, + { + "name": "volMaxCutRatio", + "type": "u64" + }, + { + "name": "amountWave", + "type": "u64" + }, + { + "name": "coinLotSize", + "type": "u64" + }, + { + "name": "pcLotSize", + "type": "u64" + }, + { + "name": "minPriceMultiplier", + "type": "u64" + }, + { + "name": "maxPriceMultiplier", + "type": "u64" + }, + { + "name": "sysDecimalValue", + "type": "u64" + }, + { + "name": "fees", + "type": { + "defined": "Fees" + } + }, + { + "name": "outPut", + "type": { + "defined": "OutPutData" + } + }, + { + "name": "tokenCoin", + "type": "publicKey" + }, + { + "name": "tokenPc", + "type": "publicKey" + }, + { + "name": "coinMint", + "type": "publicKey" + }, + { + "name": "pcMint", + "type": "publicKey" + }, + { + "name": "lpMint", + "type": "publicKey" + }, + { + "name": "openOrders", + "type": "publicKey" + }, + { + "name": "market", + "type": "publicKey" + }, + { + "name": "serumDex", + "type": "publicKey" + }, + { + "name": "targetOrders", + "type": "publicKey" + }, + { + "name": "withdrawQueue", + "type": "publicKey" + }, + { + "name": "tokenTempLp", + "type": "publicKey" + }, + { + "name": "ammOwner", + "type": "publicKey" + }, + { + "name": "lpAmount", + "type": "u64" + }, + { + "name": "clientOrderId", + "type": "u64" + }, + { + "name": "padding", + "type": { + "array": ["u64", 2] + } + } + ] + } + } + ], + "types": [ + { + "name": "WithdrawDestToken", + "type": { + "kind": "struct", + "fields": [ + { + "name": "withdrawAmount", + "type": "u64" + }, + { + "name": "coinAmount", + "type": "u64" + }, + { + "name": "pcAmount", + "type": "u64" + }, + { + "name": "destTokenCoin", + "type": "publicKey" + }, + { + "name": "destTokenPc", + "type": "publicKey" + } + ] + } + }, + { + "name": "WithdrawQueue", + "type": { + "kind": "struct", + "fields": [ + { + "name": "owner", + "type": { + "array": ["u64", 4] + } + }, + { + "name": "head", + "type": "u64" + }, + { + "name": "count", + "type": "u64" + }, + { + "name": "buf", + "type": { + "array": [ + { + "defined": "WithdrawDestToken" + }, + 64 + ] + } + } + ] + } + }, + { + "name": "TargetOrder", + "type": { + "kind": "struct", + "fields": [ + { + "name": "price", + "type": "u64" + }, + { + "name": "vol", + "type": "u64" + } + ] + } + }, + { + "name": "OutPutData", + "type": { + "kind": "struct", + "fields": [ + { + "name": "needTakePnlCoin", + "type": "u64" + }, + { + "name": "needTakePnlPc", + "type": "u64" + }, + { + "name": "totalPnlPc", + "type": "u64" + }, + { + "name": "totalPnlCoin", + "type": "u64" + }, + { + "name": "poolOpenTime", + "type": "u64" + }, + { + "name": "punishPcAmount", + "type": "u64" + }, + { + "name": "punishCoinAmount", + "type": "u64" + }, + { + "name": "orderbookToInitTime", + "type": "u64" + }, + { + "name": "swapCoinInAmount", + "type": "u128" + }, + { + "name": "swapPcOutAmount", + "type": "u128" + }, + { + "name": "swapTakePcFee", + "type": "u64" + }, + { + "name": "swapPcInAmount", + "type": "u128" + }, + { + "name": "swapCoinOutAmount", + "type": "u128" + }, + { + "name": "swapTakeCoinFee", + "type": "u64" + } + ] + } + }, + { + "name": "AmmConfig", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pnlOwner", + "type": "publicKey" + }, + { + "name": "cancelOwner", + "type": "publicKey" + }, + { + "name": "pending1", + "type": { + "array": ["u64", 28] + } + }, + { + "name": "pending2", + "type": { + "array": ["u64", 32] + } + } + ] + } + }, + { + "name": "LastOrderDistance", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lastOrderNumerator", + "type": "u64" + }, + { + "name": "lastOrderDenominator", + "type": "u64" + } + ] + } + }, + { + "name": "NeedTake", + "type": { + "kind": "struct", + "fields": [ + { + "name": "needTakePc", + "type": "u64" + }, + { + "name": "needTakeCoin", + "type": "u64" + } + ] + } + }, + { + "name": "SwapInstructionBaseIn", + "type": { + "kind": "struct", + "fields": [ + { + "name": "amountIn", + "type": "u64" + }, + { + "name": "minimumAmountOut", + "type": "u64" + } + ] + } + }, + { + "name": "SwapInstructionBaseOut", + "type": { + "kind": "struct", + "fields": [ + { + "name": "maxAmountIn", + "type": "u64" + }, + { + "name": "amountOut", + "type": "u64" + } + ] + } + } + ], + "errors": [ + { + "code": 0, + "name": "AlreadyInUse", + "msg": "AlreadyInUse" + }, + { + "code": 1, + "name": "InvalidProgramAddress", + "msg": "InvalidProgramAddress" + }, + { + "code": 2, + "name": "ExpectedMint", + "msg": "ExpectedMint" + }, + { + "code": 3, + "name": "ExpectedAccount", + "msg": "ExpectedAccount" + }, + { + "code": 4, + "name": "InvalidCoinVault", + "msg": "InvalidCoinVault" + }, + { + "code": 5, + "name": "InvalidPCVault", + "msg": "InvalidPCVault" + }, + { + "code": 6, + "name": "InvalidTokenLP", + "msg": "InvalidTokenLP" + }, + { + "code": 7, + "name": "InvalidDestTokenCoin", + "msg": "InvalidDestTokenCoin" + }, + { + "code": 8, + "name": "InvalidDestTokenPC", + "msg": "InvalidDestTokenPC" + }, + { + "code": 9, + "name": "InvalidPoolMint", + "msg": "InvalidPoolMint" + }, + { + "code": 10, + "name": "InvalidOpenOrders", + "msg": "InvalidOpenOrders" + }, + { + "code": 11, + "name": "InvalidSerumMarket", + "msg": "InvalidSerumMarket" + }, + { + "code": 12, + "name": "InvalidSerumProgram", + "msg": "InvalidSerumProgram" + }, + { + "code": 13, + "name": "InvalidTargetOrders", + "msg": "InvalidTargetOrders" + }, + { + "code": 14, + "name": "InvalidWithdrawQueue", + "msg": "InvalidWithdrawQueue" + }, + { + "code": 15, + "name": "InvalidTempLp", + "msg": "InvalidTempLp" + }, + { + "code": 16, + "name": "InvalidCoinMint", + "msg": "InvalidCoinMint" + }, + { + "code": 17, + "name": "InvalidPCMint", + "msg": "InvalidPCMint" + }, + { + "code": 18, + "name": "InvalidOwner", + "msg": "InvalidOwner" + }, + { + "code": 19, + "name": "InvalidSupply", + "msg": "InvalidSupply" + }, + { + "code": 20, + "name": "InvalidDelegate", + "msg": "InvalidDelegate" + }, + { + "code": 21, + "name": "InvalidSignAccount", + "msg": "Invalid Sign Account" + }, + { + "code": 22, + "name": "InvalidStatus", + "msg": "InvalidStatus" + }, + { + "code": 23, + "name": "InvalidInstruction", + "msg": "Invalid instruction" + }, + { + "code": 24, + "name": "WrongAccountsNumber", + "msg": "Wrong accounts number" + }, + { + "code": 25, + "name": "WithdrawTransferBusy", + "msg": "Withdraw_transfer is busy" + }, + { + "code": 26, + "name": "WithdrawQueueFull", + "msg": "WithdrawQueue is full" + }, + { + "code": 27, + "name": "WithdrawQueueEmpty", + "msg": "WithdrawQueue is empty" + }, + { + "code": 28, + "name": "InvalidParamsSet", + "msg": "Params Set is invalid" + }, + { + "code": 29, + "name": "InvalidInput", + "msg": "InvalidInput" + }, + { + "code": 30, + "name": "ExceededSlippage", + "msg": "instruction exceeds desired slippage limit" + }, + { + "code": 31, + "name": "CalculationExRateFailure", + "msg": "CalculationExRateFailure" + }, + { + "code": 32, + "name": "CheckedSubOverflow", + "msg": "Checked_Sub Overflow" + }, + { + "code": 33, + "name": "CheckedAddOverflow", + "msg": "Checked_Add Overflow" + }, + { + "code": 34, + "name": "CheckedMulOverflow", + "msg": "Checked_Mul Overflow" + }, + { + "code": 35, + "name": "CheckedDivOverflow", + "msg": "Checked_Div Overflow" + }, + { + "code": 36, + "name": "CheckedEmptyFunds", + "msg": "Empty Funds" + }, + { + "code": 37, + "name": "CalcPnlError", + "msg": "Calc pnl error" + }, + { + "code": 38, + "name": "InvalidSplTokenProgram", + "msg": "InvalidSplTokenProgram" + }, + { + "code": 39, + "name": "TakePnlError", + "msg": "Take Pnl error" + }, + { + "code": 40, + "name": "InsufficientFunds", + "msg": "Insufficient funds" + }, + { + "code": 41, + "name": "ConversionFailure", + "msg": "Conversion to u64 failed with an overflow or underflow" + }, + { + "code": 42, + "name": "InvalidUserToken", + "msg": "user token input does not match amm" + }, + { + "code": 43, + "name": "InvalidSrmMint", + "msg": "InvalidSrmMint" + }, + { + "code": 44, + "name": "InvalidSrmToken", + "msg": "InvalidSrmToken" + }, + { + "code": 45, + "name": "TooManyOpenOrders", + "msg": "TooManyOpenOrders" + }, + { + "code": 46, + "name": "OrderAtSlotIsPlaced", + "msg": "OrderAtSlotIsPlaced" + }, + { + "code": 47, + "name": "InvalidSysProgramAddress", + "msg": "InvalidSysProgramAddress" + }, + { + "code": 48, + "name": "InvalidFee", + "msg": "The provided fee does not match the program owner's constraints" + }, + { + "code": 49, + "name": "RepeatCreateAmm", + "msg": "Repeat create amm about market" + }, + { + "code": 50, + "name": "NotAllowZeroLP", + "msg": "Not allow Zero LP" + }, + { + "code": 51, + "name": "InvalidCloseAuthority", + "msg": "Token account has a close authority" + }, + { + "code": 52, + "name": "InvalidFreezeAuthority", + "msg": "Pool token mint has a freeze authority" + }, + { + "code": 53, + "name": "InvalidReferPCMint", + "msg": "InvalidReferPCMint" + }, + { + "code": 54, + "name": "InvalidConfigAccount", + "msg": "InvalidConfigAccount" + }, + { + "code": 55, + "name": "RepeatCreateConfigAccount", + "msg": "Repeat create staking config account" + }, + { + "code": 56, + "name": "UnknownAmmError", + "msg": "Unknown Amm Error" + } + ], + "metadata": { + "instruction_selector_type": "index", + "address": "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8" + } +} diff --git a/idl/raydium_clmm.json b/idl/raydium_clmm.json new file mode 100644 index 0000000..69f24dc --- /dev/null +++ b/idl/raydium_clmm.json @@ -0,0 +1,4154 @@ +{ + "version": "0.1.0", + "name": "amm_v3", + "instructions": [ + { + "name": "createAmmConfig", + "docs": [ + "# Arguments", + "", + "* `ctx`- The accounts needed by instruction.", + "* `index` - The index of amm config, there may be multiple config.", + "* `tick_spacing` - The tickspacing binding with config, cannot be changed.", + "* `trade_fee_rate` - Trade fee rate, can be changed.", + "* `protocol_fee_rate` - The rate of protocol fee within tarde fee.", + "* `fund_fee_rate` - The rate of fund fee within tarde fee.", + "" + ], + "accounts": [ + { + "name": "owner", + "isMut": true, + "isSigner": true, + "docs": [ + "Address to be set as protocol owner." + ] + }, + { + "name": "ammConfig", + "isMut": true, + "isSigner": false, + "docs": [ + "Initialize config state account to store protocol owner address and fee rates." + ] + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "index", + "type": "u16" + }, + { + "name": "tickSpacing", + "type": "u16" + }, + { + "name": "tradeFeeRate", + "type": "u32" + }, + { + "name": "protocolFeeRate", + "type": "u32" + }, + { + "name": "fundFeeRate", + "type": "u32" + } + ] + }, + { + "name": "updateAmmConfig", + "docs": [ + "Updates the owner of the amm config", + "Must be called by the current owner or admin", + "", + "# Arguments", + "", + "* `ctx`- The context of accounts", + "* `trade_fee_rate`- The new trade fee rate of amm config, be set when `param` is 0", + "* `protocol_fee_rate`- The new protocol fee rate of amm config, be set when `param` is 1", + "* `fund_fee_rate`- The new fund fee rate of amm config, be set when `param` is 2", + "* `new_owner`- The config's new owner, be set when `param` is 3", + "* `new_fund_owner`- The config's new fund owner, be set when `param` is 4", + "* `param`- The vaule can be 0 | 1 | 2 | 3 | 4, otherwise will report a error", + "" + ], + "accounts": [ + { + "name": "owner", + "isMut": false, + "isSigner": true, + "docs": [ + "The amm config owner or admin" + ] + }, + { + "name": "ammConfig", + "isMut": true, + "isSigner": false, + "docs": [ + "Amm config account to be changed" + ] + } + ], + "args": [ + { + "name": "param", + "type": "u8" + }, + { + "name": "value", + "type": "u32" + } + ] + }, + { + "name": "createPool", + "docs": [ + "Creates a pool for the given token pair and the initial price", + "", + "# Arguments", + "", + "* `ctx`- The context of accounts", + "* `sqrt_price_x64` - the initial sqrt price (amount_token_1 / amount_token_0) of the pool as a Q64.64", + "" + ], + "accounts": [ + { + "name": "poolCreator", + "isMut": true, + "isSigner": true, + "docs": [ + "Address paying to create the pool. Can be anyone" + ] + }, + { + "name": "ammConfig", + "isMut": false, + "isSigner": false, + "docs": [ + "Which config the pool belongs to." + ] + }, + { + "name": "poolState", + "isMut": true, + "isSigner": false, + "docs": [ + "Initialize an account to store the pool state" + ] + }, + { + "name": "tokenMint0", + "isMut": false, + "isSigner": false, + "docs": [ + "Token_0 mint, the key must be smaller then token_1 mint." + ] + }, + { + "name": "tokenMint1", + "isMut": false, + "isSigner": false, + "docs": [ + "Token_1 mint" + ] + }, + { + "name": "tokenVault0", + "isMut": true, + "isSigner": false, + "docs": [ + "Token_0 vault for the pool" + ] + }, + { + "name": "tokenVault1", + "isMut": true, + "isSigner": false, + "docs": [ + "Token_1 vault for the pool" + ] + }, + { + "name": "observationState", + "isMut": true, + "isSigner": false, + "docs": [ + "Initialize an account to store oracle observations" + ] + }, + { + "name": "tickArrayBitmap", + "isMut": true, + "isSigner": false, + "docs": [ + "Initialize an account to store if a tick array is initialized." + ] + }, + { + "name": "tokenProgram0", + "isMut": false, + "isSigner": false, + "docs": [ + "Spl token program or token program 2022" + ] + }, + { + "name": "tokenProgram1", + "isMut": false, + "isSigner": false, + "docs": [ + "Spl token program or token program 2022" + ] + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "To create a new program account" + ] + }, + { + "name": "rent", + "isMut": false, + "isSigner": false, + "docs": [ + "Sysvar for program account" + ] + } + ], + "args": [ + { + "name": "sqrtPriceX64", + "type": "u128" + }, + { + "name": "openTime", + "type": "u64" + } + ] + }, + { + "name": "updatePoolStatus", + "docs": [ + "Update pool status for given vaule", + "", + "# Arguments", + "", + "* `ctx`- The context of accounts", + "* `status` - The vaule of status", + "" + ], + "accounts": [ + { + "name": "authority", + "isMut": false, + "isSigner": true + }, + { + "name": "poolState", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "status", + "type": "u8" + } + ] + }, + { + "name": "createOperationAccount", + "docs": [ + "Creates an operation account for the program", + "", + "# Arguments", + "", + "* `ctx`- The context of accounts", + "" + ], + "accounts": [ + { + "name": "owner", + "isMut": true, + "isSigner": true, + "docs": [ + "Address to be set as operation account owner." + ] + }, + { + "name": "operationState", + "isMut": true, + "isSigner": false, + "docs": [ + "Initialize operation state account to store operation owner address and white list mint." + ] + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "updateOperationAccount", + "docs": [ + "Update the operation account", + "", + "# Arguments", + "", + "* `ctx`- The context of accounts", + "* `param`- The vaule can be 0 | 1 | 2 | 3, otherwise will report a error", + "* `keys`- update operation owner when the `param` is 0", + "remove operation owner when the `param` is 1", + "update whitelist mint when the `param` is 2", + "remove whitelist mint when the `param` is 3", + "" + ], + "accounts": [ + { + "name": "owner", + "isMut": false, + "isSigner": true, + "docs": [ + "Address to be set as operation account owner." + ] + }, + { + "name": "operationState", + "isMut": true, + "isSigner": false, + "docs": [ + "Initialize operation state account to store operation owner address and white list mint." + ] + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "param", + "type": "u8" + }, + { + "name": "keys", + "type": { + "vec": "publicKey" + } + } + ] + }, + { + "name": "transferRewardOwner", + "docs": [ + "Transfer reward owner", + "", + "# Arguments", + "", + "* `ctx`- The context of accounts", + "* `new_owner`- new owner pubkey", + "" + ], + "accounts": [ + { + "name": "authority", + "isMut": false, + "isSigner": true, + "docs": [ + "Address to be set as operation account owner." + ] + }, + { + "name": "poolState", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "newOwner", + "type": "publicKey" + } + ] + }, + { + "name": "initializeReward", + "docs": [ + "Initialize a reward info for a given pool and reward index", + "", + "# Arguments", + "", + "* `ctx`- The context of accounts", + "* `reward_index` - the index to reward info", + "* `open_time` - reward open timestamp", + "* `end_time` - reward end timestamp", + "* `emissions_per_second_x64` - Token reward per second are earned per unit of liquidity.", + "" + ], + "accounts": [ + { + "name": "rewardFunder", + "isMut": true, + "isSigner": true, + "docs": [ + "The founder deposit reward token to vault" + ] + }, + { + "name": "funderTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "ammConfig", + "isMut": false, + "isSigner": false, + "docs": [ + "For check the reward_funder authority" + ] + }, + { + "name": "poolState", + "isMut": true, + "isSigner": false, + "docs": [ + "Set reward for this pool" + ] + }, + { + "name": "operationState", + "isMut": false, + "isSigner": false, + "docs": [ + "load info from the account to judge reward permission" + ] + }, + { + "name": "rewardTokenMint", + "isMut": false, + "isSigner": false, + "docs": [ + "Reward mint" + ] + }, + { + "name": "rewardTokenVault", + "isMut": true, + "isSigner": false, + "docs": [ + "A pda, reward vault" + ] + }, + { + "name": "rewardTokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "param", + "type": { + "defined": "InitializeRewardParam" + } + } + ] + }, + { + "name": "collectRemainingRewards", + "docs": [ + "Collect remaining reward token for reward founder", + "", + "# Arguments", + "", + "* `ctx`- The context of accounts", + "* `reward_index` - the index to reward info", + "" + ], + "accounts": [ + { + "name": "rewardFunder", + "isMut": false, + "isSigner": true, + "docs": [ + "The founder who init reward info in berfore" + ] + }, + { + "name": "funderTokenAccount", + "isMut": true, + "isSigner": false, + "docs": [ + "The funder's reward token account" + ] + }, + { + "name": "poolState", + "isMut": true, + "isSigner": false, + "docs": [ + "Set reward for this pool" + ] + }, + { + "name": "rewardTokenVault", + "isMut": false, + "isSigner": false, + "docs": [ + "Reward vault transfer remaining token to founder token account" + ] + }, + { + "name": "rewardVaultMint", + "isMut": false, + "isSigner": false, + "docs": [ + "The mint of reward token vault" + ] + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgram2022", + "isMut": false, + "isSigner": false, + "docs": [ + "Token program 2022" + ] + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "memo program" + ] + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u8" + } + ] + }, + { + "name": "updateRewardInfos", + "docs": [ + "Update rewards info of the given pool, can be called for everyone", + "", + "# Arguments", + "", + "* `ctx`- The context of accounts", + "" + ], + "accounts": [ + { + "name": "poolState", + "isMut": true, + "isSigner": false, + "docs": [ + "The liquidity pool for which reward info to update" + ] + } + ], + "args": [] + }, + { + "name": "setRewardParams", + "docs": [ + "Restset reward param, start a new reward cycle or extend the current cycle.", + "", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "* `reward_index` - The index of reward token in the pool.", + "* `emissions_per_second_x64` - The per second emission reward, when extend the current cycle,", + "new value can't be less than old value", + "* `open_time` - reward open timestamp, must be set when state a new cycle", + "* `end_time` - reward end timestamp", + "" + ], + "accounts": [ + { + "name": "authority", + "isMut": false, + "isSigner": true, + "docs": [ + "Address to be set as protocol owner. It pays to create factory state account." + ] + }, + { + "name": "ammConfig", + "isMut": false, + "isSigner": false + }, + { + "name": "poolState", + "isMut": true, + "isSigner": false + }, + { + "name": "operationState", + "isMut": false, + "isSigner": false, + "docs": [ + "load info from the account to judge reward permission" + ] + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "Token program" + ] + }, + { + "name": "tokenProgram2022", + "isMut": false, + "isSigner": false, + "docs": [ + "Token program 2022" + ] + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u8" + }, + { + "name": "emissionsPerSecondX64", + "type": "u128" + }, + { + "name": "openTime", + "type": "u64" + }, + { + "name": "endTime", + "type": "u64" + } + ] + }, + { + "name": "collectProtocolFee", + "docs": [ + "Collect the protocol fee accrued to the pool", + "", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "* `amount_0_requested` - The maximum amount of token_0 to send, can be 0 to collect fees in only token_1", + "* `amount_1_requested` - The maximum amount of token_1 to send, can be 0 to collect fees in only token_0", + "" + ], + "accounts": [ + { + "name": "owner", + "isMut": false, + "isSigner": true, + "docs": [ + "Only admin or config owner can collect fee now" + ] + }, + { + "name": "poolState", + "isMut": true, + "isSigner": false, + "docs": [ + "Pool state stores accumulated protocol fee amount" + ] + }, + { + "name": "ammConfig", + "isMut": false, + "isSigner": false, + "docs": [ + "Amm config account stores owner" + ] + }, + { + "name": "tokenVault0", + "isMut": true, + "isSigner": false, + "docs": [ + "The address that holds pool tokens for token_0" + ] + }, + { + "name": "tokenVault1", + "isMut": true, + "isSigner": false, + "docs": [ + "The address that holds pool tokens for token_1" + ] + }, + { + "name": "vault0Mint", + "isMut": false, + "isSigner": false, + "docs": [ + "The mint of token vault 0" + ] + }, + { + "name": "vault1Mint", + "isMut": false, + "isSigner": false, + "docs": [ + "The mint of token vault 1" + ] + }, + { + "name": "recipientTokenAccount0", + "isMut": true, + "isSigner": false, + "docs": [ + "The address that receives the collected token_0 protocol fees" + ] + }, + { + "name": "recipientTokenAccount1", + "isMut": true, + "isSigner": false, + "docs": [ + "The address that receives the collected token_1 protocol fees" + ] + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "The SPL program to perform token transfers" + ] + }, + { + "name": "tokenProgram2022", + "isMut": false, + "isSigner": false, + "docs": [ + "The SPL program 2022 to perform token transfers" + ] + } + ], + "args": [ + { + "name": "amount0Requested", + "type": "u64" + }, + { + "name": "amount1Requested", + "type": "u64" + } + ] + }, + { + "name": "collectFundFee", + "docs": [ + "Collect the fund fee accrued to the pool", + "", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "* `amount_0_requested` - The maximum amount of token_0 to send, can be 0 to collect fees in only token_1", + "* `amount_1_requested` - The maximum amount of token_1 to send, can be 0 to collect fees in only token_0", + "" + ], + "accounts": [ + { + "name": "owner", + "isMut": false, + "isSigner": true, + "docs": [ + "Only admin or fund_owner can collect fee now" + ] + }, + { + "name": "poolState", + "isMut": true, + "isSigner": false, + "docs": [ + "Pool state stores accumulated protocol fee amount" + ] + }, + { + "name": "ammConfig", + "isMut": false, + "isSigner": false, + "docs": [ + "Amm config account stores fund_owner" + ] + }, + { + "name": "tokenVault0", + "isMut": true, + "isSigner": false, + "docs": [ + "The address that holds pool tokens for token_0" + ] + }, + { + "name": "tokenVault1", + "isMut": true, + "isSigner": false, + "docs": [ + "The address that holds pool tokens for token_1" + ] + }, + { + "name": "vault0Mint", + "isMut": false, + "isSigner": false, + "docs": [ + "The mint of token vault 0" + ] + }, + { + "name": "vault1Mint", + "isMut": false, + "isSigner": false, + "docs": [ + "The mint of token vault 1" + ] + }, + { + "name": "recipientTokenAccount0", + "isMut": true, + "isSigner": false, + "docs": [ + "The address that receives the collected token_0 protocol fees" + ] + }, + { + "name": "recipientTokenAccount1", + "isMut": true, + "isSigner": false, + "docs": [ + "The address that receives the collected token_1 protocol fees" + ] + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "The SPL program to perform token transfers" + ] + }, + { + "name": "tokenProgram2022", + "isMut": false, + "isSigner": false, + "docs": [ + "The SPL program 2022 to perform token transfers" + ] + } + ], + "args": [ + { + "name": "amount0Requested", + "type": "u64" + }, + { + "name": "amount1Requested", + "type": "u64" + } + ] + }, + { + "name": "openPosition", + "docs": [ + "#[deprecated(note = \"Use `open_position_with_token22_nft` instead.\")]", + "Creates a new position wrapped in a NFT", + "", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "* `tick_lower_index` - The low boundary of market", + "* `tick_upper_index` - The upper boundary of market", + "* `tick_array_lower_start_index` - The start index of tick array which include tick low", + "* `tick_array_upper_start_index` - The start index of tick array which include tick upper", + "* `liquidity` - The liquidity to be added", + "* `amount_0_max` - The max amount of token_0 to spend, which serves as a slippage check", + "* `amount_1_max` - The max amount of token_1 to spend, which serves as a slippage check", + "" + ], + "accounts": [ + { + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "Pays to mint the position" + ] + }, + { + "name": "positionNftOwner", + "isMut": false, + "isSigner": false + }, + { + "name": "positionNftMint", + "isMut": true, + "isSigner": true, + "docs": [ + "Unique token mint address" + ] + }, + { + "name": "positionNftAccount", + "isMut": true, + "isSigner": false, + "docs": [ + "Token account where position NFT will be minted", + "This account created in the contract by cpi to avoid large stack variables" + ] + }, + { + "name": "metadataAccount", + "isMut": true, + "isSigner": false, + "docs": [ + "To store metaplex metadata" + ] + }, + { + "name": "poolState", + "isMut": true, + "isSigner": false, + "docs": [ + "Add liquidity for this pool" + ] + }, + { + "name": "protocolPosition", + "isMut": true, + "isSigner": false, + "docs": [ + "Store the information of market marking in range" + ] + }, + { + "name": "tickArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayUpper", + "isMut": true, + "isSigner": false + }, + { + "name": "personalPosition", + "isMut": true, + "isSigner": false, + "docs": [ + "personal position state" + ] + }, + { + "name": "tokenAccount0", + "isMut": true, + "isSigner": false, + "docs": [ + "The token_0 account deposit token to the pool" + ] + }, + { + "name": "tokenAccount1", + "isMut": true, + "isSigner": false, + "docs": [ + "The token_1 account deposit token to the pool" + ] + }, + { + "name": "tokenVault0", + "isMut": true, + "isSigner": false, + "docs": [ + "The address that holds pool tokens for token_0" + ] + }, + { + "name": "tokenVault1", + "isMut": true, + "isSigner": false, + "docs": [ + "The address that holds pool tokens for token_1" + ] + }, + { + "name": "rent", + "isMut": false, + "isSigner": false, + "docs": [ + "Sysvar for token mint and ATA creation" + ] + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "Program to create the position manager state account" + ] + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "Program to create mint account and mint tokens" + ] + }, + { + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "Program to create an ATA for receiving position NFT" + ] + }, + { + "name": "metadataProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "Program to create NFT metadata" + ] + } + ], + "args": [ + { + "name": "tickLowerIndex", + "type": "i32" + }, + { + "name": "tickUpperIndex", + "type": "i32" + }, + { + "name": "tickArrayLowerStartIndex", + "type": "i32" + }, + { + "name": "tickArrayUpperStartIndex", + "type": "i32" + }, + { + "name": "liquidity", + "type": "u128" + }, + { + "name": "amount0Max", + "type": "u64" + }, + { + "name": "amount1Max", + "type": "u64" + } + ] + }, + { + "name": "openPositionV2", + "docs": [ + "#[deprecated(note = \"Use `open_position_with_token22_nft` instead.\")]", + "Creates a new position wrapped in a NFT, support Token2022", + "", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "* `tick_lower_index` - The low boundary of market", + "* `tick_upper_index` - The upper boundary of market", + "* `tick_array_lower_start_index` - The start index of tick array which include tick low", + "* `tick_array_upper_start_index` - The start index of tick array which include tick upper", + "* `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", + "* `amount_0_max` - The max amount of token_0 to spend, which serves as a slippage check", + "* `amount_1_max` - The max amount of token_1 to spend, which serves as a slippage check", + "* `with_metadata` - The flag indicating whether to create NFT mint metadata", + "* `base_flag` - if the liquidity specified as zero, true: calculate liquidity base amount_0_max otherwise base amount_1_max", + "" + ], + "accounts": [ + { + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "Pays to mint the position" + ] + }, + { + "name": "positionNftOwner", + "isMut": false, + "isSigner": false + }, + { + "name": "positionNftMint", + "isMut": true, + "isSigner": true, + "docs": [ + "Unique token mint address" + ] + }, + { + "name": "positionNftAccount", + "isMut": true, + "isSigner": false, + "docs": [ + "Token account where position NFT will be minted" + ] + }, + { + "name": "metadataAccount", + "isMut": true, + "isSigner": false, + "docs": [ + "To store metaplex metadata" + ] + }, + { + "name": "poolState", + "isMut": true, + "isSigner": false, + "docs": [ + "Add liquidity for this pool" + ] + }, + { + "name": "protocolPosition", + "isMut": true, + "isSigner": false, + "docs": [ + "Store the information of market marking in range" + ] + }, + { + "name": "tickArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayUpper", + "isMut": true, + "isSigner": false + }, + { + "name": "personalPosition", + "isMut": true, + "isSigner": false, + "docs": [ + "personal position state" + ] + }, + { + "name": "tokenAccount0", + "isMut": true, + "isSigner": false, + "docs": [ + "The token_0 account deposit token to the pool" + ] + }, + { + "name": "tokenAccount1", + "isMut": true, + "isSigner": false, + "docs": [ + "The token_1 account deposit token to the pool" + ] + }, + { + "name": "tokenVault0", + "isMut": true, + "isSigner": false, + "docs": [ + "The address that holds pool tokens for token_0" + ] + }, + { + "name": "tokenVault1", + "isMut": true, + "isSigner": false, + "docs": [ + "The address that holds pool tokens for token_1" + ] + }, + { + "name": "rent", + "isMut": false, + "isSigner": false, + "docs": [ + "Sysvar for token mint and ATA creation" + ] + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "Program to create the position manager state account" + ] + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "Program to create mint account and mint tokens" + ] + }, + { + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "Program to create an ATA for receiving position NFT" + ] + }, + { + "name": "metadataProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "Program to create NFT metadata" + ] + }, + { + "name": "tokenProgram2022", + "isMut": false, + "isSigner": false, + "docs": [ + "Program to create mint account and mint tokens" + ] + }, + { + "name": "vault0Mint", + "isMut": false, + "isSigner": false, + "docs": [ + "The mint of token vault 0" + ] + }, + { + "name": "vault1Mint", + "isMut": false, + "isSigner": false, + "docs": [ + "The mint of token vault 1" + ] + } + ], + "args": [ + { + "name": "tickLowerIndex", + "type": "i32" + }, + { + "name": "tickUpperIndex", + "type": "i32" + }, + { + "name": "tickArrayLowerStartIndex", + "type": "i32" + }, + { + "name": "tickArrayUpperStartIndex", + "type": "i32" + }, + { + "name": "liquidity", + "type": "u128" + }, + { + "name": "amount0Max", + "type": "u64" + }, + { + "name": "amount1Max", + "type": "u64" + }, + { + "name": "withMetadata", + "type": "bool" + }, + { + "name": "baseFlag", + "type": { + "option": "bool" + } + } + ] + }, + { + "name": "openPositionWithToken22Nft", + "docs": [ + "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.", + "", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "* `tick_lower_index` - The low boundary of market", + "* `tick_upper_index` - The upper boundary of market", + "* `tick_array_lower_start_index` - The start index of tick array which include tick low", + "* `tick_array_upper_start_index` - The start index of tick array which include tick upper", + "* `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", + "* `amount_0_max` - The max amount of token_0 to spend, which serves as a slippage check", + "* `amount_1_max` - The max amount of token_1 to spend, which serves as a slippage check", + "* `with_metadata` - The flag indicating whether to create NFT mint metadata", + "* `base_flag` - if the liquidity specified as zero, true: calculate liquidity base amount_0_max otherwise base amount_1_max", + "" + ], + "accounts": [ + { + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "Pays to mint the position" + ] + }, + { + "name": "positionNftOwner", + "isMut": false, + "isSigner": false + }, + { + "name": "positionNftMint", + "isMut": true, + "isSigner": true, + "docs": [ + "Unique token mint address, initialize in constract" + ] + }, + { + "name": "positionNftAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "poolState", + "isMut": true, + "isSigner": false, + "docs": [ + "Add liquidity for this pool" + ] + }, + { + "name": "protocolPosition", + "isMut": true, + "isSigner": false, + "docs": [ + "Store the information of market marking in range" + ] + }, + { + "name": "tickArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "tickArrayUpper", + "isMut": true, + "isSigner": false + }, + { + "name": "personalPosition", + "isMut": true, + "isSigner": false, + "docs": [ + "personal position state" + ] + }, + { + "name": "tokenAccount0", + "isMut": true, + "isSigner": false, + "docs": [ + "The token_0 account deposit token to the pool" + ] + }, + { + "name": "tokenAccount1", + "isMut": true, + "isSigner": false, + "docs": [ + "The token_1 account deposit token to the pool" + ] + }, + { + "name": "tokenVault0", + "isMut": true, + "isSigner": false, + "docs": [ + "The address that holds pool tokens for token_0" + ] + }, + { + "name": "tokenVault1", + "isMut": true, + "isSigner": false, + "docs": [ + "The address that holds pool tokens for token_1" + ] + }, + { + "name": "rent", + "isMut": false, + "isSigner": false, + "docs": [ + "Sysvar for token mint and ATA creation" + ] + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "Program to create the position manager state account" + ] + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "Program to transfer for token account" + ] + }, + { + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "Program to create an ATA for receiving position NFT" + ] + }, + { + "name": "tokenProgram2022", + "isMut": false, + "isSigner": false, + "docs": [ + "Program to create NFT mint/token account and transfer for token22 account" + ] + }, + { + "name": "vault0Mint", + "isMut": false, + "isSigner": false, + "docs": [ + "The mint of token vault 0" + ] + }, + { + "name": "vault1Mint", + "isMut": false, + "isSigner": false, + "docs": [ + "The mint of token vault 1" + ] + } + ], + "args": [ + { + "name": "tickLowerIndex", + "type": "i32" + }, + { + "name": "tickUpperIndex", + "type": "i32" + }, + { + "name": "tickArrayLowerStartIndex", + "type": "i32" + }, + { + "name": "tickArrayUpperStartIndex", + "type": "i32" + }, + { + "name": "liquidity", + "type": "u128" + }, + { + "name": "amount0Max", + "type": "u64" + }, + { + "name": "amount1Max", + "type": "u64" + }, + { + "name": "withMetadata", + "type": "bool" + }, + { + "name": "baseFlag", + "type": { + "option": "bool" + } + } + ] + }, + { + "name": "closePosition", + "docs": [ + "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.", + "", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "" + ], + "accounts": [ + { + "name": "nftOwner", + "isMut": true, + "isSigner": true, + "docs": [ + "The position nft owner" + ] + }, + { + "name": "positionNftMint", + "isMut": true, + "isSigner": false, + "docs": [ + "Mint address bound to the personal position." + ] + }, + { + "name": "positionNftAccount", + "isMut": true, + "isSigner": false, + "docs": [ + "User token account where position NFT be minted to" + ] + }, + { + "name": "personalPosition", + "isMut": true, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "System program to close the position state account" + ] + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "Token/Token2022 program to close token/mint account" + ] + } + ], + "args": [] + }, + { + "name": "increaseLiquidity", + "docs": [ + "#[deprecated(note = \"Use `increase_liquidity_v2` instead.\")]", + "Increases liquidity with a exist position, with amount paid by `payer`", + "", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "* `liquidity` - The desired liquidity to be added, can't be zero", + "* `amount_0_max` - The max amount of token_0 to spend, which serves as a slippage check", + "* `amount_1_max` - The max amount of token_1 to spend, which serves as a slippage check", + "" + ], + "accounts": [ + { + "name": "nftOwner", + "isMut": false, + "isSigner": true, + "docs": [ + "Pays to mint the position" + ] + }, + { + "name": "nftAccount", + "isMut": false, + "isSigner": false, + "docs": [ + "The token account for nft" + ] + }, + { + "name": "poolState", + "isMut": true, + "isSigner": false + }, + { + "name": "protocolPosition", + "isMut": true, + "isSigner": false + }, + { + "name": "personalPosition", + "isMut": true, + "isSigner": false, + "docs": [ + "Increase liquidity for this position" + ] + }, + { + "name": "tickArrayLower", + "isMut": true, + "isSigner": false, + "docs": [ + "Stores init state for the lower tick" + ] + }, + { + "name": "tickArrayUpper", + "isMut": true, + "isSigner": false, + "docs": [ + "Stores init state for the upper tick" + ] + }, + { + "name": "tokenAccount0", + "isMut": true, + "isSigner": false, + "docs": [ + "The payer's token account for token_0" + ] + }, + { + "name": "tokenAccount1", + "isMut": true, + "isSigner": false, + "docs": [ + "The token account spending token_1 to mint the position" + ] + }, + { + "name": "tokenVault0", + "isMut": true, + "isSigner": false, + "docs": [ + "The address that holds pool tokens for token_0" + ] + }, + { + "name": "tokenVault1", + "isMut": true, + "isSigner": false, + "docs": [ + "The address that holds pool tokens for token_1" + ] + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "Program to create mint account and mint tokens" + ] + } + ], + "args": [ + { + "name": "liquidity", + "type": "u128" + }, + { + "name": "amount0Max", + "type": "u64" + }, + { + "name": "amount1Max", + "type": "u64" + } + ] + }, + { + "name": "increaseLiquidityV2", + "docs": [ + "Increases liquidity with a exist position, with amount paid by `payer`, support Token2022", + "", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "* `liquidity` - The desired liquidity to be added, if zero, calculate liquidity base amount_0 or amount_1 according base_flag", + "* `amount_0_max` - The max amount of token_0 to spend, which serves as a slippage check", + "* `amount_1_max` - The max amount of token_1 to spend, which serves as a slippage check", + "* `base_flag` - must be specified if liquidity is zero, true: calculate liquidity base amount_0_max otherwise base amount_1_max", + "" + ], + "accounts": [ + { + "name": "nftOwner", + "isMut": false, + "isSigner": true, + "docs": [ + "Pays to mint the position" + ] + }, + { + "name": "nftAccount", + "isMut": false, + "isSigner": false, + "docs": [ + "The token account for nft" + ] + }, + { + "name": "poolState", + "isMut": true, + "isSigner": false + }, + { + "name": "protocolPosition", + "isMut": true, + "isSigner": false + }, + { + "name": "personalPosition", + "isMut": true, + "isSigner": false, + "docs": [ + "Increase liquidity for this position" + ] + }, + { + "name": "tickArrayLower", + "isMut": true, + "isSigner": false, + "docs": [ + "Stores init state for the lower tick" + ] + }, + { + "name": "tickArrayUpper", + "isMut": true, + "isSigner": false, + "docs": [ + "Stores init state for the upper tick" + ] + }, + { + "name": "tokenAccount0", + "isMut": true, + "isSigner": false, + "docs": [ + "The payer's token account for token_0" + ] + }, + { + "name": "tokenAccount1", + "isMut": true, + "isSigner": false, + "docs": [ + "The token account spending token_1 to mint the position" + ] + }, + { + "name": "tokenVault0", + "isMut": true, + "isSigner": false, + "docs": [ + "The address that holds pool tokens for token_0" + ] + }, + { + "name": "tokenVault1", + "isMut": true, + "isSigner": false, + "docs": [ + "The address that holds pool tokens for token_1" + ] + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "Program to create mint account and mint tokens" + ] + }, + { + "name": "tokenProgram2022", + "isMut": false, + "isSigner": false, + "docs": [ + "Token program 2022" + ] + }, + { + "name": "vault0Mint", + "isMut": false, + "isSigner": false, + "docs": [ + "The mint of token vault 0" + ] + }, + { + "name": "vault1Mint", + "isMut": false, + "isSigner": false, + "docs": [ + "The mint of token vault 1" + ] + } + ], + "args": [ + { + "name": "liquidity", + "type": "u128" + }, + { + "name": "amount0Max", + "type": "u64" + }, + { + "name": "amount1Max", + "type": "u64" + }, + { + "name": "baseFlag", + "type": { + "option": "bool" + } + } + ] + }, + { + "name": "decreaseLiquidity", + "docs": [ + "#[deprecated(note = \"Use `decrease_liquidity_v2` instead.\")]", + "Decreases liquidity with a exist position", + "", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "* `liquidity` - The amount by which liquidity will be decreased", + "* `amount_0_min` - The minimum amount of token_0 that should be accounted for the burned liquidity", + "* `amount_1_min` - The minimum amount of token_1 that should be accounted for the burned liquidity", + "" + ], + "accounts": [ + { + "name": "nftOwner", + "isMut": false, + "isSigner": true, + "docs": [ + "The position owner or delegated authority" + ] + }, + { + "name": "nftAccount", + "isMut": false, + "isSigner": false, + "docs": [ + "The token account for the tokenized position" + ] + }, + { + "name": "personalPosition", + "isMut": true, + "isSigner": false, + "docs": [ + "Decrease liquidity for this position" + ] + }, + { + "name": "poolState", + "isMut": true, + "isSigner": false + }, + { + "name": "protocolPosition", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVault0", + "isMut": true, + "isSigner": false, + "docs": [ + "Token_0 vault" + ] + }, + { + "name": "tokenVault1", + "isMut": true, + "isSigner": false, + "docs": [ + "Token_1 vault" + ] + }, + { + "name": "tickArrayLower", + "isMut": true, + "isSigner": false, + "docs": [ + "Stores init state for the lower tick" + ] + }, + { + "name": "tickArrayUpper", + "isMut": true, + "isSigner": false, + "docs": [ + "Stores init state for the upper tick" + ] + }, + { + "name": "recipientTokenAccount0", + "isMut": true, + "isSigner": false, + "docs": [ + "The destination token account for receive amount_0" + ] + }, + { + "name": "recipientTokenAccount1", + "isMut": true, + "isSigner": false, + "docs": [ + "The destination token account for receive amount_1" + ] + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "SPL program to transfer out tokens" + ] + } + ], + "args": [ + { + "name": "liquidity", + "type": "u128" + }, + { + "name": "amount0Min", + "type": "u64" + }, + { + "name": "amount1Min", + "type": "u64" + } + ] + }, + { + "name": "decreaseLiquidityV2", + "docs": [ + "Decreases liquidity with a exist position, support Token2022", + "", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "* `liquidity` - The amount by which liquidity will be decreased", + "* `amount_0_min` - The minimum amount of token_0 that should be accounted for the burned liquidity", + "* `amount_1_min` - The minimum amount of token_1 that should be accounted for the burned liquidity", + "" + ], + "accounts": [ + { + "name": "nftOwner", + "isMut": false, + "isSigner": true, + "docs": [ + "The position owner or delegated authority" + ] + }, + { + "name": "nftAccount", + "isMut": false, + "isSigner": false, + "docs": [ + "The token account for the tokenized position" + ] + }, + { + "name": "personalPosition", + "isMut": true, + "isSigner": false, + "docs": [ + "Decrease liquidity for this position" + ] + }, + { + "name": "poolState", + "isMut": true, + "isSigner": false + }, + { + "name": "protocolPosition", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenVault0", + "isMut": true, + "isSigner": false, + "docs": [ + "Token_0 vault" + ] + }, + { + "name": "tokenVault1", + "isMut": true, + "isSigner": false, + "docs": [ + "Token_1 vault" + ] + }, + { + "name": "tickArrayLower", + "isMut": true, + "isSigner": false, + "docs": [ + "Stores init state for the lower tick" + ] + }, + { + "name": "tickArrayUpper", + "isMut": true, + "isSigner": false, + "docs": [ + "Stores init state for the upper tick" + ] + }, + { + "name": "recipientTokenAccount0", + "isMut": true, + "isSigner": false, + "docs": [ + "The destination token account for receive amount_0" + ] + }, + { + "name": "recipientTokenAccount1", + "isMut": true, + "isSigner": false, + "docs": [ + "The destination token account for receive amount_1" + ] + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "SPL program to transfer out tokens" + ] + }, + { + "name": "tokenProgram2022", + "isMut": false, + "isSigner": false, + "docs": [ + "Token program 2022" + ] + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "memo program" + ] + }, + { + "name": "vault0Mint", + "isMut": false, + "isSigner": false, + "docs": [ + "The mint of token vault 0" + ] + }, + { + "name": "vault1Mint", + "isMut": false, + "isSigner": false, + "docs": [ + "The mint of token vault 1" + ] + } + ], + "args": [ + { + "name": "liquidity", + "type": "u128" + }, + { + "name": "amount0Min", + "type": "u64" + }, + { + "name": "amount1Min", + "type": "u64" + } + ] + }, + { + "name": "swap", + "docs": [ + "#[deprecated(note = \"Use `swap_v2` instead.\")]", + "Swaps one token for as much as possible of another token across a single pool", + "", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "* `amount` - Arranged in pairs with other_amount_threshold. (amount_in, amount_out_minimum) or (amount_out, amount_in_maximum)", + "* `other_amount_threshold` - For slippage check", + "* `sqrt_price_limit` - The Q64.64 sqrt price √P limit. If zero for one, the price cannot", + "* `is_base_input` - swap base input or swap base output", + "" + ], + "accounts": [ + { + "name": "payer", + "isMut": false, + "isSigner": true, + "docs": [ + "The user performing the swap" + ] + }, + { + "name": "ammConfig", + "isMut": false, + "isSigner": false, + "docs": [ + "The factory state to read protocol fees" + ] + }, + { + "name": "poolState", + "isMut": true, + "isSigner": false, + "docs": [ + "The program account of the pool in which the swap will be performed" + ] + }, + { + "name": "inputTokenAccount", + "isMut": true, + "isSigner": false, + "docs": [ + "The user token account for input token" + ] + }, + { + "name": "outputTokenAccount", + "isMut": true, + "isSigner": false, + "docs": [ + "The user token account for output token" + ] + }, + { + "name": "inputVault", + "isMut": true, + "isSigner": false, + "docs": [ + "The vault token account for input token" + ] + }, + { + "name": "outputVault", + "isMut": true, + "isSigner": false, + "docs": [ + "The vault token account for output token" + ] + }, + { + "name": "observationState", + "isMut": true, + "isSigner": false, + "docs": [ + "The program account for the most recent oracle observation" + ] + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "SPL program for token transfers" + ] + }, + { + "name": "tickArray", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + }, + { + "name": "otherAmountThreshold", + "type": "u64" + }, + { + "name": "sqrtPriceLimitX64", + "type": "u128" + }, + { + "name": "isBaseInput", + "type": "bool" + } + ] + }, + { + "name": "swapV2", + "docs": [ + "Swaps one token for as much as possible of another token across a single pool, support token program 2022", + "", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "* `amount` - Arranged in pairs with other_amount_threshold. (amount_in, amount_out_minimum) or (amount_out, amount_in_maximum)", + "* `other_amount_threshold` - For slippage check", + "* `sqrt_price_limit` - The Q64.64 sqrt price √P limit. If zero for one, the price cannot", + "* `is_base_input` - swap base input or swap base output", + "" + ], + "accounts": [ + { + "name": "payer", + "isMut": false, + "isSigner": true, + "docs": [ + "The user performing the swap" + ] + }, + { + "name": "ammConfig", + "isMut": false, + "isSigner": false, + "docs": [ + "The factory state to read protocol fees" + ] + }, + { + "name": "poolState", + "isMut": true, + "isSigner": false, + "docs": [ + "The program account of the pool in which the swap will be performed" + ] + }, + { + "name": "inputTokenAccount", + "isMut": true, + "isSigner": false, + "docs": [ + "The user token account for input token" + ] + }, + { + "name": "outputTokenAccount", + "isMut": true, + "isSigner": false, + "docs": [ + "The user token account for output token" + ] + }, + { + "name": "inputVault", + "isMut": true, + "isSigner": false, + "docs": [ + "The vault token account for input token" + ] + }, + { + "name": "outputVault", + "isMut": true, + "isSigner": false, + "docs": [ + "The vault token account for output token" + ] + }, + { + "name": "observationState", + "isMut": true, + "isSigner": false, + "docs": [ + "The program account for the most recent oracle observation" + ] + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "SPL program for token transfers" + ] + }, + { + "name": "tokenProgram2022", + "isMut": false, + "isSigner": false, + "docs": [ + "SPL program 2022 for token transfers" + ] + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "inputVaultMint", + "isMut": false, + "isSigner": false, + "docs": [ + "The mint of token vault 0" + ] + }, + { + "name": "outputVaultMint", + "isMut": false, + "isSigner": false, + "docs": [ + "The mint of token vault 1" + ] + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + }, + { + "name": "otherAmountThreshold", + "type": "u64" + }, + { + "name": "sqrtPriceLimitX64", + "type": "u128" + }, + { + "name": "isBaseInput", + "type": "bool" + } + ] + }, + { + "name": "swapRouterBaseIn", + "docs": [ + "Swap token for as much as possible of another token across the path provided, base input", + "", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "* `amount_in` - Token amount to be swapped in", + "* `amount_out_minimum` - Panic if output amount is below minimum amount. For slippage.", + "" + ], + "accounts": [ + { + "name": "payer", + "isMut": false, + "isSigner": true, + "docs": [ + "The user performing the swap" + ] + }, + { + "name": "inputTokenAccount", + "isMut": true, + "isSigner": false, + "docs": [ + "The token account that pays input tokens for the swap" + ] + }, + { + "name": "inputTokenMint", + "isMut": true, + "isSigner": false, + "docs": [ + "The mint of input token" + ] + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "SPL program for token transfers" + ] + }, + { + "name": "tokenProgram2022", + "isMut": false, + "isSigner": false, + "docs": [ + "SPL program 2022 for token transfers" + ] + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "amountIn", + "type": "u64" + }, + { + "name": "amountOutMinimum", + "type": "u64" + } + ] + } + ], + "accounts": [ + { + "name": "AmmConfig", + "docs": [ + "Holds the current owner of the factory" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "bump", + "docs": [ + "Bump to identify PDA" + ], + "type": "u8" + }, + { + "name": "index", + "type": "u16" + }, + { + "name": "owner", + "docs": [ + "Address of the protocol owner" + ], + "type": "publicKey" + }, + { + "name": "protocolFeeRate", + "docs": [ + "The protocol fee" + ], + "type": "u32" + }, + { + "name": "tradeFeeRate", + "docs": [ + "The trade fee, denominated in hundredths of a bip (10^-6)" + ], + "type": "u32" + }, + { + "name": "tickSpacing", + "docs": [ + "The tick spacing" + ], + "type": "u16" + }, + { + "name": "fundFeeRate", + "docs": [ + "The fund fee, denominated in hundredths of a bip (10^-6)" + ], + "type": "u32" + }, + { + "name": "paddingU32", + "type": "u32" + }, + { + "name": "fundOwner", + "type": "publicKey" + }, + { + "name": "padding", + "type": { + "array": [ + "u64", + 3 + ] + } + } + ] + } + }, + { + "name": "OperationState", + "docs": [ + "Holds the current owner of the factory" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "bump", + "docs": [ + "Bump to identify PDA" + ], + "type": "u8" + }, + { + "name": "operationOwners", + "docs": [ + "Address of the operation owner" + ], + "type": { + "array": [ + "publicKey", + 10 + ] + } + }, + { + "name": "whitelistMints", + "docs": [ + "The mint address of whitelist to emmit reward" + ], + "type": { + "array": [ + "publicKey", + 100 + ] + } + } + ] + } + }, + { + "name": "ObservationState", + "type": { + "kind": "struct", + "fields": [ + { + "name": "initialized", + "docs": [ + "Whether the ObservationState is initialized" + ], + "type": "bool" + }, + { + "name": "recentEpoch", + "docs": [ + "recent update epoch" + ], + "type": "u64" + }, + { + "name": "observationIndex", + "docs": [ + "the most-recently updated index of the observations array" + ], + "type": "u16" + }, + { + "name": "poolId", + "docs": [ + "belongs to which pool" + ], + "type": "publicKey" + }, + { + "name": "observations", + "docs": [ + "observation array" + ], + "type": { + "array": [ + { + "defined": "Observation" + }, + 100 + ] + } + }, + { + "name": "padding", + "docs": [ + "padding for feature update" + ], + "type": { + "array": [ + "u64", + 4 + ] + } + } + ] + } + }, + { + "name": "PersonalPositionState", + "type": { + "kind": "struct", + "fields": [ + { + "name": "bump", + "docs": [ + "Bump to identify PDA" + ], + "type": { + "array": [ + "u8", + 1 + ] + } + }, + { + "name": "nftMint", + "docs": [ + "Mint address of the tokenized position" + ], + "type": "publicKey" + }, + { + "name": "poolId", + "docs": [ + "The ID of the pool with which this token is connected" + ], + "type": "publicKey" + }, + { + "name": "tickLowerIndex", + "docs": [ + "The lower bound tick of the position" + ], + "type": "i32" + }, + { + "name": "tickUpperIndex", + "docs": [ + "The upper bound tick of the position" + ], + "type": "i32" + }, + { + "name": "liquidity", + "docs": [ + "The amount of liquidity owned by this position" + ], + "type": "u128" + }, + { + "name": "feeGrowthInside0LastX64", + "docs": [ + "The token_0 fee growth of the aggregate position as of the last action on the individual position" + ], + "type": "u128" + }, + { + "name": "feeGrowthInside1LastX64", + "docs": [ + "The token_1 fee growth of the aggregate position as of the last action on the individual position" + ], + "type": "u128" + }, + { + "name": "tokenFeesOwed0", + "docs": [ + "The fees owed to the position owner in token_0, as of the last computation" + ], + "type": "u64" + }, + { + "name": "tokenFeesOwed1", + "docs": [ + "The fees owed to the position owner in token_1, as of the last computation" + ], + "type": "u64" + }, + { + "name": "rewardInfos", + "type": { + "array": [ + { + "defined": "PositionRewardInfo" + }, + 3 + ] + } + }, + { + "name": "recentEpoch", + "type": "u64" + }, + { + "name": "padding", + "type": { + "array": [ + "u64", + 7 + ] + } + } + ] + } + }, + { + "name": "PoolState", + "docs": [ + "The pool state", + "", + "PDA of `[POOL_SEED, config, token_mint_0, token_mint_1]`", + "" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "bump", + "docs": [ + "Bump to identify PDA" + ], + "type": { + "array": [ + "u8", + 1 + ] + } + }, + { + "name": "ammConfig", + "type": "publicKey" + }, + { + "name": "owner", + "type": "publicKey" + }, + { + "name": "tokenMint0", + "docs": [ + "Token pair of the pool, where token_mint_0 address < token_mint_1 address" + ], + "type": "publicKey" + }, + { + "name": "tokenMint1", + "type": "publicKey" + }, + { + "name": "tokenVault0", + "docs": [ + "Token pair vault" + ], + "type": "publicKey" + }, + { + "name": "tokenVault1", + "type": "publicKey" + }, + { + "name": "observationKey", + "docs": [ + "observation account key" + ], + "type": "publicKey" + }, + { + "name": "mintDecimals0", + "docs": [ + "mint0 and mint1 decimals" + ], + "type": "u8" + }, + { + "name": "mintDecimals1", + "type": "u8" + }, + { + "name": "tickSpacing", + "docs": [ + "The minimum number of ticks between initialized ticks" + ], + "type": "u16" + }, + { + "name": "liquidity", + "docs": [ + "The currently in range liquidity available to the pool." + ], + "type": "u128" + }, + { + "name": "sqrtPriceX64", + "docs": [ + "The current price of the pool as a sqrt(token_1/token_0) Q64.64 value" + ], + "type": "u128" + }, + { + "name": "tickCurrent", + "docs": [ + "The current tick of the pool, i.e. according to the last tick transition that was run." + ], + "type": "i32" + }, + { + "name": "padding3", + "type": "u16" + }, + { + "name": "padding4", + "type": "u16" + }, + { + "name": "feeGrowthGlobal0X64", + "docs": [ + "The fee growth as a Q64.64 number, i.e. fees of token_0 and token_1 collected per", + "unit of liquidity for the entire life of the pool." + ], + "type": "u128" + }, + { + "name": "feeGrowthGlobal1X64", + "type": "u128" + }, + { + "name": "protocolFeesToken0", + "docs": [ + "The amounts of token_0 and token_1 that are owed to the protocol." + ], + "type": "u64" + }, + { + "name": "protocolFeesToken1", + "type": "u64" + }, + { + "name": "swapInAmountToken0", + "docs": [ + "The amounts in and out of swap token_0 and token_1" + ], + "type": "u128" + }, + { + "name": "swapOutAmountToken1", + "type": "u128" + }, + { + "name": "swapInAmountToken1", + "type": "u128" + }, + { + "name": "swapOutAmountToken0", + "type": "u128" + }, + { + "name": "status", + "docs": [ + "Bitwise representation of the state of the pool", + "bit0, 1: disable open position and increase liquidity, 0: normal", + "bit1, 1: disable decrease liquidity, 0: normal", + "bit2, 1: disable collect fee, 0: normal", + "bit3, 1: disable collect reward, 0: normal", + "bit4, 1: disable swap, 0: normal" + ], + "type": "u8" + }, + { + "name": "padding", + "docs": [ + "Leave blank for future use" + ], + "type": { + "array": [ + "u8", + 7 + ] + } + }, + { + "name": "rewardInfos", + "type": { + "array": [ + { + "defined": "RewardInfo" + }, + 3 + ] + } + }, + { + "name": "tickArrayBitmap", + "docs": [ + "Packed initialized tick array state" + ], + "type": { + "array": [ + "u64", + 16 + ] + } + }, + { + "name": "totalFeesToken0", + "docs": [ + "except protocol_fee and fund_fee" + ], + "type": "u64" + }, + { + "name": "totalFeesClaimedToken0", + "docs": [ + "except protocol_fee and fund_fee" + ], + "type": "u64" + }, + { + "name": "totalFeesToken1", + "type": "u64" + }, + { + "name": "totalFeesClaimedToken1", + "type": "u64" + }, + { + "name": "fundFeesToken0", + "type": "u64" + }, + { + "name": "fundFeesToken1", + "type": "u64" + }, + { + "name": "openTime", + "type": "u64" + }, + { + "name": "recentEpoch", + "type": "u64" + }, + { + "name": "padding1", + "type": { + "array": [ + "u64", + 24 + ] + } + }, + { + "name": "padding2", + "type": { + "array": [ + "u64", + 32 + ] + } + } + ] + } + }, + { + "name": "ProtocolPositionState", + "docs": [ + "Info stored for each user's position" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "bump", + "docs": [ + "Bump to identify PDA" + ], + "type": "u8" + }, + { + "name": "poolId", + "docs": [ + "The ID of the pool with which this token is connected" + ], + "type": "publicKey" + }, + { + "name": "tickLowerIndex", + "docs": [ + "The lower bound tick of the position" + ], + "type": "i32" + }, + { + "name": "tickUpperIndex", + "docs": [ + "The upper bound tick of the position" + ], + "type": "i32" + }, + { + "name": "liquidity", + "docs": [ + "The amount of liquidity owned by this position" + ], + "type": "u128" + }, + { + "name": "feeGrowthInside0LastX64", + "docs": [ + "The token_0 fee growth per unit of liquidity as of the last update to liquidity or fees owed" + ], + "type": "u128" + }, + { + "name": "feeGrowthInside1LastX64", + "docs": [ + "The token_1 fee growth per unit of liquidity as of the last update to liquidity or fees owed" + ], + "type": "u128" + }, + { + "name": "tokenFeesOwed0", + "docs": [ + "The fees owed to the position owner in token_0" + ], + "type": "u64" + }, + { + "name": "tokenFeesOwed1", + "docs": [ + "The fees owed to the position owner in token_1" + ], + "type": "u64" + }, + { + "name": "rewardGrowthInside", + "docs": [ + "The reward growth per unit of liquidity as of the last update to liquidity" + ], + "type": { + "array": [ + "u128", + 3 + ] + } + }, + { + "name": "recentEpoch", + "type": "u64" + }, + { + "name": "padding", + "type": { + "array": [ + "u64", + 7 + ] + } + } + ] + } + }, + { + "name": "TickArrayState", + "type": { + "kind": "struct", + "fields": [ + { + "name": "poolId", + "type": "publicKey" + }, + { + "name": "startTickIndex", + "type": "i32" + }, + { + "name": "ticks", + "type": { + "array": [ + { + "defined": "TickState" + }, + 60 + ] + } + }, + { + "name": "initializedTickCount", + "type": "u8" + }, + { + "name": "recentEpoch", + "type": "u64" + }, + { + "name": "padding", + "type": { + "array": [ + "u8", + 107 + ] + } + } + ] + } + }, + { + "name": "TickArrayBitmapExtension", + "type": { + "kind": "struct", + "fields": [ + { + "name": "poolId", + "type": "publicKey" + }, + { + "name": "positiveTickArrayBitmap", + "docs": [ + "Packed initialized tick array state for start_tick_index is positive" + ], + "type": { + "array": [ + { + "array": [ + "u64", + 8 + ] + }, + 14 + ] + } + }, + { + "name": "negativeTickArrayBitmap", + "docs": [ + "Packed initialized tick array state for start_tick_index is negitive" + ], + "type": { + "array": [ + { + "array": [ + "u64", + 8 + ] + }, + 14 + ] + } + } + ] + } + } + ], + "types": [ + { + "name": "InitializeRewardParam", + "type": { + "kind": "struct", + "fields": [ + { + "name": "openTime", + "docs": [ + "Reward open time" + ], + "type": "u64" + }, + { + "name": "endTime", + "docs": [ + "Reward end time" + ], + "type": "u64" + }, + { + "name": "emissionsPerSecondX64", + "docs": [ + "Token reward per second are earned per unit of liquidity" + ], + "type": "u128" + } + ] + } + }, + { + "name": "Observation", + "docs": [ + "The element of observations in ObservationState" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "blockTimestamp", + "docs": [ + "The block timestamp of the observation" + ], + "type": "u32" + }, + { + "name": "tickCumulative", + "docs": [ + "the cumulative of tick during the duration time" + ], + "type": "i64" + }, + { + "name": "padding", + "docs": [ + "padding for feature update" + ], + "type": { + "array": [ + "u64", + 4 + ] + } + } + ] + } + }, + { + "name": "PositionRewardInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "growthInsideLastX64", + "type": "u128" + }, + { + "name": "rewardAmountOwed", + "type": "u64" + } + ] + } + }, + { + "name": "RewardInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "rewardState", + "docs": [ + "Reward state" + ], + "type": "u8" + }, + { + "name": "openTime", + "docs": [ + "Reward open time" + ], + "type": "u64" + }, + { + "name": "endTime", + "docs": [ + "Reward end time" + ], + "type": "u64" + }, + { + "name": "lastUpdateTime", + "docs": [ + "Reward last update time" + ], + "type": "u64" + }, + { + "name": "emissionsPerSecondX64", + "docs": [ + "Q64.64 number indicates how many tokens per second are earned per unit of liquidity." + ], + "type": "u128" + }, + { + "name": "rewardTotalEmissioned", + "docs": [ + "The total amount of reward emissioned" + ], + "type": "u64" + }, + { + "name": "rewardClaimed", + "docs": [ + "The total amount of claimed reward" + ], + "type": "u64" + }, + { + "name": "tokenMint", + "docs": [ + "Reward token mint." + ], + "type": "publicKey" + }, + { + "name": "tokenVault", + "docs": [ + "Reward vault token account." + ], + "type": "publicKey" + }, + { + "name": "authority", + "docs": [ + "The owner that has permission to set reward param" + ], + "type": "publicKey" + }, + { + "name": "rewardGrowthGlobalX64", + "docs": [ + "Q64.64 number that tracks the total tokens earned per unit of liquidity since the reward", + "emissions were turned on." + ], + "type": "u128" + } + ] + } + }, + { + "name": "TickState", + "type": { + "kind": "struct", + "fields": [ + { + "name": "tick", + "type": "i32" + }, + { + "name": "liquidityNet", + "docs": [ + "Amount of net liquidity added (subtracted) when tick is crossed from left to right (right to left)" + ], + "type": "i128" + }, + { + "name": "liquidityGross", + "docs": [ + "The total position liquidity that references this tick" + ], + "type": "u128" + }, + { + "name": "feeGrowthOutside0X64", + "docs": [ + "Fee growth per unit of liquidity on the _other_ side of this tick (relative to the current tick)", + "only has relative meaning, not absolute — the value depends on when the tick is initialized" + ], + "type": "u128" + }, + { + "name": "feeGrowthOutside1X64", + "type": "u128" + }, + { + "name": "rewardGrowthsOutsideX64", + "type": { + "array": [ + "u128", + 3 + ] + } + }, + { + "name": "padding", + "type": { + "array": [ + "u32", + 13 + ] + } + } + ] + } + }, + { + "name": "PoolStatusBitIndex", + "type": { + "kind": "enum", + "variants": [ + { + "name": "OpenPositionOrIncreaseLiquidity" + }, + { + "name": "DecreaseLiquidity" + }, + { + "name": "CollectFee" + }, + { + "name": "CollectReward" + }, + { + "name": "Swap" + } + ] + } + }, + { + "name": "PoolStatusBitFlag", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Enable" + }, + { + "name": "Disable" + } + ] + } + }, + { + "name": "RewardState", + "docs": [ + "State of reward" + ], + "type": { + "kind": "enum", + "variants": [ + { + "name": "Uninitialized" + }, + { + "name": "Initialized" + }, + { + "name": "Opening" + }, + { + "name": "Ended" + } + ] + } + }, + { + "name": "TickArryBitmap", + "type": { + "kind": "alias", + "value": { + "array": [ + "u64", + 8 + ] + } + } + } + ], + "events": [ + { + "name": "ConfigChangeEvent", + "fields": [ + { + "name": "index", + "type": "u16", + "index": false + }, + { + "name": "owner", + "type": "publicKey", + "index": true + }, + { + "name": "protocolFeeRate", + "type": "u32", + "index": false + }, + { + "name": "tradeFeeRate", + "type": "u32", + "index": false + }, + { + "name": "tickSpacing", + "type": "u16", + "index": false + }, + { + "name": "fundFeeRate", + "type": "u32", + "index": false + }, + { + "name": "fundOwner", + "type": "publicKey", + "index": false + } + ] + }, + { + "name": "CreatePersonalPositionEvent", + "fields": [ + { + "name": "poolState", + "type": "publicKey", + "index": false + }, + { + "name": "minter", + "type": "publicKey", + "index": false + }, + { + "name": "nftOwner", + "type": "publicKey", + "index": false + }, + { + "name": "tickLowerIndex", + "type": "i32", + "index": false + }, + { + "name": "tickUpperIndex", + "type": "i32", + "index": false + }, + { + "name": "liquidity", + "type": "u128", + "index": false + }, + { + "name": "depositAmount0", + "type": "u64", + "index": false + }, + { + "name": "depositAmount1", + "type": "u64", + "index": false + }, + { + "name": "depositAmount0TransferFee", + "type": "u64", + "index": false + }, + { + "name": "depositAmount1TransferFee", + "type": "u64", + "index": false + } + ] + }, + { + "name": "IncreaseLiquidityEvent", + "fields": [ + { + "name": "positionNftMint", + "type": "publicKey", + "index": false + }, + { + "name": "liquidity", + "type": "u128", + "index": false + }, + { + "name": "amount0", + "type": "u64", + "index": false + }, + { + "name": "amount1", + "type": "u64", + "index": false + }, + { + "name": "amount0TransferFee", + "type": "u64", + "index": false + }, + { + "name": "amount1TransferFee", + "type": "u64", + "index": false + } + ] + }, + { + "name": "DecreaseLiquidityEvent", + "fields": [ + { + "name": "positionNftMint", + "type": "publicKey", + "index": false + }, + { + "name": "liquidity", + "type": "u128", + "index": false + }, + { + "name": "decreaseAmount0", + "type": "u64", + "index": false + }, + { + "name": "decreaseAmount1", + "type": "u64", + "index": false + }, + { + "name": "feeAmount0", + "type": "u64", + "index": false + }, + { + "name": "feeAmount1", + "type": "u64", + "index": false + }, + { + "name": "rewardAmounts", + "type": { + "array": [ + "u64", + 3 + ] + }, + "index": false + }, + { + "name": "transferFee0", + "type": "u64", + "index": false + }, + { + "name": "transferFee1", + "type": "u64", + "index": false + } + ] + }, + { + "name": "LiquidityCalculateEvent", + "fields": [ + { + "name": "poolLiquidity", + "type": "u128", + "index": false + }, + { + "name": "poolSqrtPriceX64", + "type": "u128", + "index": false + }, + { + "name": "poolTick", + "type": "i32", + "index": false + }, + { + "name": "calcAmount0", + "type": "u64", + "index": false + }, + { + "name": "calcAmount1", + "type": "u64", + "index": false + }, + { + "name": "tradeFeeOwed0", + "type": "u64", + "index": false + }, + { + "name": "tradeFeeOwed1", + "type": "u64", + "index": false + }, + { + "name": "transferFee0", + "type": "u64", + "index": false + }, + { + "name": "transferFee1", + "type": "u64", + "index": false + } + ] + }, + { + "name": "CollectPersonalFeeEvent", + "fields": [ + { + "name": "positionNftMint", + "type": "publicKey", + "index": false + }, + { + "name": "recipientTokenAccount0", + "type": "publicKey", + "index": false + }, + { + "name": "recipientTokenAccount1", + "type": "publicKey", + "index": false + }, + { + "name": "amount0", + "type": "u64", + "index": false + }, + { + "name": "amount1", + "type": "u64", + "index": false + } + ] + }, + { + "name": "UpdateRewardInfosEvent", + "fields": [ + { + "name": "rewardGrowthGlobalX64", + "type": { + "array": [ + "u128", + 3 + ] + }, + "index": false + } + ] + }, + { + "name": "PoolCreatedEvent", + "fields": [ + { + "name": "tokenMint0", + "type": "publicKey", + "index": false + }, + { + "name": "tokenMint1", + "type": "publicKey", + "index": false + }, + { + "name": "tickSpacing", + "type": "u16", + "index": false + }, + { + "name": "poolState", + "type": "publicKey", + "index": false + }, + { + "name": "sqrtPriceX64", + "type": "u128", + "index": false + }, + { + "name": "tick", + "type": "i32", + "index": false + }, + { + "name": "tokenVault0", + "type": "publicKey", + "index": false + }, + { + "name": "tokenVault1", + "type": "publicKey", + "index": false + } + ] + }, + { + "name": "CollectProtocolFeeEvent", + "fields": [ + { + "name": "poolState", + "type": "publicKey", + "index": false + }, + { + "name": "recipientTokenAccount0", + "type": "publicKey", + "index": false + }, + { + "name": "recipientTokenAccount1", + "type": "publicKey", + "index": false + }, + { + "name": "amount0", + "type": "u64", + "index": false + }, + { + "name": "amount1", + "type": "u64", + "index": false + } + ] + }, + { + "name": "SwapEvent", + "fields": [ + { + "name": "poolState", + "type": "publicKey", + "index": false + }, + { + "name": "sender", + "type": "publicKey", + "index": false + }, + { + "name": "tokenAccount0", + "type": "publicKey", + "index": false + }, + { + "name": "tokenAccount1", + "type": "publicKey", + "index": false + }, + { + "name": "amount0", + "type": "u64", + "index": false + }, + { + "name": "transferFee0", + "type": "u64", + "index": false + }, + { + "name": "amount1", + "type": "u64", + "index": false + }, + { + "name": "transferFee1", + "type": "u64", + "index": false + }, + { + "name": "zeroForOne", + "type": "bool", + "index": false + }, + { + "name": "sqrtPriceX64", + "type": "u128", + "index": false + }, + { + "name": "liquidity", + "type": "u128", + "index": false + }, + { + "name": "tick", + "type": "i32", + "index": false + } + ] + }, + { + "name": "LiquidityChangeEvent", + "fields": [ + { + "name": "poolState", + "type": "publicKey", + "index": false + }, + { + "name": "tick", + "type": "i32", + "index": false + }, + { + "name": "tickLower", + "type": "i32", + "index": false + }, + { + "name": "tickUpper", + "type": "i32", + "index": false + }, + { + "name": "liquidityBefore", + "type": "u128", + "index": false + }, + { + "name": "liquidityAfter", + "type": "u128", + "index": false + } + ] + } + ], + "errors": [ + { + "code": 6000, + "name": "LOK", + "msg": "LOK" + }, + { + "code": 6001, + "name": "NotApproved", + "msg": "Not approved" + }, + { + "code": 6002, + "name": "InvalidUpdateConfigFlag", + "msg": "invalid update amm config flag" + }, + { + "code": 6003, + "name": "AccountLack", + "msg": "Account lack" + }, + { + "code": 6004, + "name": "ClosePositionErr", + "msg": "Remove liquitity, collect fees owed and reward then you can close position account" + }, + { + "code": 6005, + "name": "ZeroMintAmount", + "msg": "Minting amount should be greater than 0" + }, + { + "code": 6006, + "name": "InvaildTickIndex", + "msg": "Tick out of range" + }, + { + "code": 6007, + "name": "TickInvaildOrder", + "msg": "The lower tick must be below the upper tick" + }, + { + "code": 6008, + "name": "TickLowerOverflow", + "msg": "The tick must be greater, or equal to the minimum tick(-443636)" + }, + { + "code": 6009, + "name": "TickUpperOverflow", + "msg": "The tick must be lesser than, or equal to the maximum tick(443636)" + }, + { + "code": 6010, + "name": "TickAndSpacingNotMatch", + "msg": "tick % tick_spacing must be zero" + }, + { + "code": 6011, + "name": "InvalidTickArray", + "msg": "Invaild tick array account" + }, + { + "code": 6012, + "name": "InvalidTickArrayBoundary", + "msg": "Invaild tick array boundary" + }, + { + "code": 6013, + "name": "SqrtPriceLimitOverflow", + "msg": "Square root price limit overflow" + }, + { + "code": 6014, + "name": "SqrtPriceX64", + "msg": "sqrt_price_x64 out of range" + }, + { + "code": 6015, + "name": "LiquiditySubValueErr", + "msg": "Liquidity sub delta L must be smaller than before" + }, + { + "code": 6016, + "name": "LiquidityAddValueErr", + "msg": "Liquidity add delta L must be greater, or equal to before" + }, + { + "code": 6017, + "name": "InvaildLiquidity", + "msg": "Invaild liquidity when update position" + }, + { + "code": 6018, + "name": "ForbidBothZeroForSupplyLiquidity", + "msg": "Both token amount must not be zero while supply liquidity" + }, + { + "code": 6019, + "name": "LiquidityInsufficient", + "msg": "Liquidity insufficient" + }, + { + "code": 6020, + "name": "TransactionTooOld", + "msg": "Transaction too old" + }, + { + "code": 6021, + "name": "PriceSlippageCheck", + "msg": "Price slippage check" + }, + { + "code": 6022, + "name": "TooLittleOutputReceived", + "msg": "Too little output received" + }, + { + "code": 6023, + "name": "TooMuchInputPaid", + "msg": "Too much input paid" + }, + { + "code": 6024, + "name": "ZeroAmountSpecified", + "msg": "Swap special amount can not be zero" + }, + { + "code": 6025, + "name": "InvalidInputPoolVault", + "msg": "Input pool vault is invalid" + }, + { + "code": 6026, + "name": "TooSmallInputOrOutputAmount", + "msg": "Swap input or output amount is too small" + }, + { + "code": 6027, + "name": "NotEnoughTickArrayAccount", + "msg": "Not enought tick array account" + }, + { + "code": 6028, + "name": "InvalidFirstTickArrayAccount", + "msg": "Invaild first tick array account" + }, + { + "code": 6029, + "name": "InvalidRewardIndex", + "msg": "Invalid reward index" + }, + { + "code": 6030, + "name": "FullRewardInfo", + "msg": "The init reward token reach to the max" + }, + { + "code": 6031, + "name": "RewardTokenAlreadyInUse", + "msg": "The init reward token already in use" + }, + { + "code": 6032, + "name": "ExceptPoolVaultMint", + "msg": "The reward tokens must contain one of pool vault mint except the last reward" + }, + { + "code": 6033, + "name": "InvalidRewardInitParam", + "msg": "Invalid reward init param" + }, + { + "code": 6034, + "name": "InvalidRewardDesiredAmount", + "msg": "Invalid collect reward desired amount" + }, + { + "code": 6035, + "name": "InvalidRewardInputAccountNumber", + "msg": "Invalid collect reward input account number" + }, + { + "code": 6036, + "name": "InvalidRewardPeriod", + "msg": "Invalid reward period" + }, + { + "code": 6037, + "name": "NotApproveUpdateRewardEmissiones", + "msg": "Modification of emissiones is allowed within 72 hours from the end of the previous cycle" + }, + { + "code": 6038, + "name": "UnInitializedRewardInfo", + "msg": "uninitialized reward info" + }, + { + "code": 6039, + "name": "NotSupportMint", + "msg": "Not support token_2022 mint extension" + }, + { + "code": 6040, + "name": "MissingTickArrayBitmapExtensionAccount", + "msg": "Missing tickarray bitmap extension account" + }, + { + "code": 6041, + "name": "InsufficientLiquidityForDirection", + "msg": "Insufficient liquidity for this direction" + }, + { + "code": 6042, + "name": "MaxTokenOverflow", + "msg": "Max token overflow" + }, + { + "code": 6043, + "name": "CalculateOverflow", + "msg": "calculate overflow" + } + ] +} \ No newline at end of file diff --git a/idl/raydium_cpmm.json b/idl/raydium_cpmm.json new file mode 100644 index 0000000..9b99ba4 --- /dev/null +++ b/idl/raydium_cpmm.json @@ -0,0 +1,3084 @@ +{ + "address": "CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C", + "metadata": { + "name": "raydium_cp_swap", + "version": "0.2.0", + "spec": "0.1.0", + "description": "Raydium constant product AMM, supports Token2022 and without Openbook" + }, + "instructions": [ + { + "name": "close_permission_pda", + "docs": [ + "Close a permission account", + "", + "# Arguments", + "", + "* `ctx`- The context of accounts", + "" + ], + "discriminator": [ + 156, + 84, + 32, + 118, + 69, + 135, + 70, + 123 + ], + "accounts": [ + { + "name": "owner", + "writable": true, + "signer": true, + "address": "GThUX1Atko4tqhN2NaiTazWSeFWMuiUvfFnyJyUghFMJ" + }, + { + "name": "permission_authority" + }, + { + "name": "permission", + "docs": [ + "Initialize config state account to store protocol owner address and fee rates." + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110 + ] + }, + { + "kind": "account", + "path": "permission_authority" + } + ] + } + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + } + ], + "args": [] + }, + { + "name": "collect_creator_fee", + "docs": [ + "Collect the creator fee", + "", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "" + ], + "discriminator": [ + 20, + 22, + 86, + 123, + 198, + 28, + 219, + 132 + ], + "accounts": [ + { + "name": "creator", + "docs": [ + "Only pool creator can collect fee" + ], + "writable": true, + "signer": true + }, + { + "name": "authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 110, + 100, + 95, + 108, + 112, + 95, + 109, + 105, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 95, + 115, + 101, + 101, + 100 + ] + } + ] + } + }, + { + "name": "pool_state", + "docs": [ + "Pool state stores accumulated protocol fee amount" + ], + "writable": true + }, + { + "name": "amm_config", + "docs": [ + "Amm config account stores fund_owner" + ] + }, + { + "name": "token_0_vault", + "docs": [ + "The address that holds pool tokens for token_0" + ], + "writable": true + }, + { + "name": "token_1_vault", + "docs": [ + "The address that holds pool tokens for token_1" + ], + "writable": true + }, + { + "name": "vault_0_mint", + "docs": [ + "The mint of token_0 vault" + ] + }, + { + "name": "vault_1_mint", + "docs": [ + "The mint of token_1 vault" + ] + }, + { + "name": "creator_token_0", + "docs": [ + "The address that receives the collected token_0 fund fees" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "creator" + }, + { + "kind": "account", + "path": "token_0_program" + }, + { + "kind": "account", + "path": "vault_0_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "creator_token_1", + "docs": [ + "The address that receives the collected token_1 fund fees" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "creator" + }, + { + "kind": "account", + "path": "token_1_program" + }, + { + "kind": "account", + "path": "vault_1_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "token_0_program", + "docs": [ + "Spl token program or token program 2022" + ] + }, + { + "name": "token_1_program", + "docs": [ + "Spl token program or token program 2022" + ] + }, + { + "name": "associated_token_program", + "docs": [ + "Program to create an ATA for receiving position NFT" + ], + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "system_program", + "docs": [ + "To create a new program account" + ], + "address": "11111111111111111111111111111111" + } + ], + "args": [] + }, + { + "name": "collect_fund_fee", + "docs": [ + "Collect the fund fee accrued to the pool", + "", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "* `amount_0_requested` - The maximum amount of token_0 to send, can be 0 to collect fees in only token_1", + "* `amount_1_requested` - The maximum amount of token_1 to send, can be 0 to collect fees in only token_0", + "" + ], + "discriminator": [ + 167, + 138, + 78, + 149, + 223, + 194, + 6, + 126 + ], + "accounts": [ + { + "name": "owner", + "docs": [ + "Only admin or fund_owner can collect fee now" + ], + "signer": true + }, + { + "name": "authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 110, + 100, + 95, + 108, + 112, + 95, + 109, + 105, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 95, + 115, + 101, + 101, + 100 + ] + } + ] + } + }, + { + "name": "pool_state", + "docs": [ + "Pool state stores accumulated protocol fee amount" + ], + "writable": true + }, + { + "name": "amm_config", + "docs": [ + "Amm config account stores fund_owner" + ] + }, + { + "name": "token_0_vault", + "docs": [ + "The address that holds pool tokens for token_0" + ], + "writable": true + }, + { + "name": "token_1_vault", + "docs": [ + "The address that holds pool tokens for token_1" + ], + "writable": true + }, + { + "name": "vault_0_mint", + "docs": [ + "The mint of token_0 vault" + ] + }, + { + "name": "vault_1_mint", + "docs": [ + "The mint of token_1 vault" + ] + }, + { + "name": "recipient_token_0_account", + "docs": [ + "The address that receives the collected token_0 fund fees" + ], + "writable": true + }, + { + "name": "recipient_token_1_account", + "docs": [ + "The address that receives the collected token_1 fund fees" + ], + "writable": true + }, + { + "name": "token_program", + "docs": [ + "The SPL program to perform token transfers" + ], + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "token_program_2022", + "docs": [ + "The SPL program 2022 to perform token transfers" + ], + "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" + } + ], + "args": [ + { + "name": "amount_0_requested", + "type": "u64" + }, + { + "name": "amount_1_requested", + "type": "u64" + } + ] + }, + { + "name": "collect_protocol_fee", + "docs": [ + "Collect the protocol fee accrued to the pool", + "", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "* `amount_0_requested` - The maximum amount of token_0 to send, can be 0 to collect fees in only token_1", + "* `amount_1_requested` - The maximum amount of token_1 to send, can be 0 to collect fees in only token_0", + "" + ], + "discriminator": [ + 136, + 136, + 252, + 221, + 194, + 66, + 126, + 89 + ], + "accounts": [ + { + "name": "owner", + "docs": [ + "Only admin or owner can collect fee now" + ], + "signer": true + }, + { + "name": "authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 110, + 100, + 95, + 108, + 112, + 95, + 109, + 105, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 95, + 115, + 101, + 101, + 100 + ] + } + ] + } + }, + { + "name": "pool_state", + "docs": [ + "Pool state stores accumulated protocol fee amount" + ], + "writable": true + }, + { + "name": "amm_config", + "docs": [ + "Amm config account stores owner" + ] + }, + { + "name": "token_0_vault", + "docs": [ + "The address that holds pool tokens for token_0" + ], + "writable": true + }, + { + "name": "token_1_vault", + "docs": [ + "The address that holds pool tokens for token_1" + ], + "writable": true + }, + { + "name": "vault_0_mint", + "docs": [ + "The mint of token_0 vault" + ] + }, + { + "name": "vault_1_mint", + "docs": [ + "The mint of token_1 vault" + ] + }, + { + "name": "recipient_token_0_account", + "docs": [ + "The address that receives the collected token_0 protocol fees" + ], + "writable": true + }, + { + "name": "recipient_token_1_account", + "docs": [ + "The address that receives the collected token_1 protocol fees" + ], + "writable": true + }, + { + "name": "token_program", + "docs": [ + "The SPL program to perform token transfers" + ], + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "token_program_2022", + "docs": [ + "The SPL program 2022 to perform token transfers" + ], + "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" + } + ], + "args": [ + { + "name": "amount_0_requested", + "type": "u64" + }, + { + "name": "amount_1_requested", + "type": "u64" + } + ] + }, + { + "name": "create_amm_config", + "docs": [ + "# Arguments", + "", + "* `ctx`- The accounts needed by instruction.", + "* `index` - The index of amm config, there may be multiple config.", + "* `trade_fee_rate` - Trade fee rate, can be changed.", + "* `protocol_fee_rate` - The rate of protocol fee within trade fee.", + "* `fund_fee_rate` - The rate of fund fee within trade fee.", + "" + ], + "discriminator": [ + 137, + 52, + 237, + 212, + 215, + 117, + 108, + 104 + ], + "accounts": [ + { + "name": "owner", + "docs": [ + "Address to be set as protocol owner." + ], + "writable": true, + "signer": true, + "address": "GThUX1Atko4tqhN2NaiTazWSeFWMuiUvfFnyJyUghFMJ" + }, + { + "name": "amm_config", + "docs": [ + "Initialize config state account to store protocol owner address and fee rates." + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 97, + 109, + 109, + 95, + 99, + 111, + 110, + 102, + 105, + 103 + ] + }, + { + "kind": "arg", + "path": "index" + } + ] + } + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + } + ], + "args": [ + { + "name": "index", + "type": "u16" + }, + { + "name": "trade_fee_rate", + "type": "u64" + }, + { + "name": "protocol_fee_rate", + "type": "u64" + }, + { + "name": "fund_fee_rate", + "type": "u64" + }, + { + "name": "create_pool_fee", + "type": "u64" + }, + { + "name": "creator_fee_rate", + "type": "u64" + } + ] + }, + { + "name": "create_permission_pda", + "docs": [ + "Create a permission account", + "", + "# Arguments", + "", + "* `ctx`- The context of accounts", + "" + ], + "discriminator": [ + 135, + 136, + 2, + 216, + 137, + 169, + 181, + 202 + ], + "accounts": [ + { + "name": "owner", + "writable": true, + "signer": true, + "address": "GThUX1Atko4tqhN2NaiTazWSeFWMuiUvfFnyJyUghFMJ" + }, + { + "name": "permission_authority" + }, + { + "name": "permission", + "docs": [ + "Initialize config state account to store protocol owner address and fee rates." + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110 + ] + }, + { + "kind": "account", + "path": "permission_authority" + } + ] + } + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + } + ], + "args": [] + }, + { + "name": "deposit", + "docs": [ + "Deposit lp token to the pool", + "", + "# Arguments", + "", + "* `ctx`- The context of accounts", + "* `lp_token_amount` - Increased number of LPs", + "* `maximum_token_0_amount` - Maximum token 0 amount to deposit, prevents excessive slippage", + "* `maximum_token_1_amount` - Maximum token 1 amount to deposit, prevents excessive slippage", + "" + ], + "discriminator": [ + 242, + 35, + 198, + 137, + 82, + 225, + 242, + 182 + ], + "accounts": [ + { + "name": "owner", + "docs": [ + "Pays to mint the position" + ], + "signer": true + }, + { + "name": "authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 110, + 100, + 95, + 108, + 112, + 95, + 109, + 105, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 95, + 115, + 101, + 101, + 100 + ] + } + ] + } + }, + { + "name": "pool_state", + "writable": true + }, + { + "name": "owner_lp_token", + "docs": [ + "Owner lp token account" + ], + "writable": true + }, + { + "name": "token_0_account", + "docs": [ + "The payer's token account for token_0" + ], + "writable": true + }, + { + "name": "token_1_account", + "docs": [ + "The payer's token account for token_1" + ], + "writable": true + }, + { + "name": "token_0_vault", + "docs": [ + "The address that holds pool tokens for token_0" + ], + "writable": true + }, + { + "name": "token_1_vault", + "docs": [ + "The address that holds pool tokens for token_1" + ], + "writable": true + }, + { + "name": "token_program", + "docs": [ + "token Program" + ], + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "token_program_2022", + "docs": [ + "Token program 2022" + ], + "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" + }, + { + "name": "vault_0_mint", + "docs": [ + "The mint of token_0 vault" + ] + }, + { + "name": "vault_1_mint", + "docs": [ + "The mint of token_1 vault" + ] + }, + { + "name": "lp_mint", + "docs": [ + "Lp token mint" + ], + "writable": true + } + ], + "args": [ + { + "name": "lp_token_amount", + "type": "u64" + }, + { + "name": "maximum_token_0_amount", + "type": "u64" + }, + { + "name": "maximum_token_1_amount", + "type": "u64" + } + ] + }, + { + "name": "initialize", + "docs": [ + "Creates a pool for the given token pair and the initial price", + "", + "# Arguments", + "", + "* `ctx`- The context of accounts", + "* `init_amount_0` - the initial amount_0 to deposit", + "* `init_amount_1` - the initial amount_1 to deposit", + "* `open_time` - the timestamp allowed for swap", + "" + ], + "discriminator": [ + 175, + 175, + 109, + 31, + 13, + 152, + 155, + 237 + ], + "accounts": [ + { + "name": "creator", + "docs": [ + "Address paying to create the pool. Can be anyone" + ], + "writable": true, + "signer": true + }, + { + "name": "amm_config", + "docs": [ + "Which config the pool belongs to." + ] + }, + { + "name": "authority", + "docs": [ + "pool vault and lp mint authority" + ], + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 110, + 100, + 95, + 108, + 112, + 95, + 109, + 105, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 95, + 115, + 101, + 101, + 100 + ] + } + ] + } + }, + { + "name": "pool_state", + "docs": [ + "PDA account:", + "seeds = [", + "POOL_SEED.as_bytes(),", + "amm_config.key().as_ref(),", + "token_0_mint.key().as_ref(),", + "token_1_mint.key().as_ref(),", + "],", + "", + "Or random account: must be signed by cli" + ], + "writable": true + }, + { + "name": "token_0_mint", + "docs": [ + "Token_0 mint, the key must smaller than token_1 mint." + ] + }, + { + "name": "token_1_mint", + "docs": [ + "Token_1 mint, the key must grater then token_0 mint." + ] + }, + { + "name": "lp_mint", + "docs": [ + "pool lp mint" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 111, + 108, + 95, + 108, + 112, + 95, + 109, + 105, + 110, + 116 + ] + }, + { + "kind": "account", + "path": "pool_state" + } + ] + } + }, + { + "name": "creator_token_0", + "docs": [ + "payer token0 account" + ], + "writable": true + }, + { + "name": "creator_token_1", + "docs": [ + "creator token1 account" + ], + "writable": true + }, + { + "name": "creator_lp_token", + "docs": [ + "creator lp token account" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "creator" + }, + { + "kind": "const", + "value": [ + 6, + 221, + 246, + 225, + 215, + 101, + 161, + 147, + 217, + 203, + 225, + 70, + 206, + 235, + 121, + 172, + 28, + 180, + 133, + 237, + 95, + 91, + 55, + 145, + 58, + 140, + 245, + 133, + 126, + 255, + 0, + 169 + ] + }, + { + "kind": "account", + "path": "lp_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "token_0_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 111, + 108, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "pool_state" + }, + { + "kind": "account", + "path": "token_0_mint" + } + ] + } + }, + { + "name": "token_1_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 111, + 108, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "pool_state" + }, + { + "kind": "account", + "path": "token_1_mint" + } + ] + } + }, + { + "name": "create_pool_fee", + "docs": [ + "create pool fee account" + ], + "writable": true, + "address": "DNXgeM9EiiaAbaWvwjHj9fQQLAX5ZsfHyvmYUNRAdNC8" + }, + { + "name": "observation_state", + "docs": [ + "an account to store oracle observations" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 111, + 98, + 115, + 101, + 114, + 118, + 97, + 116, + 105, + 111, + 110 + ] + }, + { + "kind": "account", + "path": "pool_state" + } + ] + } + }, + { + "name": "token_program", + "docs": [ + "Program to create mint account and mint tokens" + ], + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "token_0_program", + "docs": [ + "Spl token program or token program 2022" + ] + }, + { + "name": "token_1_program", + "docs": [ + "Spl token program or token program 2022" + ] + }, + { + "name": "associated_token_program", + "docs": [ + "Program to create an ATA for receiving position NFT" + ], + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "system_program", + "docs": [ + "To create a new program account" + ], + "address": "11111111111111111111111111111111" + }, + { + "name": "rent", + "docs": [ + "Sysvar for program account" + ], + "address": "SysvarRent111111111111111111111111111111111" + } + ], + "args": [ + { + "name": "init_amount_0", + "type": "u64" + }, + { + "name": "init_amount_1", + "type": "u64" + }, + { + "name": "open_time", + "type": "u64" + } + ] + }, + { + "name": "initialize_with_permission", + "docs": [ + "Create a pool with permission", + "", + "# Arguments", + "", + "* `ctx`- The context of accounts", + "* `init_amount_0` - the initial amount_0 to deposit", + "* `init_amount_1` - the initial amount_1 to deposit", + "* `open_time` - the timestamp allowed for swap", + "* `creator_fee_on` - creator fee model, 0:both token0 and token1 (depends on the input), 1: only token0, 2: only token1", + "" + ], + "discriminator": [ + 63, + 55, + 254, + 65, + 49, + 178, + 89, + 121 + ], + "accounts": [ + { + "name": "payer", + "docs": [ + "Address paying to create the pool. Can be anyone" + ], + "writable": true, + "signer": true + }, + { + "name": "creator" + }, + { + "name": "amm_config", + "docs": [ + "Which config the pool belongs to." + ] + }, + { + "name": "authority", + "docs": [ + "pool vault and lp mint authority" + ], + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 110, + 100, + 95, + 108, + 112, + 95, + 109, + 105, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 95, + 115, + 101, + 101, + 100 + ] + } + ] + } + }, + { + "name": "pool_state", + "docs": [ + "PDA account:", + "seeds = [", + "POOL_SEED.as_bytes(),", + "amm_config.key().as_ref(),", + "token_0_mint.key().as_ref(),", + "token_1_mint.key().as_ref(),", + "],", + "", + "Or random account: must be signed by cli" + ], + "writable": true + }, + { + "name": "token_0_mint", + "docs": [ + "Token_0 mint, the key must smaller than token_1 mint." + ] + }, + { + "name": "token_1_mint", + "docs": [ + "Token_1 mint, the key must grater then token_0 mint." + ] + }, + { + "name": "lp_mint", + "docs": [ + "pool lp mint" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 111, + 108, + 95, + 108, + 112, + 95, + 109, + 105, + 110, + 116 + ] + }, + { + "kind": "account", + "path": "pool_state" + } + ] + } + }, + { + "name": "payer_token_0", + "docs": [ + "payer token0 account" + ], + "writable": true + }, + { + "name": "payer_token_1", + "docs": [ + "payer token1 account" + ], + "writable": true + }, + { + "name": "payer_lp_token", + "docs": [ + "payer lp token account" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "payer" + }, + { + "kind": "const", + "value": [ + 6, + 221, + 246, + 225, + 215, + 101, + 161, + 147, + 217, + 203, + 225, + 70, + 206, + 235, + 121, + 172, + 28, + 180, + 133, + 237, + 95, + 91, + 55, + 145, + 58, + 140, + 245, + 133, + 126, + 255, + 0, + 169 + ] + }, + { + "kind": "account", + "path": "lp_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "token_0_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 111, + 108, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "pool_state" + }, + { + "kind": "account", + "path": "token_0_mint" + } + ] + } + }, + { + "name": "token_1_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 111, + 108, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "pool_state" + }, + { + "kind": "account", + "path": "token_1_mint" + } + ] + } + }, + { + "name": "create_pool_fee", + "docs": [ + "create pool fee account" + ], + "writable": true, + "address": "DNXgeM9EiiaAbaWvwjHj9fQQLAX5ZsfHyvmYUNRAdNC8" + }, + { + "name": "observation_state", + "docs": [ + "an account to store oracle observations" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 111, + 98, + 115, + 101, + 114, + 118, + 97, + 116, + 105, + 111, + 110 + ] + }, + { + "kind": "account", + "path": "pool_state" + } + ] + } + }, + { + "name": "permission", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110 + ] + }, + { + "kind": "account", + "path": "payer" + } + ] + } + }, + { + "name": "token_program", + "docs": [ + "Program to create mint account and mint tokens" + ], + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "token_0_program", + "docs": [ + "Spl token program or token program 2022" + ] + }, + { + "name": "token_1_program", + "docs": [ + "Spl token program or token program 2022" + ] + }, + { + "name": "associated_token_program", + "docs": [ + "Program to create an ATA for receiving position NFT" + ], + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "system_program", + "docs": [ + "To create a new program account" + ], + "address": "11111111111111111111111111111111" + } + ], + "args": [ + { + "name": "init_amount_0", + "type": "u64" + }, + { + "name": "init_amount_1", + "type": "u64" + }, + { + "name": "open_time", + "type": "u64" + }, + { + "name": "creator_fee_on", + "type": { + "defined": { + "name": "CreatorFeeOn" + } + } + } + ] + }, + { + "name": "swap_base_input", + "docs": [ + "Swap the tokens in the pool base input amount", + "", + "# Arguments", + "", + "* `ctx`- The context of accounts", + "* `amount_in` - input amount to transfer, output to DESTINATION is based on the exchange rate", + "* `minimum_amount_out` - Minimum amount of output token, prevents excessive slippage", + "" + ], + "discriminator": [ + 143, + 190, + 90, + 218, + 196, + 30, + 51, + 222 + ], + "accounts": [ + { + "name": "payer", + "docs": [ + "The user performing the swap" + ], + "signer": true + }, + { + "name": "authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 110, + 100, + 95, + 108, + 112, + 95, + 109, + 105, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 95, + 115, + 101, + 101, + 100 + ] + } + ] + } + }, + { + "name": "amm_config", + "docs": [ + "The factory state to read protocol fees" + ] + }, + { + "name": "pool_state", + "docs": [ + "The program account of the pool in which the swap will be performed" + ], + "writable": true + }, + { + "name": "input_token_account", + "docs": [ + "The user token account for input token" + ], + "writable": true + }, + { + "name": "output_token_account", + "docs": [ + "The user token account for output token" + ], + "writable": true + }, + { + "name": "input_vault", + "docs": [ + "The vault token account for input token" + ], + "writable": true + }, + { + "name": "output_vault", + "docs": [ + "The vault token account for output token" + ], + "writable": true + }, + { + "name": "input_token_program", + "docs": [ + "SPL program for input token transfers" + ] + }, + { + "name": "output_token_program", + "docs": [ + "SPL program for output token transfers" + ] + }, + { + "name": "input_token_mint", + "docs": [ + "The mint of input token" + ] + }, + { + "name": "output_token_mint", + "docs": [ + "The mint of output token" + ] + }, + { + "name": "observation_state", + "docs": [ + "The program account for the most recent oracle observation" + ], + "writable": true + } + ], + "args": [ + { + "name": "amount_in", + "type": "u64" + }, + { + "name": "minimum_amount_out", + "type": "u64" + } + ] + }, + { + "name": "swap_base_output", + "docs": [ + "Swap the tokens in the pool base output amount", + "", + "# Arguments", + "", + "* `ctx`- The context of accounts", + "* `max_amount_in` - input amount prevents excessive slippage", + "* `amount_out` - amount of output token", + "" + ], + "discriminator": [ + 55, + 217, + 98, + 86, + 163, + 74, + 180, + 173 + ], + "accounts": [ + { + "name": "payer", + "docs": [ + "The user performing the swap" + ], + "signer": true + }, + { + "name": "authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 110, + 100, + 95, + 108, + 112, + 95, + 109, + 105, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 95, + 115, + 101, + 101, + 100 + ] + } + ] + } + }, + { + "name": "amm_config", + "docs": [ + "The factory state to read protocol fees" + ] + }, + { + "name": "pool_state", + "docs": [ + "The program account of the pool in which the swap will be performed" + ], + "writable": true + }, + { + "name": "input_token_account", + "docs": [ + "The user token account for input token" + ], + "writable": true + }, + { + "name": "output_token_account", + "docs": [ + "The user token account for output token" + ], + "writable": true + }, + { + "name": "input_vault", + "docs": [ + "The vault token account for input token" + ], + "writable": true + }, + { + "name": "output_vault", + "docs": [ + "The vault token account for output token" + ], + "writable": true + }, + { + "name": "input_token_program", + "docs": [ + "SPL program for input token transfers" + ] + }, + { + "name": "output_token_program", + "docs": [ + "SPL program for output token transfers" + ] + }, + { + "name": "input_token_mint", + "docs": [ + "The mint of input token" + ] + }, + { + "name": "output_token_mint", + "docs": [ + "The mint of output token" + ] + }, + { + "name": "observation_state", + "docs": [ + "The program account for the most recent oracle observation" + ], + "writable": true + } + ], + "args": [ + { + "name": "max_amount_in", + "type": "u64" + }, + { + "name": "amount_out", + "type": "u64" + } + ] + }, + { + "name": "update_amm_config", + "docs": [ + "Updates the owner of the amm config", + "Must be called by the current owner or admin", + "", + "# Arguments", + "", + "* `ctx`- The context of accounts", + "* `trade_fee_rate`- The new trade fee rate of amm config, be set when `param` is 0", + "* `protocol_fee_rate`- The new protocol fee rate of amm config, be set when `param` is 1", + "* `fund_fee_rate`- The new fund fee rate of amm config, be set when `param` is 2", + "* `new_owner`- The config's new owner, be set when `param` is 3", + "* `new_fund_owner`- The config's new fund owner, be set when `param` is 4", + "* `param`- The value can be 0 | 1 | 2 | 3 | 4, otherwise will report a error", + "" + ], + "discriminator": [ + 49, + 60, + 174, + 136, + 154, + 28, + 116, + 200 + ], + "accounts": [ + { + "name": "owner", + "docs": [ + "The amm config owner or admin" + ], + "signer": true, + "address": "GThUX1Atko4tqhN2NaiTazWSeFWMuiUvfFnyJyUghFMJ" + }, + { + "name": "amm_config", + "docs": [ + "Amm config account to be changed" + ], + "writable": true + } + ], + "args": [ + { + "name": "param", + "type": "u8" + }, + { + "name": "value", + "type": "u64" + } + ] + }, + { + "name": "update_pool_status", + "docs": [ + "Update pool status for given value", + "", + "# Arguments", + "", + "* `ctx`- The context of accounts", + "* `status` - The value of status", + "" + ], + "discriminator": [ + 130, + 87, + 108, + 6, + 46, + 224, + 117, + 123 + ], + "accounts": [ + { + "name": "authority", + "signer": true, + "address": "GThUX1Atko4tqhN2NaiTazWSeFWMuiUvfFnyJyUghFMJ" + }, + { + "name": "pool_state", + "writable": true + } + ], + "args": [ + { + "name": "status", + "type": "u8" + } + ] + }, + { + "name": "withdraw", + "docs": [ + "Withdraw lp for token0 and token1", + "", + "# Arguments", + "", + "* `ctx`- The context of accounts", + "* `lp_token_amount` - Amount of pool tokens to burn. User receives an output of token a and b based on the percentage of the pool tokens that are returned.", + "* `minimum_token_0_amount` - Minimum amount of token 0 to receive, prevents excessive slippage", + "* `minimum_token_1_amount` - Minimum amount of token 1 to receive, prevents excessive slippage", + "" + ], + "discriminator": [ + 183, + 18, + 70, + 156, + 148, + 109, + 161, + 34 + ], + "accounts": [ + { + "name": "owner", + "docs": [ + "Pays to mint the position" + ], + "signer": true + }, + { + "name": "authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 110, + 100, + 95, + 108, + 112, + 95, + 109, + 105, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 95, + 115, + 101, + 101, + 100 + ] + } + ] + } + }, + { + "name": "pool_state", + "docs": [ + "Pool state account" + ], + "writable": true + }, + { + "name": "owner_lp_token", + "docs": [ + "Owner lp token account" + ], + "writable": true + }, + { + "name": "token_0_account", + "docs": [ + "The token account for receive token_0," + ], + "writable": true + }, + { + "name": "token_1_account", + "docs": [ + "The token account for receive token_1" + ], + "writable": true + }, + { + "name": "token_0_vault", + "docs": [ + "The address that holds pool tokens for token_0" + ], + "writable": true + }, + { + "name": "token_1_vault", + "docs": [ + "The address that holds pool tokens for token_1" + ], + "writable": true + }, + { + "name": "token_program", + "docs": [ + "token Program" + ], + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "token_program_2022", + "docs": [ + "Token program 2022" + ], + "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" + }, + { + "name": "vault_0_mint", + "docs": [ + "The mint of token_0 vault" + ] + }, + { + "name": "vault_1_mint", + "docs": [ + "The mint of token_1 vault" + ] + }, + { + "name": "lp_mint", + "docs": [ + "Pool lp token mint" + ], + "writable": true + }, + { + "name": "memo_program", + "docs": [ + "memo program" + ], + "address": "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr" + } + ], + "args": [ + { + "name": "lp_token_amount", + "type": "u64" + }, + { + "name": "minimum_token_0_amount", + "type": "u64" + }, + { + "name": "minimum_token_1_amount", + "type": "u64" + } + ] + } + ], + "accounts": [ + { + "name": "AmmConfig", + "discriminator": [ + 218, + 244, + 33, + 104, + 203, + 203, + 43, + 111 + ] + }, + { + "name": "ObservationState", + "discriminator": [ + 122, + 174, + 197, + 53, + 129, + 9, + 165, + 132 + ] + }, + { + "name": "Permission", + "discriminator": [ + 224, + 83, + 28, + 79, + 10, + 253, + 161, + 28 + ] + }, + { + "name": "PoolState", + "discriminator": [ + 247, + 237, + 227, + 245, + 215, + 195, + 222, + 70 + ] + } + ], + "events": [ + { + "name": "LpChangeEvent", + "discriminator": [ + 121, + 163, + 205, + 201, + 57, + 218, + 117, + 60 + ] + }, + { + "name": "SwapEvent", + "discriminator": [ + 64, + 198, + 205, + 232, + 38, + 8, + 113, + 226 + ] + } + ], + "errors": [ + { + "code": 6000, + "name": "NotApproved", + "msg": "Not approved" + }, + { + "code": 6001, + "name": "InvalidOwner", + "msg": "Input account owner is not the program address" + }, + { + "code": 6002, + "name": "EmptySupply", + "msg": "Input token account empty" + }, + { + "code": 6003, + "name": "InvalidInput", + "msg": "InvalidInput" + }, + { + "code": 6004, + "name": "IncorrectLpMint", + "msg": "Address of the provided lp token mint is incorrect" + }, + { + "code": 6005, + "name": "ExceededSlippage", + "msg": "Exceeds desired slippage limit" + }, + { + "code": 6006, + "name": "ZeroTradingTokens", + "msg": "Given pool token amount results in zero trading tokens" + }, + { + "code": 6007, + "name": "NotSupportMint", + "msg": "Not support token_2022 mint extension" + }, + { + "code": 6008, + "name": "InvalidVault", + "msg": "invaild vault" + }, + { + "code": 6009, + "name": "InitLpAmountTooLess", + "msg": "Init lp amount is too less(Because 100 amount lp will be locked)" + }, + { + "code": 6010, + "name": "TransferFeeCalculateNotMatch", + "msg": "TransferFee calculate not match" + }, + { + "code": 6011, + "name": "MathOverflow", + "msg": "Math overflow" + }, + { + "code": 6012, + "name": "InsufficientVault", + "msg": "Insufficient vault" + }, + { + "code": 6013, + "name": "InvalidFeeModel", + "msg": "Invalid fee model" + }, + { + "code": 6014, + "name": "NoFeeCollect", + "msg": "Fee is zero" + } + ], + "types": [ + { + "name": "AmmConfig", + "docs": [ + "Holds the current owner of the factory" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "bump", + "docs": [ + "Bump to identify PDA" + ], + "type": "u8" + }, + { + "name": "disable_create_pool", + "docs": [ + "Status to control if new pool can be create" + ], + "type": "bool" + }, + { + "name": "index", + "docs": [ + "Config index" + ], + "type": "u16" + }, + { + "name": "trade_fee_rate", + "docs": [ + "The trade fee, denominated in hundredths of a bip (10^-6)" + ], + "type": "u64" + }, + { + "name": "protocol_fee_rate", + "docs": [ + "The protocol fee" + ], + "type": "u64" + }, + { + "name": "fund_fee_rate", + "docs": [ + "The fund fee, denominated in hundredths of a bip (10^-6)" + ], + "type": "u64" + }, + { + "name": "create_pool_fee", + "docs": [ + "Fee for create a new pool" + ], + "type": "u64" + }, + { + "name": "protocol_owner", + "docs": [ + "Address of the protocol fee owner" + ], + "type": "pubkey" + }, + { + "name": "fund_owner", + "docs": [ + "Address of the fund fee owner" + ], + "type": "pubkey" + }, + { + "name": "creator_fee_rate", + "docs": [ + "The pool creator fee, denominated in hundredths of a bip (10^-6)" + ], + "type": "u64" + }, + { + "name": "padding", + "docs": [ + "padding" + ], + "type": { + "array": [ + "u64", + 15 + ] + } + } + ] + } + }, + { + "name": "CreatorFeeOn", + "type": { + "kind": "enum", + "variants": [ + { + "name": "BothToken" + }, + { + "name": "OnlyToken0" + }, + { + "name": "OnlyToken1" + } + ] + } + }, + { + "name": "LpChangeEvent", + "docs": [ + "Emitted when deposit and withdraw" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool_id", + "type": "pubkey" + }, + { + "name": "lp_amount_before", + "type": "u64" + }, + { + "name": "token_0_vault_before", + "docs": [ + "pool vault sub trade fees" + ], + "type": "u64" + }, + { + "name": "token_1_vault_before", + "docs": [ + "pool vault sub trade fees" + ], + "type": "u64" + }, + { + "name": "token_0_amount", + "docs": [ + "calculate result without transfer fee" + ], + "type": "u64" + }, + { + "name": "token_1_amount", + "docs": [ + "calculate result without transfer fee" + ], + "type": "u64" + }, + { + "name": "token_0_transfer_fee", + "type": "u64" + }, + { + "name": "token_1_transfer_fee", + "type": "u64" + }, + { + "name": "change_type", + "type": "u8" + } + ] + } + }, + { + "name": "Observation", + "docs": [ + "The element of observations in ObservationState" + ], + "serialization": "bytemuckunsafe", + "repr": { + "kind": "c", + "packed": true + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "block_timestamp", + "docs": [ + "The block timestamp of the observation" + ], + "type": "u64" + }, + { + "name": "cumulative_token_0_price_x32", + "docs": [ + "the cumulative of token0 price during the duration time, Q32.32, the remaining 64 bit for overflow" + ], + "type": "u128" + }, + { + "name": "cumulative_token_1_price_x32", + "docs": [ + "the cumulative of token1 price during the duration time, Q32.32, the remaining 64 bit for overflow" + ], + "type": "u128" + } + ] + } + }, + { + "name": "ObservationState", + "serialization": "bytemuckunsafe", + "repr": { + "kind": "c", + "packed": true + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "initialized", + "docs": [ + "Whether the ObservationState is initialized" + ], + "type": "bool" + }, + { + "name": "observation_index", + "docs": [ + "the most-recently updated index of the observations array" + ], + "type": "u16" + }, + { + "name": "pool_id", + "type": "pubkey" + }, + { + "name": "observations", + "docs": [ + "observation array" + ], + "type": { + "array": [ + { + "defined": { + "name": "Observation" + } + }, + 100 + ] + } + }, + { + "name": "padding", + "docs": [ + "padding for feature update" + ], + "type": { + "array": [ + "u64", + 4 + ] + } + } + ] + } + }, + { + "name": "Permission", + "docs": [ + "Holds the current owner of the factory" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "authority", + "docs": [ + "authority" + ], + "type": "pubkey" + }, + { + "name": "padding", + "docs": [ + "padding" + ], + "type": { + "array": [ + "u64", + 30 + ] + } + } + ] + } + }, + { + "name": "PoolState", + "serialization": "bytemuckunsafe", + "repr": { + "kind": "c", + "packed": true + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "amm_config", + "docs": [ + "Which config the pool belongs" + ], + "type": "pubkey" + }, + { + "name": "pool_creator", + "docs": [ + "pool creator" + ], + "type": "pubkey" + }, + { + "name": "token_0_vault", + "docs": [ + "Token A" + ], + "type": "pubkey" + }, + { + "name": "token_1_vault", + "docs": [ + "Token B" + ], + "type": "pubkey" + }, + { + "name": "lp_mint", + "docs": [ + "Pool tokens are issued when A or B tokens are deposited.", + "Pool tokens can be withdrawn back to the original A or B token." + ], + "type": "pubkey" + }, + { + "name": "token_0_mint", + "docs": [ + "Mint information for token A" + ], + "type": "pubkey" + }, + { + "name": "token_1_mint", + "docs": [ + "Mint information for token B" + ], + "type": "pubkey" + }, + { + "name": "token_0_program", + "docs": [ + "token_0 program" + ], + "type": "pubkey" + }, + { + "name": "token_1_program", + "docs": [ + "token_1 program" + ], + "type": "pubkey" + }, + { + "name": "observation_key", + "docs": [ + "observation account to store oracle data" + ], + "type": "pubkey" + }, + { + "name": "auth_bump", + "type": "u8" + }, + { + "name": "status", + "docs": [ + "Bitwise representation of the state of the pool", + "bit0, 1: disable deposit(value is 1), 0: normal", + "bit1, 1: disable withdraw(value is 2), 0: normal", + "bit2, 1: disable swap(value is 4), 0: normal" + ], + "type": "u8" + }, + { + "name": "lp_mint_decimals", + "type": "u8" + }, + { + "name": "mint_0_decimals", + "docs": [ + "mint0 and mint1 decimals" + ], + "type": "u8" + }, + { + "name": "mint_1_decimals", + "type": "u8" + }, + { + "name": "lp_supply", + "docs": [ + "True circulating supply without burns and lock ups" + ], + "type": "u64" + }, + { + "name": "protocol_fees_token_0", + "docs": [ + "The amounts of token_0 and token_1 that are owed to the liquidity provider." + ], + "type": "u64" + }, + { + "name": "protocol_fees_token_1", + "type": "u64" + }, + { + "name": "fund_fees_token_0", + "type": "u64" + }, + { + "name": "fund_fees_token_1", + "type": "u64" + }, + { + "name": "open_time", + "docs": [ + "The timestamp allowed for swap in the pool." + ], + "type": "u64" + }, + { + "name": "recent_epoch", + "docs": [ + "recent epoch" + ], + "type": "u64" + }, + { + "name": "creator_fee_on", + "docs": [ + "Creator fee collect mode", + "0: both token_0 and token_1 can be used as trade fees. It depends on what the input token is when swapping", + "1: only token_0 as trade fee", + "2: only token_1 as trade fee" + ], + "type": "u8" + }, + { + "name": "enable_creator_fee", + "type": "bool" + }, + { + "name": "padding1", + "type": { + "array": [ + "u8", + 6 + ] + } + }, + { + "name": "creator_fees_token_0", + "type": "u64" + }, + { + "name": "creator_fees_token_1", + "type": "u64" + }, + { + "name": "padding", + "docs": [ + "padding for future updates" + ], + "type": { + "array": [ + "u64", + 28 + ] + } + } + ] + } + }, + { + "name": "SwapEvent", + "docs": [ + "Emitted when swap" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool_id", + "type": "pubkey" + }, + { + "name": "input_vault_before", + "docs": [ + "pool vault sub trade fees" + ], + "type": "u64" + }, + { + "name": "output_vault_before", + "docs": [ + "pool vault sub trade fees" + ], + "type": "u64" + }, + { + "name": "input_amount", + "docs": [ + "calculate result without transfer fee" + ], + "type": "u64" + }, + { + "name": "output_amount", + "docs": [ + "calculate result without transfer fee" + ], + "type": "u64" + }, + { + "name": "input_transfer_fee", + "type": "u64" + }, + { + "name": "output_transfer_fee", + "type": "u64" + }, + { + "name": "base_input", + "type": "bool" + }, + { + "name": "input_mint", + "type": "pubkey" + }, + { + "name": "output_mint", + "type": "pubkey" + }, + { + "name": "trade_fee", + "type": "u64" + }, + { + "name": "creator_fee", + "docs": [ + "Amount of fee tokens going to creator" + ], + "type": "u64" + }, + { + "name": "creator_fee_on_input", + "type": "bool" + } + ] + } + } + ] +} diff --git a/idl/raydium_launchpad.json b/idl/raydium_launchpad.json new file mode 100644 index 0000000..5e4563c --- /dev/null +++ b/idl/raydium_launchpad.json @@ -0,0 +1,5946 @@ +{ + "address": "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj", + "metadata": { + "name": "raydium_launchpad", + "version": "0.2.0", + "spec": "0.1.0", + "description": "Created with Anchor" + }, + "instructions": [ + { + "name": "buy_exact_in", + "docs": [ + "Use the given amount of quote tokens to purchase base tokens.", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "* `amount_in` - Amount of quote token to purchase", + "* `minimum_amount_out` - Minimum amount of base token to receive (slippage protection)", + "* `share_fee_rate` - Fee rate for the share", + "" + ], + "discriminator": [ + 250, + 234, + 13, + 123, + 213, + 156, + 19, + 236 + ], + "accounts": [ + { + "name": "payer", + "docs": [ + "The user performing the swap operation", + "Must sign the transaction and pay for fees" + ], + "writable": true, + "signer": true + }, + { + "name": "authority", + "docs": [ + "PDA that acts as the authority for pool vault operations", + "Generated using AUTH_SEED" + ], + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104, + 95, + 115, + 101, + 101, + 100 + ] + } + ] + } + }, + { + "name": "global_config", + "docs": [ + "Global configuration account containing protocol-wide settings", + "Used to read protocol fee rates and curve type" + ] + }, + { + "name": "platform_config", + "docs": [ + "Platform configuration account containing platform-wide settings", + "Used to read platform fee rate" + ] + }, + { + "name": "pool_state", + "docs": [ + "The pool state account where the swap will be performed", + "Contains current pool parameters and balances" + ], + "writable": true + }, + { + "name": "user_base_token", + "docs": [ + "The user's token account for base tokens (tokens being bought)", + "Will receive the output tokens after the swap" + ], + "writable": true + }, + { + "name": "user_quote_token", + "docs": [ + "The user's token account for quote tokens (tokens being sold)", + "Will be debited for the input amount" + ], + "writable": true + }, + { + "name": "base_vault", + "docs": [ + "The pool's vault for base tokens", + "Will be debited to send tokens to the user" + ], + "writable": true + }, + { + "name": "quote_vault", + "docs": [ + "The pool's vault for quote tokens", + "Will receive the input tokens from the user" + ], + "writable": true + }, + { + "name": "base_token_mint", + "docs": [ + "The mint of the base token", + "Used for transfer fee calculations if applicable" + ] + }, + { + "name": "quote_token_mint", + "docs": [ + "The mint of the quote token" + ] + }, + { + "name": "base_token_program", + "docs": [ + "SPL Token program for base token transfers" + ] + }, + { + "name": "quote_token_program", + "docs": [ + "SPL Token program for quote token transfers" + ], + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "amount_in", + "type": "u64" + }, + { + "name": "minimum_amount_out", + "type": "u64" + }, + { + "name": "share_fee_rate", + "type": "u64" + } + ] + }, + { + "name": "buy_exact_out", + "docs": [ + "Use quote tokens to purchase the given amount of base tokens.", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "* `amount_out` - Amount of base token to receive", + "* `maximum_amount_in` - Maximum amount of quote token to purchase (slippage protection)", + "* `share_fee_rate` - Fee rate for the share" + ], + "discriminator": [ + 24, + 211, + 116, + 40, + 105, + 3, + 153, + 56 + ], + "accounts": [ + { + "name": "payer", + "docs": [ + "The user performing the swap operation", + "Must sign the transaction and pay for fees" + ], + "writable": true, + "signer": true + }, + { + "name": "authority", + "docs": [ + "PDA that acts as the authority for pool vault operations", + "Generated using AUTH_SEED" + ], + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104, + 95, + 115, + 101, + 101, + 100 + ] + } + ] + } + }, + { + "name": "global_config", + "docs": [ + "Global configuration account containing protocol-wide settings", + "Used to read protocol fee rates and curve type" + ] + }, + { + "name": "platform_config", + "docs": [ + "Platform configuration account containing platform-wide settings", + "Used to read platform fee rate" + ] + }, + { + "name": "pool_state", + "docs": [ + "The pool state account where the swap will be performed", + "Contains current pool parameters and balances" + ], + "writable": true + }, + { + "name": "user_base_token", + "docs": [ + "The user's token account for base tokens (tokens being bought)", + "Will receive the output tokens after the swap" + ], + "writable": true + }, + { + "name": "user_quote_token", + "docs": [ + "The user's token account for quote tokens (tokens being sold)", + "Will be debited for the input amount" + ], + "writable": true + }, + { + "name": "base_vault", + "docs": [ + "The pool's vault for base tokens", + "Will be debited to send tokens to the user" + ], + "writable": true + }, + { + "name": "quote_vault", + "docs": [ + "The pool's vault for quote tokens", + "Will receive the input tokens from the user" + ], + "writable": true + }, + { + "name": "base_token_mint", + "docs": [ + "The mint of the base token", + "Used for transfer fee calculations if applicable" + ] + }, + { + "name": "quote_token_mint", + "docs": [ + "The mint of the quote token" + ] + }, + { + "name": "base_token_program", + "docs": [ + "SPL Token program for base token transfers" + ] + }, + { + "name": "quote_token_program", + "docs": [ + "SPL Token program for quote token transfers" + ], + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "amount_out", + "type": "u64" + }, + { + "name": "maximum_amount_in", + "type": "u64" + }, + { + "name": "share_fee_rate", + "type": "u64" + } + ] + }, + { + "name": "claim_creator_fee", + "docs": [ + "Claim the fee from the exclusive creator fee vault.", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "" + ], + "discriminator": [ + 26, + 97, + 138, + 203, + 132, + 171, + 141, + 252 + ], + "accounts": [ + { + "name": "creator", + "docs": [ + "The pool creator" + ], + "writable": true, + "signer": true + }, + { + "name": "fee_vault_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 99, + 114, + 101, + 97, + 116, + 111, + 114, + 95, + 102, + 101, + 101, + 95, + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104, + 95, + 115, + 101, + 101, + 100 + ] + } + ] + } + }, + { + "name": "creator_fee_vault", + "docs": [ + "The creator fee vault" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "creator" + }, + { + "kind": "account", + "path": "quote_mint" + } + ] + } + }, + { + "name": "recipient_token_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "creator" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "quote_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "quote_mint", + "docs": [ + "The mint for the quote token" + ] + }, + { + "name": "token_program", + "docs": [ + "SPL Token program for the quote token" + ], + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "system_program", + "docs": [ + "Required for account creation" + ], + "address": "11111111111111111111111111111111" + }, + { + "name": "associated_token_program", + "docs": [ + "Required for associated token program" + ], + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + } + ], + "args": [] + }, + { + "name": "claim_platform_fee", + "docs": [ + "Claim platform fee", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "" + ], + "discriminator": [ + 156, + 39, + 208, + 135, + 76, + 237, + 61, + 72 + ], + "accounts": [ + { + "name": "platform_fee_wallet", + "docs": [ + "Only the wallet stored in platform_config can collect platform fees" + ], + "writable": true, + "signer": true + }, + { + "name": "authority", + "docs": [ + "PDA that acts as the authority for pool vault and mint operations", + "Generated using AUTH_SEED" + ], + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104, + 95, + 115, + 101, + 101, + 100 + ] + } + ] + } + }, + { + "name": "pool_state", + "docs": [ + "Account that stores the pool's state and parameters", + "PDA generated using POOL_SEED and both token mints" + ], + "writable": true + }, + { + "name": "platform_config", + "docs": [ + "The platform config account" + ] + }, + { + "name": "quote_vault", + "writable": true + }, + { + "name": "recipient_token_account", + "docs": [ + "The address that receives the collected quote token fees" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "platform_fee_wallet" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "quote_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "quote_mint", + "docs": [ + "The mint of quote token vault" + ] + }, + { + "name": "token_program", + "docs": [ + "SPL program for input token transfers" + ], + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "system_program", + "docs": [ + "Required for account creation" + ], + "address": "11111111111111111111111111111111" + }, + { + "name": "associated_token_program", + "docs": [ + "Required for associated token program" + ], + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + } + ], + "args": [] + }, + { + "name": "claim_platform_fee_from_vault", + "docs": [ + "Claim the fee from the exclusive platform fee vault.", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "" + ], + "discriminator": [ + 117, + 241, + 198, + 168, + 248, + 218, + 80, + 29 + ], + "accounts": [ + { + "name": "platform_fee_wallet", + "docs": [ + "Only the wallet stored in platform_config can collect platform fees" + ], + "writable": true, + "signer": true + }, + { + "name": "fee_vault_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 108, + 97, + 116, + 102, + 111, + 114, + 109, + 95, + 102, + 101, + 101, + 95, + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104, + 95, + 115, + 101, + 101, + 100 + ] + } + ] + } + }, + { + "name": "platform_config", + "docs": [ + "The platform config account" + ] + }, + { + "name": "platform_fee_vault", + "docs": [ + "The platform fee vault" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "platform_config" + }, + { + "kind": "account", + "path": "quote_mint" + } + ] + } + }, + { + "name": "recipient_token_account", + "docs": [ + "The address that receives the collected quote token fees" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "platform_fee_wallet" + }, + { + "kind": "account", + "path": "token_program" + }, + { + "kind": "account", + "path": "quote_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "quote_mint", + "docs": [ + "The mint of quote token vault" + ] + }, + { + "name": "token_program", + "docs": [ + "SPL program for input token transfers" + ], + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "system_program", + "docs": [ + "Required for account creation" + ], + "address": "11111111111111111111111111111111" + }, + { + "name": "associated_token_program", + "docs": [ + "Required for associated token program" + ], + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + } + ], + "args": [] + }, + { + "name": "claim_vested_token", + "docs": [ + "Claim vested token", + "# Arguments" + ], + "discriminator": [ + 49, + 33, + 104, + 30, + 189, + 157, + 79, + 35 + ], + "accounts": [ + { + "name": "beneficiary", + "docs": [ + "The beneficiary of the vesting account" + ], + "writable": true, + "signer": true + }, + { + "name": "authority", + "docs": [ + "PDA that acts as the authority for pool vault and mint operations", + "Generated using AUTH_SEED" + ], + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104, + 95, + 115, + 101, + 101, + 100 + ] + } + ] + } + }, + { + "name": "pool_state", + "docs": [ + "Account that stores the pool's state and parameters", + "PDA generated using POOL_SEED and both token mints" + ], + "writable": true + }, + { + "name": "vesting_record", + "docs": [ + "The vesting record account" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 111, + 108, + 95, + 118, + 101, + 115, + 116, + 105, + 110, + 103 + ] + }, + { + "kind": "account", + "path": "pool_state" + }, + { + "kind": "account", + "path": "beneficiary" + } + ] + } + }, + { + "name": "base_vault", + "docs": [ + "The pool's vault for base tokens", + "Will be debited to send tokens to the user" + ], + "writable": true + }, + { + "name": "user_base_token", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "beneficiary" + }, + { + "kind": "account", + "path": "base_token_program" + }, + { + "kind": "account", + "path": "base_token_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89 + ] + } + } + }, + { + "name": "base_token_mint", + "docs": [ + "The mint for the base token (token being sold)", + "Created in this instruction with specified decimals" + ] + }, + { + "name": "base_token_program", + "docs": [ + "SPL Token program for the base token", + "Must be the standard Token program" + ], + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "system_program", + "docs": [ + "Required for account creation" + ], + "address": "11111111111111111111111111111111" + }, + { + "name": "associated_token_program", + "docs": [ + "Required for associated token program" + ], + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + } + ], + "args": [] + }, + { + "name": "collect_fee", + "docs": [ + "Collects accumulated fees from the pool", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "" + ], + "discriminator": [ + 60, + 173, + 247, + 103, + 4, + 93, + 130, + 48 + ], + "accounts": [ + { + "name": "owner", + "docs": [ + "Only protocol_fee_owner saved in global_config can collect protocol fee now" + ], + "signer": true + }, + { + "name": "authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104, + 95, + 115, + 101, + 101, + 100 + ] + } + ] + } + }, + { + "name": "pool_state", + "docs": [ + "Pool state stores accumulated protocol fee amount" + ], + "writable": true + }, + { + "name": "global_config", + "docs": [ + "Global config account stores owner" + ] + }, + { + "name": "quote_vault", + "docs": [ + "The address that holds pool tokens for quote token" + ], + "writable": true + }, + { + "name": "quote_mint", + "docs": [ + "The mint of quote token vault" + ] + }, + { + "name": "recipient_token_account", + "docs": [ + "The address that receives the collected quote token fees" + ], + "writable": true + }, + { + "name": "token_program", + "docs": [ + "SPL program for input token transfers" + ], + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + } + ], + "args": [] + }, + { + "name": "collect_migrate_fee", + "docs": [ + "Collects migrate fees from the pool", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "" + ], + "discriminator": [ + 255, + 186, + 150, + 223, + 235, + 118, + 201, + 186 + ], + "accounts": [ + { + "name": "owner", + "docs": [ + "Only migrate_fee_owner saved in global_config can collect migrate fee now" + ], + "signer": true + }, + { + "name": "authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104, + 95, + 115, + 101, + 101, + 100 + ] + } + ] + } + }, + { + "name": "pool_state", + "docs": [ + "Pool state stores accumulated protocol fee amount" + ], + "writable": true + }, + { + "name": "global_config", + "docs": [ + "Global config account stores owner" + ] + }, + { + "name": "quote_vault", + "docs": [ + "The address that holds pool tokens for quote token" + ], + "writable": true + }, + { + "name": "quote_mint", + "docs": [ + "The mint of quote token vault" + ] + }, + { + "name": "recipient_token_account", + "docs": [ + "The address that receives the collected quote token fees" + ], + "writable": true + }, + { + "name": "token_program", + "docs": [ + "SPL program for input token transfers" + ], + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + } + ], + "args": [] + }, + { + "name": "create_config", + "docs": [ + "Creates a new configuration", + "# Arguments", + "", + "* `ctx` - The accounts needed by instruction", + "* `curve_type` - The type of bonding curve (0: ConstantProduct)", + "* `index` - The index of config, there may be multiple config with the same curve type.", + "* `trade_fee_rate` - Trade fee rate, must be less than RATE_DENOMINATOR_VALUE", + "" + ], + "discriminator": [ + 201, + 207, + 243, + 114, + 75, + 111, + 47, + 189 + ], + "accounts": [ + { + "name": "owner", + "docs": [ + "The protocol owner/admin account", + "Must match the predefined admin address", + "Has authority to create and modify protocol configurations" + ], + "writable": true, + "signer": true, + "address": "GThUX1Atko4tqhN2NaiTazWSeFWMuiUvfFnyJyUghFMJ" + }, + { + "name": "global_config", + "docs": [ + "Global configuration account that stores protocol-wide settings", + "PDA generated using GLOBAL_CONFIG_SEED, quote token mint, and curve type", + "Stores fee rates and protocol parameters" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 103, + 108, + 111, + 98, + 97, + 108, + 95, + 99, + 111, + 110, + 102, + 105, + 103 + ] + }, + { + "kind": "account", + "path": "quote_token_mint" + }, + { + "kind": "arg", + "path": "curve_type" + }, + { + "kind": "arg", + "path": "index" + } + ] + } + }, + { + "name": "quote_token_mint", + "docs": [ + "The mint address of the quote token (token used for buying)", + "This will be the standard token used for all pools with this config" + ] + }, + { + "name": "protocol_fee_owner", + "docs": [ + "Account that will receive protocol fees" + ] + }, + { + "name": "migrate_fee_owner", + "docs": [ + "Account that will receive migrate fees" + ] + }, + { + "name": "migrate_to_amm_wallet", + "docs": [ + "The control wallet address for migrating to amm" + ] + }, + { + "name": "migrate_to_cpswap_wallet", + "docs": [ + "The control wallet address for migrating to cpswap" + ] + }, + { + "name": "system_program", + "docs": [ + "Required for account creation" + ], + "address": "11111111111111111111111111111111" + } + ], + "args": [ + { + "name": "curve_type", + "type": "u8" + }, + { + "name": "index", + "type": "u16" + }, + { + "name": "migrate_fee", + "type": "u64" + }, + { + "name": "trade_fee_rate", + "type": "u64" + } + ] + }, + { + "name": "create_platform_config", + "docs": [ + "Create platform config account", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "# Fields", + "* `fee_rate` - Fee rate of the platform", + "* `name` - Name of the platform", + "* `web` - Website of the platform", + "* `img` - Image link of the platform", + "" + ], + "discriminator": [ + 176, + 90, + 196, + 175, + 253, + 113, + 220, + 20 + ], + "accounts": [ + { + "name": "platform_admin", + "docs": [ + "The account paying for the initialization costs" + ], + "writable": true, + "signer": true + }, + { + "name": "platform_fee_wallet" + }, + { + "name": "platform_nft_wallet" + }, + { + "name": "platform_config", + "docs": [ + "The platform config account" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 108, + 97, + 116, + 102, + 111, + 114, + 109, + 95, + 99, + 111, + 110, + 102, + 105, + 103 + ] + }, + { + "kind": "account", + "path": "platform_admin" + } + ] + } + }, + { + "name": "cpswap_config" + }, + { + "name": "system_program", + "docs": [ + "Required for account creation" + ], + "address": "11111111111111111111111111111111" + }, + { + "name": "transfer_fee_extension_authority" + }, + { + "name": "platform_vesting_wallet" + } + ], + "args": [ + { + "name": "platform_params", + "type": { + "defined": { + "name": "PlatformParams" + } + } + } + ] + }, + { + "name": "create_platform_vesting_account", + "docs": [ + "Create vesting account", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "* `share` - The share amount of base token to be vested", + "" + ], + "discriminator": [ + 146, + 71, + 173, + 69, + 98, + 19, + 15, + 106 + ], + "accounts": [ + { + "name": "platform_vesting_wallet", + "docs": [ + "The account paying for the initialization costs", + "This can be any account with sufficient SOL to cover the transaction" + ], + "writable": true, + "signer": true + }, + { + "name": "beneficiary", + "docs": [ + "The beneficiary is used to receive the allocated linear release of tokens.", + "Once this account is set, it cannot be modified, so please ensure the validity of this account,", + "otherwise, the unlocked tokens will not be claimable." + ], + "writable": true + }, + { + "name": "platform_config", + "docs": [ + "Platform config account to be changed" + ] + }, + { + "name": "pool_state", + "docs": [ + "The pool state account" + ], + "writable": true + }, + { + "name": "platform_vesting_record", + "docs": [ + "The vesting record account" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 111, + 108, + 95, + 118, + 101, + 115, + 116, + 105, + 110, + 103 + ] + }, + { + "kind": "account", + "path": "pool_state" + }, + { + "kind": "account", + "path": "beneficiary" + } + ] + } + }, + { + "name": "system_program", + "docs": [ + "Required for account creation" + ], + "address": "11111111111111111111111111111111" + } + ], + "args": [] + }, + { + "name": "create_vesting_account", + "docs": [ + "Create vesting account", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "* `share` - The share amount of base token to be vested", + "" + ], + "discriminator": [ + 129, + 178, + 2, + 13, + 217, + 172, + 230, + 218 + ], + "accounts": [ + { + "name": "creator", + "docs": [ + "The account paying for the initialization costs", + "This can be any account with sufficient SOL to cover the transaction" + ], + "writable": true, + "signer": true + }, + { + "name": "beneficiary", + "docs": [ + "The beneficiary is used to receive the allocated linear release of tokens.", + "Once this account is set, it cannot be modified, so please ensure the validity of this account,", + "otherwise, the unlocked tokens will not be claimable." + ], + "writable": true + }, + { + "name": "pool_state", + "docs": [ + "The pool state account" + ], + "writable": true + }, + { + "name": "vesting_record", + "docs": [ + "The vesting record account" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 111, + 108, + 95, + 118, + 101, + 115, + 116, + 105, + 110, + 103 + ] + }, + { + "kind": "account", + "path": "pool_state" + }, + { + "kind": "account", + "path": "beneficiary" + } + ] + } + }, + { + "name": "system_program", + "docs": [ + "Required for account creation" + ], + "address": "11111111111111111111111111111111" + } + ], + "args": [ + { + "name": "share_amount", + "type": "u64" + } + ] + }, + { + "name": "initialize", + "docs": [ + "Initializes a new trading pool", + "# Arguments", + "", + "* `ctx` - The context of accounts containing pool and token information", + "" + ], + "discriminator": [ + 175, + 175, + 109, + 31, + 13, + 152, + 155, + 237 + ], + "accounts": [ + { + "name": "payer", + "docs": [ + "The account paying for the initialization costs", + "This can be any account with sufficient SOL to cover the transaction" + ], + "writable": true, + "signer": true + }, + { + "name": "creator" + }, + { + "name": "global_config", + "docs": [ + "Global configuration account containing protocol-wide settings", + "Includes settings like quote token mint and fee parameters" + ] + }, + { + "name": "platform_config", + "docs": [ + "Platform configuration account containing platform info", + "Includes settings like the fee_rate, name, web, img of the platform" + ] + }, + { + "name": "authority", + "docs": [ + "PDA that acts as the authority for pool vault and mint operations", + "Generated using AUTH_SEED" + ], + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104, + 95, + 115, + 101, + 101, + 100 + ] + } + ] + } + }, + { + "name": "pool_state", + "docs": [ + "Account that stores the pool's state and parameters", + "PDA generated using POOL_SEED and both token mints" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 111, + 108 + ] + }, + { + "kind": "account", + "path": "base_mint" + }, + { + "kind": "account", + "path": "quote_mint" + } + ] + } + }, + { + "name": "base_mint", + "docs": [ + "The mint for the base token (token being sold)", + "Created in this instruction with specified decimals" + ], + "writable": true, + "signer": true + }, + { + "name": "quote_mint", + "docs": [ + "The mint for the quote token (token used to buy)", + "Must match the quote_mint specified in global config" + ] + }, + { + "name": "base_vault", + "docs": [ + "Token account that holds the pool's base tokens", + "PDA generated using POOL_VAULT_SEED" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 111, + 108, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "pool_state" + }, + { + "kind": "account", + "path": "base_mint" + } + ] + } + }, + { + "name": "quote_vault", + "docs": [ + "Token account that holds the pool's quote tokens", + "PDA generated using POOL_VAULT_SEED" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 111, + 108, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "pool_state" + }, + { + "kind": "account", + "path": "quote_mint" + } + ] + } + }, + { + "name": "metadata_account", + "docs": [ + "Account to store the base token's metadata", + "Created using Metaplex metadata program" + ], + "writable": true + }, + { + "name": "base_token_program", + "docs": [ + "SPL Token program for the base token", + "Must be the standard Token program" + ], + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "quote_token_program", + "docs": [ + "SPL Token program for the quote token" + ], + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "metadata_program", + "docs": [ + "Metaplex Token Metadata program", + "Used to create metadata for the base token" + ], + "address": "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s" + }, + { + "name": "system_program", + "docs": [ + "Required for account creation" + ], + "address": "11111111111111111111111111111111" + }, + { + "name": "rent_program", + "docs": [ + "Required for rent exempt calculations" + ], + "address": "SysvarRent111111111111111111111111111111111" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "base_mint_param", + "type": { + "defined": { + "name": "MintParams" + } + } + }, + { + "name": "curve_param", + "type": { + "defined": { + "name": "CurveParams" + } + } + }, + { + "name": "vesting_param", + "type": { + "defined": { + "name": "VestingParams" + } + } + } + ] + }, + { + "name": "initialize_v2", + "docs": [ + "Initializes a new trading pool", + "# Arguments", + "", + "* `ctx` - The context of accounts containing pool and token information", + "" + ], + "discriminator": [ + 67, + 153, + 175, + 39, + 218, + 16, + 38, + 32 + ], + "accounts": [ + { + "name": "payer", + "docs": [ + "The account paying for the initialization costs", + "This can be any account with sufficient SOL to cover the transaction" + ], + "writable": true, + "signer": true + }, + { + "name": "creator" + }, + { + "name": "global_config", + "docs": [ + "Global configuration account containing protocol-wide settings", + "Includes settings like quote token mint and fee parameters" + ] + }, + { + "name": "platform_config", + "docs": [ + "Platform configuration account containing platform info", + "Includes settings like the fee_rate, name, web, img of the platform" + ] + }, + { + "name": "authority", + "docs": [ + "PDA that acts as the authority for pool vault and mint operations", + "Generated using AUTH_SEED" + ], + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104, + 95, + 115, + 101, + 101, + 100 + ] + } + ] + } + }, + { + "name": "pool_state", + "docs": [ + "Account that stores the pool's state and parameters", + "PDA generated using POOL_SEED and both token mints" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 111, + 108 + ] + }, + { + "kind": "account", + "path": "base_mint" + }, + { + "kind": "account", + "path": "quote_mint" + } + ] + } + }, + { + "name": "base_mint", + "docs": [ + "The mint for the base token (token being sold)", + "Created in this instruction with specified decimals" + ], + "writable": true, + "signer": true + }, + { + "name": "quote_mint", + "docs": [ + "The mint for the quote token (token used to buy)", + "Must match the quote_mint specified in global config" + ] + }, + { + "name": "base_vault", + "docs": [ + "Token account that holds the pool's base tokens", + "PDA generated using POOL_VAULT_SEED" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 111, + 108, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "pool_state" + }, + { + "kind": "account", + "path": "base_mint" + } + ] + } + }, + { + "name": "quote_vault", + "docs": [ + "Token account that holds the pool's quote tokens", + "PDA generated using POOL_VAULT_SEED" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 111, + 108, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "pool_state" + }, + { + "kind": "account", + "path": "quote_mint" + } + ] + } + }, + { + "name": "metadata_account", + "docs": [ + "Account to store the base token's metadata", + "Created using Metaplex metadata program" + ], + "writable": true + }, + { + "name": "base_token_program", + "docs": [ + "SPL Token program for the base token", + "Must be the standard Token program" + ], + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "quote_token_program", + "docs": [ + "SPL Token program for the quote token" + ], + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "metadata_program", + "docs": [ + "Metaplex Token Metadata program", + "Used to create metadata for the base token" + ], + "address": "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s" + }, + { + "name": "system_program", + "docs": [ + "Required for account creation" + ], + "address": "11111111111111111111111111111111" + }, + { + "name": "rent_program", + "docs": [ + "Required for rent exempt calculations" + ], + "address": "SysvarRent111111111111111111111111111111111" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "base_mint_param", + "type": { + "defined": { + "name": "MintParams" + } + } + }, + { + "name": "curve_param", + "type": { + "defined": { + "name": "CurveParams" + } + } + }, + { + "name": "vesting_param", + "type": { + "defined": { + "name": "VestingParams" + } + } + }, + { + "name": "amm_fee_on", + "type": { + "defined": { + "name": "AmmCreatorFeeOn" + } + } + } + ] + }, + { + "name": "initialize_with_token_2022", + "docs": [ + "Initializes a new trading pool with base token belongs to spl-token-2022,", + "pool created by this instruction must be migrated to cpswap after fundraising ends, i.e., curve_param.migrate_type = 1", + "# Arguments", + "", + "* `ctx` - The context of accounts containing pool and token information", + "" + ], + "discriminator": [ + 37, + 190, + 126, + 222, + 44, + 154, + 171, + 17 + ], + "accounts": [ + { + "name": "payer", + "docs": [ + "The account paying for the initialization costs", + "This can be any account with sufficient SOL to cover the transaction" + ], + "writable": true, + "signer": true + }, + { + "name": "creator" + }, + { + "name": "global_config", + "docs": [ + "Global configuration account containing protocol-wide settings", + "Includes settings like quote token mint and fee parameters" + ] + }, + { + "name": "platform_config", + "docs": [ + "Platform configuration account containing platform info", + "Includes settings like the fee_rate, name, web, img of the platform" + ] + }, + { + "name": "authority", + "docs": [ + "PDA that acts as the authority for pool vault and mint operations", + "Generated using AUTH_SEED" + ], + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104, + 95, + 115, + 101, + 101, + 100 + ] + } + ] + } + }, + { + "name": "pool_state", + "docs": [ + "Account that stores the pool's state and parameters", + "PDA generated using POOL_SEED and both token mints" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 111, + 108 + ] + }, + { + "kind": "account", + "path": "base_mint" + }, + { + "kind": "account", + "path": "quote_mint" + } + ] + } + }, + { + "name": "base_mint", + "docs": [ + "The mint for the base token (token being sold)", + "Created in this instruction with specified decimals" + ], + "writable": true, + "signer": true + }, + { + "name": "quote_mint", + "docs": [ + "The mint for the quote token (token used to buy)", + "Must match the quote_mint specified in global config" + ] + }, + { + "name": "base_vault", + "docs": [ + "Token account that holds the pool's base tokens", + "PDA generated using POOL_VAULT_SEED" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 111, + 108, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "pool_state" + }, + { + "kind": "account", + "path": "base_mint" + } + ] + } + }, + { + "name": "quote_vault", + "docs": [ + "Token account that holds the pool's quote tokens", + "PDA generated using POOL_VAULT_SEED" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 111, + 108, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "pool_state" + }, + { + "kind": "account", + "path": "quote_mint" + } + ] + } + }, + { + "name": "base_token_program", + "docs": [ + "SPL Token program for the base token" + ], + "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" + }, + { + "name": "quote_token_program", + "docs": [ + "SPL Token program for the quote token" + ], + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "system_program", + "docs": [ + "Required for account creation" + ], + "address": "11111111111111111111111111111111" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "base_mint_param", + "type": { + "defined": { + "name": "MintParams" + } + } + }, + { + "name": "curve_param", + "type": { + "defined": { + "name": "CurveParams" + } + } + }, + { + "name": "vesting_param", + "type": { + "defined": { + "name": "VestingParams" + } + } + }, + { + "name": "amm_fee_on", + "type": { + "defined": { + "name": "AmmCreatorFeeOn" + } + } + }, + { + "name": "transfer_fee_extension_param", + "type": { + "option": { + "defined": { + "name": "TransferFeeExtensionParams" + } + } + } + } + ] + }, + { + "name": "migrate_to_amm", + "docs": [ + "# Arguments", + "", + "* `ctx` - The context of accounts", + "" + ], + "discriminator": [ + 207, + 82, + 192, + 145, + 254, + 207, + 145, + 223 + ], + "accounts": [ + { + "name": "payer", + "docs": [ + "Only migrate_to_amm_wallet can migrate to cpswap pool", + "This signer must match the migrate_to_amm_wallet saved in global_config" + ], + "writable": true, + "signer": true + }, + { + "name": "base_mint", + "docs": [ + "The mint for the base token (token being sold)" + ] + }, + { + "name": "quote_mint", + "docs": [ + "The mint for the quote token (token used to buy)" + ] + }, + { + "name": "openbook_program", + "address": "srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX" + }, + { + "name": "market", + "docs": [ + "Account created and asigned to openbook_program but not been initialized" + ], + "writable": true + }, + { + "name": "request_queue", + "docs": [ + "Account created and asigned to openbook_program but not been initialized" + ], + "writable": true + }, + { + "name": "event_queue", + "docs": [ + "Account created and asigned to openbook_program but not been initialized" + ], + "writable": true + }, + { + "name": "bids", + "docs": [ + "Account created and asigned to openbook_program but not been initialized" + ], + "writable": true + }, + { + "name": "asks", + "docs": [ + "Account created and asigned to openbook_program but not been initialized" + ], + "writable": true + }, + { + "name": "market_vault_signer" + }, + { + "name": "market_base_vault", + "docs": [ + "Token account that holds the market's base tokens" + ], + "writable": true + }, + { + "name": "market_quote_vault", + "docs": [ + "Token account that holds the market's quote tokens" + ], + "writable": true + }, + { + "name": "amm_program", + "address": "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8" + }, + { + "name": "amm_pool", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "amm_program" + }, + { + "kind": "account", + "path": "market" + }, + { + "kind": "const", + "value": [ + 97, + 109, + 109, + 95, + 97, + 115, + 115, + 111, + 99, + 105, + 97, + 116, + 101, + 100, + 95, + 115, + 101, + 101, + 100 + ] + } + ], + "program": { + "kind": "account", + "path": "amm_program" + } + } + }, + { + "name": "amm_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 97, + 109, + 109, + 32, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ], + "program": { + "kind": "account", + "path": "amm_program" + } + } + }, + { + "name": "amm_open_orders", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "amm_program" + }, + { + "kind": "account", + "path": "market" + }, + { + "kind": "const", + "value": [ + 111, + 112, + 101, + 110, + 95, + 111, + 114, + 100, + 101, + 114, + 95, + 97, + 115, + 115, + 111, + 99, + 105, + 97, + 116, + 101, + 100, + 95, + 115, + 101, + 101, + 100 + ] + } + ], + "program": { + "kind": "account", + "path": "amm_program" + } + } + }, + { + "name": "amm_lp_mint", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "amm_program" + }, + { + "kind": "account", + "path": "market" + }, + { + "kind": "const", + "value": [ + 108, + 112, + 95, + 109, + 105, + 110, + 116, + 95, + 97, + 115, + 115, + 111, + 99, + 105, + 97, + 116, + 101, + 100, + 95, + 115, + 101, + 101, + 100 + ] + } + ], + "program": { + "kind": "account", + "path": "amm_program" + } + } + }, + { + "name": "amm_base_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "amm_program" + }, + { + "kind": "account", + "path": "market" + }, + { + "kind": "const", + "value": [ + 99, + 111, + 105, + 110, + 95, + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 115, + 115, + 111, + 99, + 105, + 97, + 116, + 101, + 100, + 95, + 115, + 101, + 101, + 100 + ] + } + ], + "program": { + "kind": "account", + "path": "amm_program" + } + } + }, + { + "name": "amm_quote_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "amm_program" + }, + { + "kind": "account", + "path": "market" + }, + { + "kind": "const", + "value": [ + 112, + 99, + 95, + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 115, + 115, + 111, + 99, + 105, + 97, + 116, + 101, + 100, + 95, + 115, + 101, + 101, + 100 + ] + } + ], + "program": { + "kind": "account", + "path": "amm_program" + } + } + }, + { + "name": "amm_target_orders", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "amm_program" + }, + { + "kind": "account", + "path": "market" + }, + { + "kind": "const", + "value": [ + 116, + 97, + 114, + 103, + 101, + 116, + 95, + 97, + 115, + 115, + 111, + 99, + 105, + 97, + 116, + 101, + 100, + 95, + 115, + 101, + 101, + 100 + ] + } + ], + "program": { + "kind": "account", + "path": "amm_program" + } + } + }, + { + "name": "amm_config", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 97, + 109, + 109, + 95, + 99, + 111, + 110, + 102, + 105, + 103, + 95, + 97, + 99, + 99, + 111, + 117, + 110, + 116, + 95, + 115, + 101, + 101, + 100 + ] + } + ], + "program": { + "kind": "account", + "path": "amm_program" + } + } + }, + { + "name": "amm_create_fee_destination", + "writable": true + }, + { + "name": "authority", + "docs": [ + "PDA that acts as the authority for pool vault operations", + "Generated using AUTH_SEED" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104, + 95, + 115, + 101, + 101, + 100 + ] + } + ] + } + }, + { + "name": "pool_state", + "docs": [ + "Account that stores the pool's state and parameters", + "PDA generated using POOL_SEED and both token mints" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 111, + 108 + ] + }, + { + "kind": "account", + "path": "base_mint" + }, + { + "kind": "account", + "path": "quote_mint" + } + ] + } + }, + { + "name": "global_config", + "docs": [ + "Global config account stores owner" + ] + }, + { + "name": "base_vault", + "docs": [ + "The pool's vault for base tokens", + "Will be fully drained during migration" + ], + "writable": true + }, + { + "name": "quote_vault", + "docs": [ + "The pool's vault for quote tokens", + "Will be fully drained during migration" + ], + "writable": true + }, + { + "name": "pool_lp_token", + "writable": true + }, + { + "name": "spl_token_program", + "docs": [ + "SPL Token program for the base token", + "Must be the standard Token program" + ], + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "associated_token_program", + "docs": [ + "Program to create an ATA for receiving fee NFT" + ], + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "system_program", + "docs": [ + "Required for account creation" + ], + "address": "11111111111111111111111111111111" + }, + { + "name": "rent_program", + "docs": [ + "Required for rent exempt calculations" + ], + "address": "SysvarRent111111111111111111111111111111111" + } + ], + "args": [ + { + "name": "base_lot_size", + "type": "u64" + }, + { + "name": "quote_lot_size", + "type": "u64" + }, + { + "name": "market_vault_signer_nonce", + "type": "u8" + } + ] + }, + { + "name": "migrate_to_cpswap", + "docs": [ + "# Arguments", + "", + "* `ctx` - The context of accounts", + "" + ], + "discriminator": [ + 136, + 92, + 200, + 103, + 28, + 218, + 144, + 140 + ], + "accounts": [ + { + "name": "payer", + "docs": [ + "Only migrate_to_cpswap_wallet can migrate to cpswap pool", + "This signer must match the migrate_to_cpswap_wallet saved in global_config" + ], + "writable": true, + "signer": true + }, + { + "name": "base_mint", + "docs": [ + "The mint for the base token (token being sold)" + ], + "writable": true + }, + { + "name": "quote_mint", + "docs": [ + "The mint for the quote token (token used to buy)" + ] + }, + { + "name": "platform_config", + "docs": [ + "Platform configuration account containing platform-wide settings", + "Used to read platform fee rate" + ] + }, + { + "name": "cpswap_program", + "address": "CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C" + }, + { + "name": "cpswap_pool", + "docs": [ + "PDA account:", + "seeds = [", + "b\"pool\",", + "cpswap_config.key().as_ref(),", + "token_0_mint.key().as_ref(),", + "token_1_mint.key().as_ref(),", + "],", + "seeds::program = cpswap_program,", + "", + "Or random account: must be signed by cli" + ], + "writable": true + }, + { + "name": "cpswap_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 110, + 100, + 95, + 108, + 112, + 95, + 109, + 105, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 95, + 115, + 101, + 101, + 100 + ] + } + ], + "program": { + "kind": "account", + "path": "cpswap_program" + } + } + }, + { + "name": "cpswap_lp_mint", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 111, + 108, + 95, + 108, + 112, + 95, + 109, + 105, + 110, + 116 + ] + }, + { + "kind": "account", + "path": "cpswap_pool" + } + ], + "program": { + "kind": "account", + "path": "cpswap_program" + } + } + }, + { + "name": "cpswap_base_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 111, + 108, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "cpswap_pool" + }, + { + "kind": "account", + "path": "base_mint" + } + ], + "program": { + "kind": "account", + "path": "cpswap_program" + } + } + }, + { + "name": "cpswap_quote_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 111, + 108, + 95, + 118, + 97, + 117, + 108, + 116 + ] + }, + { + "kind": "account", + "path": "cpswap_pool" + }, + { + "kind": "account", + "path": "quote_mint" + } + ], + "program": { + "kind": "account", + "path": "cpswap_program" + } + } + }, + { + "name": "cpswap_config" + }, + { + "name": "cpswap_create_pool_fee", + "writable": true + }, + { + "name": "cpswap_observation", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 111, + 98, + 115, + 101, + 114, + 118, + 97, + 116, + 105, + 111, + 110 + ] + }, + { + "kind": "account", + "path": "cpswap_pool" + } + ], + "program": { + "kind": "account", + "path": "cpswap_program" + } + } + }, + { + "name": "lock_program", + "address": "LockrWmn6K5twhz3y9w1dQERbmgSaRkfnTeTKbpofwE" + }, + { + "name": "lock_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 108, + 111, + 99, + 107, + 95, + 99, + 112, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121, + 95, + 115, + 101, + 101, + 100 + ] + } + ], + "program": { + "kind": "account", + "path": "lock_program" + } + } + }, + { + "name": "lock_lp_vault", + "writable": true + }, + { + "name": "authority", + "docs": [ + "PDA that acts as the authority for pool vault operations", + "Generated using AUTH_SEED" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104, + 95, + 115, + 101, + 101, + 100 + ] + } + ] + } + }, + { + "name": "pool_state", + "docs": [ + "Account that stores the pool's state and parameters", + "PDA generated using POOL_SEED and both token mints" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 111, + 111, + 108 + ] + }, + { + "kind": "account", + "path": "base_mint" + }, + { + "kind": "account", + "path": "quote_mint" + } + ] + } + }, + { + "name": "global_config", + "docs": [ + "Global config account stores owner" + ] + }, + { + "name": "base_vault", + "docs": [ + "The pool's vault for base tokens", + "Will be fully drained during migration" + ], + "writable": true + }, + { + "name": "quote_vault", + "docs": [ + "The pool's vault for quote tokens", + "Will be fully drained during migration" + ], + "writable": true + }, + { + "name": "pool_lp_token", + "writable": true + }, + { + "name": "base_token_program", + "docs": [ + "SPL Token program for the base token", + "Must be the standard Token program" + ] + }, + { + "name": "quote_token_program", + "docs": [ + "SPL Token program for the quote token" + ], + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "associated_token_program", + "docs": [ + "Program to create an ATA for receiving fee NFT" + ], + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "system_program", + "docs": [ + "Required for account creation" + ], + "address": "11111111111111111111111111111111" + }, + { + "name": "rent_program", + "docs": [ + "Required for rent exempt calculations" + ], + "address": "SysvarRent111111111111111111111111111111111" + }, + { + "name": "metadata_program", + "docs": [ + "Program to create NFT metadata accunt" + ], + "address": "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s" + } + ], + "args": [] + }, + { + "name": "remove_platform_curve_param", + "docs": [ + "Remove platform launch param", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "* `index` - The index of the curve param to remove", + "" + ], + "discriminator": [ + 27, + 30, + 62, + 169, + 93, + 224, + 24, + 145 + ], + "accounts": [ + { + "name": "platform_admin", + "docs": [ + "The account paying for the initialization costs" + ], + "signer": true + }, + { + "name": "platform_config", + "docs": [ + "Platform config account to be changed" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 108, + 97, + 116, + 102, + 111, + 114, + 109, + 95, + 99, + 111, + 110, + 102, + 105, + 103 + ] + }, + { + "kind": "account", + "path": "platform_admin" + } + ] + } + } + ], + "args": [ + { + "name": "index", + "type": "u8" + } + ] + }, + { + "name": "sell_exact_in", + "docs": [ + "Use the given amount of base tokens to sell for quote tokens.", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "* `amount_in` - Amount of base token to sell", + "* `minimum_amount_out` - Minimum amount of quote token to receive (slippage protection)", + "* `share_fee_rate` - Fee rate for the share", + "" + ], + "discriminator": [ + 149, + 39, + 222, + 155, + 211, + 124, + 152, + 26 + ], + "accounts": [ + { + "name": "payer", + "docs": [ + "The user performing the swap operation", + "Must sign the transaction and pay for fees" + ], + "writable": true, + "signer": true + }, + { + "name": "authority", + "docs": [ + "PDA that acts as the authority for pool vault operations", + "Generated using AUTH_SEED" + ], + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104, + 95, + 115, + 101, + 101, + 100 + ] + } + ] + } + }, + { + "name": "global_config", + "docs": [ + "Global configuration account containing protocol-wide settings", + "Used to read protocol fee rates and curve type" + ] + }, + { + "name": "platform_config", + "docs": [ + "Platform configuration account containing platform-wide settings", + "Used to read platform fee rate" + ] + }, + { + "name": "pool_state", + "docs": [ + "The pool state account where the swap will be performed", + "Contains current pool parameters and balances" + ], + "writable": true + }, + { + "name": "user_base_token", + "docs": [ + "The user's token account for base tokens (tokens being bought)", + "Will receive the output tokens after the swap" + ], + "writable": true + }, + { + "name": "user_quote_token", + "docs": [ + "The user's token account for quote tokens (tokens being sold)", + "Will be debited for the input amount" + ], + "writable": true + }, + { + "name": "base_vault", + "docs": [ + "The pool's vault for base tokens", + "Will be debited to send tokens to the user" + ], + "writable": true + }, + { + "name": "quote_vault", + "docs": [ + "The pool's vault for quote tokens", + "Will receive the input tokens from the user" + ], + "writable": true + }, + { + "name": "base_token_mint", + "docs": [ + "The mint of the base token", + "Used for transfer fee calculations if applicable" + ] + }, + { + "name": "quote_token_mint", + "docs": [ + "The mint of the quote token" + ] + }, + { + "name": "base_token_program", + "docs": [ + "SPL Token program for base token transfers" + ] + }, + { + "name": "quote_token_program", + "docs": [ + "SPL Token program for quote token transfers" + ], + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "amount_in", + "type": "u64" + }, + { + "name": "minimum_amount_out", + "type": "u64" + }, + { + "name": "share_fee_rate", + "type": "u64" + } + ] + }, + { + "name": "sell_exact_out", + "docs": [ + "Sell base tokens for the given amount of quote tokens.", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "* `amount_out` - Amount of quote token to receive", + "* `maximum_amount_in` - Maximum amount of base token to purchase (slippage protection)", + "* `share_fee_rate` - Fee rate for the share", + "" + ], + "discriminator": [ + 95, + 200, + 71, + 34, + 8, + 9, + 11, + 166 + ], + "accounts": [ + { + "name": "payer", + "docs": [ + "The user performing the swap operation", + "Must sign the transaction and pay for fees" + ], + "writable": true, + "signer": true + }, + { + "name": "authority", + "docs": [ + "PDA that acts as the authority for pool vault operations", + "Generated using AUTH_SEED" + ], + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 118, + 97, + 117, + 108, + 116, + 95, + 97, + 117, + 116, + 104, + 95, + 115, + 101, + 101, + 100 + ] + } + ] + } + }, + { + "name": "global_config", + "docs": [ + "Global configuration account containing protocol-wide settings", + "Used to read protocol fee rates and curve type" + ] + }, + { + "name": "platform_config", + "docs": [ + "Platform configuration account containing platform-wide settings", + "Used to read platform fee rate" + ] + }, + { + "name": "pool_state", + "docs": [ + "The pool state account where the swap will be performed", + "Contains current pool parameters and balances" + ], + "writable": true + }, + { + "name": "user_base_token", + "docs": [ + "The user's token account for base tokens (tokens being bought)", + "Will receive the output tokens after the swap" + ], + "writable": true + }, + { + "name": "user_quote_token", + "docs": [ + "The user's token account for quote tokens (tokens being sold)", + "Will be debited for the input amount" + ], + "writable": true + }, + { + "name": "base_vault", + "docs": [ + "The pool's vault for base tokens", + "Will be debited to send tokens to the user" + ], + "writable": true + }, + { + "name": "quote_vault", + "docs": [ + "The pool's vault for quote tokens", + "Will receive the input tokens from the user" + ], + "writable": true + }, + { + "name": "base_token_mint", + "docs": [ + "The mint of the base token", + "Used for transfer fee calculations if applicable" + ] + }, + { + "name": "quote_token_mint", + "docs": [ + "The mint of the quote token" + ] + }, + { + "name": "base_token_program", + "docs": [ + "SPL Token program for base token transfers" + ] + }, + { + "name": "quote_token_program", + "docs": [ + "SPL Token program for quote token transfers" + ], + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "event_authority", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 95, + 95, + 101, + 118, + 101, + 110, + 116, + 95, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 116, + 121 + ] + } + ] + } + }, + { + "name": "program" + } + ], + "args": [ + { + "name": "amount_out", + "type": "u64" + }, + { + "name": "maximum_amount_in", + "type": "u64" + }, + { + "name": "share_fee_rate", + "type": "u64" + } + ] + }, + { + "name": "update_config", + "docs": [ + "Updates configuration parameters", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "* `param` - Parameter to update:", + "- 0: Update trade_fee_rate", + "- 1: Update fee owner", + "* `value` - New value for the selected parameter", + "" + ], + "discriminator": [ + 29, + 158, + 252, + 191, + 10, + 83, + 219, + 99 + ], + "accounts": [ + { + "name": "owner", + "docs": [ + "The global config owner or admin" + ], + "signer": true, + "address": "GThUX1Atko4tqhN2NaiTazWSeFWMuiUvfFnyJyUghFMJ" + }, + { + "name": "global_config", + "docs": [ + "Global config account to be changed" + ], + "writable": true + } + ], + "args": [ + { + "name": "param", + "type": "u8" + }, + { + "name": "value", + "type": "u64" + } + ] + }, + { + "name": "update_platform_config", + "docs": [ + "Update platform config", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "* `param` - Parameter to update", + "" + ], + "discriminator": [ + 195, + 60, + 76, + 129, + 146, + 45, + 67, + 143 + ], + "accounts": [ + { + "name": "platform_admin", + "docs": [ + "The account paying for the initialization costs" + ], + "signer": true + }, + { + "name": "platform_config", + "docs": [ + "Platform config account to be changed" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 108, + 97, + 116, + 102, + 111, + 114, + 109, + 95, + 99, + 111, + 110, + 102, + 105, + 103 + ] + }, + { + "kind": "account", + "path": "platform_admin" + } + ] + } + } + ], + "args": [ + { + "name": "param", + "type": { + "defined": { + "name": "PlatformConfigParam" + } + } + } + ] + }, + { + "name": "update_platform_curve_param", + "docs": [ + "Update platform launch param", + "# Arguments", + "", + "* `ctx` - The context of accounts", + "* `bonding_curve_param` - Parameter to update", + "" + ], + "discriminator": [ + 138, + 144, + 138, + 250, + 220, + 128, + 4, + 57 + ], + "accounts": [ + { + "name": "platform_admin", + "docs": [ + "The account paying for the initialization costs" + ], + "writable": true, + "signer": true + }, + { + "name": "platform_config", + "docs": [ + "Platform config account to be changed" + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, + 108, + 97, + 116, + 102, + 111, + 114, + 109, + 95, + 99, + 111, + 110, + 102, + 105, + 103 + ] + }, + { + "kind": "account", + "path": "platform_admin" + } + ] + } + }, + { + "name": "global_config", + "docs": [ + "Global configuration account containing protocol-wide settings", + "Includes settings like quote token mint and fee parameters" + ] + }, + { + "name": "system_program", + "docs": [ + "System program for lamport transfers" + ], + "address": "11111111111111111111111111111111" + } + ], + "args": [ + { + "name": "index", + "type": "u8" + }, + { + "name": "bonding_curve_param", + "type": { + "defined": { + "name": "BondingCurveParam" + } + } + } + ] + } + ], + "accounts": [ + { + "name": "GlobalConfig", + "discriminator": [ + 149, + 8, + 156, + 202, + 160, + 252, + 176, + 217 + ] + }, + { + "name": "PlatformConfig", + "discriminator": [ + 160, + 78, + 128, + 0, + 248, + 83, + 230, + 160 + ] + }, + { + "name": "PoolState", + "discriminator": [ + 247, + 237, + 227, + 245, + 215, + 195, + 222, + 70 + ] + }, + { + "name": "VestingRecord", + "discriminator": [ + 106, + 243, + 221, + 205, + 230, + 126, + 85, + 83 + ] + } + ], + "events": [ + { + "name": "ClaimVestedEvent", + "discriminator": [ + 21, + 194, + 114, + 87, + 120, + 211, + 226, + 32 + ] + }, + { + "name": "CreateVestingEvent", + "discriminator": [ + 150, + 152, + 11, + 179, + 52, + 210, + 191, + 125 + ] + }, + { + "name": "PoolCreateEvent", + "discriminator": [ + 151, + 215, + 226, + 9, + 118, + 161, + 115, + 174 + ] + }, + { + "name": "TradeEvent", + "discriminator": [ + 189, + 219, + 127, + 211, + 78, + 230, + 97, + 238 + ] + } + ], + "errors": [ + { + "code": 6000, + "name": "NotApproved", + "msg": "Not approved" + }, + { + "code": 6001, + "name": "InvalidOwner", + "msg": "Input account owner is not the program address" + }, + { + "code": 6002, + "name": "InvalidInput", + "msg": "InvalidInput" + }, + { + "code": 6003, + "name": "InputNotMatchCurveConfig", + "msg": "The input params are not match with curve type in config" + }, + { + "code": 6004, + "name": "ExceededSlippage", + "msg": "Exceeds desired slippage limit" + }, + { + "code": 6005, + "name": "PoolFunding", + "msg": "Pool funding" + }, + { + "code": 6006, + "name": "PoolMigrated", + "msg": "Pool migrated" + }, + { + "code": 6007, + "name": "MigrateTypeNotMatch", + "msg": "Migrate type not match" + }, + { + "code": 6008, + "name": "MathOverflow", + "msg": "Math overflow" + }, + { + "code": 6009, + "name": "NoAssetsToCollect", + "msg": "No assets to collect" + }, + { + "code": 6010, + "name": "VestingRatioTooHigh", + "msg": "Vesting ratio too high" + }, + { + "code": 6011, + "name": "VestingSettingEnded", + "msg": "Vesting setting ended" + }, + { + "code": 6012, + "name": "VestingNotStarted", + "msg": "Vesting not started" + }, + { + "code": 6013, + "name": "NoVestingSchedule", + "msg": "No vesting schedule" + }, + { + "code": 6014, + "name": "InvalidPlatformInfo", + "msg": "The platform info input is invalid" + }, + { + "code": 6015, + "name": "PoolNotMigrated", + "msg": "Pool not migrated" + }, + { + "code": 6016, + "name": "InvalidCpSwapConfig", + "msg": "The input cp swap config account is invalid" + }, + { + "code": 6017, + "name": "NoSupportExtension", + "msg": "No support extension" + }, + { + "code": 6018, + "name": "NotEnoughRemainingAccounts", + "msg": "Not enough remaining accounts" + }, + { + "code": 6019, + "name": "TransferFeeCalculateNotMatch", + "msg": "TransferFee calculate not match" + }, + { + "code": 6020, + "name": "CurveParamIsNotExist", + "msg": "Curve param is not exist" + }, + { + "code": 6021, + "name": "InvalidTotalLockedAmount", + "msg": "Total locked amount must great or equal to the platform vesting share amount" + } + ], + "types": [ + { + "name": "AmmCreatorFeeOn", + "docs": [ + "migrate to cpmm, creator fee on quote token or both token" + ], + "type": { + "kind": "enum", + "variants": [ + { + "name": "QuoteToken" + }, + { + "name": "BothToken" + } + ] + } + }, + { + "name": "BondingCurveParam", + "type": { + "kind": "struct", + "fields": [ + { + "name": "migrate_type", + "docs": [ + "Migrate to AMM or CpSwap, 0: amm, 1: cpswap,", + "Neither 0 nor 1: invalid" + ], + "type": "u8" + }, + { + "name": "migrate_cpmm_fee_on", + "docs": [ + "The migrate fee on, 0 means fee on the quote token, 1 means fee on both token", + "Neither 0 nor 1: invalid" + ], + "type": "u8" + }, + { + "name": "supply", + "docs": [ + "The supply of the token,", + "0: invalid" + ], + "type": "u64" + }, + { + "name": "total_base_sell", + "docs": [ + "The total base sell of the token", + "0: invalid" + ], + "type": "u64" + }, + { + "name": "total_quote_fund_raising", + "docs": [ + "The total quote fund raising of the token", + "0: invalid" + ], + "type": "u64" + }, + { + "name": "total_locked_amount", + "docs": [ + "total amount of tokens to be unlocked", + "u64::MAX: invalid" + ], + "type": "u64" + }, + { + "name": "cliff_period", + "docs": [ + "Waiting time in seconds before unlocking after fundraising ends", + "u64::MAX: invalid" + ], + "type": "u64" + }, + { + "name": "unlock_period", + "docs": [ + "Unlocking period in seconds", + "u64::MAX: invalid" + ], + "type": "u64" + } + ] + } + }, + { + "name": "ClaimVestedEvent", + "docs": [ + "Emitted when vesting token claimed by beneficiary" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool_state", + "type": "pubkey" + }, + { + "name": "beneficiary", + "type": "pubkey" + }, + { + "name": "claim_amount", + "type": "u64" + } + ] + } + }, + { + "name": "ConstantCurve", + "type": { + "kind": "struct", + "fields": [ + { + "name": "supply", + "type": "u64" + }, + { + "name": "total_base_sell", + "type": "u64" + }, + { + "name": "total_quote_fund_raising", + "type": "u64" + }, + { + "name": "migrate_type", + "type": "u8" + } + ] + } + }, + { + "name": "CreateVestingEvent", + "docs": [ + "Emitted when vest_account created" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool_state", + "type": "pubkey" + }, + { + "name": "beneficiary", + "type": "pubkey" + }, + { + "name": "share_amount", + "type": "u64" + } + ] + } + }, + { + "name": "CurveParams", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Constant", + "fields": [ + { + "name": "data", + "type": { + "defined": { + "name": "ConstantCurve" + } + } + } + ] + }, + { + "name": "Fixed", + "fields": [ + { + "name": "data", + "type": { + "defined": { + "name": "FixedCurve" + } + } + } + ] + }, + { + "name": "Linear", + "fields": [ + { + "name": "data", + "type": { + "defined": { + "name": "LinearCurve" + } + } + } + ] + } + ] + } + }, + { + "name": "FixedCurve", + "type": { + "kind": "struct", + "fields": [ + { + "name": "supply", + "type": "u64" + }, + { + "name": "total_quote_fund_raising", + "type": "u64" + }, + { + "name": "migrate_type", + "type": "u8" + } + ] + } + }, + { + "name": "GlobalConfig", + "docs": [ + "Holds the current owner of the factory" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "epoch", + "docs": [ + "Account update epoch" + ], + "type": "u64" + }, + { + "name": "curve_type", + "docs": [ + "0: Constant Product Curve", + "1: Fixed Price Curve", + "2: Linear Price Curve" + ], + "type": "u8" + }, + { + "name": "index", + "docs": [ + "Config index" + ], + "type": "u16" + }, + { + "name": "migrate_fee", + "docs": [ + "The fee of migrate to amm" + ], + "type": "u64" + }, + { + "name": "trade_fee_rate", + "docs": [ + "The trade fee rate, denominated in hundredths of a bip (10^-6)" + ], + "type": "u64" + }, + { + "name": "max_share_fee_rate", + "docs": [ + "The maximum share fee rate, denominated in hundredths of a bip (10^-6)" + ], + "type": "u64" + }, + { + "name": "min_base_supply", + "docs": [ + "The minimum base supply, the value without decimals" + ], + "type": "u64" + }, + { + "name": "max_lock_rate", + "docs": [ + "The maximum lock rate, denominated in hundredths of a bip (10^-6)" + ], + "type": "u64" + }, + { + "name": "min_base_sell_rate", + "docs": [ + "The minimum base sell rate, denominated in hundredths of a bip (10^-6)" + ], + "type": "u64" + }, + { + "name": "min_base_migrate_rate", + "docs": [ + "The minimum base migrate rate, denominated in hundredths of a bip (10^-6)" + ], + "type": "u64" + }, + { + "name": "min_quote_fund_raising", + "docs": [ + "The minimum quote fund raising, the value with decimals" + ], + "type": "u64" + }, + { + "name": "quote_mint", + "docs": [ + "Mint information for quote token" + ], + "type": "pubkey" + }, + { + "name": "protocol_fee_owner", + "docs": [ + "Protocol Fee owner" + ], + "type": "pubkey" + }, + { + "name": "migrate_fee_owner", + "docs": [ + "Migrate Fee owner" + ], + "type": "pubkey" + }, + { + "name": "migrate_to_amm_wallet", + "docs": [ + "Migrate to amm control wallet" + ], + "type": "pubkey" + }, + { + "name": "migrate_to_cpswap_wallet", + "docs": [ + "Migrate to cpswap wallet" + ], + "type": "pubkey" + }, + { + "name": "padding", + "docs": [ + "padding for future updates" + ], + "type": { + "array": [ + "u64", + 16 + ] + } + } + ] + } + }, + { + "name": "LinearCurve", + "type": { + "kind": "struct", + "fields": [ + { + "name": "supply", + "type": "u64" + }, + { + "name": "total_quote_fund_raising", + "type": "u64" + }, + { + "name": "migrate_type", + "type": "u8" + } + ] + } + }, + { + "name": "MigrateNftInfo", + "docs": [ + "Represents the parameters for initializing a platform config account(Only support MigrateType::CPSWAP)", + "# Fields", + "* `platform_scale` - Scale of the platform liquidity quantity rights will be converted into NFT", + "* `creator_scale` - Scale of the token creator liquidity quantity rights will be converted into NFT", + "* `burn_scale` - Scale of liquidity directly to burn", + "", + "* platform_scale + creator_scale + burn_scale = RATE_DENOMINATOR_VALUE" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "platform_scale", + "type": "u64" + }, + { + "name": "creator_scale", + "type": "u64" + }, + { + "name": "burn_scale", + "type": "u64" + } + ] + } + }, + { + "name": "MintParams", + "docs": [ + "Represents the parameters for initializing a new token mint", + "# Fields", + "* `decimals` - Number of decimal places for the token", + "* `name` - Name of the token", + "* `symbol` - Symbol/ticker of the token", + "* `uri` - URI pointing to token metadata" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "decimals", + "type": "u8" + }, + { + "name": "name", + "type": "string" + }, + { + "name": "symbol", + "type": "string" + }, + { + "name": "uri", + "type": "string" + } + ] + } + }, + { + "name": "PlatformConfig", + "type": { + "kind": "struct", + "fields": [ + { + "name": "epoch", + "docs": [ + "The epoch for update interval" + ], + "type": "u64" + }, + { + "name": "platform_fee_wallet", + "docs": [ + "The platform fee wallet" + ], + "type": "pubkey" + }, + { + "name": "platform_nft_wallet", + "docs": [ + "The platform nft wallet to receive the platform NFT after migration if platform_scale is not 0(Only support MigrateType::CPSWAP)" + ], + "type": "pubkey" + }, + { + "name": "platform_scale", + "docs": [ + "Scale of the platform liquidity quantity rights will be converted into NFT(Only support MigrateType::CPSWAP)" + ], + "type": "u64" + }, + { + "name": "creator_scale", + "docs": [ + "Scale of the token creator liquidity quantity rights will be converted into NFT(Only support MigrateType::CPSWAP)" + ], + "type": "u64" + }, + { + "name": "burn_scale", + "docs": [ + "Scale of liquidity directly to burn" + ], + "type": "u64" + }, + { + "name": "fee_rate", + "docs": [ + "The platform fee rate" + ], + "type": "u64" + }, + { + "name": "name", + "docs": [ + "The platform name" + ], + "type": { + "array": [ + "u8", + 64 + ] + } + }, + { + "name": "web", + "docs": [ + "The platform website" + ], + "type": { + "array": [ + "u8", + 256 + ] + } + }, + { + "name": "img", + "docs": [ + "The platform img link" + ], + "type": { + "array": [ + "u8", + 256 + ] + } + }, + { + "name": "cpswap_config", + "docs": [ + "The platform specifies the trade fee rate after migration to cp swap" + ], + "type": "pubkey" + }, + { + "name": "creator_fee_rate", + "docs": [ + "Creator fee rate" + ], + "type": "u64" + }, + { + "name": "transfer_fee_extension_auth", + "docs": [ + "If the base token belongs to token2022, then you can choose to support the transferfeeConfig extension, which includes permissions such as `transfer_fee_config_authority`` and `withdraw_withheld_authority`.", + "When initializing mint, `withdraw_withheld_authority` and `transfer_fee_config_authority` both belongs to the contract.", + "Once the token is migrated to AMM, the authorities will be reset to this value" + ], + "type": "pubkey" + }, + { + "name": "platform_vesting_wallet", + "type": "pubkey" + }, + { + "name": "platform_vesting_scale", + "type": "u64" + }, + { + "name": "platform_cp_creator", + "docs": [ + "If a valid platform_cp_creator is configured for the platform,", + "it will be used as the creator for the AMM pool during migration to cpswap pool." + ], + "type": "pubkey" + }, + { + "name": "padding", + "docs": [ + "padding for future updates" + ], + "type": { + "array": [ + "u8", + 108 + ] + } + }, + { + "name": "curve_params", + "docs": [ + "The parameters for launching the pool" + ], + "type": { + "vec": { + "defined": { + "name": "PlatformCurveParam" + } + } + } + } + ] + } + }, + { + "name": "PlatformConfigInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "fee_wallet", + "type": "pubkey" + }, + { + "name": "nft_wallet", + "type": "pubkey" + }, + { + "name": "migrate_nft_info", + "type": { + "defined": { + "name": "MigrateNftInfo" + } + } + }, + { + "name": "fee_rate", + "type": "u64" + }, + { + "name": "name", + "type": "string" + }, + { + "name": "web", + "type": "string" + }, + { + "name": "img", + "type": "string" + }, + { + "name": "transfer_fee_extension_auth", + "type": "pubkey" + }, + { + "name": "creator_fee_rate", + "type": "u64" + }, + { + "name": "platform_vesting_scale", + "type": "u64" + }, + { + "name": "vesting_wallet", + "type": "pubkey" + } + ] + } + }, + { + "name": "PlatformConfigParam", + "type": { + "kind": "enum", + "variants": [ + { + "name": "FeeWallet", + "fields": [ + "pubkey" + ] + }, + { + "name": "NFTWallet", + "fields": [ + "pubkey" + ] + }, + { + "name": "MigrateNftInfo", + "fields": [ + { + "defined": { + "name": "MigrateNftInfo" + } + } + ] + }, + { + "name": "FeeRate", + "fields": [ + "u64" + ] + }, + { + "name": "Name", + "fields": [ + "string" + ] + }, + { + "name": "Web", + "fields": [ + "string" + ] + }, + { + "name": "Img", + "fields": [ + "string" + ] + }, + { + "name": "CpSwapConfig" + }, + { + "name": "AllInfo", + "fields": [ + { + "defined": { + "name": "PlatformConfigInfo" + } + } + ] + }, + { + "name": "VestingWallet", + "fields": [ + "pubkey" + ] + }, + { + "name": "PlatformVestingScale", + "fields": [ + "u64" + ] + }, + { + "name": "PlatformCPCreator", + "fields": [ + "pubkey" + ] + } + ] + } + }, + { + "name": "PlatformCurveParam", + "type": { + "kind": "struct", + "fields": [ + { + "name": "epoch", + "docs": [ + "The epoch for update interval, 0 means not update" + ], + "type": "u64" + }, + { + "name": "index", + "docs": [ + "The curve params index" + ], + "type": "u8" + }, + { + "name": "global_config", + "docs": [ + "The global config address" + ], + "type": "pubkey" + }, + { + "name": "bonding_curve_param", + "docs": [ + "bonding curve param" + ], + "type": { + "defined": { + "name": "BondingCurveParam" + } + } + }, + { + "name": "padding", + "docs": [ + "padding for future updates" + ], + "type": { + "array": [ + "u64", + 50 + ] + } + } + ] + } + }, + { + "name": "PlatformParams", + "docs": [ + "Represents the parameters for initializing a platform config account", + "# Fields", + "* `migrate_nft_info` - The platform configures liquidity info during migration(Only support MigrateType::CPSWAP)", + "* `fee_rate` - Fee rate of the platform", + "* `name` - Name of the platform", + "* `web` - Website of the platform", + "* `img` - Image link of the platform", + "/// * `creator_fee_rate` - The fee rate charged by the creator for each transaction." + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "migrate_nft_info", + "type": { + "defined": { + "name": "MigrateNftInfo" + } + } + }, + { + "name": "fee_rate", + "type": "u64" + }, + { + "name": "name", + "type": "string" + }, + { + "name": "web", + "type": "string" + }, + { + "name": "img", + "type": "string" + }, + { + "name": "creator_fee_rate", + "type": "u64" + }, + { + "name": "platform_vesting_scale", + "type": "u64" + } + ] + } + }, + { + "name": "PoolCreateEvent", + "docs": [ + "Emitted when pool created" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool_state", + "type": "pubkey" + }, + { + "name": "creator", + "type": "pubkey" + }, + { + "name": "config", + "type": "pubkey" + }, + { + "name": "base_mint_param", + "type": { + "defined": { + "name": "MintParams" + } + } + }, + { + "name": "curve_param", + "type": { + "defined": { + "name": "CurveParams" + } + } + }, + { + "name": "vesting_param", + "type": { + "defined": { + "name": "VestingParams" + } + } + }, + { + "name": "amm_fee_on", + "type": { + "defined": { + "name": "AmmCreatorFeeOn" + } + } + } + ] + } + }, + { + "name": "PoolState", + "docs": [ + "Represents the state of a trading pool in the protocol", + "Stores all essential information about pool balances, fees, and configuration" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "epoch", + "docs": [ + "Account update epoch" + ], + "type": "u64" + }, + { + "name": "auth_bump", + "docs": [ + "Bump seed used for PDA address derivation" + ], + "type": "u8" + }, + { + "name": "status", + "docs": [ + "Current status of the pool", + "* 0: Pool is funding", + "* 1: Pool funding is end, waiting for migration", + "* 2: Pool migration is done" + ], + "type": "u8" + }, + { + "name": "base_decimals", + "docs": [ + "Decimals of the pool base token" + ], + "type": "u8" + }, + { + "name": "quote_decimals", + "docs": [ + "Decimals of the pool quote token" + ], + "type": "u8" + }, + { + "name": "migrate_type", + "docs": [ + "Migrate to AMM or CpSwap, 0: amm, 1: cpswap" + ], + "type": "u8" + }, + { + "name": "supply", + "docs": [ + "Supply of the pool base token" + ], + "type": "u64" + }, + { + "name": "total_base_sell", + "docs": [ + "Total sell amount of the base token" + ], + "type": "u64" + }, + { + "name": "virtual_base", + "docs": [ + "For different curves, virtual_base and virtual_quote have different meanings", + "For constant product curve, virtual_base and virtual_quote are virtual liquidity, virtual_quote/virtual_base is the initial price", + "For linear price curve, virtual_base is the price slope parameter a, virtual_quote has no effect", + "For fixed price curve, virtual_quote/virtual_base is the initial price" + ], + "type": "u64" + }, + { + "name": "virtual_quote", + "type": "u64" + }, + { + "name": "real_base", + "docs": [ + "Actual base token amount in the pool", + "Represents the real tokens available for trading" + ], + "type": "u64" + }, + { + "name": "real_quote", + "docs": [ + "Actual quote token amount in the pool", + "Represents the real tokens available for trading" + ], + "type": "u64" + }, + { + "name": "total_quote_fund_raising", + "docs": [ + "The total quote fund raising of the pool" + ], + "type": "u64" + }, + { + "name": "quote_protocol_fee", + "docs": [ + "Accumulated trading fees in quote tokens", + "Can be collected by the protocol fee owner" + ], + "type": "u64" + }, + { + "name": "platform_fee", + "docs": [ + "Accumulated platform fees in quote tokens", + "Can be collected by the platform wallet stored in platform config" + ], + "type": "u64" + }, + { + "name": "migrate_fee", + "docs": [ + "The fee of migrate to amm" + ], + "type": "u64" + }, + { + "name": "vesting_schedule", + "docs": [ + "Vesting schedule for the base token" + ], + "type": { + "defined": { + "name": "VestingSchedule" + } + } + }, + { + "name": "global_config", + "docs": [ + "Public key of the global configuration account", + "Contains protocol-wide settings this pool adheres to" + ], + "type": "pubkey" + }, + { + "name": "platform_config", + "docs": [ + "Public key of the platform configuration account", + "Contains platform-wide settings this pool adheres to" + ], + "type": "pubkey" + }, + { + "name": "base_mint", + "docs": [ + "Public key of the base mint address" + ], + "type": "pubkey" + }, + { + "name": "quote_mint", + "docs": [ + "Public key of the quote mint address" + ], + "type": "pubkey" + }, + { + "name": "base_vault", + "docs": [ + "Public key of the base token vault", + "Holds the actual base tokens owned by the pool" + ], + "type": "pubkey" + }, + { + "name": "quote_vault", + "docs": [ + "Public key of the quote token vault", + "Holds the actual quote tokens owned by the pool" + ], + "type": "pubkey" + }, + { + "name": "creator", + "docs": [ + "The creator of base token" + ], + "type": "pubkey" + }, + { + "name": "token_program_flag", + "docs": [ + "token program bits", + "bit0: base token program flag", + "0: spl_token_program", + "1: token_program_2022", + "", + "bit1: quote token program flag", + "0: spl_token_program", + "1: token_program_2022" + ], + "type": "u8" + }, + { + "name": "amm_creator_fee_on", + "docs": [ + "migrate to cpmm, creator fee on quote token or both token" + ], + "type": { + "defined": { + "name": "AmmCreatorFeeOn" + } + } + }, + { + "name": "platform_vesting_share", + "docs": [ + "platform vesting token amount" + ], + "type": "u64" + }, + { + "name": "padding", + "docs": [ + "padding for future updates" + ], + "type": { + "array": [ + "u8", + 54 + ] + } + } + ] + } + }, + { + "name": "PoolStatus", + "docs": [ + "Represents the different states a pool can be in", + "* Fund - Initial state where pool is accepting funds", + "* Migrate - Pool funding has ended and waiting for migration", + "* Trade - Pool migration is complete and amm trading is enabled" + ], + "type": { + "kind": "enum", + "variants": [ + { + "name": "Fund" + }, + { + "name": "Migrate" + }, + { + "name": "Trade" + } + ] + } + }, + { + "name": "TradeDirection", + "docs": [ + "Specifies the direction of a trade in the bonding curve", + "This is important because curves can treat tokens differently through weights or offsets" + ], + "type": { + "kind": "enum", + "variants": [ + { + "name": "Buy" + }, + { + "name": "Sell" + } + ] + } + }, + { + "name": "TradeEvent", + "docs": [ + "Emitted when trade process" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "pool_state", + "type": "pubkey" + }, + { + "name": "total_base_sell", + "type": "u64" + }, + { + "name": "virtual_base", + "type": "u64" + }, + { + "name": "virtual_quote", + "type": "u64" + }, + { + "name": "real_base_before", + "type": "u64" + }, + { + "name": "real_quote_before", + "type": "u64" + }, + { + "name": "real_base_after", + "type": "u64" + }, + { + "name": "real_quote_after", + "type": "u64" + }, + { + "name": "amount_in", + "type": "u64" + }, + { + "name": "amount_out", + "type": "u64" + }, + { + "name": "protocol_fee", + "type": "u64" + }, + { + "name": "platform_fee", + "type": "u64" + }, + { + "name": "creator_fee", + "type": "u64" + }, + { + "name": "share_fee", + "type": "u64" + }, + { + "name": "trade_direction", + "type": { + "defined": { + "name": "TradeDirection" + } + } + }, + { + "name": "pool_status", + "type": { + "defined": { + "name": "PoolStatus" + } + } + }, + { + "name": "exact_in", + "type": "bool" + } + ] + } + }, + { + "name": "TransferFeeExtensionParams", + "type": { + "kind": "struct", + "fields": [ + { + "name": "transfer_fee_basis_points", + "docs": [ + "denominator is 10000, currently, this value cannot exceed 5%, which is 500." + ], + "type": "u16" + }, + { + "name": "maximum_fee", + "docs": [ + "Maximum fee on each transfers, the value must exceed supply * transfer_fee_basis_points / 10000" + ], + "type": "u64" + } + ] + } + }, + { + "name": "VestingParams", + "type": { + "kind": "struct", + "fields": [ + { + "name": "total_locked_amount", + "type": "u64" + }, + { + "name": "cliff_period", + "type": "u64" + }, + { + "name": "unlock_period", + "type": "u64" + } + ] + } + }, + { + "name": "VestingRecord", + "type": { + "kind": "struct", + "fields": [ + { + "name": "epoch", + "docs": [ + "Account update epoch" + ], + "type": "u64" + }, + { + "name": "pool", + "docs": [ + "The pool state account" + ], + "type": "pubkey" + }, + { + "name": "beneficiary", + "docs": [ + "The beneficiary of the vesting account" + ], + "type": "pubkey" + }, + { + "name": "claimed_amount", + "docs": [ + "The amount of tokens claimed" + ], + "type": "u64" + }, + { + "name": "token_share_amount", + "docs": [ + "The share amount of the token to be vested" + ], + "type": "u64" + }, + { + "name": "padding", + "docs": [ + "padding for future updates" + ], + "type": { + "array": [ + "u64", + 8 + ] + } + } + ] + } + }, + { + "name": "VestingSchedule", + "type": { + "kind": "struct", + "fields": [ + { + "name": "total_locked_amount", + "type": "u64" + }, + { + "name": "cliff_period", + "type": "u64" + }, + { + "name": "unlock_period", + "type": "u64" + }, + { + "name": "start_time", + "type": "u64" + }, + { + "name": "allocated_share_amount", + "docs": [ + "Total allocated share amount of the base token, not greater than total_locked_amount" + ], + "type": "u64" + } + ] + } + } + ] +} diff --git a/idl/raydium_pool_v4.json b/idl/raydium_pool_v4.json new file mode 100644 index 0000000..39d2ee9 --- /dev/null +++ b/idl/raydium_pool_v4.json @@ -0,0 +1,3400 @@ + +{ + "version": "4.0.0", + "name": "Raydium Liquidity Pool V4", + "instructions": [ + { + "name": "initializeStrategy", + "accounts": [ + { + "name": "admin", + "isMut": true, + "isSigner": true + }, + { + "name": "strategyState", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "strategyFeeAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "strategyTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyLpAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardTknAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardTknAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "lendingPoolAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingPoolCreditAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingPoolAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingPoolCreditAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "clock", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "ammProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "ammId", + "isMut": false, + "isSigner": false + }, + { + "name": "ammIdRewards", + "isMut": false, + "isSigner": false + }, + { + "name": "ammIdRewardsB", + "isMut": false, + "isSigner": false + }, + { + "name": "stakeProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "stakePoolId", + "isMut": false, + "isSigner": false + }, + { + "name": "stakePoolTkn", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "version", + "type": { + "defined": "ProtocolVerison" + } + } + ] + }, + { + "name": "initializeUserWithNonce", + "accounts": [ + { + "name": "userMainAccount", + "isMut": true, + "isSigner": true + }, + { + "name": "userInfoAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyState", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "clock", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "nonce", + "type": "u32" + }, + { + "name": "bumpSeed", + "type": "u8" + } + ] + }, + { + "name": "closeEmptyAccount", + "accounts": [ + { + "name": "userMainAccount", + "isMut": true, + "isSigner": true + }, + { + "name": "userInfoAccount", + "isMut": true, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "setPositionStopLoss", + "accounts": [ + { + "name": "userMainAccount", + "isMut": false, + "isSigner": true + }, + { + "name": "userInfoAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyState", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "stopLossType", + "type": "u8" + }, + { + "name": "stopLossRatio", + "type": "u8" + } + ] + }, + { + "name": "setPositionRangeStop", + "accounts": [ + { + "name": "userMainAccount", + "isMut": false, + "isSigner": true + }, + { + "name": "userInfoAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyState", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rangeStopType", + "type": "u8" + }, + { + "name": "priceRange0", + "type": "u128" + }, + { + "name": "priceRange1", + "type": "u128" + } + ] + }, + { + "name": "transfer", + "accounts": [ + { + "name": "userMainAccount", + "isMut": false, + "isSigner": true + }, + { + "name": "userInfoAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "userTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "userTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyState", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyAuthority", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "clock", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "param", + "type": { + "defined": "TransferForInvestParam" + } + } + ] + }, + { + "name": "transferLp", + "accounts": [ + { + "name": "userMainAccount", + "isMut": false, + "isSigner": true + }, + { + "name": "userInfoAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "userLpAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyState", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyAuthority", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyLpAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "userFrcRewardsTknAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "strategyFrcRewardsTknAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "clock", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "param", + "type": { + "defined": "TransferLpParam" + } + } + ] + }, + { + "name": "borrow", + "accounts": [ + { + "name": "userMainAccount", + "isMut": false, + "isSigner": true + }, + { + "name": "userInfoAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyState", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyAuthority", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingMarketAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingMarketAuthorityInfo", + "isMut": false, + "isSigner": false + }, + { + "name": "lendingPoolProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "lendingPoolInfoAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingPoolTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingPoolCreditAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyCreditAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingPoolInfoAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingPoolTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingPoolCreditAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyCreditAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "clock", + "isMut": false, + "isSigner": false + }, + { + "name": "ammId", + "isMut": true, + "isSigner": false + }, + { + "name": "ammOpenOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "lpMintAccount", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "param", + "type": { + "defined": "BorrowParam" + } + } + ] + }, + { + "name": "swapLimit", + "accounts": [ + { + "name": "userMainAccount", + "isMut": false, + "isSigner": true + }, + { + "name": "userInfo", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyState", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "strategyTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyLpAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "raydiumAmmProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "ammId", + "isMut": true, + "isSigner": false + }, + { + "name": "ammAuthority", + "isMut": true, + "isSigner": false + }, + { + "name": "ammOpenOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTargetOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "lpMintAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "serumProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "serumMarketId", + "isMut": true, + "isSigner": false + }, + { + "name": "serumBids", + "isMut": true, + "isSigner": false + }, + { + "name": "serumAsks", + "isMut": true, + "isSigner": false + }, + { + "name": "serumEventQueue", + "isMut": true, + "isSigner": false + }, + { + "name": "serumTknVault0", + "isMut": true, + "isSigner": false + }, + { + "name": "serumTknVault1", + "isMut": true, + "isSigner": false + }, + { + "name": "serumVaultSinger", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "swapLimit", + "type": "u64" + } + ] + }, + { + "name": "swapBaseIn", + "accounts": [ + { + "name": "TokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "AmmId", + "isMut": true, + "isSigner": false + }, + { + "name": "AmmAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "AmmOpenOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "AmmTargetOrders", + "isMut": true, + "optional": true, + "isSigner": false + }, + { + "name": "PoolCoinTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "PoolPcTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "OpenBookProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "OpenBookMarket", + "isMut": true, + "isSigner": false + }, + { + "name": "OpenBookBids", + "isMut": true, + "isSigner": false + }, + { + "name": "OpenBookAsks", + "isMut": true, + "isSigner": false + }, + { + "name": "OpenBookQueue", + "isMut": true, + "isSigner": false + }, + { + "name": "OpenBookVaultAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "OpenBookPcVaultAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "OpenBookVaultSigner", + "isMut": false, + "isSigner": false + }, + { + "name": "UserSourceTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "UserDestTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "UserOwner", + "isMut": true, + "isSigner": true + } + ], + "args": [ + { + "name": "param", + "type": { + "defined": "SwapParam" + } + } + ] + }, + { + "name": "addLiquidity", + "docs": [ + "add liquidity" + ], + "accounts": [ + { + "name": "userMainAccount", + "isMut": false, + "isSigner": true + }, + { + "name": "userInfo", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyState", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "strategyTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyLpAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "raydiumAmmProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "ammId", + "isMut": true, + "isSigner": false + }, + { + "name": "ammAuthority", + "isMut": true, + "isSigner": false + }, + { + "name": "ammOpenOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTargetOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "lpMintAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "serumMarketId", + "isMut": true, + "isSigner": false + }, + { + "name": "userRewardsTknAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyRewardsTknAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "clock", + "isMut": false, + "isSigner": false + }, + { + "name": "serumEventQueue", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "stakeLp", + "accounts": [ + { + "name": "strategyState", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyAuthority", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyLpAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyRewardTknAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyRewardTknAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyFarmInfo", + "isMut": true, + "isSigner": false + }, + { + "name": "raydiumStakingProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "poolId", + "isMut": true, + "isSigner": false + }, + { + "name": "poolAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "poolLpAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "poolRewardTknAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "poolRewardTknAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "clock", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "unstakeLp", + "accounts": [ + { + "name": "userMainAccount", + "isMut": false, + "isSigner": true + }, + { + "name": "userInfo", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyState", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyAuthority", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyLpAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyRewardTknAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyRewardTknAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyFarmInfo", + "isMut": true, + "isSigner": false + }, + { + "name": "raydiumStakingProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "poolId", + "isMut": true, + "isSigner": false + }, + { + "name": "poolAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "poolLpAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "poolRewardTknAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "poolRewardTknAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "clock", + "isMut": false, + "isSigner": false + }, + { + "name": "lendingPoolInfoAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingPoolInfoAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "userRewardsTknAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyRewardsTknAccount", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "param", + "type": { + "defined": "UnstakeLpParam" + } + } + ] + }, + { + "name": "unstakeLpWithType", + "accounts": [ + { + "name": "userMainAccount", + "isMut": false, + "isSigner": true + }, + { + "name": "userInfo", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyState", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyAuthority", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyLpAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyRewardTknAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyRewardTknAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyFarmInfo", + "isMut": true, + "isSigner": false + }, + { + "name": "raydiumStakingProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "poolId", + "isMut": true, + "isSigner": false + }, + { + "name": "poolAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "poolLpAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "poolRewardTknAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "poolRewardTknAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "clock", + "isMut": false, + "isSigner": false + }, + { + "name": "lendingPoolInfoAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingPoolInfoAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "userRewardsTknAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyRewardsTknAccount", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "param", + "type": { + "defined": "WithdrawParam" + } + } + ] + }, + { + "name": "removeLiquidity", + "accounts": [ + { + "name": "userMainAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "userInfo", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyState", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "strategyTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyLpAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "raydiumAmmProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "ammId", + "isMut": true, + "isSigner": false + }, + { + "name": "ammAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "ammOpenOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTargetOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "lpMintAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "ammWithdrawQueue", + "isMut": true, + "isSigner": false + }, + { + "name": "ammPoolTempLpAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "serumProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "serumMarketId", + "isMut": true, + "isSigner": false + }, + { + "name": "serumTknVault1", + "isMut": true, + "isSigner": false + }, + { + "name": "serumTknVault0", + "isMut": true, + "isSigner": false + }, + { + "name": "serumVaultSinger", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "removeLiquidityLimit", + "accounts": [ + { + "name": "userMainAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "userInfo", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyState", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "strategyTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyLpAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "raydiumAmmProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "ammId", + "isMut": true, + "isSigner": false + }, + { + "name": "ammAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "ammOpenOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTargetOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "lpMintAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "ammWithdrawQueue", + "isMut": true, + "isSigner": false + }, + { + "name": "ammPoolTempLpAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "serumProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "serumMarketId", + "isMut": true, + "isSigner": false + }, + { + "name": "serumTknVault1", + "isMut": true, + "isSigner": false + }, + { + "name": "serumTknVault0", + "isMut": true, + "isSigner": false + }, + { + "name": "serumVaultSinger", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "limit", + "type": "u64" + } + ] + }, + { + "name": "swapForWithdrawLimit", + "accounts": [ + { + "name": "userMainAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "userInfo", + "isMut": true, + "isSigner": false + }, + { + "name": "userTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "userTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyState", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "strategyTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyLpAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "raydiumAmmProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "ammId", + "isMut": true, + "isSigner": false + }, + { + "name": "ammAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "ammOpenOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTargetOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "serumProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "serumMarketId", + "isMut": true, + "isSigner": false + }, + { + "name": "serumBids", + "isMut": true, + "isSigner": false + }, + { + "name": "serumAsks", + "isMut": true, + "isSigner": false + }, + { + "name": "serumEventQueue", + "isMut": true, + "isSigner": false + }, + { + "name": "serumTknVault1", + "isMut": true, + "isSigner": false + }, + { + "name": "serumTknVault0", + "isMut": true, + "isSigner": false + }, + { + "name": "serumVaultSinger", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "swapLimit", + "type": "u64" + }, + { + "name": "withdrawType", + "type": "u8" + } + ] + }, + { + "name": "swapAndWithdraw", + "accounts": [ + { + "name": "userMainAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "userInfo", + "isMut": true, + "isSigner": false + }, + { + "name": "userTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "userTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyState", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "strategyTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyLpAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "raydiumAmmProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "ammId", + "isMut": true, + "isSigner": false + }, + { + "name": "ammAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "ammOpenOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTargetOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "serumProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "serumMarketId", + "isMut": true, + "isSigner": false + }, + { + "name": "serumBids", + "isMut": true, + "isSigner": false + }, + { + "name": "serumAsks", + "isMut": true, + "isSigner": false + }, + { + "name": "serumEventQueue", + "isMut": true, + "isSigner": false + }, + { + "name": "serumTknVault1", + "isMut": true, + "isSigner": false + }, + { + "name": "serumTknVault0", + "isMut": true, + "isSigner": false + }, + { + "name": "serumVaultSinger", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "param", + "type": { + "defined": "SwapAndWithdrawParam" + } + } + ] + }, + { + "name": "repayBorrowedPc", + "accounts": [ + { + "name": "userMainAccount", + "isMut": false, + "isSigner": true + }, + { + "name": "strategyState", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyAuthority", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingMarketAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingMarketAuthorityInfo", + "isMut": false, + "isSigner": false + }, + { + "name": "lendingPoolProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "lendingPoolInfoAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingPoolTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingPoolCreditMint0", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingPoolCreditAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyCreditAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingPoolInfoAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingPoolTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingPoolCreditMint1", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingPoolCreditAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyCreditAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "clock", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "repayBorrowedCoin", + "accounts": [ + { + "name": "userMainAccount", + "isMut": false, + "isSigner": true + }, + { + "name": "strategyState", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyAuthority", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingMarketAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingMarketAuthorityInfo", + "isMut": false, + "isSigner": false + }, + { + "name": "lendingPoolProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "lendingPoolInfoAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingPoolTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingPoolCreditMint0", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingPoolCreditAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyCreditAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingPoolInfoAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingPoolTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingPoolCreditMint1", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingPoolCreditAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyCreditAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "clock", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "userRepay", + "accounts": [ + { + "name": "userMainAccount", + "isMut": false, + "isSigner": true + }, + { + "name": "userInfoAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "userTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "userTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyState", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingPoolInfoAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingPoolInfoAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgramId", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "param", + "type": { + "defined": "UserRepayParam" + } + } + ] + }, + { + "name": "liquidateUnstakeLp", + "accounts": [ + { + "name": "liquidator", + "isMut": false, + "isSigner": true + }, + { + "name": "liquidatorLpTknAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "userInfo", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyState", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyAuthority", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyLpAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyRewardTknAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyRewardTknAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyFarmInfo", + "isMut": true, + "isSigner": false + }, + { + "name": "raydiumStakingProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "poolId", + "isMut": true, + "isSigner": false + }, + { + "name": "poolAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "poolLpAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "poolRewardTknAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "poolRewardTknAccountB", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "clock", + "isMut": false, + "isSigner": false + }, + { + "name": "lendingPoolInfoAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "lendingPoolInfoAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "ammId", + "isMut": true, + "isSigner": false + }, + { + "name": "ammOpenOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "lpMintAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "userRewardsTknAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "strategyRewardsTknAccount", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidateType", + "type": "u8" + } + ] + }, + { + "name": "liquidateRepayAndGetLp", + "accounts": [ + { + "name": "liquidator", + "isMut": false, + "isSigner": true + }, + { + "name": "userInfo", + "isMut": true, + "isSigner": false + }, + { + "name": "userLpAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "liquidatorLpAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "liquidatorTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "liquidatorTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyState", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyAuthority", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyLpAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "ammId", + "isMut": true, + "isSigner": false + }, + { + "name": "ammOpenOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "lpMintAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgramId", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "swapRewardsToTarget", + "accounts": [ + { + "name": "userMainAccount", + "isMut": false, + "isSigner": true + }, + { + "name": "strategyState", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "strategyTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "raydiumAmmProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "ammId", + "isMut": true, + "isSigner": false + }, + { + "name": "ammAuthority", + "isMut": true, + "isSigner": false + }, + { + "name": "ammOpenOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTargetOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "serumProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "serumMarketId", + "isMut": true, + "isSigner": false + }, + { + "name": "serumBids", + "isMut": true, + "isSigner": false + }, + { + "name": "serumAsks", + "isMut": true, + "isSigner": false + }, + { + "name": "serumEventQueue", + "isMut": true, + "isSigner": false + }, + { + "name": "serumTknVault0", + "isMut": true, + "isSigner": false + }, + { + "name": "serumTknVault1", + "isMut": true, + "isSigner": false + }, + { + "name": "serumVaultSinger", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "direction", + "type": "u8" + } + ] + }, + { + "name": "swapRewards", + "accounts": [ + { + "name": "userMainAccount", + "isMut": false, + "isSigner": true + }, + { + "name": "strategyState", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "strategyTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyLpAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "raydiumAmmProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "ammId", + "isMut": true, + "isSigner": false + }, + { + "name": "ammAuthority", + "isMut": true, + "isSigner": false + }, + { + "name": "ammOpenOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTargetOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "lpMintAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "serumProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "serumMarketId", + "isMut": true, + "isSigner": false + }, + { + "name": "serumBids", + "isMut": true, + "isSigner": false + }, + { + "name": "serumAsks", + "isMut": true, + "isSigner": false + }, + { + "name": "serumEventQueue", + "isMut": true, + "isSigner": false + }, + { + "name": "serumTknVault0", + "isMut": true, + "isSigner": false + }, + { + "name": "serumTknVault1", + "isMut": true, + "isSigner": false + }, + { + "name": "serumVaultSinger", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "addRewardsToLiquidity", + "docs": [ + "add rewards to liquidity" + ], + "accounts": [ + { + "name": "userMainAccount", + "isMut": false, + "isSigner": true + }, + { + "name": "userLpAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyState", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "strategyTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyLpAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "raydiumAmmProgramId", + "isMut": false, + "isSigner": false + }, + { + "name": "ammId", + "isMut": true, + "isSigner": false + }, + { + "name": "ammAuthority", + "isMut": true, + "isSigner": false + }, + { + "name": "ammOpenOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTargetOrders", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "ammTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "lpMintAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "serumMarketId", + "isMut": true, + "isSigner": false + }, + { + "name": "serumEventQueue", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "adminUpdateRewardsAmmId", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, + { + "name": "strategyState", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardsAmmId", + "isMut": false, + "isSigner": false + }, + { + "name": "rewardsAmmIdB", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "adminUpdateStakeInfo", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, + { + "name": "strategyState", + "isMut": true, + "isSigner": false + }, + { + "name": "stakePoolId", + "isMut": false, + "isSigner": false + }, + { + "name": "stakePoolTkn", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "adminUpdateMaxLeverage", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, + { + "name": "strategyState", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "newLeverage", + "type": "u8" + } + ] + }, + { + "name": "adminUpdateLiquidateLine", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, + { + "name": "strategyState", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "newLiquidateLine", + "type": "u8" + } + ] + }, + { + "name": "adminUpdateCompoundRewardsRate", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, + { + "name": "strategyState", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "compoundRewardsRate", + "type": "u8" + } + ] + }, + { + "name": "adminRepayBadDebts", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, + { + "name": "strategyState", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "adminTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "adminTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyTknAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyTknAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgramId", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "tknRepay0", + "type": "u64" + }, + { + "name": "tknRepay1", + "type": "u64" + } + ] + }, + { + "name": "adminBurnBorrowCredit", + "accounts": [ + { + "name": "admin", + "isMut": false, + "isSigner": true + }, + { + "name": "strategyState", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "creditMint0", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyCreditAccount0", + "isMut": true, + "isSigner": false + }, + { + "name": "creditMint1", + "isMut": true, + "isSigner": false + }, + { + "name": "strategyCreditAccount1", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgramId", + "isMut": false, + "isSigner": false + } + ], + "args": [] + } + ], + "accounts": [ + { + "name": "StrategyState", + "type": { + "kind": "struct", + "fields": [ + { + "name": "protocolVersion", + "type": "u8" + }, + { + "name": "protocolSubVersion", + "type": "u8" + }, + { + "name": "lastUpdateSlot", + "type": "u64" + }, + { + "name": "totalLp", + "type": "u64" + }, + { + "name": "totalShares", + "type": "u64" + }, + { + "name": "totalBorrowed0", + "type": "u64" + }, + { + "name": "totalBorrowed1", + "type": "u64" + }, + { + "name": "pendingTkn0", + "type": "u64" + }, + { + "name": "pendingTkn1", + "type": "u64" + }, + { + "name": "pendingWithdrawLp", + "type": "u64" + }, + { + "name": "pendingRepay0", + "type": "u64" + }, + { + "name": "pendingRepay1", + "type": "u64" + }, + { + "name": "cumulatedBorrowRate0", + "type": "u128" + }, + { + "name": "cumulatedBorrowRate1", + "type": "u128" + }, + { + "name": "admin", + "type": "publicKey" + }, + { + "name": "authority", + "type": "publicKey" + }, + { + "name": "authorityNonce", + "type": "u8" + }, + { + "name": "feeAccount", + "type": "publicKey" + }, + { + "name": "tknAccount0", + "type": "publicKey" + }, + { + "name": "tknAccount1", + "type": "publicKey" + }, + { + "name": "lpAccount", + "type": "publicKey" + }, + { + "name": "rewardAccount", + "type": "publicKey" + }, + { + "name": "rewardAccountB", + "type": "publicKey" + }, + { + "name": "lendingProgramId", + "type": "publicKey" + }, + { + "name": "lendingPool0", + "type": "publicKey" + }, + { + "name": "strategyLendingCreditAccount0", + "type": "publicKey" + }, + { + "name": "lendingPool1", + "type": "publicKey" + }, + { + "name": "strategyLendingCreditAccount1", + "type": "publicKey" + }, + { + "name": "platformRewardsEnable", + "type": "u8" + }, + { + "name": "rewardsStartSlot", + "type": "u64" + }, + { + "name": "rewardsEndSlot", + "type": "u64" + }, + { + "name": "rewardsPerSlot", + "type": "u64" + }, + { + "name": "platformRewardsTknMint", + "type": "publicKey" + }, + { + "name": "platformRewardsTknAccount", + "type": "publicKey" + }, + { + "name": "accumulatedRewardsPerShare", + "type": "u128" + }, + { + "name": "maxLeverage", + "type": "u8" + }, + { + "name": "liquidateLine", + "type": "u8" + }, + { + "name": "compoundRewardsRate", + "type": "u8" + }, + { + "name": "ammProgramId", + "type": "publicKey" + }, + { + "name": "ammId", + "type": "publicKey" + }, + { + "name": "ammIdForRewards", + "type": "publicKey" + }, + { + "name": "ammIdForRewardsB", + "type": "publicKey" + }, + { + "name": "stakeProgramId", + "type": "publicKey" + }, + { + "name": "stakePoolId", + "type": "publicKey" + }, + { + "name": "stakePoolTkn", + "type": "publicKey" + }, + { + "name": "padding0", + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] + } + }, + { + "name": "UserInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "version", + "type": "u8" + }, + { + "name": "lastUpdateSlot", + "type": "u64" + }, + { + "name": "strategyStateAccount", + "type": "publicKey" + }, + { + "name": "userMainAccount", + "type": "publicKey" + }, + { + "name": "padding0", + "type": "u8" + }, + { + "name": "pendingInvestFlag", + "type": "u8" + }, + { + "name": "stopLoss", + "type": "u8" + }, + { + "name": "tkn0", + "type": "u64" + }, + { + "name": "tkn1", + "type": "u64" + }, + { + "name": "borrowed0", + "type": "u64" + }, + { + "name": "borrowed1", + "type": "u64" + }, + { + "name": "principle0", + "type": "u64" + }, + { + "name": "principle1", + "type": "u64" + }, + { + "name": "investedLp", + "type": "u64" + }, + { + "name": "lpShares", + "type": "u64" + }, + { + "name": "pendingWithdrawLp", + "type": "u64" + }, + { + "name": "pendingRepay0", + "type": "u64" + }, + { + "name": "pendingRepay1", + "type": "u64" + }, + { + "name": "cumulatedBorrowRate0", + "type": "u128" + }, + { + "name": "cumulatedBorrowRate1", + "type": "u128" + }, + { + "name": "platformRewardsDebt", + "type": "u128" + }, + { + "name": "pendingWithdrawFlag", + "type": "u8" + }, + { + "name": "takeProfitLine", + "type": "u16" + }, + { + "name": "stopPositionType", + "type": "u8" + }, + { + "name": "priceRange0", + "type": "u128" + }, + { + "name": "priceRange1", + "type": "u128" + }, + { + "name": "padding2", + "type": { + "array": [ + "u8", + 23 + ] + } + }, + { + "name": "accountNonce", + "type": "u32" + }, + { + "name": "isEmpty", + "type": "u8" + }, + { + "name": "bump", + "type": "u8" + } + ] + } + } + ], + "types": [ + { + "name": "ProtocolVerison", + "type": { + "kind": "struct", + "fields": [ + { + "name": "protocolVersion", + "type": "u8" + }, + { + "name": "subVersion", + "type": "u8" + } + ] + } + }, + { + "name": "PositionStopParam", + "type": { + "kind": "struct", + "fields": [ + { + "name": "liquidateType", + "type": "u8" + }, + { + "name": "stopLossType", + "type": "u8" + }, + { + "name": "stopLossRatio", + "type": "u8" + }, + { + "name": "takeProfitType", + "type": "u8" + }, + { + "name": "takeProfitRatio", + "type": "u16" + }, + { + "name": "rangeStopType", + "type": "u8" + }, + { + "name": "priceRange0", + "type": "u128" + }, + { + "name": "priceRange1", + "type": "u128" + } + ] + } + }, + { + "name": "TransferForInvestParam", + "type": { + "kind": "struct", + "fields": [ + { + "name": "stopLoss", + "type": "u8" + }, + { + "name": "amount0", + "type": "u64" + }, + { + "name": "amount1", + "type": "u64" + } + ] + } + }, + { + "name": "TransferLpParam", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lpAmount", + "type": "u64" + } + ] + } + }, + { + "name": "BorrowParam", + "type": { + "kind": "struct", + "fields": [ + { + "name": "borrow0", + "type": "u64" + }, + { + "name": "borrow1", + "type": "u64" + } + ] + } + }, + { + "name": "SwapParam", + "type": { + "kind": "struct", + "fields": [ + { + "name": "amountIn", + "type": "u64" + }, + { + "name": "minAmountOut", + "type": "u64" + } + ] + } + }, + { + "name": "UnstakeLpParam", + "type": { + "kind": "struct", + "fields": [ + { + "name": "sharesAmount", + "type": "u64" + } + ] + } + }, + { + "name": "WithdrawParam", + "type": { + "kind": "struct", + "fields": [ + { + "name": "withdrawType", + "type": "u8" + }, + { + "name": "sharesAmount", + "type": "u64" + } + ] + } + }, + { + "name": "SwapAndWithdrawParam", + "type": { + "kind": "struct", + "fields": [ + { + "name": "withdrawType", + "type": "u8" + } + ] + } + }, + { + "name": "UserRepayParam", + "type": { + "kind": "struct", + "fields": [ + { + "name": "repaySide", + "type": "u8" + }, + { + "name": "repayAmount", + "type": "u64" + } + ] + } + }, + { + "name": "RaydiumError", + "type": { + "kind": "enum", + "variants": [ + { + "name": "InvalidVersion" + } + ] + } + } + ], + "errors": [ + { + "code": 6000, + "name": "MathOverflow", + "msg": "Math Overflow" + }, + { + "code": 6001, + "name": "InvalidInstruction", + "msg": "Invalid Instruction" + }, + { + "code": 6002, + "name": "InvalidProgramAddress", + "msg": "Invalid program derivated address or nonce" + }, + { + "code": 6003, + "name": "InvalidProtocolVersion", + "msg": "Invalid Protocol Version" + }, + { + "code": 6004, + "name": "InvalidData", + "msg": "Invalid data" + }, + { + "code": 6005, + "name": "AlreadyInUse", + "msg": "Already in use" + }, + { + "code": 6006, + "name": "InvalidTokenMint", + "msg": "Invalid token mint" + }, + { + "code": 6007, + "name": "InsufficientBalance", + "msg": "Insufficient balance" + }, + { + "code": 6008, + "name": "UnexpectedError", + "msg": "UnexpectedError" + }, + { + "code": 6009, + "name": "InvalidStrategyAccount", + "msg": "Invalid Strategy Account" + }, + { + "code": 6010, + "name": "InvalidStrategyAuthority", + "msg": "Invalid Strategy Authority" + }, + { + "code": 6011, + "name": "InvalidUserInfoAccount", + "msg": "Invalid UserInfo Account" + }, + { + "code": 6012, + "name": "InvalidTokenAccount", + "msg": "Invalid Token Account" + }, + { + "code": 6013, + "name": "InvalidTokenAccountOwner", + "msg": "Invalid Token Account Owner" + }, + { + "code": 6014, + "name": "InvalidStrategyState", + "msg": "Invalid Strategy state" + }, + { + "code": 6015, + "name": "InvalidLendingPool", + "msg": "Invalid lending pool" + }, + { + "code": 6016, + "name": "UnsupportedFeature", + "msg": "Unsupported Feature" + }, + { + "code": 6017, + "name": "NeedAdminPermission", + "msg": "Need Admin Permission" + }, + { + "code": 6018, + "name": "AlreadyInLiquidationOrWithdraw", + "msg": "Already in liquidation or withdraw" + }, + { + "code": 6019, + "name": "InvalidLiquidator", + "msg": "Invalid Liquidator" + }, + { + "code": 6020, + "name": "InvalidBorrowAmount", + "msg": "Invalid Borrow Amount" + }, + { + "code": 6021, + "name": "AmountTooLarge", + "msg": "Amount Too Large" + }, + { + "code": 6022, + "name": "CurrentSlotTooOld", + "msg": "Current Slot Too Old" + }, + { + "code": 6023, + "name": "AccountNotEmpty", + "msg": "Account Not Empty" + }, + { + "code": 6024, + "name": "LeverageTooHigh", + "msg": "Leverage Too High" + } + ], + "metadata": { + "instruction_selector_type": "index" + } +} diff --git a/src/streaming/event_parser/protocols/pumpfun/parser.rs b/src/streaming/event_parser/protocols/pumpfun/parser.rs index fd5790f..2e0447f 100755 --- a/src/streaming/event_parser/protocols/pumpfun/parser.rs +++ b/src/streaming/event_parser/protocols/pumpfun/parser.rs @@ -27,7 +27,8 @@ pub fn parse_pumpfun_instruction_data( discriminators::CREATE_V2_TOKEN_IX => { parse_create_v2_token_instruction(data, accounts, metadata) } - discriminators::BUY_IX | discriminators::BUY_EXACT_SOL_IN_IX => parse_buy_instruction(data, accounts, metadata), + discriminators::BUY_IX => parse_buy_instruction(data, accounts, metadata), + discriminators::BUY_EXACT_SOL_IN_IX => parse_buy_exact_sol_in_instruction(data, accounts, metadata), discriminators::SELL_IX => parse_sell_instruction(data, accounts, metadata), discriminators::MIGRATE_IX => parse_migrate_instruction(data, accounts, metadata), _ => None, @@ -273,6 +274,49 @@ fn parse_buy_instruction( })) } +/// 解析 buy_exact_sol_in 指令事件 +/// 注意:参数顺序与 buy 指令不同 +/// buy_exact_sol_in: spendable_sol_in (SOL), min_tokens_out (token) +/// buy: amount (token), max_sol_cost (SOL) +fn parse_buy_exact_sol_in_instruction( + data: &[u8], accounts: &[Pubkey], + mut metadata: EventMetadata, +) -> Option { + metadata.event_type = EventType::PumpFunBuy; + + if data.len() < 16 || accounts.len() < 16 { + return None; + } + + // 注意:buy_exact_sol_in 的参数顺序是先 SOL 再 token + let spendable_sol_in = u64::from_le_bytes(data[0..8].try_into().unwrap()); + let min_tokens_out = u64::from_le_bytes(data[8..16].try_into().unwrap()); + + Some(DexEvent::PumpFunTradeEvent(PumpFunTradeEvent { + metadata, + global: accounts[0], + fee_recipient: accounts[1], + mint: accounts[2], + bonding_curve: accounts[3], + associated_bonding_curve: accounts[4], + associated_user: accounts[5], + user: accounts[6], + system_program: accounts[7], + token_program: accounts[8], + creator_vault: accounts[9], + event_authority: accounts[10], + program: accounts[11], + global_volume_accumulator: accounts[12], + user_volume_accumulator: accounts[13], + fee_config: accounts[14], + fee_program: accounts[15], + max_sol_cost: spendable_sol_in, // Map spendable_sol_in to max_sol_cost + amount: min_tokens_out, // Map min_tokens_out to amount + is_buy: true, + ..Default::default() + })) +} + // 解析卖出指令事件 fn parse_sell_instruction( data: &[u8], diff --git a/src/streaming/event_parser/protocols/raydium_cpmm/events.rs b/src/streaming/event_parser/protocols/raydium_cpmm/events.rs index c131f23..8aef79e 100755 --- a/src/streaming/event_parser/protocols/raydium_cpmm/events.rs +++ b/src/streaming/event_parser/protocols/raydium_cpmm/events.rs @@ -45,14 +45,14 @@ pub struct RaydiumCpmmDepositEvent { pub authority: Pubkey, pub pool_state: Pubkey, pub owner_lp_token: Pubkey, - pub token0_account: Pubkey, - pub token1_account: Pubkey, - pub token0_vault: Pubkey, - pub token1_vault: Pubkey, + pub token_0_account: Pubkey, + pub token_1_account: Pubkey, + pub token_0_vault: Pubkey, + pub token_1_vault: Pubkey, pub token_program: Pubkey, pub token_program2022: Pubkey, - pub vault0_mint: Pubkey, - pub vault1_mint: Pubkey, + pub vault_0_mint: Pubkey, + pub vault_1_mint: Pubkey, pub lp_mint: Pubkey, } @@ -69,19 +69,19 @@ pub struct RaydiumCpmmInitializeEvent { pub amm_config: Pubkey, pub authority: Pubkey, pub pool_state: Pubkey, - pub token0_mint: Pubkey, - pub token1_mint: Pubkey, + pub token_0_mint: Pubkey, + pub token_1_mint: Pubkey, pub lp_mint: Pubkey, - pub creator_token0: Pubkey, - pub creator_token1: Pubkey, + pub creator_token_0: Pubkey, + pub creator_token_1: Pubkey, pub creator_lp_token: Pubkey, - pub token0_vault: Pubkey, - pub token1_vault: Pubkey, + pub token_0_vault: Pubkey, + pub token_1_vault: Pubkey, pub create_pool_fee: Pubkey, pub observation_state: Pubkey, pub token_program: Pubkey, - pub token0_program: Pubkey, - pub token1_program: Pubkey, + pub token_0_program: Pubkey, + pub token_1_program: Pubkey, pub associated_token_program: Pubkey, pub system_program: Pubkey, pub rent: Pubkey, @@ -100,14 +100,14 @@ pub struct RaydiumCpmmWithdrawEvent { pub authority: Pubkey, pub pool_state: Pubkey, pub owner_lp_token: Pubkey, - pub token0_account: Pubkey, - pub token1_account: Pubkey, - pub token0_vault: Pubkey, - pub token1_vault: Pubkey, + pub token_0_account: Pubkey, + pub token_1_account: Pubkey, + pub token_0_vault: Pubkey, + pub token_1_vault: Pubkey, pub token_program: Pubkey, pub token_program2022: Pubkey, - pub vault0_mint: Pubkey, - pub vault1_mint: Pubkey, + pub vault_0_mint: Pubkey, + pub vault_1_mint: Pubkey, pub lp_mint: Pubkey, pub memo_program: Pubkey, } diff --git a/src/streaming/event_parser/protocols/raydium_cpmm/parser.rs b/src/streaming/event_parser/protocols/raydium_cpmm/parser.rs index 3e0407a..1c20d13 100755 --- a/src/streaming/event_parser/protocols/raydium_cpmm/parser.rs +++ b/src/streaming/event_parser/protocols/raydium_cpmm/parser.rs @@ -88,14 +88,14 @@ fn parse_withdraw_instruction( authority: accounts[1], pool_state: accounts[2], owner_lp_token: accounts[3], - token0_account: accounts[4], - token1_account: accounts[5], - token0_vault: accounts[6], - token1_vault: accounts[7], + token_0_account: accounts[4], + token_1_account: accounts[5], + token_0_vault: accounts[6], + token_1_vault: accounts[7], token_program: accounts[8], token_program2022: accounts[9], - vault0_mint: accounts[10], - vault1_mint: accounts[11], + vault_0_mint: accounts[10], + vault_1_mint: accounts[11], lp_mint: accounts[12], memo_program: accounts[13], })) @@ -121,19 +121,19 @@ fn parse_initialize_instruction( amm_config: accounts[1], authority: accounts[2], pool_state: accounts[3], - token0_mint: accounts[4], - token1_mint: accounts[5], + token_0_mint: accounts[4], + token_1_mint: accounts[5], lp_mint: accounts[6], - creator_token0: accounts[7], - creator_token1: accounts[8], + creator_token_0: accounts[7], + creator_token_1: accounts[8], creator_lp_token: accounts[9], - token0_vault: accounts[10], - token1_vault: accounts[11], + token_0_vault: accounts[10], + token_1_vault: accounts[11], create_pool_fee: accounts[12], observation_state: accounts[13], token_program: accounts[14], - token0_program: accounts[15], - token1_program: accounts[16], + token_0_program: accounts[15], + token_1_program: accounts[16], associated_token_program: accounts[17], system_program: accounts[18], rent: accounts[19], @@ -160,14 +160,14 @@ fn parse_deposit_instruction( authority: accounts[1], pool_state: accounts[2], owner_lp_token: accounts[3], - token0_account: accounts[4], - token1_account: accounts[5], - token0_vault: accounts[6], - token1_vault: accounts[7], + token_0_account: accounts[4], + token_1_account: accounts[5], + token_0_vault: accounts[6], + token_1_vault: accounts[7], token_program: accounts[8], token_program2022: accounts[9], - vault0_mint: accounts[10], - vault1_mint: accounts[11], + vault_0_mint: accounts[10], + vault_1_mint: accounts[11], lp_mint: accounts[12], })) } diff --git a/src/streaming/event_parser/protocols/raydium_cpmm/types.rs b/src/streaming/event_parser/protocols/raydium_cpmm/types.rs index a0f9b94..015562e 100644 --- a/src/streaming/event_parser/protocols/raydium_cpmm/types.rs +++ b/src/streaming/event_parser/protocols/raydium_cpmm/types.rs @@ -62,24 +62,24 @@ pub fn amm_config_parser(account: &AccountPretty, mut metadata: EventMetadata) - pub struct PoolState { pub amm_config: Pubkey, pub pool_creator: Pubkey, - pub token0_vault: Pubkey, - pub token1_vault: Pubkey, + pub token_0_vault: Pubkey, + pub token_1_vault: Pubkey, pub lp_mint: Pubkey, - pub token0_mint: Pubkey, - pub token1_mint: Pubkey, - pub token0_program: Pubkey, - pub token1_program: Pubkey, + pub token_0_mint: Pubkey, + pub token_1_mint: Pubkey, + pub token_0_program: Pubkey, + pub token_1_program: Pubkey, pub observation_key: Pubkey, pub auth_bump: u8, pub status: u8, pub lp_mint_decimals: u8, - pub mint0_decimals: u8, - pub mint1_decimals: u8, + pub mint_0_decimals: u8, + pub mint_1_decimals: u8, pub lp_supply: u64, - pub protocol_fees_token0: u64, - pub protocol_fees_token1: u64, - pub fund_fees_token0: u64, - pub fund_fees_token1: u64, + pub protocol_fees_token_0: u64, + pub protocol_fees_token_1: u64, + pub fund_fees_token_0: u64, + pub fund_fees_token_1: u64, pub open_time: u64, pub recent_epoch: u64, pub creator_fee_on: u8,