goosefx-amm-sdk
Version:
SDK for the GooseFx AMM
1,960 lines (1,959 loc) • 113 kB
text/typescript
/**
* Program IDL in camelCase format in order to be used in JS/TS.
*
* Note that this is only a type helper and is not the actual IDL. The original
* IDL can be found at `target/idl/gamma.json`.
*/
export type Gamma = {
address: "GAMMA7meSFWaBXF25oSUgmGRwaW6sCMFLmBNiMSdbHVT";
metadata: {
name: "gamma";
version: "0.1.0";
spec: "0.1.0";
description: "Created with Anchor";
};
instructions: [
{
name: "addPartner";
docs: [
"Admin-permissioned instruction to add a new partner to a pool",
"",
"* `ctx` - The context of accounts",
"",
];
discriminator: [180, 111, 45, 157, 241, 187, 234, 88];
accounts: [
{
name: "authority";
signer: true;
},
{
name: "ammConfig";
},
{
name: "poolState";
writable: true;
relations: ["partner"];
},
{
name: "poolPartners";
writable: true;
pda: {
seeds: [
{
kind: "const";
value: [112, 97, 114, 116, 110, 101, 114, 95, 105, 110, 102, 111, 115];
},
{
kind: "account";
path: "poolState";
},
];
};
},
{
name: "partner";
},
];
args: [];
},
{
name: "calculateRewards";
docs: ["Calculate rewards for the user", "", "* `ctx` - The context of accounts", ""];
discriminator: [199, 115, 201, 124, 71, 81, 143, 252];
accounts: [
{
name: "signer";
writable: true;
signer: true;
},
{
name: "user";
docs: ["User for which we are calculating rewards"];
},
{
name: "poolState";
},
{
name: "rewardInfo";
pda: {
seeds: [
{
kind: "const";
value: [114, 101, 119, 97, 114, 100, 95, 105, 110, 102, 111, 95, 115, 101, 101, 100];
},
{
kind: "account";
path: "poolState";
},
{
kind: "account";
path: "reward_info.start_at";
account: "rewardInfo";
},
{
kind: "account";
path: "reward_info.mint";
account: "rewardInfo";
},
];
};
},
{
name: "userRewardInfo";
writable: true;
pda: {
seeds: [
{
kind: "const";
value: [
117,
115,
101,
114,
95,
114,
101,
119,
97,
114,
100,
95,
105,
110,
102,
111,
95,
115,
101,
101,
100,
];
},
{
kind: "account";
path: "rewardInfo";
},
{
kind: "account";
path: "user";
},
];
};
},
{
name: "userPoolLiquidity";
docs: ["User pool liquidity account"];
pda: {
seeds: [
{
kind: "const";
value: [117, 115, 101, 114, 45, 112, 111, 111, 108, 45, 108, 105, 113, 117, 105, 100, 105, 116, 121];
},
{
kind: "account";
path: "poolState";
},
{
kind: "account";
path: "user";
},
];
};
},
{
name: "systemProgram";
address: "11111111111111111111111111111111";
},
];
args: [];
},
{
name: "claimPartnerFees";
docs: ["Claim fees for a particular partner", "", "* `ctx` - The context of accounts", ""];
discriminator: [114, 71, 103, 57, 160, 205, 242, 185];
accounts: [
{
name: "partner";
},
{
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: "poolState";
},
{
name: "token0Vault";
docs: ["The address that holds pool tokens for token_0"];
writable: true;
},
{
name: "token1Vault";
docs: ["The address that holds pool tokens for token_1"];
writable: true;
},
{
name: "vault0Mint";
docs: ["The mint of token_0 vault"];
},
{
name: "vault1Mint";
docs: ["The mint of token_1 vault"];
},
{
name: "poolPartners";
writable: true;
pda: {
seeds: [
{
kind: "const";
value: [112, 97, 114, 116, 110, 101, 114, 95, 105, 110, 102, 111, 115];
},
{
kind: "account";
path: "poolState";
},
];
};
},
{
name: "token0TokenAccount";
writable: true;
relations: ["partner"];
},
{
name: "token1TokenAccount";
writable: true;
relations: ["partner"];
},
{
name: "tokenProgram";
docs: ["The SPL program to perform token transfers"];
address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
},
{
name: "tokenProgram2022";
docs: ["The SPL program 2022 to perform token transfers"];
address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
},
];
args: [];
},
{
name: "claimRewards";
docs: [
"Claim rewards for the user",
"Transfers the amount of tokens calculated for the user to their reward token account",
"",
"# Arguments",
"",
"* `ctx` - The context of accounts",
"",
];
discriminator: [4, 144, 132, 71, 116, 23, 151, 80];
accounts: [
{
name: "user";
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: "poolState";
},
{
name: "rewardInfo";
pda: {
seeds: [
{
kind: "const";
value: [114, 101, 119, 97, 114, 100, 95, 105, 110, 102, 111, 95, 115, 101, 101, 100];
},
{
kind: "account";
path: "poolState";
},
{
kind: "account";
path: "reward_info.start_at";
account: "rewardInfo";
},
{
kind: "account";
path: "reward_info.mint";
account: "rewardInfo";
},
];
};
},
{
name: "rewardVault";
writable: true;
pda: {
seeds: [
{
kind: "const";
value: [114, 101, 119, 97, 114, 100, 95, 118, 97, 117, 108, 116, 95, 115, 101, 101, 100];
},
{
kind: "account";
path: "rewardInfo";
},
];
};
},
{
name: "userTokenAccount";
writable: true;
},
{
name: "userRewardInfo";
writable: true;
pda: {
seeds: [
{
kind: "const";
value: [
117,
115,
101,
114,
95,
114,
101,
119,
97,
114,
100,
95,
105,
110,
102,
111,
95,
115,
101,
101,
100,
];
},
{
kind: "account";
path: "rewardInfo";
},
{
kind: "account";
path: "user";
},
];
};
},
{
name: "rewardMint";
writable: true;
},
{
name: "tokenProgram";
docs: ["token Program"];
address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
},
{
name: "tokenProgram2022";
docs: ["Token program 2022"];
address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
},
{
name: "systemProgram";
address: "11111111111111111111111111111111";
},
];
args: [];
},
{
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",
"",
];
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: "poolState";
docs: ["Pool state stores accumulated protocol fee amount"];
writable: true;
},
{
name: "ammConfig";
docs: ["Amm config account stores fund_owner"];
},
{
name: "token0Vault";
docs: ["The address that holds pool tokens for token_0"];
writable: true;
},
{
name: "token1Vault";
docs: ["The address that holds pool tokens for token_1"];
writable: true;
},
{
name: "vault0Mint";
docs: ["The mint of token_0 vault"];
},
{
name: "vault1Mint";
docs: ["The mint of token_1 vault"];
},
{
name: "recipientToken0Account";
docs: ["The address that receives the collected token_0 fund fees"];
writable: true;
},
{
name: "recipientToken1Account";
docs: ["The address that receives the collected token_1 fund fees"];
writable: true;
},
{
name: "tokenProgram";
docs: ["The SPL program to perform token transfers"];
address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
},
{
name: "tokenProgram2022";
docs: ["The SPL program 2022 to perform token transfers"];
address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
},
];
args: [
{
name: "amount0Requested";
type: "u64";
},
{
name: "amount1Requested";
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",
"",
];
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: "poolState";
docs: ["Pool state stores accumulated protocol fee amount"];
writable: true;
},
{
name: "ammConfig";
docs: ["Amm config account stores owner"];
},
{
name: "token0Vault";
docs: ["The address that holds pool tokens for token_0"];
writable: true;
},
{
name: "token1Vault";
docs: ["The address that holds pool tokens for token_1"];
writable: true;
},
{
name: "vault0Mint";
docs: ["The mint of token_0 vault"];
},
{
name: "vault1Mint";
docs: ["The mint of token_1 vault"];
},
{
name: "recipientToken0Account";
docs: ["The address that receives the collected token_0 protocol fees"];
writable: true;
},
{
name: "recipientToken1Account";
docs: ["The address that receives the collected token_1 protocol fees"];
writable: true;
},
{
name: "tokenProgram";
docs: ["The SPL program to perform token transfers"];
address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
},
{
name: "tokenProgram2022";
docs: ["The SPL program 2022 to perform token transfers"];
address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
},
];
args: [
{
name: "amount0Requested";
type: "u64";
},
{
name: "amount1Requested";
type: "u64";
},
];
},
{
name: "createAmmConfig";
docs: [
"The configuation of AMM protocol, include trade fee and protocol fee",
"# 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 tarde fee.",
"* `fund_fee_rate` - The rate of fund fee within tarde 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: "9QcHinaHcJFdzSHeiF1yGchcuQk3qPFNV13q6dZJbAny";
},
{
name: "ammConfig";
docs: ["Initialize AmmConfig 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: "systemProgram";
address: "11111111111111111111111111111111";
},
];
args: [
{
name: "index";
type: "u16";
},
{
name: "tradeFeeRate";
type: "u64";
},
{
name: "protocolFeeRate";
type: "u64";
},
{
name: "fundFeeRate";
type: "u64";
},
{
name: "createPoolFee";
type: "u64";
},
{
name: "maxOpenTime";
type: "u64";
},
];
},
{
name: "createRewards";
docs: [
"Create rewards for the pool",
"Initializes a new reward info account and a reward vault account",
"Transfers the rewards to the reward vault",
"",
"# Arguments",
"",
"* `ctx` - The context of accounts",
"* `start_time` - The start time of the reward",
"* `end_time` - The end time of the reward",
"* `reward_amount` - The amount of the reward",
"",
];
discriminator: [124, 251, 145, 232, 5, 173, 159, 223];
accounts: [
{
name: "rewardProvider";
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: "poolState";
},
{
name: "rewardInfo";
writable: true;
pda: {
seeds: [
{
kind: "const";
value: [114, 101, 119, 97, 114, 100, 95, 105, 110, 102, 111, 95, 115, 101, 101, 100];
},
{
kind: "account";
path: "poolState";
},
{
kind: "arg";
path: "startTime";
},
{
kind: "account";
path: "rewardMint";
},
];
};
},
{
name: "rewardProvidersTokenAccount";
writable: true;
},
{
name: "rewardVault";
docs: ["For reward to deposit into."];
writable: true;
pda: {
seeds: [
{
kind: "const";
value: [114, 101, 119, 97, 114, 100, 95, 118, 97, 117, 108, 116, 95, 115, 101, 101, 100];
},
{
kind: "account";
path: "rewardInfo";
},
];
};
},
{
name: "rewardMint";
writable: true;
},
{
name: "tokenProgram";
docs: ["token Program"];
address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
},
{
name: "tokenProgram2022";
docs: ["Token program 2022"];
address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
},
{
name: "systemProgram";
address: "11111111111111111111111111111111";
},
];
args: [
{
name: "startTime";
type: "u64";
},
{
name: "endTime";
type: "u64";
},
{
name: "rewardAmount";
type: "u64";
},
];
},
{
name: "createSwapReferral";
docs: [
"Initialize swap referrals for an existing AMM config",
"# Arguments",
"",
"* `ctx` - The accounts needed by the instruction, including those used by cpi to the referral program",
"* `name` - The project name, passed to the referral program. Must be less than 50 chars in length",
"* `default_share_bps` - Percentage share of fees to referrers. Must be less than 10_000",
];
discriminator: [67, 131, 93, 236, 56, 6, 40, 77];
accounts: [
{
name: "admin";
docs: ["Admin signer for this operation"];
signer: true;
},
{
name: "owner";
address: "9QcHinaHcJFdzSHeiF1yGchcuQk3qPFNV13q6dZJbAny";
},
{
name: "payer";
writable: true;
signer: true;
},
{
name: "ammConfig";
docs: ["The config acts as the base for its referral project"];
writable: true;
},
{
name: "project";
writable: true;
},
{
name: "systemProgram";
address: "11111111111111111111111111111111";
},
{
name: "referralProgram";
address: "REFER4ZgmyYx9c6He5XfaTMiGfdLwRnkV4RPp9t9iF3";
},
];
args: [
{
name: "name";
type: "string";
},
{
name: "defaultShareBps";
type: "u16";
},
];
},
{
name: "deposit";
docs: [
"Creates a pool for the given token pair and the initial price",
"",
"# Arguments",
"",
"* `ctx`- The context of accounts",
"* `lp_token_amount` - Pool token amount to transfer. token_a and token_b amount are set by the current exchange rate and size of the pool",
"* `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: ["Owner of the liquidity provided"];
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: "poolState";
docs: ["Pool state the owner is depositing into"];
writable: true;
},
{
name: "userPoolLiquidity";
writable: true;
pda: {
seeds: [
{
kind: "const";
value: [117, 115, 101, 114, 45, 112, 111, 111, 108, 45, 108, 105, 113, 117, 105, 100, 105, 116, 121];
},
{
kind: "account";
path: "poolState";
},
{
kind: "account";
path: "owner";
},
];
};
},
{
name: "token0Account";
docs: ["The payer's token account to deposit token_0"];
writable: true;
},
{
name: "token1Account";
docs: ["The payer's token account to deposit token_1"];
writable: true;
},
{
name: "token0Vault";
docs: ["Pool vault for token_0 to deposit into", "The address that holds pool tokens for token_0"];
writable: true;
},
{
name: "token1Vault";
docs: ["Pool vault for token_1 to deposit into", "The address that holds pool tokens for token_1"];
writable: true;
},
{
name: "tokenProgram";
docs: ["token Program"];
address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
},
{
name: "tokenProgram2022";
docs: ["Token program 2022"];
address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
},
{
name: "vault0Mint";
docs: ["The mint of token_0 vault"];
},
{
name: "vault1Mint";
docs: ["The mint of token_1 vault"];
},
{
name: "poolPartners";
writable: true;
pda: {
seeds: [
{
kind: "const";
value: [112, 97, 114, 116, 110, 101, 114, 95, 105, 110, 102, 111, 115];
},
{
kind: "account";
path: "poolState";
},
];
};
},
];
args: [
{
name: "lpTokenAmount";
type: "u64";
},
{
name: "maximumToken0Amount";
type: "u64";
},
{
name: "maximumToken1Amount";
type: "u64";
},
];
},
{
name: "initUserPoolLiquidity";
discriminator: [227, 221, 200, 212, 36, 107, 149, 36];
accounts: [
{
name: "user";
writable: true;
signer: true;
},
{
name: "poolState";
},
{
name: "userPoolLiquidity";
writable: true;
pda: {
seeds: [
{
kind: "const";
value: [117, 115, 101, 114, 45, 112, 111, 111, 108, 45, 108, 105, 113, 117, 105, 100, 105, 116, 121];
},
{
kind: "account";
path: "poolState";
},
{
kind: "account";
path: "user";
},
];
};
},
{
name: "poolPartners";
writable: true;
pda: {
seeds: [
{
kind: "const";
value: [112, 97, 114, 116, 110, 101, 114, 95, 105, 110, 102, 111, 115];
},
{
kind: "account";
path: "poolState";
},
];
};
},
{
name: "systemProgram";
docs: ["To create a new program account"];
address: "11111111111111111111111111111111";
},
];
args: [
{
name: "partner";
type: {
option: "pubkey";
};
},
];
},
{
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",
"* `max_trade_fee_rate` - The maximum trade fee that can be charged on swaps",
"* `volatility_factor` - The volatility factor of the pool to determine the trade fee",
"",
];
discriminator: [175, 175, 109, 31, 13, 152, 155, 237];
accounts: [
{
name: "creator";
docs: ["Address paying to create the pool. It can be anyone."];
writable: true;
signer: true;
},
{
name: "ammConfig";
docs: ["Which amm config the pool belongs to"];
},
{
name: "authority";
docs: ["sign transactions on behalf of the pool", "for vault and lp_mint"];
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: "poolState";
docs: ["Initialize an account to store the pool state"];
writable: true;
pda: {
seeds: [
{
kind: "const";
value: [112, 111, 111, 108];
},
{
kind: "account";
path: "ammConfig";
},
{
kind: "account";
path: "token0Mint";
},
{
kind: "account";
path: "token1Mint";
},
];
};
},
{
name: "userPoolLiquidity";
writable: true;
pda: {
seeds: [
{
kind: "const";
value: [117, 115, 101, 114, 45, 112, 111, 111, 108, 45, 108, 105, 113, 117, 105, 100, 105, 116, 121];
},
{
kind: "account";
path: "poolState";
},
{
kind: "account";
path: "creator";
},
];
};
},
{
name: "token0Mint";
docs: ["Token_0 mint, the key must smaller than token_1 mint."];
},
{
name: "token1Mint";
docs: ["Token_1 mint, the key must greater than token_0 mint."];
},
{
name: "creatorToken0";
docs: ["creator token 0 account"];
writable: true;
},
{
name: "creatorToken1";
docs: ["creator token 1 account"];
writable: true;
},
{
name: "token0Vault";
writable: true;
pda: {
seeds: [
{
kind: "const";
value: [112, 111, 111, 108, 95, 118, 97, 117, 108, 116];
},
{
kind: "account";
path: "poolState";
},
{
kind: "account";
path: "token0Mint";
},
];
};
},
{
name: "token1Vault";
writable: true;
pda: {
seeds: [
{
kind: "const";
value: [112, 111, 111, 108, 95, 118, 97, 117, 108, 116];
},
{
kind: "account";
path: "poolState";
},
{
kind: "account";
path: "token1Mint";
},
];
};
},
{
name: "createPoolFee";
docs: ["create pool fee account"];
writable: true;
address: "8PhehuioLjhJ35A5eavazJSwoXcA4J7WwzgoWDBDFSuY";
},
{
name: "observationState";
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: "poolState";
},
];
};
},
{
name: "poolPartners";
docs: ["account storing partner infos"];
writable: true;
pda: {
seeds: [
{
kind: "const";
value: [112, 97, 114, 116, 110, 101, 114, 95, 105, 110, 102, 111, 115];
},
{
kind: "account";
path: "poolState";
},
];
};
},
{
name: "tokenProgram";
docs: ["Program to create mint account and mint tokens"];
address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
},
{
name: "token0Program";
docs: ["Spl token program or token program 2022"];
},
{
name: "token1Program";
docs: ["Spl token program or token program 2022"];
},
{
name: "associatedTokenProgram";
docs: ["Program to create an ATA for receiving position NFT"];
address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
},
{
name: "systemProgram";
docs: ["To create a new program account"];
address: "11111111111111111111111111111111";
},
{
name: "rent";
docs: ["Sysvar for program account"];
address: "SysvarRent111111111111111111111111111111111";
},
];
args: [
{
name: "initAmount0";
type: "u64";
},
{
name: "initAmount1";
type: "u64";
},
{
name: "openTime";
type: "u64";
},
{
name: "maxTradeFeeRate";
type: "u64";
},
{
name: "volatilityFactor";
type: "u64";
},
];
},
{
name: "initializePartner";
docs: [
"Creates a new `Partner` account associated with a certain pool",
"",
"* `ctx` - The context of accounts",
"* `name` - The name associated with the partner",
"* `token_0_token_account` - Token account for receiving token0 tokens",
"* `token_1_token_account` - Token account for receiving token1 tokens",
"",
];
discriminator: [165, 62, 179, 112, 129, 50, 173, 144];
accounts: [
{
name: "payer";
writable: true;
signer: true;
},
{
name: "authority";
signer: true;
},
{
name: "poolState";
},
{
name: "poolPartners";
writable: true;
pda: {
seeds: [
{
kind: "const";
value: [112, 97, 114, 116, 110, 101, 114, 95, 105, 110, 102, 111, 115];
},
{
kind: "account";
path: "poolState";
},
];
};
},
{
name: "partner";
writable: true;
signer: true;
},
{
name: "systemProgram";
address: "11111111111111111111111111111111";
},
];
args: [
{
name: "name";
type: "string";
},
{
name: "token0TokenAccount";
type: "pubkey";
},
{
name: "token1TokenAccount";
type: "pubkey";
},
];
},
{
name: "initializePoolPartners";
docs: [
"Initializes a new `PoolPartnerInfos` account unique to a particular pool",
"",
"* `ctx` - The context of accounts",
"* `partner_share_rate` - A fraction representing the partner's share of protocol fees",
"",
];
discriminator: [99, 11, 108, 186, 1, 126, 209, 251];
accounts: [
{
name: "payer";
writable: true;
signer: true;
},
{
name: "poolState";
writable: true;
},
{
name: "poolPartners";
writable: true;
pda: {
seeds: [
{
kind: "const";
value: [112, 97, 114, 116, 110, 101, 114, 95, 105, 110, 102, 111, 115];
},
{
kind: "account";
path: "poolState";
},
];
};
},
{
name: "systemProgram";
address: "11111111111111111111111111111111";
},
];
args: [
{
name: "partnerShareRate";
type: "u64";
},
];
},
{
name: "migrateMeteoraDlmmToGamma";
docs: ["Migrate from Meteora Dlmm to Gamma"];
discriminator: [166, 33, 209, 228, 15, 46, 252, 67];
accounts: [
{
name: "dlmmPosition";
writable: true;
},
{
name: "dlmmLbPair";
writable: true;
},
{
name: "dlmmBinArrayBitmapExtension";
writable: true;
optional: true;
},
{
name: "dlmmReserveX";
writable: true;
},
{
name: "dlmmReserveY";
writable: true;
},
{
name: "dlmmBinArrayLower";
writable: true;
},
{
name: "dlmmBinArrayUpper";
writable: true;
},
{
name: "dlmmProgram";
address: "LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo";
},
{
name: "dlmmEventAuthority";
},
{
name: "tokenXProgram";
},
{
name: "tokenYProgram";
},
{
name: "gammaOwner";
docs: ["The owner LP Position in Gamma pool"];
signer: true;
},
{
name: "gammaAuthority";
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: "gammaPoolState";
docs: ["Gamma Pool state the owner is depositing into"];
writable: true;
},
{
name: "gammaUserPoolLiquidity";
writable: true;
pda: {
seeds: [
{
kind: "const";
value: [117, 115, 101, 114, 45, 112, 111, 111, 108, 45, 108, 105, 113, 117, 105, 100, 105, 116, 121];
},
{
kind: "account";
path: "gammaPoolState";
},
{
kind: "account";
path: "gammaOwner";
},
];
};
},
{
name: "gammaToken0Account";
docs: ["The payer's token account to deposit token_0"];
writable: true;
},
{
name: "gammaToken1Account";
docs: ["The payer's token account to deposit token_1"];
writable: true;
},
{
name: "gammaToken0Vault";
docs: ["Pool vault for token_0 to deposit into", "The address that holds pool tokens for token_0"];
writable: true;
},
{
name: "gammaToken1Vault";
docs: ["Pool vault for token_1 to deposit into", "The address that holds pool tokens for token_1"];
writable: true;
},
{
name: "tokenProgram";
docs: ["token Program"];
address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
},
{
name: "tokenProgram2022";
docs: ["Token program 2022"];
address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
},
{
name: "gammaVault0Mint";
docs: ["The mint of token_0 vault"];
},
{
name: "gammaVault1Mint";
docs: ["The mint of token_1 vault"];
},
{
name: "poolPartners";
writable: true;
pda: {
seeds: [
{
kind: "const";
value: [112, 97, 114, 116, 110, 101, 114, 95, 105, 110, 102, 111, 115];
},
{
kind: "account";
path: "gammaPoolState";
},
];
};
},
];
args: [
{
name: "binLiquidityReduction";
type: {
vec: {
defined: {
name: "binLiquidityReduction";
};
};
};
},
{
name: "maximumToken0Amount";
type: "u64";
},
{
name: "maximumToken1Amount";
type: "u64";
},
];
},
{
name: "migrateOrcaWhirlpoolToGamma";
docs: ["Migrate from Orca Whirlpool to Gamma for simple spl tokens"];
discriminator: [197, 196, 129, 5, 64, 184, 129, 242];
accounts: [
{
name: "whirlpoolProgram";
address: "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc";
},
{
name: "whirlpool";
writable: true;
},
{
name: "tokenProgramA";
},
{
name: "tokenProgramB";
},
{
name: "memoProgram";
address: "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr";
},
{
name: "whirlpoolPosition";
writable: true;
},
{
name: "whirlpoolPositionTokenAccount";
},
{
name: "whirlpoolTokenVaultA";
writable: true;
},
{
name: "whirlpoolTokenVaultB";
writable: true;
},
{
name: "whirlpoolTickArrayLower";
writable: true;
},
{
name: "whirlpoolTickArrayUpper";
writable: true;
},
{
name: "gammaOwner";
docs: ["The owner LP Position in Gamma pool"];
signer: true;
},
{
name: "gammaAuthority";
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: "gammaPoolState";
docs: ["Gamma Pool state the owner is depositing into"];
writable: true;
},
{
name: "gammaUserPoolLiquidity";
writable: true;
pda: {
seeds: [
{
kind: "const";
value: [117, 115, 101, 114, 45, 112, 111, 111, 108, 45, 108, 105, 113, 117, 105, 100, 105, 116, 121];
},
{
kind: "account";
path: "gammaPoolState";
},
{
kind: "account";
path: "gammaOwner";
},
];
};
},
{
name: "gammaToken0Account";
docs: ["The payer's token account to deposit token_0"];
writable: true;
},
{
name: "gammaToken1Account";
docs: ["The payer's token account to deposit token_1"];
writable: true;
},
{
name: "gammaToken0Vault";
docs: ["Pool vault for token_0 to deposit into", "The address that holds pool tokens for token_0"];
writable: true;
},
{
name: "gammaToken1Vault";
docs: ["Pool vault for token_1 to deposit into", "The address that holds pool tokens for token_1"];
writable: true;
},
{
name: "tokenProgram";
docs: ["token Program"];
address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
},
{
name: "tokenProgram2022";
docs: ["Token program 2022"];
address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
},
{
name: "gammaVault0Mint";
docs: ["The mint of token_0 vault"];
},
{
name: "gammaVault1Mint";
docs: ["The mint of token_1 vault"];
},
{
name: "poolPartners";
writable: true;
pda: {
seeds: [
{
kind: "const";
value: [112, 97, 114, 116, 110, 101, 114, 95, 105, 110, 102, 111, 115];
},
{
kind: "account";
path: "gammaPoolState";
},
];
};
},
];
args: [
{
name: "liquidityAmount";
type: "u128";
},
{
name: "tokenMinA";
type: "u64";
},
{
name: "tokenMinB";
type: "u64";
},
{
name: "maximumToken0Amount";
type: "u64";
},
{
name: "maximumToken1Amount";
type: "u64";
},
];
},
{
name: "migrateOrcaWhirlpoolToGammaV2";
docs: ["Migrate from Orca Whirlpool to Gamma for token 2022"];
discriminator: [48, 74, 173, 201, 189, 38, 220, 244];
accounts: [
{
name: "whirlpoolProgram";
address: "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc";
},
{
name: "whirlpool";
writable: true;
},
{
name: "tokenProgramA";
},
{
name: "tokenProgramB";
},
{
name: "memoProgram";
address: "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr";
},
{
name: "whirlpoolPosition";
writable: true;
},
{
name: "whirlpoolPositionTokenAccount";
},
{
name: "whirlpoolTokenVaultA";
writable: true;