diff --git a/cmd/dlmmparse/main.go b/cmd/dlmmparse/main.go new file mode 100644 index 0000000..6294c86 --- /dev/null +++ b/cmd/dlmmparse/main.go @@ -0,0 +1,170 @@ +package main + +import ( + "context" + "encoding/json" + "fmt" + "log" + + "github.com/gagliardetto/solana-go" + "github.com/gagliardetto/solana-go/programs/address-lookup-table" + "github.com/gagliardetto/solana-go/rpc" + + "github.com/samlior/libsam/pkg/shreder" +) + +// OKX tx +// const dlmmSignature = "4W8gD2iEYyvzpPiW9BhdH5hUrfXhqH46ziLzPkaaxmaA8XXK53erUvrPdZ5cY2XrgWwix1hmRajUnGAiNp4cSGpN" + +const dlmmSignature = "3Kcm9rqG9mJ6PCM5DuUoZ6jk3kzbH7J5GP488E5MKMwodf2NXgddygEcWBmzRBrV2YZFmXtG22gvcJixqdsCjRPn" + + +func main() { + const rpcURL = "https://staked.helius-rpc.com?api-key=5adcf1f9-5719-43d1-bf3f-c2d4e1e5f94d" + if rpcURL == "" { + log.Fatal("SOL_RPC_URL is not set") + } + + client := rpc.New(rpcURL) + sig, err := solana.SignatureFromBase58(dlmmSignature) + if err != nil { + log.Fatalf("invalid dlmmSignature: %v", err) + } + version := uint64(0) + tx, err := client.GetTransaction( + context.Background(), + sig, + &rpc.GetTransactionOpts{ + Commitment: rpc.CommitmentFinalized, + MaxSupportedTransactionVersion: &version, + }, + ) + if err != nil { + log.Fatalf("getTransaction failed: %v", err) + } + if tx == nil || tx.Transaction == nil { + log.Fatal("transaction is empty") + } + + rawTx, err := tx.Transaction.GetTransaction() + if err != nil { + log.Fatalf("decode transaction failed: %v", err) + } + if rawTx == nil { + log.Fatal("decoded transaction is nil") + } + + if len(rawTx.Message.AddressTableLookups) > 0 { + tables := make(map[solana.PublicKey]solana.PublicKeySlice, len(rawTx.Message.AddressTableLookups)) + for _, lookup := range rawTx.Message.AddressTableLookups { + state, err := addresslookuptable.GetAddressLookupTable(context.Background(), client, lookup.AccountKey) + if err != nil { + log.Fatalf("load address table %s failed: %v", lookup.AccountKey, err) + } + tables[lookup.AccountKey] = state.Addresses + } + if err := rawTx.Message.SetAddressTables(tables); err != nil { + log.Fatalf("set address tables failed: %v", err) + } + if err := rawTx.Message.ResolveLookups(); err != nil { + log.Fatalf("resolve address lookups failed: %v", err) + } + } + + update := toSubscribeUpdate(tx.Slot, rawTx) + signals := shreder.ParseTransaction(update, nil, true) + if len(signals) == 0 { + fmt.Println("no signals parsed") + return + } + + printed := false + for _, signal := range signals { + if signal == nil || signal.Label != "dlmm" { + continue + } + printed = true + output, err := json.MarshalIndent(signal, "", " ") + if err != nil { + log.Fatalf("marshal signal failed: %v", err) + } + fmt.Println(string(output)) + } + + if printed { + return + } + + fmt.Println("no dlmm signal parsed, dump all signals:") + for _, signal := range signals { + if signal == nil { + continue + } + output, err := json.MarshalIndent(signal, "", " ") + if err != nil { + log.Fatalf("marshal signal failed: %v", err) + } + fmt.Println(string(output)) + } +} + +func toSubscribeUpdate(slot uint64, tx *solana.Transaction) *shreder.SubscribeUpdateTransaction { + signatures := make([][]byte, len(tx.Signatures)) + for i, sig := range tx.Signatures { + signatures[i] = sig[:] + } + + accountKeys := make([][]byte, len(tx.Message.AccountKeys)) + for i, key := range tx.Message.AccountKeys { + accountKeys[i] = key[:] + } + + instructions := make([]*shreder.CompiledInstruction, len(tx.Message.Instructions)) + for i, instr := range tx.Message.Instructions { + accounts := make([]byte, len(instr.Accounts)) + for j, acc := range instr.Accounts { + accounts[j] = byte(acc) + } + instructions[i] = &shreder.CompiledInstruction{ + ProgramIdIndex: uint32(instr.ProgramIDIndex), + Accounts: accounts, + Data: instr.Data[:], + } + } + + addressTableLookups := make([]*shreder.MessageAddressTableLookup, len(tx.Message.AddressTableLookups)) + for i, lookup := range tx.Message.AddressTableLookups { + writable := make([]byte, len(lookup.WritableIndexes)) + for j, idx := range lookup.WritableIndexes { + writable[j] = byte(idx) + } + readonly := make([]byte, len(lookup.ReadonlyIndexes)) + for j, idx := range lookup.ReadonlyIndexes { + readonly[j] = byte(idx) + } + addressTableLookups[i] = &shreder.MessageAddressTableLookup{ + AccountKey: lookup.AccountKey[:], + WritableIndexes: writable, + ReadonlyIndexes: readonly, + } + } + + return &shreder.SubscribeUpdateTransaction{ + Transaction: &shreder.Transaction{ + Signatures: signatures, + Message: &shreder.Message{ + Header: &shreder.MessageHeader{ + NumRequiredSignatures: uint32(tx.Message.Header.NumRequiredSignatures), + NumReadonlySignedAccounts: uint32(tx.Message.Header.NumReadonlySignedAccounts), + NumReadonlyUnsignedAccounts: uint32(tx.Message.Header.NumReadonlyUnsignedAccounts), + }, + AccountKeys: accountKeys, + RecentBlockhash: nil, + Instructions: instructions, + Versioned: false, + AddressTableLookups: addressTableLookups, + }, + }, + Slot: slot, + } +} diff --git a/pkg/shreder/dlmm_idl.json b/pkg/shreder/dlmm_idl.json new file mode 100644 index 0000000..9d20919 --- /dev/null +++ b/pkg/shreder/dlmm_idl.json @@ -0,0 +1,8471 @@ +{ + "address": "LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo", + "metadata": { + "name": "lb_clmm", + "version": "0.10.1", + "spec": "0.1.0", + "description": "Created with Anchor" + }, + "instructions": [ + { + "name": "add_liquidity", + "discriminator": [181, 157, 89, 67, 143, 182, 52, 72], + "accounts": [ + { + "name": "position", + "writable": true + }, + { + "name": "lb_pair", + "writable": true, + "relations": [ + "position", + "bin_array_bitmap_extension", + "bin_array_lower", + "bin_array_upper" + ] + }, + { + "name": "bin_array_bitmap_extension", + "writable": true, + "optional": true + }, + { + "name": "user_token_x", + "writable": true + }, + { + "name": "user_token_y", + "writable": true + }, + { + "name": "reserve_x", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "reserve_y", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "token_x_mint", + "relations": ["lb_pair"] + }, + { + "name": "token_y_mint", + "relations": ["lb_pair"] + }, + { + "name": "bin_array_lower", + "writable": true + }, + { + "name": "bin_array_upper", + "writable": true + }, + { + "name": "sender", + "signer": true + }, + { + "name": "token_x_program", + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "token_y_program", + "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": "liquidity_parameter", + "type": { + "defined": { + "name": "LiquidityParameter" + } + } + } + ] + }, + { + "name": "add_liquidity2", + "discriminator": [228, 162, 78, 28, 70, 219, 116, 115], + "accounts": [ + { + "name": "position", + "writable": true + }, + { + "name": "lb_pair", + "writable": true, + "relations": ["position", "bin_array_bitmap_extension"] + }, + { + "name": "bin_array_bitmap_extension", + "writable": true, + "optional": true + }, + { + "name": "user_token_x", + "writable": true + }, + { + "name": "user_token_y", + "writable": true + }, + { + "name": "reserve_x", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "reserve_y", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "token_x_mint", + "relations": ["lb_pair"] + }, + { + "name": "token_y_mint", + "relations": ["lb_pair"] + }, + { + "name": "sender", + "signer": true + }, + { + "name": "token_x_program" + }, + { + "name": "token_y_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": "liquidity_parameter", + "type": { + "defined": { + "name": "LiquidityParameter" + } + } + }, + { + "name": "remaining_accounts_info", + "type": { + "defined": { + "name": "RemainingAccountsInfo" + } + } + } + ] + }, + { + "name": "add_liquidity_by_strategy", + "discriminator": [7, 3, 150, 127, 148, 40, 61, 200], + "accounts": [ + { + "name": "position", + "writable": true + }, + { + "name": "lb_pair", + "writable": true, + "relations": [ + "position", + "bin_array_bitmap_extension", + "bin_array_lower", + "bin_array_upper" + ] + }, + { + "name": "bin_array_bitmap_extension", + "writable": true, + "optional": true + }, + { + "name": "user_token_x", + "writable": true + }, + { + "name": "user_token_y", + "writable": true + }, + { + "name": "reserve_x", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "reserve_y", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "token_x_mint", + "relations": ["lb_pair"] + }, + { + "name": "token_y_mint", + "relations": ["lb_pair"] + }, + { + "name": "bin_array_lower", + "writable": true + }, + { + "name": "bin_array_upper", + "writable": true + }, + { + "name": "sender", + "signer": true + }, + { + "name": "token_x_program", + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "token_y_program", + "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": "liquidity_parameter", + "type": { + "defined": { + "name": "LiquidityParameterByStrategy" + } + } + } + ] + }, + { + "name": "add_liquidity_by_strategy2", + "discriminator": [3, 221, 149, 218, 111, 141, 118, 213], + "accounts": [ + { + "name": "position", + "writable": true + }, + { + "name": "lb_pair", + "writable": true, + "relations": ["position", "bin_array_bitmap_extension"] + }, + { + "name": "bin_array_bitmap_extension", + "writable": true, + "optional": true + }, + { + "name": "user_token_x", + "writable": true + }, + { + "name": "user_token_y", + "writable": true + }, + { + "name": "reserve_x", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "reserve_y", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "token_x_mint", + "relations": ["lb_pair"] + }, + { + "name": "token_y_mint", + "relations": ["lb_pair"] + }, + { + "name": "sender", + "signer": true + }, + { + "name": "token_x_program" + }, + { + "name": "token_y_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": "liquidity_parameter", + "type": { + "defined": { + "name": "LiquidityParameterByStrategy" + } + } + }, + { + "name": "remaining_accounts_info", + "type": { + "defined": { + "name": "RemainingAccountsInfo" + } + } + } + ] + }, + { + "name": "add_liquidity_by_strategy_one_side", + "discriminator": [41, 5, 238, 175, 100, 225, 6, 205], + "accounts": [ + { + "name": "position", + "writable": true + }, + { + "name": "lb_pair", + "writable": true, + "relations": [ + "position", + "bin_array_bitmap_extension", + "bin_array_lower", + "bin_array_upper" + ] + }, + { + "name": "bin_array_bitmap_extension", + "writable": true, + "optional": true + }, + { + "name": "user_token", + "writable": true + }, + { + "name": "reserve", + "writable": true + }, + { + "name": "token_mint" + }, + { + "name": "bin_array_lower", + "writable": true + }, + { + "name": "bin_array_upper", + "writable": true + }, + { + "name": "sender", + "signer": true + }, + { + "name": "token_program", + "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": "liquidity_parameter", + "type": { + "defined": { + "name": "LiquidityParameterByStrategyOneSide" + } + } + } + ] + }, + { + "name": "add_liquidity_by_weight", + "discriminator": [28, 140, 238, 99, 231, 162, 21, 149], + "accounts": [ + { + "name": "position", + "writable": true + }, + { + "name": "lb_pair", + "writable": true, + "relations": [ + "position", + "bin_array_bitmap_extension", + "bin_array_lower", + "bin_array_upper" + ] + }, + { + "name": "bin_array_bitmap_extension", + "writable": true, + "optional": true + }, + { + "name": "user_token_x", + "writable": true + }, + { + "name": "user_token_y", + "writable": true + }, + { + "name": "reserve_x", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "reserve_y", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "token_x_mint", + "relations": ["lb_pair"] + }, + { + "name": "token_y_mint", + "relations": ["lb_pair"] + }, + { + "name": "bin_array_lower", + "writable": true + }, + { + "name": "bin_array_upper", + "writable": true + }, + { + "name": "sender", + "signer": true + }, + { + "name": "token_x_program", + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "token_y_program", + "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": "liquidity_parameter", + "type": { + "defined": { + "name": "LiquidityParameterByWeight" + } + } + } + ] + }, + { + "name": "add_liquidity_one_side", + "discriminator": [94, 155, 103, 151, 70, 95, 220, 165], + "accounts": [ + { + "name": "position", + "writable": true + }, + { + "name": "lb_pair", + "writable": true, + "relations": [ + "position", + "bin_array_bitmap_extension", + "bin_array_lower", + "bin_array_upper" + ] + }, + { + "name": "bin_array_bitmap_extension", + "writable": true, + "optional": true + }, + { + "name": "user_token", + "writable": true + }, + { + "name": "reserve", + "writable": true + }, + { + "name": "token_mint" + }, + { + "name": "bin_array_lower", + "writable": true + }, + { + "name": "bin_array_upper", + "writable": true + }, + { + "name": "sender", + "signer": true + }, + { + "name": "token_program", + "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": "liquidity_parameter", + "type": { + "defined": { + "name": "LiquidityOneSideParameter" + } + } + } + ] + }, + { + "name": "add_liquidity_one_side_precise", + "discriminator": [161, 194, 103, 84, 171, 71, 250, 154], + "accounts": [ + { + "name": "position", + "writable": true + }, + { + "name": "lb_pair", + "writable": true, + "relations": [ + "position", + "bin_array_bitmap_extension", + "bin_array_lower", + "bin_array_upper" + ] + }, + { + "name": "bin_array_bitmap_extension", + "writable": true, + "optional": true + }, + { + "name": "user_token", + "writable": true + }, + { + "name": "reserve", + "writable": true + }, + { + "name": "token_mint" + }, + { + "name": "bin_array_lower", + "writable": true + }, + { + "name": "bin_array_upper", + "writable": true + }, + { + "name": "sender", + "signer": true + }, + { + "name": "token_program", + "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": "parameter", + "type": { + "defined": { + "name": "AddLiquiditySingleSidePreciseParameter" + } + } + } + ] + }, + { + "name": "add_liquidity_one_side_precise2", + "discriminator": [33, 51, 163, 201, 117, 98, 125, 231], + "accounts": [ + { + "name": "position", + "writable": true + }, + { + "name": "lb_pair", + "writable": true, + "relations": ["position", "bin_array_bitmap_extension"] + }, + { + "name": "bin_array_bitmap_extension", + "writable": true, + "optional": true + }, + { + "name": "user_token", + "writable": true + }, + { + "name": "reserve", + "writable": true + }, + { + "name": "token_mint" + }, + { + "name": "sender", + "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": "liquidity_parameter", + "type": { + "defined": { + "name": "AddLiquiditySingleSidePreciseParameter2" + } + } + }, + { + "name": "remaining_accounts_info", + "type": { + "defined": { + "name": "RemainingAccountsInfo" + } + } + } + ] + }, + { + "name": "claim_fee", + "discriminator": [169, 32, 79, 137, 136, 232, 70, 137], + "accounts": [ + { + "name": "lb_pair", + "writable": true, + "relations": ["position", "bin_array_lower", "bin_array_upper"] + }, + { + "name": "position", + "writable": true + }, + { + "name": "bin_array_lower", + "writable": true + }, + { + "name": "bin_array_upper", + "writable": true + }, + { + "name": "sender", + "signer": true + }, + { + "name": "reserve_x", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "reserve_y", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "user_token_x", + "writable": true + }, + { + "name": "user_token_y", + "writable": true + }, + { + "name": "token_x_mint", + "relations": ["lb_pair"] + }, + { + "name": "token_y_mint", + "relations": ["lb_pair"] + }, + { + "name": "token_program", + "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": "claim_fee2", + "discriminator": [112, 191, 101, 171, 28, 144, 127, 187], + "accounts": [ + { + "name": "lb_pair", + "writable": true, + "relations": ["position"] + }, + { + "name": "position", + "writable": true + }, + { + "name": "sender", + "signer": true + }, + { + "name": "reserve_x", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "reserve_y", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "user_token_x", + "writable": true + }, + { + "name": "user_token_y", + "writable": true + }, + { + "name": "token_x_mint", + "relations": ["lb_pair"] + }, + { + "name": "token_y_mint", + "relations": ["lb_pair"] + }, + { + "name": "token_program_x" + }, + { + "name": "token_program_y" + }, + { + "name": "memo_program", + "address": "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr" + }, + { + "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": "min_bin_id", + "type": "i32" + }, + { + "name": "max_bin_id", + "type": "i32" + }, + { + "name": "remaining_accounts_info", + "type": { + "defined": { + "name": "RemainingAccountsInfo" + } + } + } + ] + }, + { + "name": "claim_reward", + "discriminator": [149, 95, 181, 242, 94, 90, 158, 162], + "accounts": [ + { + "name": "lb_pair", + "writable": true, + "relations": ["position", "bin_array_lower", "bin_array_upper"] + }, + { + "name": "position", + "writable": true + }, + { + "name": "bin_array_lower", + "writable": true + }, + { + "name": "bin_array_upper", + "writable": true + }, + { + "name": "sender", + "signer": true + }, + { + "name": "reward_vault", + "writable": true + }, + { + "name": "reward_mint" + }, + { + "name": "user_token_account", + "writable": true + }, + { + "name": "token_program", + "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": "reward_index", + "type": "u64" + } + ] + }, + { + "name": "claim_reward2", + "discriminator": [190, 3, 127, 119, 178, 87, 157, 183], + "accounts": [ + { + "name": "lb_pair", + "writable": true, + "relations": ["position"] + }, + { + "name": "position", + "writable": true + }, + { + "name": "sender", + "signer": true + }, + { + "name": "reward_vault", + "writable": true + }, + { + "name": "reward_mint" + }, + { + "name": "user_token_account", + "writable": true + }, + { + "name": "token_program" + }, + { + "name": "memo_program", + "address": "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr" + }, + { + "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": "u64" + }, + { + "name": "min_bin_id", + "type": "i32" + }, + { + "name": "max_bin_id", + "type": "i32" + }, + { + "name": "remaining_accounts_info", + "type": { + "defined": { + "name": "RemainingAccountsInfo" + } + } + } + ] + }, + { + "name": "close_claim_protocol_fee_operator", + "discriminator": [8, 41, 87, 35, 80, 48, 121, 26], + "accounts": [ + { + "name": "claim_fee_operator", + "writable": true + }, + { + "name": "rent_receiver", + "writable": true + }, + { + "name": "admin", + "signer": true + } + ], + "args": [] + }, + { + "name": "close_position", + "discriminator": [123, 134, 81, 0, 49, 68, 98, 98], + "accounts": [ + { + "name": "position", + "writable": true + }, + { + "name": "lb_pair", + "writable": true, + "relations": ["position", "bin_array_lower", "bin_array_upper"] + }, + { + "name": "bin_array_lower", + "writable": true + }, + { + "name": "bin_array_upper", + "writable": true + }, + { + "name": "sender", + "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_position2", + "discriminator": [174, 90, 35, 115, 186, 40, 147, 226], + "accounts": [ + { + "name": "position", + "writable": true + }, + { + "name": "sender", + "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_if_empty", + "discriminator": [59, 124, 212, 118, 91, 152, 110, 157], + "accounts": [ + { + "name": "position", + "writable": true + }, + { + "name": "sender", + "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_preset_parameter", + "discriminator": [4, 148, 145, 100, 134, 26, 181, 61], + "accounts": [ + { + "name": "preset_parameter", + "writable": true + }, + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "rent_receiver", + "writable": true + } + ], + "args": [] + }, + { + "name": "close_preset_parameter2", + "discriminator": [39, 25, 95, 107, 116, 17, 115, 28], + "accounts": [ + { + "name": "preset_parameter", + "writable": true + }, + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "rent_receiver", + "writable": true + } + ], + "args": [] + }, + { + "name": "close_token_badge", + "discriminator": [108, 146, 86, 110, 179, 254, 10, 104], + "accounts": [ + { + "name": "token_badge", + "writable": true + }, + { + "name": "rent_receiver", + "writable": true + }, + { + "name": "admin", + "signer": true + } + ], + "args": [] + }, + { + "name": "create_claim_protocol_fee_operator", + "discriminator": [51, 19, 150, 252, 105, 157, 48, 91], + "accounts": [ + { + "name": "claim_fee_operator", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [99, 102, 95, 111, 112, 101, 114, 97, 116, 111, 114] + }, + { + "kind": "account", + "path": "operator" + } + ] + } + }, + { + "name": "operator" + }, + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + } + ], + "args": [] + }, + { + "name": "decrease_position_length", + "discriminator": [194, 219, 136, 32, 25, 96, 105, 37], + "accounts": [ + { + "name": "rent_receiver", + "writable": true + }, + { + "name": "position", + "writable": true + }, + { + "name": "owner", + "signer": true, + "relations": ["position"] + }, + { + "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": "length_to_remove", + "type": "u16" + }, + { + "name": "side", + "type": "u8" + } + ] + }, + { + "name": "for_idl_type_generation_do_not_call", + "discriminator": [180, 105, 69, 80, 95, 50, 73, 108], + "accounts": [ + { + "name": "dummy_zc_account" + } + ], + "args": [ + { + "name": "_ix", + "type": { + "defined": { + "name": "DummyIx" + } + } + } + ] + }, + { + "name": "fund_reward", + "discriminator": [188, 50, 249, 165, 93, 151, 38, 63], + "accounts": [ + { + "name": "lb_pair", + "writable": true, + "relations": ["bin_array"] + }, + { + "name": "reward_vault", + "writable": true + }, + { + "name": "reward_mint" + }, + { + "name": "funder_token_account", + "writable": true + }, + { + "name": "funder", + "signer": true + }, + { + "name": "bin_array", + "writable": 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": "u64" + }, + { + "name": "amount", + "type": "u64" + }, + { + "name": "carry_forward", + "type": "bool" + }, + { + "name": "remaining_accounts_info", + "type": { + "defined": { + "name": "RemainingAccountsInfo" + } + } + } + ] + }, + { + "name": "go_to_a_bin", + "discriminator": [146, 72, 174, 224, 40, 253, 84, 174], + "accounts": [ + { + "name": "lb_pair", + "writable": true, + "relations": [ + "bin_array_bitmap_extension", + "from_bin_array", + "to_bin_array" + ] + }, + { + "name": "bin_array_bitmap_extension", + "optional": true + }, + { + "name": "from_bin_array", + "optional": true + }, + { + "name": "to_bin_array", + "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": "bin_id", + "type": "i32" + } + ] + }, + { + "name": "increase_oracle_length", + "discriminator": [190, 61, 125, 87, 103, 79, 158, 173], + "accounts": [ + { + "name": "oracle", + "writable": true + }, + { + "name": "funder", + "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": "length_to_add", + "type": "u64" + } + ] + }, + { + "name": "increase_position_length", + "discriminator": [80, 83, 117, 211, 66, 13, 33, 149], + "accounts": [ + { + "name": "funder", + "writable": true, + "signer": true + }, + { + "name": "lb_pair", + "relations": ["position"] + }, + { + "name": "position", + "writable": true + }, + { + "name": "owner", + "signer": true, + "relations": ["position"] + }, + { + "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": "length_to_add", + "type": "u16" + }, + { + "name": "side", + "type": "u8" + } + ] + }, + { + "name": "increase_position_length2", + "discriminator": [255, 210, 204, 71, 115, 137, 225, 113], + "accounts": [ + { + "name": "funder", + "writable": true, + "signer": true + }, + { + "name": "lb_pair", + "relations": ["position"] + }, + { + "name": "position", + "writable": true + }, + { + "name": "owner", + "signer": true, + "relations": ["position"] + }, + { + "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": "minimum_upper_bin_id", + "type": "i32" + } + ] + }, + { + "name": "initialize_bin_array", + "discriminator": [35, 86, 19, 185, 78, 212, 75, 211], + "accounts": [ + { + "name": "lb_pair" + }, + { + "name": "bin_array", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [98, 105, 110, 95, 97, 114, 114, 97, 121] + }, + { + "kind": "account", + "path": "lb_pair" + }, + { + "kind": "arg", + "path": "index" + } + ] + } + }, + { + "name": "funder", + "writable": true, + "signer": true + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + } + ], + "args": [ + { + "name": "index", + "type": "i64" + } + ] + }, + { + "name": "initialize_bin_array_bitmap_extension", + "discriminator": [47, 157, 226, 180, 12, 240, 33, 71], + "accounts": [ + { + "name": "lb_pair" + }, + { + "name": "bin_array_bitmap_extension", + "docs": [ + "Initialize an account to store if a bin array is initialized." + ], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [98, 105, 116, 109, 97, 112] + }, + { + "kind": "account", + "path": "lb_pair" + } + ] + } + }, + { + "name": "funder", + "writable": true, + "signer": true + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "rent", + "address": "SysvarRent111111111111111111111111111111111" + } + ], + "args": [] + }, + { + "name": "initialize_customizable_permissionless_lb_pair", + "discriminator": [46, 39, 41, 135, 111, 183, 200, 64], + "accounts": [ + { + "name": "lb_pair", + "writable": true + }, + { + "name": "bin_array_bitmap_extension", + "writable": true, + "optional": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [98, 105, 116, 109, 97, 112] + }, + { + "kind": "account", + "path": "lb_pair" + } + ] + } + }, + { + "name": "token_mint_x" + }, + { + "name": "token_mint_y" + }, + { + "name": "reserve_x", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "lb_pair" + }, + { + "kind": "account", + "path": "token_mint_x" + } + ] + } + }, + { + "name": "reserve_y", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "lb_pair" + }, + { + "kind": "account", + "path": "token_mint_y" + } + ] + } + }, + { + "name": "oracle", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [111, 114, 97, 99, 108, 101] + }, + { + "kind": "account", + "path": "lb_pair" + } + ] + } + }, + { + "name": "user_token_x" + }, + { + "name": "funder", + "writable": true, + "signer": true + }, + { + "name": "token_program", + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "user_token_y" + }, + { + "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": "CustomizableParams" + } + } + } + ] + }, + { + "name": "initialize_customizable_permissionless_lb_pair2", + "discriminator": [243, 73, 129, 126, 51, 19, 241, 107], + "accounts": [ + { + "name": "lb_pair", + "writable": true + }, + { + "name": "bin_array_bitmap_extension", + "writable": true, + "optional": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [98, 105, 116, 109, 97, 112] + }, + { + "kind": "account", + "path": "lb_pair" + } + ] + } + }, + { + "name": "token_mint_x" + }, + { + "name": "token_mint_y" + }, + { + "name": "reserve_x", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "lb_pair" + }, + { + "kind": "account", + "path": "token_mint_x" + } + ] + } + }, + { + "name": "reserve_y", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "lb_pair" + }, + { + "kind": "account", + "path": "token_mint_y" + } + ] + } + }, + { + "name": "oracle", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [111, 114, 97, 99, 108, 101] + }, + { + "kind": "account", + "path": "lb_pair" + } + ] + } + }, + { + "name": "user_token_x" + }, + { + "name": "funder", + "writable": true, + "signer": true + }, + { + "name": "token_badge_x", + "optional": true + }, + { + "name": "token_badge_y", + "optional": true + }, + { + "name": "token_program_x" + }, + { + "name": "token_program_y" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "user_token_y" + }, + { + "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": "CustomizableParams" + } + } + } + ] + }, + { + "name": "initialize_lb_pair", + "discriminator": [45, 154, 237, 210, 221, 15, 166, 92], + "accounts": [ + { + "name": "lb_pair", + "writable": true + }, + { + "name": "bin_array_bitmap_extension", + "writable": true, + "optional": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [98, 105, 116, 109, 97, 112] + }, + { + "kind": "account", + "path": "lb_pair" + } + ] + } + }, + { + "name": "token_mint_x" + }, + { + "name": "token_mint_y" + }, + { + "name": "reserve_x", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "lb_pair" + }, + { + "kind": "account", + "path": "token_mint_x" + } + ] + } + }, + { + "name": "reserve_y", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "lb_pair" + }, + { + "kind": "account", + "path": "token_mint_y" + } + ] + } + }, + { + "name": "oracle", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [111, 114, 97, 99, 108, 101] + }, + { + "kind": "account", + "path": "lb_pair" + } + ] + } + }, + { + "name": "preset_parameter" + }, + { + "name": "funder", + "writable": true, + "signer": true + }, + { + "name": "token_program", + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "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": "active_id", + "type": "i32" + }, + { + "name": "bin_step", + "type": "u16" + } + ] + }, + { + "name": "initialize_lb_pair2", + "discriminator": [73, 59, 36, 120, 237, 83, 108, 198], + "accounts": [ + { + "name": "lb_pair", + "writable": true + }, + { + "name": "bin_array_bitmap_extension", + "writable": true, + "optional": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [98, 105, 116, 109, 97, 112] + }, + { + "kind": "account", + "path": "lb_pair" + } + ] + } + }, + { + "name": "token_mint_x" + }, + { + "name": "token_mint_y" + }, + { + "name": "reserve_x", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "lb_pair" + }, + { + "kind": "account", + "path": "token_mint_x" + } + ] + } + }, + { + "name": "reserve_y", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "lb_pair" + }, + { + "kind": "account", + "path": "token_mint_y" + } + ] + } + }, + { + "name": "oracle", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [111, 114, 97, 99, 108, 101] + }, + { + "kind": "account", + "path": "lb_pair" + } + ] + } + }, + { + "name": "preset_parameter" + }, + { + "name": "funder", + "writable": true, + "signer": true + }, + { + "name": "token_badge_x", + "optional": true + }, + { + "name": "token_badge_y", + "optional": true + }, + { + "name": "token_program_x" + }, + { + "name": "token_program_y" + }, + { + "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": "InitializeLbPair2Params" + } + } + } + ] + }, + { + "name": "initialize_permission_lb_pair", + "discriminator": [108, 102, 213, 85, 251, 3, 53, 21], + "accounts": [ + { + "name": "base", + "signer": true + }, + { + "name": "lb_pair", + "writable": true + }, + { + "name": "bin_array_bitmap_extension", + "writable": true, + "optional": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [98, 105, 116, 109, 97, 112] + }, + { + "kind": "account", + "path": "lb_pair" + } + ] + } + }, + { + "name": "token_mint_x" + }, + { + "name": "token_mint_y" + }, + { + "name": "reserve_x", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "lb_pair" + }, + { + "kind": "account", + "path": "token_mint_x" + } + ] + } + }, + { + "name": "reserve_y", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "lb_pair" + }, + { + "kind": "account", + "path": "token_mint_y" + } + ] + } + }, + { + "name": "oracle", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [111, 114, 97, 99, 108, 101] + }, + { + "kind": "account", + "path": "lb_pair" + } + ] + } + }, + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "token_badge_x", + "optional": true + }, + { + "name": "token_badge_y", + "optional": true + }, + { + "name": "token_program_x" + }, + { + "name": "token_program_y" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "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": "ix_data", + "type": { + "defined": { + "name": "InitPermissionPairIx" + } + } + } + ] + }, + { + "name": "initialize_position", + "discriminator": [219, 192, 234, 71, 190, 191, 102, 80], + "accounts": [ + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "position", + "writable": true, + "signer": true + }, + { + "name": "lb_pair" + }, + { + "name": "owner", + "signer": true + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "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": "lower_bin_id", + "type": "i32" + }, + { + "name": "width", + "type": "i32" + } + ] + }, + { + "name": "initialize_position2", + "discriminator": [143, 19, 242, 145, 213, 15, 104, 115], + "accounts": [ + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "position", + "writable": true, + "signer": true + }, + { + "name": "lb_pair" + }, + { + "name": "owner", + "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": "lower_bin_id", + "type": "i32" + }, + { + "name": "width", + "type": "i32" + } + ] + }, + { + "name": "initialize_position_by_operator", + "discriminator": [251, 189, 190, 244, 117, 254, 35, 148], + "accounts": [ + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "base", + "signer": true + }, + { + "name": "position", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [112, 111, 115, 105, 116, 105, 111, 110] + }, + { + "kind": "account", + "path": "lb_pair" + }, + { + "kind": "account", + "path": "base" + }, + { + "kind": "arg", + "path": "lower_bin_id" + }, + { + "kind": "arg", + "path": "width" + } + ] + } + }, + { + "name": "lb_pair" + }, + { + "name": "owner" + }, + { + "name": "operator", + "docs": ["operator"], + "signer": true + }, + { + "name": "operator_token_x" + }, + { + "name": "owner_token_x" + }, + { + "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": "lower_bin_id", + "type": "i32" + }, + { + "name": "width", + "type": "i32" + }, + { + "name": "fee_owner", + "type": "pubkey" + }, + { + "name": "lock_release_point", + "type": "u64" + } + ] + }, + { + "name": "initialize_position_pda", + "discriminator": [46, 82, 125, 146, 85, 141, 228, 153], + "accounts": [ + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "base", + "signer": true + }, + { + "name": "position", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [112, 111, 115, 105, 116, 105, 111, 110] + }, + { + "kind": "account", + "path": "lb_pair" + }, + { + "kind": "account", + "path": "base" + }, + { + "kind": "arg", + "path": "lower_bin_id" + }, + { + "kind": "arg", + "path": "width" + } + ] + } + }, + { + "name": "lb_pair" + }, + { + "name": "owner", + "docs": ["owner"], + "signer": true + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "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": "lower_bin_id", + "type": "i32" + }, + { + "name": "width", + "type": "i32" + } + ] + }, + { + "name": "initialize_preset_parameter", + "discriminator": [66, 188, 71, 211, 98, 109, 14, 186], + "accounts": [ + { + "name": "preset_parameter", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, 114, 101, 115, 101, 116, 95, 112, 97, 114, 97, 109, 101, + 116, 101, 114 + ] + }, + { + "kind": "arg", + "path": "ix.bin_step" + }, + { + "kind": "arg", + "path": "ix.base_factor" + } + ] + } + }, + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "name": "rent", + "address": "SysvarRent111111111111111111111111111111111" + } + ], + "args": [ + { + "name": "ix", + "type": { + "defined": { + "name": "InitPresetParametersIx" + } + } + } + ] + }, + { + "name": "initialize_preset_parameter2", + "discriminator": [184, 7, 240, 171, 103, 47, 183, 121], + "accounts": [ + { + "name": "preset_parameter", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 112, 114, 101, 115, 101, 116, 95, 112, 97, 114, 97, 109, 101, + 116, 101, 114, 50 + ] + }, + { + "kind": "arg", + "path": "ix.index" + } + ] + } + }, + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + } + ], + "args": [ + { + "name": "ix", + "type": { + "defined": { + "name": "InitPresetParameters2Ix" + } + } + } + ] + }, + { + "name": "initialize_reward", + "discriminator": [95, 135, 192, 196, 242, 129, 230, 68], + "accounts": [ + { + "name": "lb_pair", + "writable": true + }, + { + "name": "reward_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "lb_pair" + }, + { + "kind": "arg", + "path": "reward_index" + } + ] + } + }, + { + "name": "reward_mint" + }, + { + "name": "token_badge", + "optional": true + }, + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "token_program" + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "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": "reward_index", + "type": "u64" + }, + { + "name": "reward_duration", + "type": "u64" + }, + { + "name": "funder", + "type": "pubkey" + } + ] + }, + { + "name": "initialize_token_badge", + "discriminator": [253, 77, 205, 95, 27, 224, 89, 223], + "accounts": [ + { + "name": "token_mint" + }, + { + "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": "admin", + "writable": true, + "signer": true + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + } + ], + "args": [] + }, + { + "name": "migrate_bin_array", + "discriminator": [17, 23, 159, 211, 101, 184, 41, 241], + "accounts": [ + { + "name": "lb_pair" + } + ], + "args": [] + }, + { + "name": "migrate_position", + "discriminator": [15, 132, 59, 50, 199, 6, 251, 46], + "accounts": [ + { + "name": "position_v2", + "writable": true, + "signer": true + }, + { + "name": "position_v1", + "writable": true + }, + { + "name": "lb_pair", + "relations": ["position_v1", "bin_array_lower", "bin_array_upper"] + }, + { + "name": "bin_array_lower", + "writable": true + }, + { + "name": "bin_array_upper", + "writable": true + }, + { + "name": "owner", + "writable": true, + "signer": true, + "relations": ["position_v1"] + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "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": "rebalance_liquidity", + "discriminator": [92, 4, 176, 193, 119, 185, 83, 9], + "accounts": [ + { + "name": "position", + "writable": true + }, + { + "name": "lb_pair", + "writable": true, + "relations": ["position", "bin_array_bitmap_extension"] + }, + { + "name": "bin_array_bitmap_extension", + "writable": true, + "optional": true + }, + { + "name": "user_token_x", + "writable": true + }, + { + "name": "user_token_y", + "writable": true + }, + { + "name": "reserve_x", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "reserve_y", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "token_x_mint", + "relations": ["lb_pair"] + }, + { + "name": "token_y_mint", + "relations": ["lb_pair"] + }, + { + "name": "owner", + "signer": true, + "relations": ["position"] + }, + { + "name": "rent_payer", + "writable": true, + "signer": true + }, + { + "name": "token_x_program" + }, + { + "name": "token_y_program" + }, + { + "name": "memo_program", + "address": "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr" + }, + { + "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": "RebalanceLiquidityParams" + } + } + }, + { + "name": "remaining_accounts_info", + "type": { + "defined": { + "name": "RemainingAccountsInfo" + } + } + } + ] + }, + { + "name": "remove_all_liquidity", + "discriminator": [10, 51, 61, 35, 112, 105, 24, 85], + "accounts": [ + { + "name": "position", + "writable": true + }, + { + "name": "lb_pair", + "writable": true, + "relations": [ + "position", + "bin_array_bitmap_extension", + "bin_array_lower", + "bin_array_upper" + ] + }, + { + "name": "bin_array_bitmap_extension", + "writable": true, + "optional": true + }, + { + "name": "user_token_x", + "writable": true + }, + { + "name": "user_token_y", + "writable": true + }, + { + "name": "reserve_x", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "reserve_y", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "token_x_mint", + "relations": ["lb_pair"] + }, + { + "name": "token_y_mint", + "relations": ["lb_pair"] + }, + { + "name": "bin_array_lower", + "writable": true + }, + { + "name": "bin_array_upper", + "writable": true + }, + { + "name": "sender", + "signer": true + }, + { + "name": "token_x_program", + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "token_y_program", + "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": "remove_liquidity", + "discriminator": [80, 85, 209, 72, 24, 206, 177, 108], + "accounts": [ + { + "name": "position", + "writable": true + }, + { + "name": "lb_pair", + "writable": true, + "relations": [ + "position", + "bin_array_bitmap_extension", + "bin_array_lower", + "bin_array_upper" + ] + }, + { + "name": "bin_array_bitmap_extension", + "writable": true, + "optional": true + }, + { + "name": "user_token_x", + "writable": true + }, + { + "name": "user_token_y", + "writable": true + }, + { + "name": "reserve_x", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "reserve_y", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "token_x_mint", + "relations": ["lb_pair"] + }, + { + "name": "token_y_mint", + "relations": ["lb_pair"] + }, + { + "name": "bin_array_lower", + "writable": true + }, + { + "name": "bin_array_upper", + "writable": true + }, + { + "name": "sender", + "signer": true + }, + { + "name": "token_x_program", + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "token_y_program", + "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": "bin_liquidity_removal", + "type": { + "vec": { + "defined": { + "name": "BinLiquidityReduction" + } + } + } + } + ] + }, + { + "name": "remove_liquidity2", + "discriminator": [230, 215, 82, 127, 241, 101, 227, 146], + "accounts": [ + { + "name": "position", + "writable": true + }, + { + "name": "lb_pair", + "writable": true, + "relations": ["position", "bin_array_bitmap_extension"] + }, + { + "name": "bin_array_bitmap_extension", + "writable": true, + "optional": true + }, + { + "name": "user_token_x", + "writable": true + }, + { + "name": "user_token_y", + "writable": true + }, + { + "name": "reserve_x", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "reserve_y", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "token_x_mint", + "relations": ["lb_pair"] + }, + { + "name": "token_y_mint", + "relations": ["lb_pair"] + }, + { + "name": "sender", + "signer": true + }, + { + "name": "token_x_program" + }, + { + "name": "token_y_program" + }, + { + "name": "memo_program", + "address": "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr" + }, + { + "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": "bin_liquidity_removal", + "type": { + "vec": { + "defined": { + "name": "BinLiquidityReduction" + } + } + } + }, + { + "name": "remaining_accounts_info", + "type": { + "defined": { + "name": "RemainingAccountsInfo" + } + } + } + ] + }, + { + "name": "remove_liquidity_by_range", + "discriminator": [26, 82, 102, 152, 240, 74, 105, 26], + "accounts": [ + { + "name": "position", + "writable": true + }, + { + "name": "lb_pair", + "writable": true, + "relations": [ + "position", + "bin_array_bitmap_extension", + "bin_array_lower", + "bin_array_upper" + ] + }, + { + "name": "bin_array_bitmap_extension", + "writable": true, + "optional": true + }, + { + "name": "user_token_x", + "writable": true + }, + { + "name": "user_token_y", + "writable": true + }, + { + "name": "reserve_x", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "reserve_y", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "token_x_mint", + "relations": ["lb_pair"] + }, + { + "name": "token_y_mint", + "relations": ["lb_pair"] + }, + { + "name": "bin_array_lower", + "writable": true + }, + { + "name": "bin_array_upper", + "writable": true + }, + { + "name": "sender", + "signer": true + }, + { + "name": "token_x_program", + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "token_y_program", + "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": "from_bin_id", + "type": "i32" + }, + { + "name": "to_bin_id", + "type": "i32" + }, + { + "name": "bps_to_remove", + "type": "u16" + } + ] + }, + { + "name": "remove_liquidity_by_range2", + "discriminator": [204, 2, 195, 145, 53, 145, 145, 205], + "accounts": [ + { + "name": "position", + "writable": true + }, + { + "name": "lb_pair", + "writable": true, + "relations": ["position", "bin_array_bitmap_extension"] + }, + { + "name": "bin_array_bitmap_extension", + "writable": true, + "optional": true + }, + { + "name": "user_token_x", + "writable": true + }, + { + "name": "user_token_y", + "writable": true + }, + { + "name": "reserve_x", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "reserve_y", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "token_x_mint", + "relations": ["lb_pair"] + }, + { + "name": "token_y_mint", + "relations": ["lb_pair"] + }, + { + "name": "sender", + "signer": true + }, + { + "name": "token_x_program" + }, + { + "name": "token_y_program" + }, + { + "name": "memo_program", + "address": "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr" + }, + { + "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": "from_bin_id", + "type": "i32" + }, + { + "name": "to_bin_id", + "type": "i32" + }, + { + "name": "bps_to_remove", + "type": "u16" + }, + { + "name": "remaining_accounts_info", + "type": { + "defined": { + "name": "RemainingAccountsInfo" + } + } + } + ] + }, + { + "name": "set_activation_point", + "discriminator": [91, 249, 15, 165, 26, 129, 254, 125], + "accounts": [ + { + "name": "lb_pair", + "writable": true + }, + { + "name": "admin", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "activation_point", + "type": "u64" + } + ] + }, + { + "name": "set_pair_status", + "discriminator": [67, 248, 231, 137, 154, 149, 217, 174], + "accounts": [ + { + "name": "lb_pair", + "writable": true + }, + { + "name": "admin", + "signer": true + } + ], + "args": [ + { + "name": "status", + "type": "u8" + } + ] + }, + { + "name": "set_pair_status_permissionless", + "discriminator": [78, 59, 152, 211, 70, 183, 46, 208], + "accounts": [ + { + "name": "lb_pair", + "writable": true + }, + { + "name": "creator", + "signer": true, + "relations": ["lb_pair"] + } + ], + "args": [ + { + "name": "status", + "type": "u8" + } + ] + }, + { + "name": "set_pre_activation_duration", + "discriminator": [165, 61, 201, 244, 130, 159, 22, 100], + "accounts": [ + { + "name": "lb_pair", + "writable": true + }, + { + "name": "creator", + "signer": true, + "relations": ["lb_pair"] + } + ], + "args": [ + { + "name": "pre_activation_duration", + "type": "u64" + } + ] + }, + { + "name": "set_pre_activation_swap_address", + "discriminator": [57, 139, 47, 123, 216, 80, 223, 10], + "accounts": [ + { + "name": "lb_pair", + "writable": true + }, + { + "name": "creator", + "signer": true, + "relations": ["lb_pair"] + } + ], + "args": [ + { + "name": "pre_activation_swap_address", + "type": "pubkey" + } + ] + }, + { + "name": "swap", + "discriminator": [248, 198, 158, 145, 225, 117, 135, 200], + "accounts": [ + { + "name": "lb_pair", + "writable": true, + "relations": ["bin_array_bitmap_extension"] + }, + { + "name": "bin_array_bitmap_extension", + "optional": true + }, + { + "name": "reserve_x", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "reserve_y", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "user_token_in", + "writable": true + }, + { + "name": "user_token_out", + "writable": true + }, + { + "name": "token_x_mint", + "relations": ["lb_pair"] + }, + { + "name": "token_y_mint", + "relations": ["lb_pair"] + }, + { + "name": "oracle", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "host_fee_in", + "writable": true, + "optional": true + }, + { + "name": "user", + "signer": true + }, + { + "name": "token_x_program", + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "token_y_program", + "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": "min_amount_out", + "type": "u64" + } + ] + }, + { + "name": "swap2", + "discriminator": [65, 75, 63, 76, 235, 91, 91, 136], + "accounts": [ + { + "name": "lb_pair", + "writable": true, + "relations": ["bin_array_bitmap_extension"] + }, + { + "name": "bin_array_bitmap_extension", + "optional": true + }, + { + "name": "reserve_x", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "reserve_y", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "user_token_in", + "writable": true + }, + { + "name": "user_token_out", + "writable": true + }, + { + "name": "token_x_mint", + "relations": ["lb_pair"] + }, + { + "name": "token_y_mint", + "relations": ["lb_pair"] + }, + { + "name": "oracle", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "host_fee_in", + "writable": true, + "optional": true + }, + { + "name": "user", + "signer": true + }, + { + "name": "token_x_program" + }, + { + "name": "token_y_program" + }, + { + "name": "memo_program", + "address": "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr" + }, + { + "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": "min_amount_out", + "type": "u64" + }, + { + "name": "remaining_accounts_info", + "type": { + "defined": { + "name": "RemainingAccountsInfo" + } + } + } + ] + }, + { + "name": "swap_exact_out", + "discriminator": [250, 73, 101, 33, 38, 207, 75, 184], + "accounts": [ + { + "name": "lb_pair", + "writable": true, + "relations": ["bin_array_bitmap_extension"] + }, + { + "name": "bin_array_bitmap_extension", + "optional": true + }, + { + "name": "reserve_x", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "reserve_y", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "user_token_in", + "writable": true + }, + { + "name": "user_token_out", + "writable": true + }, + { + "name": "token_x_mint", + "relations": ["lb_pair"] + }, + { + "name": "token_y_mint", + "relations": ["lb_pair"] + }, + { + "name": "oracle", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "host_fee_in", + "writable": true, + "optional": true + }, + { + "name": "user", + "signer": true + }, + { + "name": "token_x_program", + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "token_y_program", + "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": "max_in_amount", + "type": "u64" + }, + { + "name": "out_amount", + "type": "u64" + } + ] + }, + { + "name": "swap_exact_out2", + "discriminator": [43, 215, 247, 132, 137, 60, 243, 81], + "accounts": [ + { + "name": "lb_pair", + "writable": true, + "relations": ["bin_array_bitmap_extension"] + }, + { + "name": "bin_array_bitmap_extension", + "optional": true + }, + { + "name": "reserve_x", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "reserve_y", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "user_token_in", + "writable": true + }, + { + "name": "user_token_out", + "writable": true + }, + { + "name": "token_x_mint", + "relations": ["lb_pair"] + }, + { + "name": "token_y_mint", + "relations": ["lb_pair"] + }, + { + "name": "oracle", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "host_fee_in", + "writable": true, + "optional": true + }, + { + "name": "user", + "signer": true + }, + { + "name": "token_x_program" + }, + { + "name": "token_y_program" + }, + { + "name": "memo_program", + "address": "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr" + }, + { + "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_in_amount", + "type": "u64" + }, + { + "name": "out_amount", + "type": "u64" + }, + { + "name": "remaining_accounts_info", + "type": { + "defined": { + "name": "RemainingAccountsInfo" + } + } + } + ] + }, + { + "name": "swap_with_price_impact", + "discriminator": [56, 173, 230, 208, 173, 228, 156, 205], + "accounts": [ + { + "name": "lb_pair", + "writable": true, + "relations": ["bin_array_bitmap_extension"] + }, + { + "name": "bin_array_bitmap_extension", + "optional": true + }, + { + "name": "reserve_x", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "reserve_y", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "user_token_in", + "writable": true + }, + { + "name": "user_token_out", + "writable": true + }, + { + "name": "token_x_mint", + "relations": ["lb_pair"] + }, + { + "name": "token_y_mint", + "relations": ["lb_pair"] + }, + { + "name": "oracle", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "host_fee_in", + "writable": true, + "optional": true + }, + { + "name": "user", + "signer": true + }, + { + "name": "token_x_program", + "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + }, + { + "name": "token_y_program", + "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": "active_id", + "type": { + "option": "i32" + } + }, + { + "name": "max_price_impact_bps", + "type": "u16" + } + ] + }, + { + "name": "swap_with_price_impact2", + "discriminator": [74, 98, 192, 214, 177, 51, 75, 51], + "accounts": [ + { + "name": "lb_pair", + "writable": true, + "relations": ["bin_array_bitmap_extension"] + }, + { + "name": "bin_array_bitmap_extension", + "optional": true + }, + { + "name": "reserve_x", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "reserve_y", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "user_token_in", + "writable": true + }, + { + "name": "user_token_out", + "writable": true + }, + { + "name": "token_x_mint", + "relations": ["lb_pair"] + }, + { + "name": "token_y_mint", + "relations": ["lb_pair"] + }, + { + "name": "oracle", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "host_fee_in", + "writable": true, + "optional": true + }, + { + "name": "user", + "signer": true + }, + { + "name": "token_x_program" + }, + { + "name": "token_y_program" + }, + { + "name": "memo_program", + "address": "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr" + }, + { + "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": "active_id", + "type": { + "option": "i32" + } + }, + { + "name": "max_price_impact_bps", + "type": "u16" + }, + { + "name": "remaining_accounts_info", + "type": { + "defined": { + "name": "RemainingAccountsInfo" + } + } + } + ] + }, + { + "name": "update_base_fee_parameters", + "discriminator": [75, 168, 223, 161, 16, 195, 3, 47], + "accounts": [ + { + "name": "lb_pair", + "writable": true + }, + { + "name": "admin", + "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": "fee_parameter", + "type": { + "defined": { + "name": "BaseFeeParameter" + } + } + } + ] + }, + { + "name": "update_dynamic_fee_parameters", + "discriminator": [92, 161, 46, 246, 255, 189, 22, 22], + "accounts": [ + { + "name": "lb_pair", + "writable": true + }, + { + "name": "admin", + "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": "fee_parameter", + "type": { + "defined": { + "name": "DynamicFeeParameter" + } + } + } + ] + }, + { + "name": "update_fees_and_reward2", + "discriminator": [32, 142, 184, 154, 103, 65, 184, 88], + "accounts": [ + { + "name": "position", + "writable": true + }, + { + "name": "lb_pair", + "writable": true, + "relations": ["position"] + }, + { + "name": "owner", + "signer": true + } + ], + "args": [ + { + "name": "min_bin_id", + "type": "i32" + }, + { + "name": "max_bin_id", + "type": "i32" + } + ] + }, + { + "name": "update_fees_and_rewards", + "discriminator": [154, 230, 250, 13, 236, 209, 75, 223], + "accounts": [ + { + "name": "position", + "writable": true + }, + { + "name": "lb_pair", + "writable": true, + "relations": ["position", "bin_array_lower", "bin_array_upper"] + }, + { + "name": "bin_array_lower", + "writable": true + }, + { + "name": "bin_array_upper", + "writable": true + }, + { + "name": "owner", + "signer": true + } + ], + "args": [] + }, + { + "name": "update_position_operator", + "discriminator": [202, 184, 103, 143, 180, 191, 116, 217], + "accounts": [ + { + "name": "position", + "writable": true + }, + { + "name": "owner", + "signer": true, + "relations": ["position"] + }, + { + "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": "operator", + "type": "pubkey" + } + ] + }, + { + "name": "update_reward_duration", + "discriminator": [138, 174, 196, 169, 213, 235, 254, 107], + "accounts": [ + { + "name": "lb_pair", + "writable": true, + "relations": ["bin_array"] + }, + { + "name": "admin", + "signer": true + }, + { + "name": "bin_array", + "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": "reward_index", + "type": "u64" + }, + { + "name": "new_duration", + "type": "u64" + } + ] + }, + { + "name": "update_reward_funder", + "discriminator": [211, 28, 48, 32, 215, 160, 35, 23], + "accounts": [ + { + "name": "lb_pair", + "writable": true + }, + { + "name": "admin", + "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": "u64" + }, + { + "name": "new_funder", + "type": "pubkey" + } + ] + }, + { + "name": "withdraw_ineligible_reward", + "discriminator": [148, 206, 42, 195, 247, 49, 103, 8], + "accounts": [ + { + "name": "lb_pair", + "writable": true, + "relations": ["bin_array"] + }, + { + "name": "reward_vault", + "writable": true + }, + { + "name": "reward_mint" + }, + { + "name": "funder_token_account", + "writable": true + }, + { + "name": "funder", + "signer": true + }, + { + "name": "bin_array", + "writable": true + }, + { + "name": "token_program" + }, + { + "name": "memo_program", + "address": "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr" + }, + { + "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": "u64" + }, + { + "name": "remaining_accounts_info", + "type": { + "defined": { + "name": "RemainingAccountsInfo" + } + } + } + ] + }, + { + "name": "withdraw_protocol_fee", + "discriminator": [158, 201, 158, 189, 33, 93, 162, 103], + "accounts": [ + { + "name": "lb_pair", + "writable": true + }, + { + "name": "reserve_x", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "reserve_y", + "writable": true, + "relations": ["lb_pair"] + }, + { + "name": "token_x_mint", + "relations": ["lb_pair"] + }, + { + "name": "token_y_mint", + "relations": ["lb_pair"] + }, + { + "name": "receiver_token_x", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 8, 234, 192, 109, 87, 125, 190, 55, 129, 173, 227, 8, 104, + 201, 104, 13, 31, 178, 74, 80, 54, 14, 77, 78, 226, 57, 47, + 122, 166, 165, 57, 144 + ] + }, + { + "kind": "account", + "path": "token_x_program" + }, + { + "kind": "account", + "path": "token_x_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": "receiver_token_y", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 8, 234, 192, 109, 87, 125, 190, 55, 129, 173, 227, 8, 104, + 201, 104, 13, 31, 178, 74, 80, 54, 14, 77, 78, 226, 57, 47, + 122, 166, 165, 57, 144 + ] + }, + { + "kind": "account", + "path": "token_y_program" + }, + { + "kind": "account", + "path": "token_y_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": "claim_fee_operator" + }, + { + "name": "operator", + "docs": ["operator"], + "signer": true, + "relations": ["claim_fee_operator"] + }, + { + "name": "token_x_program" + }, + { + "name": "token_y_program" + }, + { + "name": "memo_program", + "address": "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr" + } + ], + "args": [ + { + "name": "max_amount_x", + "type": "u64" + }, + { + "name": "max_amount_y", + "type": "u64" + }, + { + "name": "remaining_accounts_info", + "type": { + "defined": { + "name": "RemainingAccountsInfo" + } + } + } + ] + } + ], + "accounts": [ + { + "name": "BinArray", + "discriminator": [92, 142, 92, 220, 5, 148, 70, 181] + }, + { + "name": "BinArrayBitmapExtension", + "discriminator": [80, 111, 124, 113, 55, 237, 18, 5] + }, + { + "name": "ClaimFeeOperator", + "discriminator": [166, 48, 134, 86, 34, 200, 188, 150] + }, + { + "name": "DummyZcAccount", + "discriminator": [94, 107, 238, 80, 208, 48, 180, 8] + }, + { + "name": "LbPair", + "discriminator": [33, 11, 49, 98, 181, 101, 177, 13] + }, + { + "name": "Oracle", + "discriminator": [139, 194, 131, 179, 140, 179, 229, 244] + }, + { + "name": "Position", + "discriminator": [170, 188, 143, 228, 122, 64, 247, 208] + }, + { + "name": "PositionV2", + "discriminator": [117, 176, 212, 199, 245, 180, 133, 182] + }, + { + "name": "PresetParameter", + "discriminator": [242, 62, 244, 34, 181, 112, 58, 170] + }, + { + "name": "PresetParameter2", + "discriminator": [171, 236, 148, 115, 162, 113, 222, 174] + }, + { + "name": "TokenBadge", + "discriminator": [116, 219, 204, 229, 249, 116, 255, 150] + } + ], + "events": [ + { + "name": "AddLiquidity", + "discriminator": [31, 94, 125, 90, 227, 52, 61, 186] + }, + { + "name": "ClaimFee", + "discriminator": [75, 122, 154, 48, 140, 74, 123, 163] + }, + { + "name": "ClaimFee2", + "discriminator": [232, 171, 242, 97, 58, 77, 35, 45] + }, + { + "name": "ClaimReward", + "discriminator": [148, 116, 134, 204, 22, 171, 85, 95] + }, + { + "name": "ClaimReward2", + "discriminator": [27, 143, 244, 33, 80, 43, 110, 146] + }, + { + "name": "CompositionFee", + "discriminator": [128, 151, 123, 106, 17, 102, 113, 142] + }, + { + "name": "DecreasePositionLength", + "discriminator": [52, 118, 235, 85, 172, 169, 15, 128] + }, + { + "name": "DynamicFeeParameterUpdate", + "discriminator": [88, 88, 178, 135, 194, 146, 91, 243] + }, + { + "name": "FeeParameterUpdate", + "discriminator": [48, 76, 241, 117, 144, 215, 242, 44] + }, + { + "name": "FundReward", + "discriminator": [246, 228, 58, 130, 145, 170, 79, 204] + }, + { + "name": "GoToABin", + "discriminator": [59, 138, 76, 68, 138, 131, 176, 67] + }, + { + "name": "IncreaseObservation", + "discriminator": [99, 249, 17, 121, 166, 156, 207, 215] + }, + { + "name": "IncreasePositionLength", + "discriminator": [157, 239, 42, 204, 30, 56, 223, 46] + }, + { + "name": "InitializeReward", + "discriminator": [211, 153, 88, 62, 149, 60, 177, 70] + }, + { + "name": "LbPairCreate", + "discriminator": [185, 74, 252, 125, 27, 215, 188, 111] + }, + { + "name": "PositionClose", + "discriminator": [255, 196, 16, 107, 28, 202, 53, 128] + }, + { + "name": "PositionCreate", + "discriminator": [144, 142, 252, 84, 157, 53, 37, 121] + }, + { + "name": "Rebalancing", + "discriminator": [0, 109, 117, 179, 61, 91, 199, 200] + }, + { + "name": "RemoveLiquidity", + "discriminator": [116, 244, 97, 232, 103, 31, 152, 58] + }, + { + "name": "Swap", + "discriminator": [81, 108, 227, 190, 205, 208, 10, 196] + }, + { + "name": "UpdatePositionLockReleasePoint", + "discriminator": [133, 214, 66, 224, 64, 12, 7, 191] + }, + { + "name": "UpdatePositionOperator", + "discriminator": [39, 115, 48, 204, 246, 47, 66, 57] + }, + { + "name": "UpdateRewardDuration", + "discriminator": [223, 245, 224, 153, 49, 29, 163, 172] + }, + { + "name": "UpdateRewardFunder", + "discriminator": [224, 178, 174, 74, 252, 165, 85, 180] + }, + { + "name": "WithdrawIneligibleReward", + "discriminator": [231, 189, 65, 149, 102, 215, 154, 244] + } + ], + "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" + }, + { + "code": 6083, + "name": "InvalidRebalanceParameters", + "msg": "Invalid rebalance parameters" + }, + { + "code": 6084, + "name": "InvalidRewardAccounts", + "msg": "Invalid reward accounts" + }, + { + "code": 6085, + "name": "UndeterminedError", + "msg": "Undetermined error" + }, + { + "code": 6086, + "name": "ReallocExceedMaxLengthPerInstruction", + "msg": "Realloc exceed max length per instruction" + }, + { + "code": 6087, + "name": "InvalidBaseFeeMantissa", + "msg": "Mantissa cannot more than two significant digits" + }, + { + "code": 6088, + "name": "InvalidPositionOwner", + "msg": "Invalid position owner" + }, + { + "code": 6089, + "name": "InvalidPoolAddress", + "msg": "Invalid pool address" + } + ], + "types": [ + { + "name": "AccountsType", + "type": { + "kind": "enum", + "variants": [ + { + "name": "TransferHookX" + }, + { + "name": "TransferHookY" + }, + { + "name": "TransferHookReward" + }, + { + "name": "TransferHookMultiReward", + "fields": ["u8"] + } + ] + } + }, + { + "name": "ActivationType", + "docs": ["Type of the activation"], + "repr": { + "kind": "rust" + }, + "type": { + "kind": "enum", + "variants": [ + { + "name": "Slot" + }, + { + "name": "Timestamp" + } + ] + } + }, + { + "name": "AddLiquidity", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lb_pair", + "type": "pubkey" + }, + { + "name": "from", + "type": "pubkey" + }, + { + "name": "position", + "type": "pubkey" + }, + { + "name": "amounts", + "type": { + "array": ["u64", 2] + } + }, + { + "name": "active_bin_id", + "type": "i32" + } + ] + } + }, + { + "name": "AddLiquidityParams", + "type": { + "kind": "struct", + "fields": [ + { + "name": "min_delta_id", + "type": "i32" + }, + { + "name": "max_delta_id", + "type": "i32" + }, + { + "name": "x0", + "type": "u64" + }, + { + "name": "y0", + "type": "u64" + }, + { + "name": "delta_x", + "type": "u64" + }, + { + "name": "delta_y", + "type": "u64" + }, + { + "name": "bit_flag", + "type": "u8" + }, + { + "name": "favor_x_in_active_id", + "type": "bool" + }, + { + "name": "padding", + "type": { + "array": ["u8", 16] + } + } + ] + } + }, + { + "name": "AddLiquiditySingleSidePreciseParameter", + "type": { + "kind": "struct", + "fields": [ + { + "name": "bins", + "type": { + "vec": { + "defined": { + "name": "CompressedBinDepositAmount" + } + } + } + }, + { + "name": "decompress_multiplier", + "type": "u64" + } + ] + } + }, + { + "name": "AddLiquiditySingleSidePreciseParameter2", + "type": { + "kind": "struct", + "fields": [ + { + "name": "bins", + "type": { + "vec": { + "defined": { + "name": "CompressedBinDepositAmount" + } + } + } + }, + { + "name": "decompress_multiplier", + "type": "u64" + }, + { + "name": "max_amount", + "type": "u64" + } + ] + } + }, + { + "name": "BaseFeeParameter", + "type": { + "kind": "struct", + "fields": [ + { + "name": "protocol_share", + "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": "base_factor", + "docs": ["Base factor for base fee rate"], + "type": "u16" + }, + { + "name": "base_fee_power_factor", + "docs": ["Base fee power factor"], + "type": "u8" + } + ] + } + }, + { + "name": "Bin", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "amount_x", + "docs": [ + "Amount of token X in the bin. This already excluded protocol fees." + ], + "type": "u64" + }, + { + "name": "amount_y", + "docs": [ + "Amount of token Y in the bin. This already excluded protocol fees." + ], + "type": "u64" + }, + { + "name": "price", + "docs": ["Bin price"], + "type": "u128" + }, + { + "name": "liquidity_supply", + "docs": [ + "Liquidities of the bin. This is the same as LP mint supply. q-number" + ], + "type": "u128" + }, + { + "name": "reward_per_token_stored", + "docs": ["reward_a_per_token_stored"], + "type": { + "array": ["u128", 2] + } + }, + { + "name": "fee_amount_x_per_token_stored", + "docs": ["Swap fee amount of token X per liquidity deposited."], + "type": "u128" + }, + { + "name": "fee_amount_y_per_token_stored", + "docs": ["Swap fee amount of token Y per liquidity deposited."], + "type": "u128" + }, + { + "name": "amount_x_in", + "docs": [ + "Total token X swap into the bin. Only used for tracking purpose." + ], + "type": "u128" + }, + { + "name": "amount_y_in", + "docs": [ + "Total token Y swap into he bin. Only used for tracking purpose." + ], + "type": "u128" + } + ] + } + }, + { + "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, ..." + ], + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "index", + "type": "i64" + }, + { + "name": "version", + "docs": ["Version of binArray"], + "type": "u8" + }, + { + "name": "_padding", + "type": { + "array": ["u8", 7] + } + }, + { + "name": "lb_pair", + "type": "pubkey" + }, + { + "name": "bins", + "type": { + "array": [ + { + "defined": { + "name": "Bin" + } + }, + 70 + ] + } + } + ] + } + }, + { + "name": "BinArrayBitmapExtension", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "lb_pair", + "type": "pubkey" + }, + { + "name": "positive_bin_array_bitmap", + "docs": [ + "Packed initialized bin array state for start_bin_index is positive" + ], + "type": { + "array": [ + { + "array": ["u64", 8] + }, + 12 + ] + } + }, + { + "name": "negative_bin_array_bitmap", + "docs": [ + "Packed initialized bin array state for start_bin_index is negative" + ], + "type": { + "array": [ + { + "array": ["u64", 8] + }, + 12 + ] + } + } + ] + } + }, + { + "name": "BinLiquidityDistribution", + "type": { + "kind": "struct", + "fields": [ + { + "name": "bin_id", + "docs": ["Define the bin ID wish to deposit to."], + "type": "i32" + }, + { + "name": "distribution_x", + "docs": [ + "DistributionX (or distributionY) is the percentages of amountX (or amountY) you want to add to each bin." + ], + "type": "u16" + }, + { + "name": "distribution_y", + "docs": [ + "DistributionX (or distributionY) is the percentages of amountX (or amountY) you want to add to each bin." + ], + "type": "u16" + } + ] + } + }, + { + "name": "BinLiquidityDistributionByWeight", + "type": { + "kind": "struct", + "fields": [ + { + "name": "bin_id", + "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": "BinLiquidityReduction", + "type": { + "kind": "struct", + "fields": [ + { + "name": "bin_id", + "type": "i32" + }, + { + "name": "bps_to_remove", + "type": "u16" + } + ] + } + }, + { + "name": "ClaimFee", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lb_pair", + "type": "pubkey" + }, + { + "name": "position", + "type": "pubkey" + }, + { + "name": "owner", + "type": "pubkey" + }, + { + "name": "fee_x", + "type": "u64" + }, + { + "name": "fee_y", + "type": "u64" + } + ] + } + }, + { + "name": "ClaimFee2", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lb_pair", + "type": "pubkey" + }, + { + "name": "position", + "type": "pubkey" + }, + { + "name": "owner", + "type": "pubkey" + }, + { + "name": "fee_x", + "type": "u64" + }, + { + "name": "fee_y", + "type": "u64" + }, + { + "name": "active_bin_id", + "type": "i32" + } + ] + } + }, + { + "name": "ClaimFeeOperator", + "docs": ["Parameter that set by the protocol"], + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "operator", + "docs": ["operator"], + "type": "pubkey" + }, + { + "name": "_padding", + "docs": ["Reserve"], + "type": { + "array": ["u8", 128] + } + } + ] + } + }, + { + "name": "ClaimReward", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lb_pair", + "type": "pubkey" + }, + { + "name": "position", + "type": "pubkey" + }, + { + "name": "owner", + "type": "pubkey" + }, + { + "name": "reward_index", + "type": "u64" + }, + { + "name": "total_reward", + "type": "u64" + } + ] + } + }, + { + "name": "ClaimReward2", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lb_pair", + "type": "pubkey" + }, + { + "name": "position", + "type": "pubkey" + }, + { + "name": "owner", + "type": "pubkey" + }, + { + "name": "reward_index", + "type": "u64" + }, + { + "name": "total_reward", + "type": "u64" + }, + { + "name": "active_bin_id", + "type": "i32" + } + ] + } + }, + { + "name": "CompositionFee", + "type": { + "kind": "struct", + "fields": [ + { + "name": "from", + "type": "pubkey" + }, + { + "name": "bin_id", + "type": "i16" + }, + { + "name": "token_x_fee_amount", + "type": "u64" + }, + { + "name": "token_y_fee_amount", + "type": "u64" + }, + { + "name": "protocol_token_x_fee_amount", + "type": "u64" + }, + { + "name": "protocol_token_y_fee_amount", + "type": "u64" + } + ] + } + }, + { + "name": "CompressedBinDepositAmount", + "type": { + "kind": "struct", + "fields": [ + { + "name": "bin_id", + "type": "i32" + }, + { + "name": "amount", + "type": "u32" + } + ] + } + }, + { + "name": "CustomizableParams", + "type": { + "kind": "struct", + "fields": [ + { + "name": "active_id", + "docs": ["Pool price"], + "type": "i32" + }, + { + "name": "bin_step", + "docs": ["Bin step"], + "type": "u16" + }, + { + "name": "base_factor", + "docs": ["Base factor"], + "type": "u16" + }, + { + "name": "activation_type", + "docs": [ + "Activation type. 0 = Slot, 1 = Time. Check ActivationType enum" + ], + "type": "u8" + }, + { + "name": "has_alpha_vault", + "docs": ["Whether the pool has an alpha vault"], + "type": "bool" + }, + { + "name": "activation_point", + "docs": ["Decide when does the pool start trade. None = Now"], + "type": { + "option": "u64" + } + }, + { + "name": "creator_pool_on_off_control", + "docs": [ + "Pool creator have permission to enable/disable pool with restricted program validation. Only applicable for customizable permissionless pool." + ], + "type": "bool" + }, + { + "name": "base_fee_power_factor", + "docs": ["Base fee power factor"], + "type": "u8" + }, + { + "name": "padding", + "docs": ["Padding, for future use"], + "type": { + "array": ["u8", 62] + } + } + ] + } + }, + { + "name": "DecreasePositionLength", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lb_pair", + "type": "pubkey" + }, + { + "name": "position", + "type": "pubkey" + }, + { + "name": "owner", + "type": "pubkey" + }, + { + "name": "length_to_remove", + "type": "u16" + }, + { + "name": "side", + "type": "u8" + } + ] + } + }, + { + "name": "DummyIx", + "type": { + "kind": "struct", + "fields": [ + { + "name": "_pair_status", + "type": { + "defined": { + "name": "PairStatus" + } + } + }, + { + "name": "_pair_type", + "type": { + "defined": { + "name": "PairType" + } + } + }, + { + "name": "_activation_type", + "type": { + "defined": { + "name": "ActivationType" + } + } + }, + { + "name": "_token_program_flag", + "type": { + "defined": { + "name": "TokenProgramFlags" + } + } + }, + { + "name": "_resize_side", + "type": { + "defined": { + "name": "ResizeSide" + } + } + }, + { + "name": "_rounding", + "type": { + "defined": { + "name": "Rounding" + } + } + } + ] + } + }, + { + "name": "DummyZcAccount", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "position_bin_data", + "type": { + "defined": { + "name": "PositionBinData" + } + } + } + ] + } + }, + { + "name": "DynamicFeeParameter", + "type": { + "kind": "struct", + "fields": [ + { + "name": "filter_period", + "docs": [ + "Filter period determine high frequency trading time window." + ], + "type": "u16" + }, + { + "name": "decay_period", + "docs": [ + "Decay period determine when the volatile fee start decay / decrease." + ], + "type": "u16" + }, + { + "name": "reduction_factor", + "docs": [ + "Reduction factor controls the volatile fee rate decrement rate." + ], + "type": "u16" + }, + { + "name": "variable_fee_control", + "docs": [ + "Used to scale the variable fee component depending on the dynamic of the market" + ], + "type": "u32" + }, + { + "name": "max_volatility_accumulator", + "docs": [ + "Maximum number of bin crossed can be accumulated. Used to cap volatile fee rate." + ], + "type": "u32" + } + ] + } + }, + { + "name": "DynamicFeeParameterUpdate", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lb_pair", + "type": "pubkey" + }, + { + "name": "filter_period", + "docs": [ + "Filter period determine high frequency trading time window." + ], + "type": "u16" + }, + { + "name": "decay_period", + "docs": [ + "Decay period determine when the volatile fee start decay / decrease." + ], + "type": "u16" + }, + { + "name": "reduction_factor", + "docs": [ + "Reduction factor controls the volatile fee rate decrement rate." + ], + "type": "u16" + }, + { + "name": "variable_fee_control", + "docs": [ + "Used to scale the variable fee component depending on the dynamic of the market" + ], + "type": "u32" + }, + { + "name": "max_volatility_accumulator", + "docs": [ + "Maximum number of bin crossed can be accumulated. Used to cap volatile fee rate." + ], + "type": "u32" + } + ] + } + }, + { + "name": "FeeInfo", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "fee_x_per_token_complete", + "type": "u128" + }, + { + "name": "fee_y_per_token_complete", + "type": "u128" + }, + { + "name": "fee_x_pending", + "type": "u64" + }, + { + "name": "fee_y_pending", + "type": "u64" + } + ] + } + }, + { + "name": "FeeParameterUpdate", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lb_pair", + "type": "pubkey" + }, + { + "name": "protocol_share", + "type": "u16" + }, + { + "name": "base_factor", + "type": "u16" + } + ] + } + }, + { + "name": "FundReward", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lb_pair", + "type": "pubkey" + }, + { + "name": "funder", + "type": "pubkey" + }, + { + "name": "reward_index", + "type": "u64" + }, + { + "name": "amount", + "type": "u64" + } + ] + } + }, + { + "name": "GoToABin", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lb_pair", + "type": "pubkey" + }, + { + "name": "from_bin_id", + "type": "i32" + }, + { + "name": "to_bin_id", + "type": "i32" + } + ] + } + }, + { + "name": "IncreaseObservation", + "type": { + "kind": "struct", + "fields": [ + { + "name": "oracle", + "type": "pubkey" + }, + { + "name": "new_observation_length", + "type": "u64" + } + ] + } + }, + { + "name": "IncreasePositionLength", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lb_pair", + "type": "pubkey" + }, + { + "name": "position", + "type": "pubkey" + }, + { + "name": "owner", + "type": "pubkey" + }, + { + "name": "length_to_add", + "type": "u16" + }, + { + "name": "side", + "type": "u8" + } + ] + } + }, + { + "name": "InitPermissionPairIx", + "type": { + "kind": "struct", + "fields": [ + { + "name": "active_id", + "type": "i32" + }, + { + "name": "bin_step", + "type": "u16" + }, + { + "name": "base_factor", + "type": "u16" + }, + { + "name": "base_fee_power_factor", + "type": "u8" + }, + { + "name": "activation_type", + "type": "u8" + }, + { + "name": "protocol_share", + "type": "u16" + } + ] + } + }, + { + "name": "InitPresetParameters2Ix", + "type": { + "kind": "struct", + "fields": [ + { + "name": "index", + "type": "u16" + }, + { + "name": "bin_step", + "docs": ["Bin step. Represent the price increment / decrement."], + "type": "u16" + }, + { + "name": "base_factor", + "docs": [ + "Used for base fee calculation. base_fee_rate = base_factor * bin_step * 10 * 10^base_fee_power_factor" + ], + "type": "u16" + }, + { + "name": "filter_period", + "docs": [ + "Filter period determine high frequency trading time window." + ], + "type": "u16" + }, + { + "name": "decay_period", + "docs": [ + "Decay period determine when the volatile fee start decay / decrease." + ], + "type": "u16" + }, + { + "name": "reduction_factor", + "docs": [ + "Reduction factor controls the volatile fee rate decrement rate." + ], + "type": "u16" + }, + { + "name": "variable_fee_control", + "docs": [ + "Used to scale the variable fee component depending on the dynamic of the market" + ], + "type": "u32" + }, + { + "name": "max_volatility_accumulator", + "docs": [ + "Maximum number of bin crossed can be accumulated. Used to cap volatile fee rate." + ], + "type": "u32" + }, + { + "name": "protocol_share", + "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": "base_fee_power_factor", + "docs": ["Base fee power factor"], + "type": "u8" + } + ] + } + }, + { + "name": "InitPresetParametersIx", + "type": { + "kind": "struct", + "fields": [ + { + "name": "bin_step", + "docs": ["Bin step. Represent the price increment / decrement."], + "type": "u16" + }, + { + "name": "base_factor", + "docs": [ + "Used for base fee calculation. base_fee_rate = base_factor * bin_step * 10 * 10^base_fee_power_factor" + ], + "type": "u16" + }, + { + "name": "filter_period", + "docs": [ + "Filter period determine high frequency trading time window." + ], + "type": "u16" + }, + { + "name": "decay_period", + "docs": [ + "Decay period determine when the volatile fee start decay / decrease." + ], + "type": "u16" + }, + { + "name": "reduction_factor", + "docs": [ + "Reduction factor controls the volatile fee rate decrement rate." + ], + "type": "u16" + }, + { + "name": "variable_fee_control", + "docs": [ + "Used to scale the variable fee component depending on the dynamic of the market" + ], + "type": "u32" + }, + { + "name": "max_volatility_accumulator", + "docs": [ + "Maximum number of bin crossed can be accumulated. Used to cap volatile fee rate." + ], + "type": "u32" + }, + { + "name": "protocol_share", + "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": "InitializeLbPair2Params", + "type": { + "kind": "struct", + "fields": [ + { + "name": "active_id", + "docs": ["Pool price"], + "type": "i32" + }, + { + "name": "padding", + "docs": ["Padding, for future use"], + "type": { + "array": ["u8", 96] + } + } + ] + } + }, + { + "name": "InitializeReward", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lb_pair", + "type": "pubkey" + }, + { + "name": "reward_mint", + "type": "pubkey" + }, + { + "name": "funder", + "type": "pubkey" + }, + { + "name": "reward_index", + "type": "u64" + }, + { + "name": "reward_duration", + "type": "u64" + } + ] + } + }, + { + "name": "LbPair", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "parameters", + "type": { + "defined": { + "name": "StaticParameters" + } + } + }, + { + "name": "v_parameters", + "type": { + "defined": { + "name": "VariableParameters" + } + } + }, + { + "name": "bump_seed", + "type": { + "array": ["u8", 1] + } + }, + { + "name": "bin_step_seed", + "docs": ["Bin step signer seed"], + "type": { + "array": ["u8", 2] + } + }, + { + "name": "pair_type", + "docs": ["Type of the pair"], + "type": "u8" + }, + { + "name": "active_id", + "docs": ["Active bin id"], + "type": "i32" + }, + { + "name": "bin_step", + "docs": ["Bin step. Represent the price increment / decrement."], + "type": "u16" + }, + { + "name": "status", + "docs": ["Status of the pair. Check PairStatus enum."], + "type": "u8" + }, + { + "name": "require_base_factor_seed", + "docs": ["Require base factor seed"], + "type": "u8" + }, + { + "name": "base_factor_seed", + "docs": ["Base factor seed"], + "type": { + "array": ["u8", 2] + } + }, + { + "name": "activation_type", + "docs": ["Activation type"], + "type": "u8" + }, + { + "name": "creator_pool_on_off_control", + "docs": [ + "Allow pool creator to enable/disable pool with restricted validation. Only applicable for customizable permissionless pair type." + ], + "type": "u8" + }, + { + "name": "token_x_mint", + "docs": ["Token X mint"], + "type": "pubkey" + }, + { + "name": "token_y_mint", + "docs": ["Token Y mint"], + "type": "pubkey" + }, + { + "name": "reserve_x", + "docs": ["LB token X vault"], + "type": "pubkey" + }, + { + "name": "reserve_y", + "docs": ["LB token Y vault"], + "type": "pubkey" + }, + { + "name": "protocol_fee", + "docs": ["Uncollected protocol fee"], + "type": { + "defined": { + "name": "ProtocolFee" + } + } + }, + { + "name": "_padding_1", + "docs": [ + "_padding_1, previous Fee owner, BE CAREFUL FOR TOMBSTONE WHEN REUSE !!" + ], + "type": { + "array": ["u8", 32] + } + }, + { + "name": "reward_infos", + "docs": ["Farming reward information"], + "type": { + "array": [ + { + "defined": { + "name": "RewardInfo" + } + }, + 2 + ] + } + }, + { + "name": "oracle", + "docs": ["Oracle pubkey"], + "type": "pubkey" + }, + { + "name": "bin_array_bitmap", + "docs": ["Packed initialized bin array state"], + "type": { + "array": ["u64", 16] + } + }, + { + "name": "last_updated_at", + "docs": ["Last time the pool fee parameter was updated"], + "type": "i64" + }, + { + "name": "_padding_2", + "docs": [ + "_padding_2, previous whitelisted_wallet, BE CAREFUL FOR TOMBSTONE WHEN REUSE !!" + ], + "type": { + "array": ["u8", 32] + } + }, + { + "name": "pre_activation_swap_address", + "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": "pubkey" + }, + { + "name": "base_key", + "docs": ["Base keypair. Only required for permission pair"], + "type": "pubkey" + }, + { + "name": "activation_point", + "docs": [ + "Time point to enable the pair. Only applicable for permission pair." + ], + "type": "u64" + }, + { + "name": "pre_activation_duration", + "docs": [ + "Duration before activation activation_point. Used to calculate pre-activation time point for pre_activation_swap_address" + ], + "type": "u64" + }, + { + "name": "_padding_3", + "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": "_padding_4", + "docs": [ + "_padding_4, previous lock_duration, BE CAREFUL FOR TOMBSTONE WHEN REUSE !!" + ], + "type": "u64" + }, + { + "name": "creator", + "docs": ["Pool creator"], + "type": "pubkey" + }, + { + "name": "token_mint_x_program_flag", + "docs": ["token_mint_x_program_flag"], + "type": "u8" + }, + { + "name": "token_mint_y_program_flag", + "docs": ["token_mint_y_program_flag"], + "type": "u8" + }, + { + "name": "_reserved", + "docs": ["Reserved space for future use"], + "type": { + "array": ["u8", 22] + } + } + ] + } + }, + { + "name": "LbPairCreate", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lb_pair", + "type": "pubkey" + }, + { + "name": "bin_step", + "type": "u16" + }, + { + "name": "token_x", + "type": "pubkey" + }, + { + "name": "token_y", + "type": "pubkey" + } + ] + } + }, + { + "name": "LiquidityOneSideParameter", + "type": { + "kind": "struct", + "fields": [ + { + "name": "amount", + "docs": ["Amount of X token or Y token to deposit"], + "type": "u64" + }, + { + "name": "active_id", + "docs": ["Active bin that integrator observe off-chain"], + "type": "i32" + }, + { + "name": "max_active_bin_slippage", + "docs": ["max active bin slippage allowed"], + "type": "i32" + }, + { + "name": "bin_liquidity_dist", + "docs": ["Liquidity distribution to each bins"], + "type": { + "vec": { + "defined": { + "name": "BinLiquidityDistributionByWeight" + } + } + } + } + ] + } + }, + { + "name": "LiquidityParameter", + "type": { + "kind": "struct", + "fields": [ + { + "name": "amount_x", + "docs": ["Amount of X token to deposit"], + "type": "u64" + }, + { + "name": "amount_y", + "docs": ["Amount of Y token to deposit"], + "type": "u64" + }, + { + "name": "bin_liquidity_dist", + "docs": ["Liquidity distribution to each bins"], + "type": { + "vec": { + "defined": { + "name": "BinLiquidityDistribution" + } + } + } + } + ] + } + }, + { + "name": "LiquidityParameterByStrategy", + "type": { + "kind": "struct", + "fields": [ + { + "name": "amount_x", + "docs": ["Amount of X token to deposit"], + "type": "u64" + }, + { + "name": "amount_y", + "docs": ["Amount of Y token to deposit"], + "type": "u64" + }, + { + "name": "active_id", + "docs": ["Active bin that integrator observe off-chain"], + "type": "i32" + }, + { + "name": "max_active_bin_slippage", + "docs": ["max active bin slippage allowed"], + "type": "i32" + }, + { + "name": "strategy_parameters", + "docs": ["strategy parameters"], + "type": { + "defined": { + "name": "StrategyParameters" + } + } + } + ] + } + }, + { + "name": "LiquidityParameterByStrategyOneSide", + "type": { + "kind": "struct", + "fields": [ + { + "name": "amount", + "docs": ["Amount of X token or Y token to deposit"], + "type": "u64" + }, + { + "name": "active_id", + "docs": ["Active bin that integrator observe off-chain"], + "type": "i32" + }, + { + "name": "max_active_bin_slippage", + "docs": ["max active bin slippage allowed"], + "type": "i32" + }, + { + "name": "strategy_parameters", + "docs": ["strategy parameters"], + "type": { + "defined": { + "name": "StrategyParameters" + } + } + } + ] + } + }, + { + "name": "LiquidityParameterByWeight", + "type": { + "kind": "struct", + "fields": [ + { + "name": "amount_x", + "docs": ["Amount of X token to deposit"], + "type": "u64" + }, + { + "name": "amount_y", + "docs": ["Amount of Y token to deposit"], + "type": "u64" + }, + { + "name": "active_id", + "docs": ["Active bin that integrator observe off-chain"], + "type": "i32" + }, + { + "name": "max_active_bin_slippage", + "docs": ["max active bin slippage allowed"], + "type": "i32" + }, + { + "name": "bin_liquidity_dist", + "docs": ["Liquidity distribution to each bins"], + "type": { + "vec": { + "defined": { + "name": "BinLiquidityDistributionByWeight" + } + } + } + } + ] + } + }, + { + "name": "Oracle", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "idx", + "docs": ["Index of latest observation"], + "type": "u64" + }, + { + "name": "active_size", + "docs": [ + "Size of active sample. Active sample is initialized observation." + ], + "type": "u64" + }, + { + "name": "length", + "docs": ["Number of observations"], + "type": "u64" + } + ] + } + }, + { + "name": "PairStatus", + "docs": [ + "Pair status. 0 = Enabled, 1 = Disabled. Putting 0 as enabled for backward compatibility." + ], + "repr": { + "kind": "rust" + }, + "type": { + "kind": "enum", + "variants": [ + { + "name": "Enabled" + }, + { + "name": "Disabled" + } + ] + } + }, + { + "name": "PairType", + "docs": [ + "Type of the Pair. 0 = Permissionless, 1 = Permission, 2 = CustomizablePermissionless. Putting 0 as permissionless for backward compatibility." + ], + "repr": { + "kind": "rust" + }, + "type": { + "kind": "enum", + "variants": [ + { + "name": "Permissionless" + }, + { + "name": "Permission" + }, + { + "name": "CustomizablePermissionless" + }, + { + "name": "PermissionlessV2" + } + ] + } + }, + { + "name": "Position", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "lb_pair", + "docs": ["The LB pair of this position"], + "type": "pubkey" + }, + { + "name": "owner", + "docs": [ + "Owner of the position. Client rely on this to to fetch their positions." + ], + "type": "pubkey" + }, + { + "name": "liquidity_shares", + "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": "reward_infos", + "docs": ["Farming reward information"], + "type": { + "array": [ + { + "defined": { + "name": "UserRewardInfo" + } + }, + 70 + ] + } + }, + { + "name": "fee_infos", + "docs": ["Swap fee to claim information"], + "type": { + "array": [ + { + "defined": { + "name": "FeeInfo" + } + }, + 70 + ] + } + }, + { + "name": "lower_bin_id", + "docs": ["Lower bin ID"], + "type": "i32" + }, + { + "name": "upper_bin_id", + "docs": ["Upper bin ID"], + "type": "i32" + }, + { + "name": "last_updated_at", + "docs": ["Last updated timestamp"], + "type": "i64" + }, + { + "name": "total_claimed_fee_x_amount", + "docs": ["Total claimed token fee X"], + "type": "u64" + }, + { + "name": "total_claimed_fee_y_amount", + "docs": ["Total claimed token fee Y"], + "type": "u64" + }, + { + "name": "total_claimed_rewards", + "docs": ["Total claimed rewards"], + "type": { + "array": ["u64", 2] + } + }, + { + "name": "_reserved", + "docs": ["Reserved space for future use"], + "type": { + "array": ["u8", 160] + } + } + ] + } + }, + { + "name": "PositionBinData", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "liquidity_share", + "type": "u128" + }, + { + "name": "reward_info", + "type": { + "defined": { + "name": "UserRewardInfo" + } + } + }, + { + "name": "fee_info", + "type": { + "defined": { + "name": "FeeInfo" + } + } + } + ] + } + }, + { + "name": "PositionClose", + "type": { + "kind": "struct", + "fields": [ + { + "name": "position", + "type": "pubkey" + }, + { + "name": "owner", + "type": "pubkey" + } + ] + } + }, + { + "name": "PositionCreate", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lb_pair", + "type": "pubkey" + }, + { + "name": "position", + "type": "pubkey" + }, + { + "name": "owner", + "type": "pubkey" + } + ] + } + }, + { + "name": "PositionV2", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "lb_pair", + "docs": ["The LB pair of this position"], + "type": "pubkey" + }, + { + "name": "owner", + "docs": [ + "Owner of the position. Client rely on this to to fetch their positions." + ], + "type": "pubkey" + }, + { + "name": "liquidity_shares", + "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": "reward_infos", + "docs": ["Farming reward information"], + "type": { + "array": [ + { + "defined": { + "name": "UserRewardInfo" + } + }, + 70 + ] + } + }, + { + "name": "fee_infos", + "docs": ["Swap fee to claim information"], + "type": { + "array": [ + { + "defined": { + "name": "FeeInfo" + } + }, + 70 + ] + } + }, + { + "name": "lower_bin_id", + "docs": ["Lower bin ID"], + "type": "i32" + }, + { + "name": "upper_bin_id", + "docs": ["Upper bin ID"], + "type": "i32" + }, + { + "name": "last_updated_at", + "docs": ["Last updated timestamp"], + "type": "i64" + }, + { + "name": "total_claimed_fee_x_amount", + "docs": ["Total claimed token fee X"], + "type": "u64" + }, + { + "name": "total_claimed_fee_y_amount", + "docs": ["Total claimed token fee Y"], + "type": "u64" + }, + { + "name": "total_claimed_rewards", + "docs": ["Total claimed rewards"], + "type": { + "array": ["u64", 2] + } + }, + { + "name": "operator", + "docs": ["Operator of position"], + "type": "pubkey" + }, + { + "name": "lock_release_point", + "docs": ["Time point which the locked liquidity can be withdraw"], + "type": "u64" + }, + { + "name": "_padding_0", + "docs": [ + "_padding_0, previous subjected_to_bootstrap_liquidity_locking, BE CAREFUL FOR TOMBSTONE WHEN REUSE !!" + ], + "type": "u8" + }, + { + "name": "fee_owner", + "docs": [ + "Address is able to claim fee in this position, only valid for bootstrap_liquidity_position" + ], + "type": "pubkey" + }, + { + "name": "_reserved", + "docs": ["Reserved space for future use"], + "type": { + "array": ["u8", 87] + } + } + ] + } + }, + { + "name": "PresetParameter", + "type": { + "kind": "struct", + "fields": [ + { + "name": "bin_step", + "docs": ["Bin step. Represent the price increment / decrement."], + "type": "u16" + }, + { + "name": "base_factor", + "docs": [ + "Used for base fee calculation. base_fee_rate = base_factor * bin_step * 10 * 10^base_fee_power_factor" + ], + "type": "u16" + }, + { + "name": "filter_period", + "docs": [ + "Filter period determine high frequency trading time window." + ], + "type": "u16" + }, + { + "name": "decay_period", + "docs": [ + "Decay period determine when the volatile fee start decay / decrease." + ], + "type": "u16" + }, + { + "name": "reduction_factor", + "docs": [ + "Reduction factor controls the volatile fee rate decrement rate." + ], + "type": "u16" + }, + { + "name": "variable_fee_control", + "docs": [ + "Used to scale the variable fee component depending on the dynamic of the market" + ], + "type": "u32" + }, + { + "name": "max_volatility_accumulator", + "docs": [ + "Maximum number of bin crossed can be accumulated. Used to cap volatile fee rate." + ], + "type": "u32" + }, + { + "name": "min_bin_id", + "docs": [ + "Min bin id supported by the pool based on the configured bin step." + ], + "type": "i32" + }, + { + "name": "max_bin_id", + "docs": [ + "Max bin id supported by the pool based on the configured bin step." + ], + "type": "i32" + }, + { + "name": "protocol_share", + "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": "PresetParameter2", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "bin_step", + "docs": ["Bin step. Represent the price increment / decrement."], + "type": "u16" + }, + { + "name": "base_factor", + "docs": [ + "Used for base fee calculation. base_fee_rate = base_factor * bin_step * 10 * 10^base_fee_power_factor" + ], + "type": "u16" + }, + { + "name": "filter_period", + "docs": [ + "Filter period determine high frequency trading time window." + ], + "type": "u16" + }, + { + "name": "decay_period", + "docs": [ + "Decay period determine when the volatile fee start decay / decrease." + ], + "type": "u16" + }, + { + "name": "variable_fee_control", + "docs": [ + "Used to scale the variable fee component depending on the dynamic of the market" + ], + "type": "u32" + }, + { + "name": "max_volatility_accumulator", + "docs": [ + "Maximum number of bin crossed can be accumulated. Used to cap volatile fee rate." + ], + "type": "u32" + }, + { + "name": "reduction_factor", + "docs": [ + "Reduction factor controls the volatile fee rate decrement rate." + ], + "type": "u16" + }, + { + "name": "protocol_share", + "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": "base_fee_power_factor", + "docs": ["Base fee power factor"], + "type": "u8" + }, + { + "name": "padding_0", + "docs": ["Padding 0 for future use"], + "type": "u8" + }, + { + "name": "padding_1", + "docs": ["Padding 1 for future use"], + "type": { + "array": ["u64", 20] + } + } + ] + } + }, + { + "name": "ProtocolFee", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "amount_x", + "type": "u64" + }, + { + "name": "amount_y", + "type": "u64" + } + ] + } + }, + { + "name": "RebalanceLiquidityParams", + "type": { + "kind": "struct", + "fields": [ + { + "name": "active_id", + "docs": ["active id"], + "type": "i32" + }, + { + "name": "max_active_bin_slippage", + "docs": ["max active bin slippage allowed"], + "type": "u16" + }, + { + "name": "should_claim_fee", + "docs": ["a flag to indicate that whether fee should be harvested"], + "type": "bool" + }, + { + "name": "should_claim_reward", + "docs": [ + "a flag to indicate that whether rewards should be harvested" + ], + "type": "bool" + }, + { + "name": "min_withdraw_x_amount", + "docs": ["threshold for withdraw token x"], + "type": "u64" + }, + { + "name": "max_deposit_x_amount", + "docs": ["threshold for deposit token x"], + "type": "u64" + }, + { + "name": "min_withdraw_y_amount", + "docs": ["threshold for withdraw token y"], + "type": "u64" + }, + { + "name": "max_deposit_y_amount", + "docs": ["threshold for deposit token y"], + "type": "u64" + }, + { + "name": "shrink_mode", + "docs": ["shrink mode"], + "type": "u8" + }, + { + "name": "padding", + "docs": ["padding 32 bytes for future usage"], + "type": { + "array": ["u8", 31] + } + }, + { + "name": "removes", + "docs": ["removes"], + "type": { + "vec": { + "defined": { + "name": "RemoveLiquidityParams" + } + } + } + }, + { + "name": "adds", + "docs": ["adds"], + "type": { + "vec": { + "defined": { + "name": "AddLiquidityParams" + } + } + } + } + ] + } + }, + { + "name": "Rebalancing", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lb_pair", + "type": "pubkey" + }, + { + "name": "position", + "type": "pubkey" + }, + { + "name": "owner", + "type": "pubkey" + }, + { + "name": "active_bin_id", + "type": "i32" + }, + { + "name": "x_withdrawn_amount", + "type": "u64" + }, + { + "name": "x_added_amount", + "type": "u64" + }, + { + "name": "y_withdrawn_amount", + "type": "u64" + }, + { + "name": "y_added_amount", + "type": "u64" + }, + { + "name": "x_fee_amount", + "type": "u64" + }, + { + "name": "y_fee_amount", + "type": "u64" + }, + { + "name": "old_min_id", + "type": "i32" + }, + { + "name": "old_max_id", + "type": "i32" + }, + { + "name": "new_min_id", + "type": "i32" + }, + { + "name": "new_max_id", + "type": "i32" + }, + { + "name": "rewards", + "type": { + "array": ["u64", 2] + } + } + ] + } + }, + { + "name": "RemainingAccountsInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "slices", + "type": { + "vec": { + "defined": { + "name": "RemainingAccountsSlice" + } + } + } + } + ] + } + }, + { + "name": "RemainingAccountsSlice", + "type": { + "kind": "struct", + "fields": [ + { + "name": "accounts_type", + "type": { + "defined": { + "name": "AccountsType" + } + } + }, + { + "name": "length", + "type": "u8" + } + ] + } + }, + { + "name": "RemoveLiquidity", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lb_pair", + "type": "pubkey" + }, + { + "name": "from", + "type": "pubkey" + }, + { + "name": "position", + "type": "pubkey" + }, + { + "name": "amounts", + "type": { + "array": ["u64", 2] + } + }, + { + "name": "active_bin_id", + "type": "i32" + } + ] + } + }, + { + "name": "RemoveLiquidityParams", + "type": { + "kind": "struct", + "fields": [ + { + "name": "min_bin_id", + "type": { + "option": "i32" + } + }, + { + "name": "max_bin_id", + "type": { + "option": "i32" + } + }, + { + "name": "bps", + "type": "u16" + }, + { + "name": "padding", + "type": { + "array": ["u8", 16] + } + } + ] + } + }, + { + "name": "ResizeSide", + "docs": ["Side of resize, 0 for lower and 1 for upper"], + "repr": { + "kind": "rust" + }, + "type": { + "kind": "enum", + "variants": [ + { + "name": "Lower" + }, + { + "name": "Upper" + } + ] + } + }, + { + "name": "RewardInfo", + "docs": [ + "Stores the state relevant for tracking liquidity mining rewards" + ], + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "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": ["LM reward duration in seconds."], + "type": "u64" + }, + { + "name": "reward_duration_end", + "docs": ["LM reward duration end time."], + "type": "u64" + }, + { + "name": "reward_rate", + "docs": ["LM reward rate"], + "type": "u128" + }, + { + "name": "last_update_time", + "docs": ["The last time reward states were updated."], + "type": "u64" + }, + { + "name": "cumulative_seconds_with_empty_liquidity_reward", + "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": "Rounding", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Up" + }, + { + "name": "Down" + } + ] + } + }, + { + "name": "StaticParameters", + "docs": ["Parameter that set by the protocol"], + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "base_factor", + "docs": [ + "Used for base fee calculation. base_fee_rate = base_factor * bin_step * 10 * 10^base_fee_power_factor" + ], + "type": "u16" + }, + { + "name": "filter_period", + "docs": [ + "Filter period determine high frequency trading time window." + ], + "type": "u16" + }, + { + "name": "decay_period", + "docs": [ + "Decay period determine when the volatile fee start decay / decrease." + ], + "type": "u16" + }, + { + "name": "reduction_factor", + "docs": [ + "Reduction factor controls the volatile fee rate decrement rate." + ], + "type": "u16" + }, + { + "name": "variable_fee_control", + "docs": [ + "Used to scale the variable fee component depending on the dynamic of the market" + ], + "type": "u32" + }, + { + "name": "max_volatility_accumulator", + "docs": [ + "Maximum number of bin crossed can be accumulated. Used to cap volatile fee rate." + ], + "type": "u32" + }, + { + "name": "min_bin_id", + "docs": [ + "Min bin id supported by the pool based on the configured bin step." + ], + "type": "i32" + }, + { + "name": "max_bin_id", + "docs": [ + "Max bin id supported by the pool based on the configured bin step." + ], + "type": "i32" + }, + { + "name": "protocol_share", + "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": "base_fee_power_factor", + "docs": ["Base fee power factor"], + "type": "u8" + }, + { + "name": "_padding", + "docs": ["Padding for bytemuck safe alignment"], + "type": { + "array": ["u8", 5] + } + } + ] + } + }, + { + "name": "StrategyParameters", + "type": { + "kind": "struct", + "fields": [ + { + "name": "min_bin_id", + "docs": ["min bin id"], + "type": "i32" + }, + { + "name": "max_bin_id", + "docs": ["max bin id"], + "type": "i32" + }, + { + "name": "strategy_type", + "docs": ["strategy type"], + "type": { + "defined": { + "name": "StrategyType" + } + } + }, + { + "name": "parameteres", + "docs": ["parameters"], + "type": { + "array": ["u8", 64] + } + } + ] + } + }, + { + "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": "Swap", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lb_pair", + "type": "pubkey" + }, + { + "name": "from", + "type": "pubkey" + }, + { + "name": "start_bin_id", + "type": "i32" + }, + { + "name": "end_bin_id", + "type": "i32" + }, + { + "name": "amount_in", + "type": "u64" + }, + { + "name": "amount_out", + "type": "u64" + }, + { + "name": "swap_for_y", + "type": "bool" + }, + { + "name": "fee", + "type": "u64" + }, + { + "name": "protocol_fee", + "type": "u64" + }, + { + "name": "fee_bps", + "type": "u128" + }, + { + "name": "host_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": "TokenProgramFlags", + "repr": { + "kind": "rust" + }, + "type": { + "kind": "enum", + "variants": [ + { + "name": "TokenProgram" + }, + { + "name": "TokenProgram2022" + } + ] + } + }, + { + "name": "UpdatePositionLockReleasePoint", + "type": { + "kind": "struct", + "fields": [ + { + "name": "position", + "type": "pubkey" + }, + { + "name": "current_point", + "type": "u64" + }, + { + "name": "new_lock_release_point", + "type": "u64" + }, + { + "name": "old_lock_release_point", + "type": "u64" + }, + { + "name": "sender", + "type": "pubkey" + } + ] + } + }, + { + "name": "UpdatePositionOperator", + "type": { + "kind": "struct", + "fields": [ + { + "name": "position", + "type": "pubkey" + }, + { + "name": "old_operator", + "type": "pubkey" + }, + { + "name": "new_operator", + "type": "pubkey" + } + ] + } + }, + { + "name": "UpdateRewardDuration", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lb_pair", + "type": "pubkey" + }, + { + "name": "reward_index", + "type": "u64" + }, + { + "name": "old_reward_duration", + "type": "u64" + }, + { + "name": "new_reward_duration", + "type": "u64" + } + ] + } + }, + { + "name": "UpdateRewardFunder", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lb_pair", + "type": "pubkey" + }, + { + "name": "reward_index", + "type": "u64" + }, + { + "name": "old_funder", + "type": "pubkey" + }, + { + "name": "new_funder", + "type": "pubkey" + } + ] + } + }, + { + "name": "UserRewardInfo", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "reward_per_token_completes", + "type": { + "array": ["u128", 2] + } + }, + { + "name": "reward_pendings", + "type": { + "array": ["u64", 2] + } + } + ] + } + }, + { + "name": "VariableParameters", + "docs": ["Parameters that changes based on dynamic of the market"], + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "volatility_accumulator", + "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": "volatility_reference", + "docs": [ + "Volatility reference is decayed volatility accumulator. It is always <= volatility_accumulator" + ], + "type": "u32" + }, + { + "name": "index_reference", + "docs": ["Active bin id of last swap."], + "type": "i32" + }, + { + "name": "_padding", + "docs": ["Padding for bytemuck safe alignment"], + "type": { + "array": ["u8", 4] + } + }, + { + "name": "last_update_timestamp", + "docs": ["Last timestamp the variable parameters was updated"], + "type": "i64" + }, + { + "name": "_padding_1", + "docs": ["Padding for bytemuck safe alignment"], + "type": { + "array": ["u8", 8] + } + } + ] + } + }, + { + "name": "WithdrawIneligibleReward", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lb_pair", + "type": "pubkey" + }, + { + "name": "reward_mint", + "type": "pubkey" + }, + { + "name": "amount", + "type": "u64" + } + ] + } + } + ], + "constants": [ + { + "name": "BASIS_POINT_MAX", + "type": "i32", + "value": "10000" + }, + { + "name": "BIN_ARRAY", + "type": "bytes", + "value": "[98, 105, 110, 95, 97, 114, 114, 97, 121]" + }, + { + "name": "BIN_ARRAY_BITMAP_SEED", + "type": "bytes", + "value": "[98, 105, 116, 109, 97, 112]" + }, + { + "name": "BIN_ARRAY_BITMAP_SIZE", + "type": "i32", + "value": "512" + }, + { + "name": "CLAIM_PROTOCOL_FEE_OPERATOR", + "type": "bytes", + "value": "[99, 102, 95, 111, 112, 101, 114, 97, 116, 111, 114]" + }, + { + "name": "DEFAULT_BIN_PER_POSITION", + "type": "u64", + "value": "70" + }, + { + "name": "EXTENSION_BINARRAY_BITMAP_SIZE", + "type": "u64", + "value": "12" + }, + { + "name": "FEE_PRECISION", + "type": "u64", + "value": "1000000000" + }, + { + "name": "HOST_FEE_BPS", + "docs": ["Host fee. 20%"], + "type": "u16", + "value": "2000" + }, + { + "name": "ILM_PROTOCOL_SHARE", + "type": "u16", + "value": "2000" + }, + { + "name": "MAX_BASE_FEE", + "docs": ["Maximum base fee, base_fee / 10^9 = fee_in_percentage"], + "type": "u128", + "value": "100000000" + }, + { + "name": "MAX_BIN_ID", + "docs": ["Maximum bin ID supported. Computed based on 1 bps."], + "type": "i32", + "value": "443636" + }, + { + "name": "MAX_BIN_PER_ARRAY", + "type": "u64", + "value": "70" + }, + { + "name": "MAX_BIN_STEP", + "docs": ["Maximum bin step"], + "type": "u16", + "value": "400" + }, + { + "name": "MAX_FEE_RATE", + "docs": ["Maximum fee rate. 10%"], + "type": "u64", + "value": "100000000" + }, + { + "name": "MAX_PROTOCOL_SHARE", + "docs": ["Maximum protocol share of the fee. 25%"], + "type": "u16", + "value": "2500" + }, + { + "name": "MAX_RESIZE_LENGTH", + "type": "u64", + "value": "91" + }, + { + "name": "MAX_REWARD_BIN_SPLIT", + "type": "u64", + "value": "15" + }, + { + "name": "MAX_REWARD_DURATION", + "type": "u64", + "value": "31536000" + }, + { + "name": "MINIMUM_LIQUIDITY", + "type": "u128", + "value": "1000000" + }, + { + "name": "MIN_BASE_FEE", + "docs": ["Minimum base fee"], + "type": "u128", + "value": "100000" + }, + { + "name": "MIN_BIN_ID", + "docs": ["Minimum bin ID supported. Computed based on 1 bps."], + "type": "i32", + "value": "-443636" + }, + { + "name": "MIN_REWARD_DURATION", + "type": "u64", + "value": "1" + }, + { + "name": "NUM_REWARDS", + "type": "u64", + "value": "2" + }, + { + "name": "ORACLE", + "type": "bytes", + "value": "[111, 114, 97, 99, 108, 101]" + }, + { + "name": "POSITION", + "type": "bytes", + "value": "[112, 111, 115, 105, 116, 105, 111, 110]" + }, + { + "name": "POSITION_MAX_LENGTH", + "type": "u64", + "value": "1400" + }, + { + "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": "PROTOCOL_SHARE", + "type": "u16", + "value": "500" + } + ] +} diff --git a/pkg/shreder/tx.go b/pkg/shreder/tx.go index 8b67637..f43340a 100644 --- a/pkg/shreder/tx.go +++ b/pkg/shreder/tx.go @@ -48,6 +48,13 @@ type TxSignal struct { ExactSOL bool `json:"exact_in"` + + //Just for metaora DLMM + // ActiveBin is the active bin id provided by swap_with_price_impact(2). + ActiveBin int32 `json:"active_bin"` + // MaxPriceImpactBps is the price impact guard for swap_with_price_impact(2). + MaxPriceImpactBps uint16 `json:"max_price_impact_bps"` + // parsed values Token0AmountUint64 uint64 `json:"-"` Token1AmountUint64 uint64 `json:"-"` diff --git a/pkg/shreder/txparser.go b/pkg/shreder/txparser.go index 3b1d54b..77a2878 100644 --- a/pkg/shreder/txparser.go +++ b/pkg/shreder/txparser.go @@ -49,6 +49,10 @@ var ( gmgnProgramID = solana.MustPublicKeyFromBase58("GMgnVFR8Jb39LoXsEVzb3DvBy3ywCmdmJquHUy1Lrkqb") bonkProgramID = solana.MustPublicKeyFromBase58("BBRouter1cVunVXvkcqeKkZQcBK7ruan37PPm3xzWaXD") + + + // For Metaora dlmm + dlmmProgramID = solana.MustPublicKeyFromBase58("LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo") ) type AccountNotFoundError struct { @@ -102,6 +106,13 @@ var ( gmgnBuyTokensIX = []byte{0x66, 0x06, 0x3d, 0x12, 0x01, 0xda, 0xeb, 0xea} bonkBuyAndSellTokensIX = []byte{0x00, 0x01, 0x00, 0x00, 0x00, 0x09, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a} + + dlmmSwapIX = []byte{248, 198, 158, 145, 225, 117, 135, 200} + dlmmSwap2IX = []byte{65, 75, 63, 76, 235, 91, 91, 136} + dlmmSwapExactOutIX = []byte{250, 73, 101, 33, 38, 207, 75, 184} + dlmmSwapExactOut2IX = []byte{43, 215, 247, 132, 137, 60, 243, 81} + dlmmSwapPriceImpactIX = []byte{56, 173, 230, 208, 173, 228, 156, 205} + dlmmSwapPriceImpact2IX = []byte{74, 98, 192, 214, 177, 51, 75, 51} ) type compiledInstruction struct { @@ -349,6 +360,9 @@ func ParseTransaction(update *SubscribeUpdateTransaction, loader *AddressTables, case bonkProgramID: txRes, err := parseBonkInstruction(versioned, i) parsed = appendParsed(now, parsed, txRes, err, txHash, "bonk") + case dlmmProgramID: + txRes, err := parseDlmmInstruction(versioned, i) + parsed = appendParsed(now, parsed, txRes, err, txHash, "dlmm") } } @@ -1344,6 +1358,222 @@ func parseTermSell(tx *versionedTransaction, instruction *compiledInstruction) ( }, nil } +func dlmmTokenOrder(tokenX, tokenY solana.PublicKey) (solana.PublicKey, solana.PublicKey) { + switch { + case tokenX.Equals(solana.WrappedSol): + return tokenY, tokenX + case tokenY.Equals(solana.WrappedSol): + return tokenX, tokenY + default: + return tokenX, tokenY + } +} + +func findAssociatedTokenAddressWithTokenProgram(wallet, mint, tokenProgram solana.PublicKey) (solana.PublicKey, uint8, error) { + return solana.FindProgramAddress([][]byte{ + wallet[:], + tokenProgram[:], + mint[:], + }, solana.SPLAssociatedTokenAccountProgramID) +} + +type dlmmParsedArgs struct { + AmountIn uint64 + AmountOut uint64 + ExactIn bool + ExactOut bool + ActiveBin int32 + MaxPriceImpactBps uint16 +} + +func parseDlmmSwapArgs(disc []byte, payload []byte) (*dlmmParsedArgs, error) { + switch { + case bytes.Equal(disc, dlmmSwapIX), bytes.Equal(disc, dlmmSwap2IX): + if len(payload) < 16 { + return nil, fmt.Errorf("data too short for dlmm swap args, len=%d", len(payload)) + } + return &dlmmParsedArgs{ + AmountIn: binary.LittleEndian.Uint64(payload[0:8]), + AmountOut: binary.LittleEndian.Uint64(payload[8:16]), + ExactIn: true, + }, nil + case bytes.Equal(disc, dlmmSwapExactOutIX), bytes.Equal(disc, dlmmSwapExactOut2IX): + if len(payload) < 16 { + return nil, fmt.Errorf("data too short for dlmm swap exact out args, len=%d", len(payload)) + } + return &dlmmParsedArgs{ + AmountIn: binary.LittleEndian.Uint64(payload[0:8]), + AmountOut: binary.LittleEndian.Uint64(payload[8:16]), + ExactOut: true, + }, nil + case bytes.Equal(disc, dlmmSwapPriceImpactIX), bytes.Equal(disc, dlmmSwapPriceImpact2IX): + if len(payload) < 11 { + return nil, fmt.Errorf("data too short for dlmm swap with price impact args, len=%d", len(payload)) + } + amountIn := binary.LittleEndian.Uint64(payload[0:8]) + idx := 8 + if len(payload) < idx+1 { + return nil, fmt.Errorf("data too short for dlmm swap with price impact args, len=%d", len(payload)) + } + activeBinTag := payload[idx] + idx++ + var activeBin int32 + if activeBinTag == 1 { + if len(payload) < idx+4 { + return nil, fmt.Errorf("data too short for dlmm swap with price impact args, len=%d", len(payload)) + } + activeBin = int32(binary.LittleEndian.Uint32(payload[idx : idx+4])) + idx += 4 + } else if activeBinTag != 0 { + return nil, fmt.Errorf("invalid active_id tag %d", activeBinTag) + } + if len(payload) < idx+2 { + return nil, fmt.Errorf("data too short for dlmm swap with price impact args, len=%d", len(payload)) + } + return &dlmmParsedArgs{ + AmountIn: amountIn, + ExactIn: true, + ActiveBin: activeBin, + MaxPriceImpactBps: binary.LittleEndian.Uint16(payload[idx : idx+2]), + }, nil + default: + return nil, nil + } +} + +func parseDlmmInstruction(tx *versionedTransaction, instructionIndex int) (*TxSignal, error) { + msg := tx.Message + if instructionIndex >= len(msg.Instructions) { + return nil, fmt.Errorf("instruction index out of bounds") + } + instruction := msg.Instructions[instructionIndex] + if len(instruction.Data) < 8 { + return nil, fmt.Errorf("data is empty") + } + if len(instruction.Accounts) < 13 { + return nil, fmt.Errorf("accounts too short") + } + + disc := instruction.Data[:8] + payload := instruction.Data[8:] + + args, err := parseDlmmSwapArgs(disc, payload) + if err != nil { + return nil, err + } + if args == nil { + return nil, nil + } + + staticKeys := tx.Message.StaticAccountKeys + userTokenIn, err := getStaticKey(staticKeys, int(instruction.Accounts[4])) + if err != nil { + return nil, err + } + userTokenOut, err := getStaticKey(staticKeys, int(instruction.Accounts[5])) + if err != nil { + return nil, err + } + tokenX, err := getStaticKey(staticKeys, int(instruction.Accounts[6])) + if err != nil { + return nil, err + } + tokenY, err := getStaticKey(staticKeys, int(instruction.Accounts[7])) + if err != nil { + return nil, err + } + user, err := getStaticKey(staticKeys, int(instruction.Accounts[10])) + if err != nil { + return nil, err + } + tokenXProgram, err := getStaticKey(staticKeys, int(instruction.Accounts[11])) + if err != nil { + return nil, err + } + tokenYProgram, err := getStaticKey(staticKeys, int(instruction.Accounts[12])) + if err != nil { + return nil, err + } + + token0Mint, token1Mint := dlmmTokenOrder(tokenX, tokenY) + var ( + token0AmountUint64 uint64 + token1AmountUint64 uint64 + ) + if !tokenX.Equals(solana.WrappedSol) && !tokenY.Equals(solana.WrappedSol) { + return nil, nil + } + wsolProgram := tokenXProgram + if tokenY.Equals(solana.WrappedSol) { + wsolProgram = tokenYProgram + } + wsolAta, _, err := findAssociatedTokenAddressWithTokenProgram(user, solana.WrappedSol, wsolProgram) + if err != nil { + return nil, nil + } + + wsolIn := userTokenIn.Equals(wsolAta) + wsolOut := userTokenOut.Equals(wsolAta) + if !wsolIn && !wsolOut { + return nil, nil + } + + event := "sell" + if wsolIn { + event = "buy" + } + exactSol := (args.ExactIn && wsolIn) || (args.ExactOut && wsolOut) + + if wsolIn { + if args.ExactIn { + token1AmountUint64 = args.AmountIn + } + if args.ExactOut { + token0AmountUint64 = args.AmountOut + } + } else { + if args.ExactOut { + token1AmountUint64 = args.AmountOut + } + if args.ExactIn { + token0AmountUint64 = args.AmountIn + } + } + + token0Amount := formatTokenAmount(token0AmountUint64) + if token0Mint.Equals(solana.WrappedSol) { + token0Amount = formatSolAmount(token0AmountUint64) + } + token1Amount := decimal.Zero + if token1AmountUint64 > 0 { + if token1Mint.Equals(solana.WrappedSol) { + token1Amount = formatSolAmount(token1AmountUint64) + } else { + token1Amount = formatTokenAmount(token1AmountUint64) + } + } + + return &TxSignal{ + TxHash: tx.Signatures[0].String(), + Label: "dlmm", + Maker: user.String(), + Token0Address: token0Mint.String(), + Token1Address: token1Mint.String(), + Token0Amount: token0Amount, + Token1Amount: token1Amount, + Program: "MeteoraDLMM", + Event: event, + IsToken2022: false, + IsMayhemMode: false, + ExactSOL: exactSol, + ActiveBin: args.ActiveBin, + MaxPriceImpactBps: args.MaxPriceImpactBps, + Block: tx.Block, + Token0AmountUint64: token0AmountUint64, + Token1AmountUint64: token1AmountUint64, + }, nil +} + func decodePumpAmmBuyArgs(data []byte) (uint64, uint64, error) { if len(data) < 9 { return 0, 0, fmt.Errorf("data too short for pump amm buy args, len=%d", len(data))