[User] How does Helius differentiate between 'COMPRESSED_NFT_MINT' and 'COMPRESSED_NFT_BURN'?

[Assistant]
In Helius, the differentiation between 'COMPRESSED_NFT_MINT' and 'COMPRESSED_NFT_BURN' is based on the actions they perform on compressed NFTs.

1. **COMPRESSED_NFT_MINT**: This instruction is used to create a new compressed NFT. When you mint a compressed NFT, you are generating a new token that represents a digital asset, which can then be owned and transferred.

   Example usage:
   ```javascript
   const mintCompressedNFT = async () => {
       // Code to mint a compressed NFT
   };
   ```

2. **COMPRESSED_NFT_BURN**: This instruction is used to permanently remove an existing compressed NFT from circulation. When you burn a compressed NFT, you are destroying the token, which means it can no longer be owned or transferred.

   Example usage:
   ```javascript
   const burnCompressedNFT = async () => {
       // Code to burn a compressed NFT
   };
   ```

In summary, 'COMPRESSED_NFT_MINT' is for creating new NFTs, while 'COMPRESSED_NFT_BURN' is for destroying existing NFTs.

TE_RAFFLE
BUY_TICKETS
UPDATE_ITEM
LIST_ITEM
DELIST_ITEM
ADD_ITEM
CLOSE_ITEM
BUY_ITEM
FILL_ORDER
UPDATE_ORDER
CREATE_ORDER
CLOSE_ORDER
CANCEL_ORDER
KICK_ITEM
UPGRADE_FOX
UPGRADE_FOX_REQUEST
LOAN_FOX
BORROW_FOX
SWITCH_FOX_REQUEST
SWITCH_FOX
CREATE_ESCROW
ACCEPT_REQUEST_ARTIST
CANCEL_ESCROW
ACCEPT_ESCROW_ARTIST
ACCEPT_ESCROW_USER
PLACE_BET
PLACE_SOL_BET
CREATE_BET
INIT_RENT
NFT_RENT_LISTING
NFT_RENT_CANCEL_LISTING
NFT_RENT_UPDATE_LISTING
NFT_RENT_ACTIVATE
NFT_RENT_END
UPGRADE_PROGRAM_INSTRUCTION
FINALIZE_PROGRAM_INSTRUCTION
EXECUTE_TRANSACTION
APPROVE_TRANSACTION
ACTIVATE_TRANSACTION
CREATE_TRANSACTION
CANCEL_TRANSACTION
REJECT_TRANSACTION
ADD_INSTRUCTION
CREATE_MASTER_EDITION
ATTACH_METADATA
REQUEST_PNFT_MIGRATION
START_PNFT_MIGRATION
MIGRATE_TO_PNFT
UPDATE_RAFFLE
CREATE_MERKLE_TREE
DELEGATE_MERKLE_TREE
COMPRESSED_NFT_MINT
COMPRESSED_NFT_TRANSFER
COMPRESSED_NFT_REDEEM
COMPRESSED_NFT_CANCEL_REDEEM
COMPRESSED_NFT_BURN
COMPRESSED_NFT_VERIFY_CREATOR
COMPRESSED_NFT_UNVERIFY_CREATOR
COMPRESSED_NFT_VERIFY_COLLECTION
COMPRESSED_NFT_UNVERIFY_COLLECTION
COMPRESSED_NFT_SET_VERIFY_COLLECTION
DECOMPRESS_NFT
COMPRESS_NFT
COMPRESSED_NFT_DELEGATE
CREATE_POOL
DISTRIBUTE_COMPRESSION_REWARDS
CHANGE_COMIC_STATE
UPDATE_RECORD_AUTHORITY_DATA
CREATE_AVATAR_CLASS
CREATE_AVATAR
CREATE_TRAIT
CREATE_PAYMENT_METHOD
EQUIP_TRAIT
EQUIP_TRAIT_AUTHORITY
REMOVE_TRAIT
REMOVE_TRAIT_AUTHORITY
UPDATE_TRAIT_VARIANT
UPDATE_TRAIT_VARIANT_AUTHORITY
UPDATE_CLASS_VARIANT_AUTHORITY
UPDATE_TRAIT_VARIANT_METADATA
UPDATE_CLA


[User] How can developers integrate with the Jupiter Perpetuals program using TypeScript?

[Assistant]
Developers can integrate with the Jupiter Perpetuals program using TypeScript by utilizing the provided TypeScript code samples that interact with the Jupiter Perpetuals program IDL (Interface Definition Language) along with the Anchor framework and the `@solana/web3.js` library.

Here’s a basic outline of how to get started:

1. **Set Up Your Environment**: Make sure you have Node.js and npm installed. Then, create a new TypeScript project and install the necessary dependencies.

   ```bash
   mkdir jupiter-perpetuals-integration
   cd jupiter-perpetuals-integration
   npm init -y
   npm install @solana/web3.js @project-serum/anchor
   npm install typescript --save-dev
   npx tsc --init
   ```

2. **Import Required Libraries**: In your TypeScript file, import the necessary modules from `@solana/web3.js` and `@project-serum/anchor`.

   ```typescript
   import { Connection, PublicKey, clusterApiUrl } from '@solana/web3.js';
   import { Program, AnchorProvider, web3 } from '@project-serum/anchor';
   ```

3. **Connect to the Solana Cluster**: Establish a connection to the Solana cluster (e.g., devnet).

   ```typescript
   const connection = new Connection(clusterApiUrl('devnet'), 'confirmed');
   ```

4. **Set Up the Provider**: Create an Anchor provider to interact with the Jupiter Perpetuals program.

   ```typescript
   const provider = AnchorProvider.local(connection);
   ```

5. **Load the Program**: Load the Jupiter Perpetuals program using its IDL.

   ```typescript
   const programId = new PublicKey('YOUR_PROGRAM_ID'); // Replace with the actual program ID
   const idl = await Program.fetchIdl(programId, provider);
   const program = new Program(idl, programId, provider);
   ```

6. **Interact with the Program**: You can now call functions from the Jupiter Perpetuals program. For example, to create or manage a position, you would call the corresponding method from the program.

   ```typescript
   const positionAccount = await program.rpc.createPosition({
       accounts: {
           owner: provider.wallet.publicKey,
           pool: new PublicKey('YOUR_POOL_PUBLIC_KEY'), // Replace with actual pool public key
           custody: new PublicKey('YOUR_CUSTODY_PUBLIC_KEY'), // Replace with actual custody public key
       },
   });
   ```

This is a simplified example to get you started. You would need to replace placeholders with actual values and handle errors and responses appropriately based on your application’s requirements. For more detailed interactions, refer to the specific functions and data structures defined in the Jupiter Perpetuals program IDL.

epers to execute your request in order to make sure that the trader experience is swift.

Onchain Account Types
This page contains an overview of all the Solana account types used in the Jupiter Perpetuals decentralized exchange.

This information is useful for developers looking to integrate or interact the Jupiter Perpetuals program and transactions.

info
This repository contains typescript code samples on interacting with the Jupiter Perpetuals program IDL with anchor and @solana/web3.js

Position account
The Position account contains the trade position data for a given token. The following is an example of a Position account:

info
An example Position account on Solscan: https://solscan.io/account/FBLzd5VM67MEKkoWerXu7Nu1ksbLXQvJDx63y5aeLEvt

The Position account contains the following data:

owner: The public key / address for the trader's wallet.

pool: The public key / address for the Jupiter Perpetuals liquidity pool account.

custody: The public key / address for the position's custody account. A custody account in the Jupiter Perpetuals exchange contains information for the token that's being traded against for the position.

For example, a long SOL position will have the custody account. 7xS2gz2bTp3fwCC7knJvUWTEU9Tycczu6VhJYKgi1wdz which contains important data like the its price impact fee scalar, tokens locked currently for potential profit payoffs, and other data used by the Jupiter Perpetuals exchanged.
collateralCustody: The public key / address for the posit


[User] What is the role of the context in the Go example for QuickNode?

[Assistant]
In the provided Go example for QuickNode, the `context` plays a crucial role in managing the lifecycle of the gRPC call. Here's a detailed explanation of its purpose:

1. **Timeout Management**: The context is created with a timeout using `context.WithTimeout`. This means that the gRPC call to retrieve the latest blockhash will only be allowed to run for a specified duration (in this case, 10 seconds). If the call does not complete within this time frame, it will be automatically canceled.

   ```go
   ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
   defer cancel()
   ```

2. **Cancellation**: The `cancel` function returned by `context.WithTimeout` is deferred to ensure that it is called after the gRPC call is completed or if the timeout occurs. This helps in releasing resources associated with the context, preventing potential memory leaks.

3. **Propagation of Deadlines and Cancellation Signals**: The context allows for the propagation of deadlines and cancellation signals across API boundaries. This means that if the context is canceled (either due to timeout or manual cancellation), any ongoing operations that are using this context can be notified and can terminate gracefully.

4. **Passing Metadata**: Although not shown in this specific example, contexts can also carry metadata (like authentication tokens or request-scoped values) that can be accessed by the gRPC server handling the request.

In summary, the context in this Go example is essential for managing the timeout and cancellation of the gRPC call to QuickNode, ensuring that the application remains responsive and does not hang indefinitely on network calls.

lastValidBlockHeight
string
The last block height at which the retrieved blockhash is valid
Request

Go
package main

import (
	"context"
	"crypto/tls"
	"fmt"
	"log"
	"time"

	pb "yellowstone/proto"

	"google.golang.org/grpc"
	"google.golang.org/grpc/credentials"
	"google.golang.org/grpc/encoding/gzip"
	"google.golang.org/grpc/keepalive"
)

// QuickNode endpoints consist of two crucial components: the endpoint name and the corresponding token
// For eg: QN Endpoint: https://docs-demo.solana-mainnet.quiknode.pro/abcde123456789
// endpoint will be: docs-demo.solana-mainnet.quiknode.pro:10000  {10000 is the port number for gRPC}
// token will be : abcde123456789

var (
	endpoint = "YOUR_QN_ENDPOINT:10000"
	token    = "YOUR_TOKEN_NUMBER"
)

func main() {
	opts := []grpc.DialOption{
		grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{})),
		grpc.WithKeepaliveParams(kacp),
		grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(1024*1024*1024), grpc.UseCompressor(gzip.Name)),
		grpc.WithPerRPCCredentials(tokenAuth{token: token}),
	}

	conn, err := grpc.NewClient(endpoint, opts...)
	if err != null {
		log.Fatalf("Failed to connect: %v", err)
	}
	defer conn.Close()

	client := pb.NewGeyserClient(conn)

    ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
    defer cancel()

    latestBlockHash, err := client.GetLatestBlockhash(ctx, &pb.GetLatestBlockhashRequest{})
	if err != null {
		log.Fatalf("Failed to get latest blockhash: %v", err)
	}

	fmt.Prin


[User] What is the purpose of the 'swapTransaction' in the Jupiter example?

[Assistant]
In the Jupiter example, the `swapTransaction` serves as the serialized transaction that contains the instructions for executing a token swap. This transaction is obtained from the response of a request made to the Jupiter API's `/swap` endpoint after fetching a quote for the swap.

Here's a breakdown of its purpose:

1. **Serialized Instructions**: The `swapTransaction` is a serialized representation of the transaction that includes all the necessary instructions for the swap operation. This allows the transaction to be sent to the Solana blockchain for execution.

2. **Execution of Token Swap**: The transaction encapsulates the routing information and the specific actions that need to be taken to swap tokens, as determined by the quote obtained from the `/quote` API.

3. **User and Merchant Interaction**: The `swapTransaction` is used by the user (in this case, Alice) to verify, sign, and send the transaction to the blockchain, facilitating the transfer of tokens between the user's wallet and the merchant's wallet.

In summary, the `swapTransaction` is crucial for executing the token swap as it contains the serialized instructions that will be processed on the Solana network.

inationWallet argument, which Alice will verify, sign and send.

info
In the example bellow, we assume the associated token account exists on destinationWallet.

import { Token, TOKEN_PROGRAM_ID, ASSOCIATED_TOKEN_PROGRAM_ID } from '@solana/spl-token'; // version 0.1.x
import { PublicKey } from '@solana/web3.js';

const USDC_MINT = new PublicKey('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v');
const paymentAmount = 5_000_000; // 5 USDC
const merchantWallet = new PublicKey('BUX7s2ef2htTGb2KKoPHWkmzxPj4nTWMWRgs5CSbQxf9');

// get serialized transactions for the swap
const transactions = await (
  await fetch('https://quote-api.jup.ag/v4/swap', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      // route from /quote api
      route: routes[0],
      userPublicKey: wallet.publicKey.toString(),
    })
  })
).json();

const { swapTransaction } = transactions;

const userDestinationTokenAccount = Token.getAssociatedTokenAddress(
  ASSOCIATED_TOKEN_PROGRAM_ID,
  TOKEN_PROGRAM_ID,
  USDC_MINT,
  wallet.publicKey,
);
const merchantTokenAccount = Token.getAssociatedTokenAddress(
  ASSOCIATED_TOKEN_PROGRAM_ID,
  TOKEN_PROGRAM_ID,
  USDC_MINT,
  merchantWallet,
  // @ts-ignore
  true,
);

// deserialize the transaction
const swapTransactionBuf = Buffer.from(swapTransaction, 'base64');
var transaction = VersionedTransaction.deserialize(swapTransactionBuf);
console.log(transaction);

// get address lookup table accounts
const


[User] What is the cache expiration time for CoinGecko's market cap data?

[Assistant] The cache for CoinGecko's market cap data expires at 00:05 UTC every day. This means that the last completed UTC day (00:00) is available 5 minutes after midnight on the next UTC day. If you wish to get the latest daily data (00:00 UTC), you can make a request at 00:05 UTC or later.

ty (auto):
1 day from now = hourly data
2 days & above from now = daily data
Exclusive for all Paid Plan Subscribers (Analyst, Lite, Pro and Enterprise)
The last completed UTC day (00:00) is available 5 minutes after midnight on the next UTC day (00:05). The cache will always expire at 00:05 UTC. If you wish to get the latest daily data (00:00 UTC), you can make request at 00:05 UTC or later.
Cache / Update Frequency: every 1 minute
Query Params
days
string
required
data up to number of days ago
Valid values: any integer

1
vs_currency
string
target currency of market cap, default: usd
*refers to /simple/supported_vs_currencies

Response

200
Get cryptocurrency global market cap chart data

Response body
object
market_cap_chart
object
market_cap
array of arrays of numbers
array of numbers
Updated 4 months ago

Global De-Fi Market Data
Companies (Beta)
Did this page help you?
Language

Shell

Node

Ruby

PHP

Python
Credentials
x-cg-pro-api-key

Log in to use your API keys
1
curl --request GET \
2
     --url 'https://pro-api.coingecko.com/api/v3/global/market_cap_chart?days=1' \
3
     --header 'accept: application/json'

Try It!
RESPONSE
1
{
2
  "market_cap_chart": {
3
    "market_cap": [
4
      [
5
        1367193600000,
6
        1661441770
7
      ],
8
      [
9
        1367280000000,
10
        1592765051
11
      ],
12
      [
13
        1367366400000,
14
        1378705103
15
      ]
16
    ]
17
  }
18
}

Public Companies Holdings
get
https://pro-api.coingecko.com/ap


[User] What does the 'executable' boolean indicate about an account in QuickNode?

[Assistant] In QuickNode, the 'executable' boolean indicates whether the account contains a program and is strictly read-only. If 'executable' is true, it means that the account is a program that can be executed, while if it is false, the account does not contain an executable program.

e blockchain
err
Error code if the transaction failed or null if the transaction succeeds
logs
An array of log messages the transaction instructions output during execution, null if simulation failed before the transaction was able to execute (for example due to an invalid blockhash or signature verification failure)
accounts
An array of accounts with the same length as the accounts.addresses array in the request
null
If the account doesn't exist or if err is not null
object
otherwise, a JSON object containing:
lamports
The number of lamports assigned to this account as u64 (64-bit unsigned integer)
owner
The base-58 encoded Pubkey of the program this account has been assigned to
data
The data associated with the account, either as encoded binary data or JSON format {'program': 'state'}, depending on encoding parameter
executable
A boolean indicating if the account contains a program (and is strictly read-only)
rentEpoch
The epoch at which this account will next owe rent, as u64 (64-bit unsigned integer)
unitsConsumed
The number of compute budget units consumed during the processing of this transaction
returnData
The most-recent return data generated by an instruction in the transaction, with the following fields:
programId
string
The program that generated the return data, as base-58 encoded Pubkey
data
The return data itself, as base-64 encoded binary data
innerInstructions
The value is a list of inner instructions.
Request

Curl
curl https://docs-demo.solana-mainnet.quikno


[User] How does Jupiter handle the closing of positions for traders with USDC as collateral?

[Assistant]
When traders with USDC as collateral close their positions on Jupiter, they will receive USDC upon closing the position or withdrawing collateral. This process ensures that the collateral used for the position is returned in the same currency (USDC) once the position is settled.

Additionally, if a trader has an active Associate Token Account (ATA) for their short positions, it is important to note that if they manually close their position, any associated take-profit (TP) or stop-loss (SL) orders linked to that ATA will be automatically canceled. This provides a seamless experience when opening new future positions, as the system manages the cancellation of these orders automatically.

In summary, closing a position with USDC as collateral results in the trader receiving USDC, and any active TP/SL orders will be canceled if the position is closed manually.

r the position.

For example, a trader with a profitable short SOL position with USDC as the underlying collateral will receive USDC when they close the position or withdraw collateral.

Take-Profit / Stop-Loss Orders
An active Associate Token Account (ATA) is needed for TP/SL to be triggered and executed:

ETH ATA for ETH-Long
wBTC ATA for wBTC-Long
USDC or USDT ATA for ALL Short positions
An ATA will be automatically created for you when you create a TP/SL.

Please note that the TP/SL will not be triggered if you close the respective ATA needed.

In the event of manually closing a position, the associated trigger orders will be automatically canceled and closed, providing a seamless experience when opening new future positions.

info
While TP/SL orders are set, keepers will monitor the mark price, when reaching the specified price level, TP/SL will close the whole position. More info on keepers here.

PnL
Profit and loss calculations directly corresponds to the size of your position. Here are two examples to illustrate this:

Long position example:
Position: 1,000 USD long on SOL
If SOL price increases by 10%: You profit 100 USD
If SOL price decreases by 10%: You lose 100 USD
Short position example:
Position: 1,000 USD short on SOL
If SOL price decreases by 10%: You profit 100 USD
If SOL price increases by 10%: You lose 100 USD
In both cases, the profit or loss is 10% of the position size, matching the percentage change in SOL's price.

Calculating realized and unrealized P


[User] Why might accounts using SPL Token-2022 require more than 0.00203928 SOL to fund on Solana?

[Assistant]
Accounts using SPL Token-2022 may require more than 0.00203928 SOL to fund because the introduction of token extensions can result in accounts being larger than the standard size of 165 bytes. Specifically, the Associated Token Account program includes the "immutable owner" extension, which increases the minimum account size to 170 bytes. As a result, this larger account size necessitates a higher funding amount of SOL to cover the storage costs on the Solana blockchain.

For instance, since the Associated Token Account with the "immutable owner" extension takes a minimum of 170 bytes, it requires at least 0.00207408 SOL to fund. This is an example of how the presence of extensions can affect the funding requirements for SPL Token-2022 accounts.

s) Standard #
SPL Token-2022 is the newest standard for wrapped/synthetic token creation and exchange on the Solana blockchain.

Also known as "Token Extensions", the standard contains many new features that token creators and account holders may optionally enable. These features include confidential transfers, fees on transfer, closing mints, metadata, permanent delegates, immutable ownership, and much more. Please see the extension guide for more information.

If your exchange supports SPL Token, there isn't a lot more work required to support SPL Token-2022:

the CLI tool works seamlessly with both programs starting with version 3.0.0.
preTokenBalances and postTokenBalances include SPL Token-2022 balances
RPC indexes SPL Token-2022 accounts, but they must be queried separately with program id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
The Associated Token Account works the same way, and properly calculates the required deposit amount of SOL for the new account.

Because of extensions, however, accounts may be larger than 165 bytes, so they may require more than 0.00203928 SOL to fund.

For example, the Associated Token Account program always includes the "immutable owner" extension, so accounts take a minimum of 170 bytes, which requires 0.00207408 SOL.

Extension-Specific Considerations #
The previous section outlines the most basic support for SPL Token-2022. Since the extensions modify the behavior of tokens, exchanges may need to change how they handle tokens.

It is


[User] How does Magic Eden address the exploitation of minors in relation to the use of its APIs?

[Assistant]
Magic Eden explicitly prohibits the exploitation of minors in relation to the use of its APIs. According to the documentation, users are not allowed to use the Magic Eden APIs in any way that intends to exploit minors. This includes any activities that could potentially harm or take advantage of minors.

The specific clause states:

- **Intending to exploit minors in any way;**

This indicates that any application or service utilizing the Magic Eden APIs must adhere to strict ethical standards and legal requirements to protect minors from exploitation. If any violations are detected, it could lead to consequences as determined by Magic Eden.

our Application available for use in a manner that circumvents the need for users to obtain a valid license to a Magic Eden Offering that is accessed through the Magic Eden APIs;
Redistribute or resell, or sublicense access to, the Magic Eden APIs, any data obtained using the Magic Eden APIs, or any other Magic Eden Offering accessed through the Magic Eden APIs;
Misrepresent expressly, by omission, or implication, the need for users to obtain a valid license to the Magic Eden application or service that is accessed through the Magic Eden APIs;
Falsify or alter any unique referral identifier in, or assigned to an Application, or otherwise obscure or alter the source of queries coming from an Application to hide a violation of this agreement;
Use the Magic Eden APIs or allow any user to use the Application in a way that violates applicable law, including:
Illegal activities, such as child pornography, gambling, piracy, violating copyright, trademark or other intellectual property laws;
Intending to exploit minors in any way;
Accessing or authorizing anyone to access the Magic Eden APIs from an embargoed country as prohibited by the U.S. government;
Threatening, stalking, defaming, defrauding, degrading, victimizing or intimidating anyone for any reason; or
Violating applicable privacy laws and regulations; or
Use the Magic Eden APIs in a way that could create, in Magic Eden’s sole discretion and judgment, an unreasonable risk to customers and end users from a security or priv


[User] What programming languages are provided as examples for making requests to the Magic Eden API?

[Assistant]
The Magic Eden API documentation provides example code snippets in the following programming languages for making requests:

1. Shell
2. Node
3. Ruby
4. PHP
5. Python

These examples can help users understand how to interact with the API using their preferred programming language.

son'

Try It!
RESPONSE
Click Try It! to start a request and see the response here! Or choose an example:
application/json

200

Get listings for a token
get
https://api-mainnet.magiceden.dev/v2/tokens/{token_mint}/listings
Log in to see full request history
time	status	user agent
Make a request to see history.

Path Params
token_mint
string
required
Mint address of the token or asset ID of compressed NFT

Query Params
listingAggMode
boolean
True to return aggregated marketplace listings, false to return just Magic Eden listings. Defaults to false.

Responses

200
success response

400
Token not found

Updated about 1 year ago

Get instruction to have a pool fulfill a sell
Get received offers for a token
Did this page help you?
Language

Shell

Node

Ruby

PHP

Python
URL

https://api-mainnet.magiceden.dev/v2
/tokens/{token_mint}/listings
1
curl --request GET \
2
     --url https://api-mainnet.magiceden.dev/v2/tokens/token_mint/listings \
3
     --header 'accept: application/json'

Try It!
RESPONSE
Click Try It! to start a request and see the response here! Or choose an example:
application/json

200

400

Get received offers for a token
get
https://api-mainnet.magiceden.dev/v2/tokens/{token_mint}/offers_received
Log in to see full request history
time	status	user agent
Retrieving recent requests…

Path Params
token_mint
string
required
Mint address of the token

Query Params
min_price
number
Filter offers that are less than this price

max_price
number
Filter offers that


[User] What does the confidence level for Jupiter transactions indicate?

[Assistant]
The confidence level for Jupiter transactions indicates the reliability or certainty of the transaction data being provided. In the provided documentation snippet, the confidence level is marked as "high." This suggests that the transaction data, such as prices and market depth, is considered to be accurate and trustworthy, which can help users make informed decisions when engaging in transactions on the Jupiter platform.

A high confidence level typically means that the market conditions are stable and that the prices reflect the current market dynamics effectively.


[User] What is the Virtual Price in Meteora's dynamic pool and how is it calculated?

[Assistant]
In Meteora's dynamic pool, the Virtual Price is a measure of how much value is present in the pool compared to what was originally deposited. It is calculated using the following formula:

\[ \text{Virtual Price} (VP) = \frac{\text{pool value}}{\text{LP tokens}} \]

Where:
- **pool value** refers to the total value of the assets in the dynamic pool.
- **LP tokens** represents the number of liquidity provider tokens that have been issued.

The Virtual Price increases as a result of swap fees being charged on each trade within the pool, reflecting the growth in value over time.

he liquidity.

How do I create a new farm?
Farms are permissioned. You can 🎫｜open-a-ticket and the team can help create one for you. We need the following info:

Link to the pool you want to create a farm for

Token mint address for the reward token you want to give. You can specify up to two types of tokens (optional).

Duration the farm will run. We recommend 4 weeks. Whenever you add rewards it resets the farm duration. So for a 4 week farm, if you upload rewards at week 2, it will reset and distribute whatever rewards in the farm for 4 more weeks.

A wallet address for us to whitelist. This wallet will be able to load the farming rewards into a dynamic pool farm, using our farm admin dashboard (link will be given to you).

Once rewards are added into the farm, they cannot be removed. Sometimes, at the end of the farm period, there could be spare rewards remaining due to 0 LP stakers in the farm during the farm period. These remaining rewards can be linearly distributed again if you extend the farm period.

Note: For DLMM farms, the team has to load the farming rewards on your behalf, so you would have to send the rewards to us first.

What is Virtual Price in a Dynamic Pool?
Virtual price is a measure of how much value is in the pool compared to what was deposited. It is determined by dividing the dynamic pool's total value by the number of LP tokens (VP = pool_value / LP token).

The dynamic pool's value rises as a result of a swap fee being charged on each trade or w


[User] What is the expected outcome after the `hello_state.serialize` function is called in the Solana program?

[Assistant]
The expected outcome after the `hello_state.serialize` function is called in the Solana program is that the state of the `hello_state` instance, which is of type `HelloState`, will be serialized and written to the data buffer of the `hello_state_account`. This means that the current values of the `hello_state` fields, including the `is_initialized` flag, will be saved in the account's data storage on the Solana blockchain.

The serialization process converts the structured data of `hello_state` into a byte array format that can be stored in the account's data field. This allows the state to be persisted across transactions, enabling the program to retrieve and manipulate the state in future invocations.

Here is a relevant snippet from the program for context:

```rust
let mut hello_state = HelloState::try_from_slice(&hello_state_account.data.borrow())?;
hello_state.is_initialized = true;
hello_state.serialize(&mut &mut hello_state_account.data.borrow_mut()[..])?;
msg!("Account initialized :)");
```

In this code, after the `serialize` method is called, the message "Account initialized :)" is logged, indicating that the serialization was successful and the account has been initialized with the new state.

struction(
    _program_id: &Pubkey,
    accounts: &[AccountInfo],
    _instruction_data: &[u8],
) -> ProgramResult {
    let accounts_iter = &mut accounts.iter();
    // Payer account
    let _payer_account = next_account_info(accounts_iter)?;
    // Hello state account
    let hello_state_account = next_account_info(accounts_iter)?;

    // Getting clock directly
    let clock = Clock::get()?;

    let mut hello_state = HelloState::try_from_slice(&hello_state_account.data.borrow())?;
    hello_state.is_initialized = true;
    hello_state.serialize(&mut &mut hello_state_account.data.borrow_mut()[..])?;
    msg!("Account initialized :)");

    // Getting timestamp
    let current_timestamp = clock.unix_timestamp;
    msg!("Current Timestamp: {}", current_timestamp);

    Ok(())
}

The client side instruction, now only needs to pass the state and payer accounts.

clock-directly-client.rs
import {
  clusterApiUrl,
  Connection,
  Keypair,
  LAMPORTS_PER_SOL,
  PublicKey,
  SystemProgram,
  Transaction,
  TransactionInstruction,
} from "@solana/web3.js";

(async () => {
  const programId = new PublicKey(
    "4ZEdbCtb5UyCSiAMHV5eSHfyjq3QwbG3yXb6oHD7RYjk",
  );

  const connection = new Connection(clusterApiUrl("devnet"), "confirmed");
  const latestBlockHash = await connection.getLatestBlockhash();

  // Airdropping 1 SOL
  const feePayer = Keypair.generate();
  await connection.confirmTransaction(
    {
      blockhash: latestBlockHash.blockhash,
      lastValidBlockHeig


[User] In the QuickNode example provided, what does the 'updatedTxInfo' parameter represent?

[Assistant]
In the QuickNode example provided, the `updatedTxInfo` parameter represents the updated transaction information for a specific transaction identified by its transaction ID (`txId`). When you call the `onSignature` method, it sets up a listener that will be triggered whenever there is an update to the status of the specified transaction.

The `updatedTxInfo` will contain details about the transaction's current state, which may include information such as whether the transaction has been confirmed, processed, or if it has failed. This allows developers to react to changes in the transaction's status in real-time.

Here’s a snippet from the example for context:

```javascript
solanaConnection.onSignature(txId, (updatedTxInfo, context) =>
  console.log("Updated account info: ", updatedTxInfo)
);
```

In this code, whenever the transaction status changes, the updated transaction information will be logged to the console.

ermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized.
confirmed
the node will query the most recent block that has been voted on by supermajority of the cluster.
processed
the node will query its most recent block. Note that the block may not be complete.
Returns
result
The result will be an RpcResponse JSON object with id equal to the subscription id (needed to unsubscribe)
Notification Format:
result
Error if the transaction failed and null if the transaction succeeded
Request

Solana Web3.js (v1.x)
const web3 = require("@solana/web3.js");
(async () => {
  const txId =
    "2KDXTegj8bDQRXJYQeJtFYHrYL6U68EPBHK3zGdkwwcKA1pFBvkTwmdmE9mME9BQkVakg73WssPzgGgbEvL52ivw";
  const solanaConnection = new web3.Connection("https://docs-demo.solana-mainnet.quiknode.pro/", {
    wsEndpoint: "wss://docs-demo.solana-mainnet.quiknode.pro/",
  });
  solanaConnection.onSignature(txId, (updatedTxInfo, context) =>
    console.log("Updated account info: ", updatedTxInfo)
  );
})();

Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free
Previous
rootUnsubscribe
Next
signatureUnsubscribe
Chat with our community
Check out our product changelog
Check on the status of our services
Read our blog for the latest announcements
Want the latest news in Web3?
We send out the #Web3Vibes newsletter with the coolest stuff in Blockchain every month. Sign up below!

hi@example.com
signatureUns


[User] What transaction types are generated exclusively by CANDY_MACHINE_V2 according to Helius?

[Assistant]
According to the Helius documentation, the transaction type that is generated exclusively by CANDY_MACHINE_V2 is **NFT_MINT**.

This means that any NFT_MINT transactions will come specifically from the CANDY_MACHINE_V2 program, without any other sources contributing to this transaction type.

el free to reach out on our Discord.

Relation between Transaction Type and Source
The mappings below illustrate the relationship between sources (programs) and specific transaction types.

For instance, the Type-to-Source mapping indicates that NFT_GLOBAL_BID transactions are generated by MAGIC_EDEN or SOLANART, while the Source-to-Type mapping shows that CANDY_MACHINE_V2 exclusively generates NFT_MINT events.

Copy
{
  "NFT_MINT": [
    "CANDY_MACHINE_V2",
    "CANDY_MACHINE_V1",
    "CANDY_MACHINE_V3",
    "FORM_FUNCTION",
    "MAGIC_EDEN",
    "LAUNCH_MY_NFT",
    "BIFROST",
    "ATADIA",
    "ELIXIR_LAUNCHPAD",
    "SOLANA_PROGRAM_LIBRARY",
    "METAPLEX"
  ],
  "TOKEN_MINT": [
    "CANDY_MACHINE_V1",
    "ATADIA",
    "SOLANA_PROGRAM_LIBRARY"
  ],
  "CANDY_MACHINE_UPDATE": [
    "CANDY_MACHINE_V3"
  ],
  "CANDY_MACHINE_ROUTE": [
    "CANDY_MACHINE_V3"
  ],
  "CANDY_MACHINE_WRAP": [
    "CANDY_MACHINE_V3"
  ],
  "CANDY_MACHINE_UNWRAP": [
    "CANDY_MACHINE_V3"
  ],
  "NFT_BID": [
    "FORM_FUNCTION",
    "EXCHANGE_ART",
    "SOLANART",
    "MAGIC_EDEN",
    "ENGLISH_AUCTION",
    "YAWWW",
    "HYPERSPACE",
    "METAPLEX",
    "FOXY_AUCTION"
  ],
  "NFT_SALE": [
    "FORM_FUNCTION",
    "EXCHANGE_ART",
    "SOLANART",
    "MAGIC_EDEN",
    "ENGLISH_AUCTION",
    "SOLSEA",
    "YAWWW",
    "DIGITAL_EYES",
    "HYPERSPACE",
    "TENSOR",
    "METAPLEX",
    "FOXY_AUCTION"
  ],
  "NFT_LISTING": [
    "FORM_FUNCTION",
    "EXCHANGE_ART",
    "SOLANART",
    "MAGIC_EDEN",


[User] What is the maximum historical data availability for the 5-minutely interval in CoinGecko?

[Assistant] The maximum historical data availability for the 5-minutely interval in CoinGecko is 10 days. This means that when you request 5-minutely historical data, the response will include information from the past 10 days, up until the current time.

4
    ],
35
    [
36
      1711929600000,
37
      19723005998.215
38
    ],
39
    [
40
      1711983682000,
41
      30137418199.6431
42
    ]
43
  ]
44
}

Coin Historical Chart Data within Time Range by Token Address
get
https://pro-api.coingecko.com/api/v3/coins/{id}/contract/{contract_address}/market_chart/range
This endpoint allows you to get the historical chart data within certain time range in UNIX along with price, market cap and 24hrs volume based on asset platform and particular token contract address.

👍
Tips

You may obtain the asset platform and contract address via several ways:
refers to respective coin page and find ‘contract’
refers to /coins/list endpoint (include platform = true)
📘
Notes

You may leave the interval params as empty for automatic granularity:
1 day from current time = 5-minutely data
1 day from any time (except current time) = hourly data
2 - 90 days from any time = hourly data
above 90 days from any time = daily data (00:00 UTC)
For non-Enterprise plan subscribers who would like to get hourly data, please leave the interval params empty for auto granularity
The 5-minutely and hourly interval params are also exclusively available to Enterprise plan subscribers, bypassing auto-granularity:
interval=5m: 5-minutely historical data (responses include information from the past 10 days, up until now)
interval=hourly: hourly historical data
(responses include information from the past 100 days, up until now)
Data availability:
interval=5m: Availab


[User] What is the credit cost for using the Enhanced Transactions API in Helius?

[Assistant] The credit cost for using the Enhanced Transactions API in Helius is 100 credits per call.

ccounts

5 calls/sec

25 calls/sec

50 calls/sec

75  calls/sec

Photon Limits
Type
Free
Developer
Business
Professional
Photon

2 calls/sec

10 calls/sec

50 calls/sec

100 calls/sec

getValidityProof

1 call/sec

5 call/sec

10 call/sec

20  call/sec

Credits
A clear breakdown of the credit costs in our Standard plans.

Standard RPC Calls: 1 credit per call

Exceptions:

getProgramAccounts : 10 credits

Archival Calls: 10 credits each

getTransaction

getBlock

getBlocks

getInflationReward

getSignaturesForAddress

getBlockTime

Send Transaction:

Via https://mainnet.helius-rpc.com : 1 credit

Via https://staked.helius-rpc.com : 50 credits

Priority Fee API: 1 credit

DAS Calls: 10 credits each

getAsset

getAssetProof

getAssetsByOwner

getAssetsByAuthority

getAssetsByCreator

getAssetsByGroup

searchAssets

getSignaturesForAsset

getTokenAccounts

getNFTEditions

Photon Calls:

Standard Calls: 10 credits

 getValidityProofs: 100 credits (due to higher computation)

Webhook:

Webhook Pushes: 1 credit

Webhook Edits via API: 100 credits

Enhanced Transactions API and Mint API: 100 credits per call

Extra Credits
If you exhaust your credits within a billing cycle, you can purchase additional credits:

Crypto Plans — purchase additional prepaid credits directly from the dashboard

Card Payment Plans — enable autoscaling in the Project Settings on the dashboard

The rates for additional credits vary depending on your plan:

Developer
Business
Professional
$5/million extra


[User] What is the purpose of the invoke function in Solana for making a CPI?

[Assistant]
The `invoke` function in Solana is used to make a Cross-Program Invocation (CPI) by calling an instruction from another program. This allows one program to execute instructions defined in another program, enabling modular and reusable code within the Solana ecosystem.

When using the `invoke` function, the caller program can pass an `Instruction` and an array of `AccountInfo` that specifies the accounts involved in the transaction. The privileges granted to the caller program determine what privileges can be extended to the callee program, specifically regarding signers and writable accounts.

Here is the signature of the `invoke` function:

```rust
pub fn invoke(
    instruction: &Instruction,
    account_infos: &[AccountInfo<'_>]
) -> Result<(), ProgramError>
```

In summary, the `invoke` function is essential for enabling interactions between different programs on Solana, allowing developers to build complex functionalities by leveraging existing programs.

(), ProgramError>

Here is an example program on Solana Playground that makes a CPI using the invoke function to call the transfer instruction on the System Program. You can also reference the Basic CPI guide for further details.

CPI with PDA Signer #
The invoke_signed function is used when making a CPI that requires PDA signers. The seeds used to derive the signer PDAs are passed into the invoke_signed function as signer_seeds.

You can reference the Program Derived Address page for details on how PDAs are derived.

pub fn invoke_signed(
    instruction: &Instruction,
    account_infos: &[AccountInfo<'_>],
    signers_seeds: &[&[&[u8]]]
) -> Result<(), ProgramError>

The runtime uses the privileges granted to the caller program to determine what privileges can be extended to the callee. Privileges in this context refer to signers and writable accounts. For example, if the instruction the caller is processing contains a signer or writable account, then the caller can invoke an instruction that also contains that signer and/or writable account.

While PDAs have no private keys, they can still act as a signer in an instruction via a CPI. To verify that a PDA is derived from the calling program, the seeds used to generate the PDA must be included as signers_seeds.

When the CPI is processed, the Solana runtime internally calls create_program_address using the signers_seeds and the program_id of the calling program. If a valid PDA is found, the address is added as a valid signer


[User] What does the 'inAmount' in the API response indicate about the transaction for Alice?

[Assistant]
The `inAmount` in the API response indicates the estimated amount of mSOL that Alice will need to spend in order to receive exactly 5 USDC. This value is crucial for Alice as it tells her how much of her mSOL she needs to swap to complete the transaction for the latte priced at 5 USDC.

In the context of the API call, the `inAmount` is derived from the quote request made to the Jupiter API, where the input mint is mSOL and the output mint is USDC, with the swap mode set to `ExactOut`.

For example, if the response shows `inAmount` as 5000000, it means Alice needs to provide 5,000,000 units of mSOL to receive the 5 USDC.

piter API allows for building a swap transaction to receive an exact amount of token A for a maximum in amount of token B.

A Practical Example using the API
Bob is selling a delicious latte for 5 USDC, Alice only holds mSOL but Bob can use the Jupiter API to let Alice swap for exactly 5 USDC then transfer 5 USDC to his payment wallet.

First, we need to show Alice how much mSOL will he have to spend for the latte.

curl -s 'https://quote-api.jup.ag/v4/quote?inputMint=mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So&outputMint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount=5000000&swapMode=ExactOut&slippageBps=1' | jq '.data | .[0] | .inAmount, .otherAmountThreshold'

Parameters:

The input mint is mSOL and the output mint is USDC.
swapMode is ExactOut, as opposed to the default ExactIn.
we want to receive amount=5000000, 5 USDC.
Response:

inAmount is the quoted estimated amount of mSOL required to receive 5 USDC.
otherAmountThreshold is the maximum in amount, the quote above with the slippage tolerance.
info
Currently, only Orca Whirlpool, Raydium CPAMM, and Raydium CLAMM support ExactOut mode. All tokens may not be available in this mode.

Then Bob creates the transaction with the /swap endpoint, and adds a 5 USDC token transfer from Alice to his payment wallet using the destinationWallet argument, which Alice will verify, sign and send.

info
In the example bellow, we assume the associated token account exists on destinationWallet.

import { Token, TOKEN_PROGRAM_ID, ASSO


[User] How should the API key be formatted in the Authorization header for Magic Eden?

[Assistant]
The API key should be formatted in the Authorization header as follows:

```
Authorization: Bearer YOUR_API_KEY
```

Replace `YOUR_API_KEY` with the actual API key provided to you. This format is necessary to access the instruction endpoints of the Magic Eden API.

 between requests to avoid connection refusal (this applies to both users with and without API keys).
Feel free to join us on Discord!
Instruction Endpoints
Endpoints that generate instructions are currently guarded by an API key that should be present in the HTTP header. Currently this includes all of the endpoints in instructions and some of the endpoints in mmm.

Authorization Header
To access the instruction endpoints, you need to include an Authorization header in your HTTP requests. The value of the Authorization header should be Bearer followed by the API key.

Example:

Authorization: Bearer YOUR_API_KEY

Replace YOUR_API_KEY with the actual API key provided to you.

Updated 4 months ago

Solana API Overview
collections
Did this page help you?
Table of Contents
Rate Limiting
Instruction Endpoints
Authorization Header

Get activities of a collection
get
https://api-mainnet.magiceden.dev/v2/collections/{symbol}/activities
Log in to see full request history
time	status	user agent
Make a request to see history.

Path Params
symbol
string
required
collection symbol

Query Params
offset
integer
The number of items to skip, default 0, min 0

limit
integer
The numbers of items to return, default 100, min 1, max 1000

Responses

200
success response

400
Invalid symbol

Updated about 1 year ago

Solana API Keys
Get stats of a collection
Did this page help you?
Language

Shell

Node

Ruby

PHP

Python
URL

https://api-mainnet.magiceden.dev/v2
/collections/{symbol}/activities


[User] How does QuickNode's Lil JIT add-on enhance MEV opportunities for Solana transactions?

[Assistant]
The Lil JIT add-on in QuickNode's Marketplace enhances MEV (Miner Extractable Value) opportunities for Solana transactions by enabling the submission of JITO (Just-in-Time Optimization) bundles and transactions. This functionality allows developers to optimize their transactions for better performance and potential profit by strategically grouping and timing their submissions to the Solana network.

By utilizing Lil JIT, developers can take advantage of the network's capabilities to maximize the efficiency of their transactions, which can lead to improved outcomes in terms of transaction processing and potential revenue generation through MEV strategies.

For more detailed information on how to implement and utilize the Lil JIT add-on, you can refer to the [Lil JIT API documentation](#).

ext
Supported Add-Ons
Chat with our community
Check out our product changelog
Check on the status of our services
Read our blog for the latest announcements
Want the latest news in Web3?
We send out the #Web3Vibes newsletter with the coolest stuff in Blockchain every month. Sign up below!

hi@example.com
Supported Marketplace Add-Ons for Solana
Updated on
Jan 9, 2025
Overview
The QuickNode Marketplace is a platform designed to provide blockchain developers with a wide range of tools and services to extend the functionality of QuickNode. Whether you are developing dApps, analyzing blockchain data, or managing infrastructure, the Marketplace offers add-ons that integrate seamlessly into your workflow, enabling efficient and effective development.

For detailed information, visit the Marketplace Add-Ons documentation page.

Notes
To explore more Marketplace Add-Ons, check them out here.

Supported Marketplace Add-Ons for Solana
The following add-ons are available in the QuickNode Marketplace for Solana:

Supported Add-Ons	Description	API Docs Link
Lil JIT - JITO Bundles and Transactions	Enables the submission of JITO bundles and transactions for Solana, optimizing MEV opportunities.	Lil JIT
Solana DAS (Digital Asset Standard) API	Provides access to Metaplex DAS API for managing and querying Solana digital assets (NFTs).	Solana DAS API
Priority Fee API	Allows setting priority fees for Solana transactions to optimize processing times on the network.	Priority Fee API
Metis - Jupit


[User] Where can users find the documentation and instructions for Proof of Concept (PoC) related to Raydium?

[Assistant]
Users can find the documentation and instructions for Proof of Concept (PoC) related to Raydium in the following locations:

1. Raydium's full bug bounty program with ImmuneFi can be found at: [ImmuneFi Raydium Bug Bounty](https://immunefi.com/bounty/raydium/).

2. The specific documentation and instructions for PoC can be found in the Raydium Hybrid AMM overview document.

These resources provide the necessary information for users interested in submitting vulnerabilities or conducting tests related to Raydium.

wYx. However, note that testing on the public testnet is prohibited by the program rules. The public testnet is provided for reference only.

If a Critical Impact can be caused to any other asset managed by Raydium that isn’t on this table but for which the impact is in the Impacts in Scope section below, you are encouraged to submit it for consideration.

Concentrated Liquidity Assets in Scope
Logo
GitHub - raydium-io/raydium-clmm: Open-Source Concentrated Liquidity Market Maker
GitHub
Please email security@reactorlabs.io with a detailed description of the attack vector. For high- and critical-severity reports, please include a proof of concept. We will reach back out within 24 hours with additional questions or next steps on the bug bounty.

Hybrid AMM Bug Bounty Details
Raydium's full bug bounty program with ImmuneFi can be found at: https://immunefi.com/bounty/raydium/

Documentation and instruction for PoC can be found here:

Raydium Hybrid AMM overview document

A public testnet of Raydium’s AMM can be found at:
AMMjRTfWhP73x9fM6jdoXRfgFJXR97NFRkV8fYJUrnLE

A public testnet of OpenBook’s Central Limit Order Book can be found at: EoTcMgcDRTJVZDMZWBoU6rhYHZfkNTVEAfz3uUJRcYGj

If a Critical Impact can be caused to any other asset managed by Raydium that isn’t included here but for which the impact is in the Impacts in Scope section below, you are encouraged to submit it for consideration by the project.

Hybrid AMM Assets in Scope
Logo
GitHub - raydium-io/raydium-amm
G


[User] What steps should you take in WSL to start a local Solana validator?

[Assistant]
To start a local Solana validator in Windows Subsystem for Linux (WSL), follow these steps:

1. **Navigate to a writable directory**: First, you need to ensure you are in a directory where you have default write access. You can do this by executing the following commands in your terminal:

   ```bash
   cd ~
   mkdir validator
   cd validator
   ```

2. **Start the local validator**: Run the Solana test validator by executing the following command:

   ```bash
   solana-test-validator
   ```

3. **Update Solana CLI configuration**: Make sure to set the Solana CLI configuration to use the localhost before executing any commands. You can do this with the following command:

   ```bash
   solana config set -ul
   ```

Following these steps will set up and start your local Solana validator in WSL.

y and test your programs locally.

In a separate terminal, run the following command to start a local validator:

solana-test-validator

Info
In WSL you may need to first navigate to a folder where you have default write access:

cd ~
mkdir validator
cd validator
solana-test-validator

Make sure to update the Solana CLI config to localhost before commands.

solana config set -ul

Getting Started with Solana Development
Welcome to the Solana developer docs!

This page has everything you need to know to get started with Solana development, including basic requirements, how Solana development works, and the tools you'll need to get started.

High Level Developer Overview #
Development on Solana can be broken down into two main parts:

Onchain Program Development: This is where you create and deploy custom programs directly to the blockchain. Once deployed, anyone who knows how to communicate with them can use them. You can write these programs in Rust, C, or C++. Rust has the most support for onchain program development today.
Client Development: This is where you write software (called decentralized applications, or dApps) that communicates with onchain programs. Your apps can submit transactions to perform actions onchain. Client development can be written in any programming language.
The "glue" between the client side and the onchain side is the Solana JSON RPC API. The client-side sends RPC requests to the Solana network to interact with onchain programs. This is very simila


[User] How can I find the official website of a token using the CoinGecko API?

[Assistant]
To find the official website of a token using the CoinGecko API, you can use the endpoint that retrieves specific token information based on the token's contract address. The official website URL is included in the response data.

Here’s how you can do it:

### API Endpoint
You will need to make a GET request to the following endpoint:
```
GET https://pro-api.coingecko.com/api/v3/onchain/networks/{network}/tokens/{address}/info
```
Replace `{network}` with the appropriate network (e.g., `eth` for Ethereum) and `{address}` with the token's contract address.

### Example Request
Here’s an example using `curl` to get information about a token:

```bash
curl --request GET \
     --url https://pro-api.coingecko.com/api/v3/onchain/networks/eth/tokens/0xdac17f958d2ee523a2206206994597c13d831ec7/info \
     --header 'accept: application/json'
```

### Example Response
The response will include various details about the token, including the official website. Here is a snippet of the expected response:

```json
{
  "data": {
    "id": "eth_0xdac17f958d2ee523a2206206994597c13d831ec7",
    "type": "token",
    "attributes": {
      "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
      "name": "Tether USD",
      "symbol": "USDT",
      "websites": [
        "https://tether.to/"
      ],
      ...
    }
  }
}
```

### Accessing the Official Website
In the response, you can find the official website under the `websites` attribute. For example, for Tether (USDT), the official website is:
```
https://tether.to/
```

This is how you can retrieve the official website of a token using the CoinGecko API.

ring
required
token contract address

Response

200
Get specific token info on a network

Response body
object
data
object
id
string
type
string
attributes
object

attributes object
Updated about 1 month ago

Tokens Data by Token Addresses
Pool Tokens Info by Pool Address
Did this page help you?
Language

Shell

Node

Ruby

PHP

Python
Credentials
x-cg-pro-api-key

Log in to use your API keys
1
curl --request GET \
2
     --url https://pro-api.coingecko.com/api/v3/onchain/networks/network/tokens/address/info \
3
     --header 'accept: application/json'

Try It!
RESPONSE
1
{
2
  "data": {
3
    "id": "eth_0xdac17f958d2ee523a2206206994597c13d831ec7",
4
    "type": "token",
5
    "attributes": {
6
      "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
7
      "name": "Tether USD",
8
      "symbol": "USDT",
9
      "image_url": "https://assets.coingecko.com/coins/images/325/small/Tether.png?1696501661",
10
      "coingecko_coin_id": "tether",
11
      "websites": [
12
        "https://tether.to/"
13
      ],
14
      "description": "Tether (USDT) is a cryptocurrency with a value meant to mirror the value of the U.S. dollar...",
15
      "gt_score": 92.6605504587156,
16
      "discord_url": null,
17
      "telegram_handle": null,
18
      "twitter_handle": "Tether_to",
19
      "categories": [],
20
      "gt_categories_id": []
21
    }
22
  }
23
}

Pool Tokens Info by Pool Address
get
https://pro-api.coingecko.com/api/v3/onchain/networks/{network}/pools/{pool_address}/inf


[User] Does using the Pump Portal Interface grant users any proprietary rights?

[Assistant] No, using the Pump Portal Interface does not grant users any proprietary rights. According to the documentation, unless expressly authorized by Pump Portal, users may not copy, modify, adapt, rent, license, sell, publish, distribute, or otherwise permit any third party to access or use the Interface or any of its contents. Accessing or using the Interface does not constitute a grant of any proprietary intellectual property or other rights in the Interface or its contents.

essly relieve us of any and all liability arising from your use of any such resources or participation in any such promotions.

6. Intellectual Proprietary Rights
Unless expressly authorized by us, you may not copy, modify, adapt, rent, license, sell, publish, distribute, or otherwise permit any third party to access or use the Interface or any of its contents. Accessing or using the Interface does not constitute a grant to you of any proprietary intellectual property or other rights in the Interface or its contents.

You will retain ownership of all intellectual property and other rights in any information and materials you submit through the Interface. However, by uploading such information or materials, you grant us a worldwide, royalty-free, irrevocable license to use, copy, distribute, publish and send this data in any manner in accordance with applicable laws and regulations.

You may choose to submit comments, bug reports, ideas, or other feedback about the Interface, including, without limitation, about how to improve the Interface (collectively, “Feedback”). By submitting any Feedback, you agree that we are free to use such Feedback at our discretion and without additional compensation to you, and to disclose such Feedback to third parties (whether on a non-confidential basis or otherwise). If necessary under applicable law, then you hereby grant us a perpetual, irrevocable, non-exclusive, transferable, worldwide license under all rights necessary for us to incorpora


[User] What is the required format for the 'transaction' value in Solana's ActionPostResponse?

[Assistant]
The required format for the 'transaction' value in Solana's `ActionPostResponse` is a base64-encoded serialized transaction. This means that the transaction must be encoded in base64 format, and the client must base64-decode the transaction and deserialize it for further processing.

Here’s a brief example of how the `ActionPostResponse` might look:

```typescript
const response: ActionPostResponse = {
  transaction: "BASE64_ENCODED_TRANSACTION_HERE",
  message: "Transaction successful!",
  links: {
    next: {
      // Next action link details
    }
  }
};
```

In this example, the `transaction` field contains a placeholder for the actual base64-encoded transaction string.

 a helpful error message to users. See Action Errors.

POST Response Body #
A POST response with an HTTP OK JSON response should include a body payload of:

ActionPostResponse
/**
 * Response body payload returned from the Action POST Request
 */
export interface ActionPostResponse<T extends ActionType = ActionType> {
  /** base64 encoded serialized transaction */
  transaction: string;
  /** describes the nature of the transaction */
  message?: string;
  links?: {
    /**
     * The next action in a successive chain of actions to be obtained after
     * the previous was successful.
     */
    next: NextActionLink;
  };
}

transaction - The value must be a base64-encoded serialized transaction. The client must base64-decode the transaction and deserialize it.

message - The value must be a UTF-8 string that describes the nature of the transaction included in the response. The client should display this value to the user. For example, this might be the name of an item being purchased, a discount applied to a purchase, or a thank you note.

links.next - An optional value use to "chain" multiple Actions together in series. After the included transaction has been confirmed on-chain, the client can fetch and render the next action. See Action Chaining for more details.

The client and application should allow additional fields in the request body and response body, which may be added by future specification updates.

Info
The application may respond with a partially or fully si


[User] What is the significance of the 'lp_mint' in the context of Meteora's liquidity pools?

[Assistant]
In the context of Meteora's liquidity pools, the 'lp_mint' refers to the Liquidity Pool (LP) Token mint address. This is significant for several reasons:

1. **Representation of Ownership**: The LP tokens represent a user's share in the liquidity pool. When a user adds liquidity to a pool, they receive LP tokens in return, which signify their ownership stake in that pool.

2. **Earning Rewards**: LP tokens are often used to earn rewards. Users can stake their LP tokens in various farming protocols to earn additional tokens or rewards, thus incentivizing liquidity provision.

3. **Withdrawal Mechanism**: To withdraw their share of the liquidity pool, users must present their LP tokens. The amount of LP tokens a user holds determines how much of the pool's assets they can redeem.

4. **Tracking Pool Performance**: The LP mint address is essential for tracking the performance and value of the liquidity pool, as it is tied to the specific pool's tokenomics.

Overall, the 'lp_mint' is a crucial component for users participating in liquidity pools on Meteora, as it encapsulates their investment and potential earnings within the ecosystem.

81017434050821

https://x.com/MeteoraAG/status/1812512465345040803

https://x.com/MeteoraAG/status/1817577695661924827

https://x.com/MeteoraAG/status/1822652568948068839

https://x.com/MeteoraAG/status/1828079101955240438

https://x.com/MeteoraAG/status/1830614540335387059

Breakpoint 2024 Edition: https://x.com/MeteoraAG/status/1836962199585312963

https://x.com/MeteoraAG/status/1838224716865339591

https://x.com/MeteoraAG/status/1840760813583495400

https://x.com/MeteoraAG/status/1843297549664596453

https://x.com/MeteoraAG/status/1845853802114728234

https://x.com/MeteoraAG/status/1848371272260190697

https://x.com/MeteoraAG/status/1850908217741906086

https://x.com/MeteoraAG/status/1853444551228473347

https://x.com/MeteoraAG/status/1855282309215510816

https://x.com/MeteoraAG/status/1858518291024883917

Pool Info
You can retrieve key pool information by accessing the Swagger UI or the API:

Swagger UI
Main

Logo
Swagger UI
Devnet

Swagger UI
API
Main API

https://amm-v2.meteora.ag/pools

Devnet API

http://devnet-amm-v2.meteora.ag/

Key information that can be retrieved:

Type field
Description
pool_address

Token mint address of the token in the pool
e.g.  USDC-USDT

pool_token_mints

Pool token mints for the pool, for both tokens

pool_token_amounts

Pool token amounts for both tokens

pool_token_usd_amounts

Pool tokens amounts in USD value

lp_mint

Liquidity Pool(LP) Token mint address

pool_tvl

Pool Total Value Locked

farm_tvl

Farm Total Value Locked

farmin


[User] Why does Solana use ns64 for type conversions between Rust and Javascript?

[Assistant]
Solana uses `ns64` for type conversions between Rust and JavaScript because JavaScript's default number type can only handle up to 53-bit integers, while Rust provides support for 64-bit integers with its `u64` type.

The `ns64` type comes from the `@solana/buffer-layout` library, which facilitates the conversion of data types between Rust and JavaScript. By using `ns64`, developers can accurately represent and manipulate 64-bit unsigned integers in JavaScript, ensuring compatibility with Rust's data types when working with Solana's instructions and data structures.

This is crucial for maintaining data integrity and ensuring that operations that rely on 64-bit integers function correctly across the two programming environments.

eNonceAccount,
    /** 5 **/WithdrawNonceAccount(u64),
    /** 6 **/InitializeNonceAccount(Pubkey),
    /** 7 **/AuthorizeNonceAccount(Pubkey),
    /** 8 **/Allocate {/**/},
    /** 9 **/AllocateWithSeed {/**/},
    /** 10 **/AssignWithSeed {/**/},
    /** 11 **/TransferWithSeed {/**/},
    /** 12 **/UpgradeNonceAccount,
}

Next up is u32('instruction').

{
  index: 8,
  layout: struct([
    u32('instruction'), /* <-- */
    ns64('space'),
  ])
}

The layout in the allocate struct must always have u32('instruction') first when you are using it to call an instruction.

{
  index: 8,
  layout: struct([
    u32('instruction'),
    ns64('space'), /* <-- */
  ])
}

ns64('space') is the argument for the allocate function. You can see in the original allocate function in Rust that space was of the type u64. u64 is an unsigned 64bit integer. Javascript by default only provides up to 53bit integers. ns64 comes from @solana/buffer-layout to help with type conversions between Rust and Javascript. You can find more type conversions between Rust and Javascript at solana-labs/buffer-layout.

let data = Buffer.alloc(allocateStruct.layout.span);
let layoutFields = Object.assign({ instruction: allocateStruct.index }, params);
allocateStruct.layout.encode(layoutFields, data);

Using the previously created bufferLayout, we can allocate a data buffer. We then assign our params { space: 100 } so that it maps correctly to the layout, and encode it to the data buffer. Now the data is ready to be se


[User] How does Sats Connect simplify the process of requesting message signing in Magic Eden?

[Assistant]
Sats Connect simplifies the process of requesting message signing in Magic Eden by providing a straightforward API that allows developers to easily prompt users to sign messages without needing to handle the underlying complexities of the wallet connection and signing process.

Here’s how it works:

1. **Easy Integration**: Developers can import the `signMessage` function from the `sats-connect` library, making it simple to integrate message signing into their applications.

2. **Configuration**: The `signMessage` function requires a configuration object that includes the network type, the user's wallet address, and the message to be signed. This encapsulates all necessary parameters in a single call.

3. **Callbacks for User Interaction**: The API provides callback functions (`onFinish` and `onCancel`) to handle the user's response to the signing request. This allows developers to easily manage the outcome of the signing process, whether it is successful or canceled.

Here’s an example of how to use Sats Connect for signing a message:

```javascript
import { BitcoinNetworkType, signMessage } from 'sats-connect';

// Example address (in a real app, this would be the user's 'payment' address)
const nativeSegwitAddress = 'bc1qcdmvsc8qqk8sr2st3mttu6fsmfrjzh5xrf4dch';

async function signWalletMessage() {
  try {
    await signMessage({
      payload: {
        network: {
          type: BitcoinNetworkType.Mainnet,
        },
        address: nativeSegwitAddress,
        message: 'Hello World. Welcome to the Magic Eden wallet!',
      },
      onFinish: (response) => {
        alert(`Successfully signed message: ${response}`);
      },
      onCancel: () => {
        alert('Request canceled');
      },
    });
  } catch (error) {
    console.error('Error signing message:', error);
  }
}
```

In this example:
- The `signMessage` function is called with the necessary parameters.
- The user is prompted to sign the message, and the application can handle the response accordingly.

Overall, Sats Connect abstracts the complexity of wallet interactions, making it easier for developers to implement message signing in their applications on Magic Eden.

allet address objects, defined as:

Copy
type address = {
    address: string;
    publicKey: string;
    purpose: "payment" | "ordinals";
}
Where:

address field
Description
address

The user’s connected  address

publicKey

A hex string representing the bytes of the public key of the account.

purpose

The purpose of the address:

payment is used to manage the user’s bitcoin

ordinals is used to manage the user’s ordinals

Signing a Message
When a web application has established a connection to the ME wallet, it can prompt users to sign a message. This is commonplace amongst many dApps, as it gives application owners the ability to verify ownership of the wallet. Signing a message does not require any transaction fees.

Sats Connect provides an easy way to request message signing. Let's take a look at the code below.

Copy
import { BitcoinNetworkType, signMessage } from 'sats-connect';

// in a real app, you'll use the ME 'payment' address returned after a connection
const nativeSegwitAddress = 'bc1qcdmvsc8qqk8sr2st3mttu6fsmfrjzh5xrf4dch'

async function signWalletMessage() {
  try {
    await signMessage({
      payload: {
        network: {
          type: BitcoinNetworkType.Mainnet,
        },
        address: nativeSegwitAddress,
        message: 'Hello World. Welcome to the Magic Eden wallet!',
      },
      onFinish: (response) => {
        alert(`Successfully signed message: ${response}`);
      },
      onCancel: () => {
        alert('Request canceled');
      }


[User] How does the 'layout' property in 'allocateStruct' define the structure of the data in Solana?

[Assistant]
In Solana, the `layout` property in the `allocateStruct` defines the structure of the data that will be encoded and sent in a transaction. It uses a schema to specify how the data is organized, which is crucial for ensuring that the data can be correctly interpreted by the program that receives it.

In the provided example, the `layout` is defined using the `struct` function, which creates a structure with specified fields. The structure in this case consists of two fields:

1. **instruction**: This is a `u32` type, which means it is a 32-bit unsigned integer. It typically represents the instruction index or type that indicates what action the program should take.

2. **space**: This is a `ns64` type, which typically represents a 64-bit signed integer. It could be used to specify the amount of space to allocate or some other relevant numeric value.

Here’s the relevant part of the code for clarity:

```javascript
const allocateStruct = {
  index: 8,
  layout: struct([u32("instruction"), ns64("space")]),
};
```

The `layout` property is crucial because it defines how the data will be encoded into a buffer before being sent in a transaction. The `encode` method is then used to convert the structured data into a binary format that can be transmitted over the network.

In the example, the `layoutFields` object is created by combining the instruction index with other parameters, and then it is encoded into a buffer:

```javascript
let data = Buffer.alloc(allocateStruct.layout.span);
let layoutFields = Object.assign({ instruction: allocateStruct.index }, params);
allocateStruct.layout.encode(layoutFields, data);
```

This encoded `data` is then included in the `TransactionInstruction` that is sent to the Solana network. The structure defined by the `layout` ensures that the receiving program can correctly decode and interpret the data it receives.

allocateStruct = {
  index: 8,
  layout: struct([u32("instruction"), ns64("space")]),
};

let data = Buffer.alloc(allocateStruct.layout.span);
let layoutFields = Object.assign({ instruction: allocateStruct.index }, params);
allocateStruct.layout.encode(layoutFields, data);

allocateTransaction.add(
  new web3.TransactionInstruction({
    keys,
    programId: web3.SystemProgram.programId,
    data,
  }),
);

await web3.sendAndConfirmTransaction(connection, allocateTransaction, [
  payer,
  keypair,
]);

Web3.js API Examples
Web3 API Reference Guide #
The @solana/web3.js library is a package that has coverage over the Solana JSON RPC API.

You can find the full documentation for the @solana/web3.js library here.

General #
Connection #
Source Documentation

Connection is used to interact with the Solana JSON RPC. You can use Connection to confirm transactions, get account info, and more.

You create a connection by defining the JSON RPC cluster endpoint and the desired commitment. Once this is complete, you can use this connection object to interact with any of the Solana JSON RPC API.

Example Usage #
const web3 = require("@solana/web3.js");

let connection = new web3.Connection(web3.clusterApiUrl("devnet"), "confirmed");

let slot = await connection.getSlot();
console.log(slot);
// 93186439

let blockTime = await connection.getBlockTime(slot);
console.log(blockTime);
// 1630747045

let block = await connection.getBlock(slot);
console.log(block);

/*
{
    blockHeight:


[User] Why is it important to verify the contract address before performing a swap on Raydium?

[Assistant]
It is important to verify the contract address before performing a swap on Raydium because Raydium operates as a decentralized protocol with a fully permissionless token listing. This means that any project or team can create a liquidity pool and list its token without prior approval. Consequently, there is a risk of encountering fraudulent or malicious contracts that could lead to the loss of funds.

By ensuring that you are interacting with the correct contract address, you can protect yourself from scams and ensure that your transactions are executed safely. Always double-check the contract address against official sources or verified platforms to avoid potential pitfalls.

d the chain.

To improve your chances of landing a transaction, you can increase your priority fees on the top right corner of your screen.
However, be careful not to overspend on priority fees, they are non-deterministic and do not guarantee bloc inclusion.

Swap FAQ
A swap is an exchange of a token for another.

Raydium swaps are performed by its smart contracts deployed on Solana. They are executed against the depositors' liquidity. Hence, they don't require any intermediary, unlike trades on custodian exchanges.

The exchange rate is calculated following predefined mathematical formulas available on Git Hub and accounting for the available tokens in the pools.

Raydium's liquidity comes from its own liquidity pools. Raydium routing engine can through several pools perform a swap to find the best execution and limit slippage.

Raydium is a decentralized protocol. The token listing on Raydium is fully permissionless. That means that any project or team can create a pool and list its token.

Raydium recommends being particularly mindful of the contract address before swapping.

When you swap in a Raydium liquidity pool, the fees charged range from 1% to 0.01% depending on the pool you are swapping through.

Those fees are distributed following this repartition:

AMM pools

88% is redeposited into the liquidity pool and acts as a reward for liquidity providers.

12% is used to buy back the RAY token

CLMM pool

84% is redeposited into the liquidity pool and acts as a


[User] How can you specify a limit on the number of transaction signatures retrieved from ChainStack?

[Assistant]
To specify a limit on the number of transaction signatures retrieved from ChainStack using the Solana `getSignaturesForAddress` method, you can use the `options` parameter, which allows you to set a `limit`.

Here is an example of how to structure your request with a limit:

```bash
curl --request POST \
     --url https://nd-326-444-187.p2pify.com/9de47db917d4f69168e3fed02217d15b/ \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "getSignaturesForAddress",
  "params": [
    "CxELquR1gPP8wHe33gZ4QxqGB3sZ9RSwsJ2KshVewkFY",
    {
      "limit": 10
    }
  ]
}
'
```

In this example, the request retrieves the signatures for the specified address, limiting the response to a maximum of 10 signatures. You can adjust the `limit` value as needed to control the number of signatures returned.

shVewkFY
Response

200
Recent prioritization fees details

Updated 10 months ago

getRecentPerformanceSamples | Solana
getSignaturesForAddress | Solana
Did this page help you?
Language

Shell

Node

Ruby

PHP

Python
1
curl --request POST \
2
     --url https://nd-326-444-187.p2pify.com/9de47db917d4f69168e3fed02217d15b/ \
3
     --header 'accept: application/json' \
4
     --header 'content-type: application/json' \
5
     --data '
6
{
7
  "id": 1,
8
  "jsonrpc": "2.0",
9
  "method": "getRecentPrioritizationFees",
10
  "params": [
11
    [
12
      "CxELquR1gPP8wHe33gZ4QxqGB3sZ9RSwsJ2KshVewkFY"
13
    ]
14
  ]
15
}
16
'

getSignaturesForAddress | Solana
post
https://nd-326-444-187.p2pify.com/9de47db917d4f69168e3fed02217d15b/
Solana getSignaturesForAddress method
The Solana getSignaturesForAddress method returns the confirmed signatures for transactions involving an address.

This method provides a list of signatures for transactions that involve a specific address. It is useful for tracking the transaction history of an address.

👍
Get you own node endpoint today

Start for free and get your app to production levels immediately. No credit card required.

You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters
address — the public key of the address to retrieve signatures for.
options — (optional) additional options:
limit — the maximum number of signatures to return.
before — only return signatures before this signature.
until — only return signatures u


[User] What should I do if I want to amend my information on DexScreener?

[Assistant]
If you want to amend your information on DexScreener, you can do so by following these steps:

1. **Sign in to Your Account**: If you have an account, log in to it.
2. **Visit Account Settings**: Navigate to the account settings section that allows you to manage your personal information.
3. **Update Your Information**: Make the necessary changes to your information.

If you do not have an account or prefer to request assistance, you can also contact DexScreener directly to request access to, correct, or delete any personal information that you have provided.

ht to delete or request that We assist in deleting the Personal Data that We have collected about You.

Our Service may give You the ability to delete certain information about You from within the Service.

You may update, amend, or delete Your information at any time by signing in to Your Account, if you have one, and visiting the account settings section that allows you to manage Your personal information. You may also contact Us to request access to, correct, or delete any personal information that You have provided to Us.

Please note, however, that We may need to retain certain information when we have a legal obligation or lawful basis to do so.

Disclosure of Your Personal Data
Business Transactions
If the Company is involved in a merger, acquisition or asset sale, Your Personal Data may be transferred. We will provide notice before Your Personal Data is transferred and becomes subject to a different Privacy Policy.

Law enforcement
Under certain circumstances, the Company may be required to disclose Your Personal Data if required to do so by law or in response to valid requests by public authorities (e.g. a court or a government agency).

Other legal requirements
The Company may disclose Your Personal Data in the good faith belief that such action is necessary to:

Comply with a legal obligation

Protect and defend the rights or property of the Company

Prevent or investigate possible wrongdoing in connection with the Service

Protect the personal safety of Users of t


[User] What are the key features of Helius Websockets for developers, businesses, and professionals?

[Assistant]
Helius Websockets provide several key features for developers, businesses, and professionals:

1. **Persistent Two-Way Communication**: Websockets allow for real-time, persistent communication between a client and a server, facilitating continuous data streams.

2. **Real-Time Data Streams**: This feature is particularly beneficial for applications that require immediate updates and interactions with on-chain data.

3. **Availability**: Solana Websockets are accessible for Developer, Business, and Professional plans, making them suitable for a range of use cases.

4. **Fragile Connection Type**: It is important to note that Websockets can drop off unexpectedly. Therefore, implementing robust reconnection logic is essential for maintaining a stable connection.

5. **Alternative Option**: For more reliable data streaming, users are encouraged to consider using Geyser, which may provide a more stable solution compared to Websockets.

These features make Helius Websockets a powerful tool for developers and businesses looking to leverage real-time data in their applications.

ations or applications requiring guaranteed message delivery.

 Standard Websockets

Websockets allow persistent, two-way communication between a client and a server, enabling real-time data streams. Solana Websockets are available for Developer, Business, and Professional plans. Websockets are a fragile connection type and can drop off unexpectedly. Implement a robust reconnection logic or consider using Geyser for more reliable data streaming.

Event Notifications
Webhooks

Webhooks notify you of onchain events in real-time. With support for over 70 transaction types, you can automate your app's interactions with Solana without complex smart contract parsers. A single webhook can support up to 100,000 addresses. Ideal for automating responses to specific on-chain events and handling large address sets. Not recommended for applications requiring sub-second latency or those with frequently changing address lists.

Solana APIs 🌉
Helius offers various APIs for interacting with NFTs, compressed NFTs, and tokens, calculating priority fees, and parsing transactions.

Priority Fee API
The Priority Fee API enables you to add optional fees to your transactions to incentivize block producers (leaders) to include your transaction in the next block. This API is useful for improving transaction landing rates, especially during periods of high network congestion.

Enhanced Transaction APIs
The Enhanced Transactions API provides enriched, descriptive context for Solana transactions. Instea


[User] How does the #[account] macro function in a Solana Anchor program?

[Assistant]
The `#[account]` macro in a Solana Anchor program is used to annotate structs that represent account data, which is the data type stored in the `AccountInfo`'s data field. This macro helps define the structure of the account that will be created and managed by the program.

When you define a struct with the `#[account]` macro, it specifies that the struct will hold the data for a Solana account. The fields within the struct represent the data that will be stored in the account.

For example, consider the following struct definition:

```rust
#[account]
pub struct MessageAccount {
    pub user: Pubkey,
    pub message: String,
    pub bump: u8,
}
```

In this example:
- `MessageAccount` is annotated with `#[account]`, indicating that it represents an account's data structure.
- The struct contains three fields:
  - `user`: A `Pubkey` representing the user who created the message account.
  - `message`: A `String` that stores the message created by the user.
  - `bump`: A `u8` that is typically used for account address derivation to prevent address collisions.

The `#[account]` macro not only defines the structure but also provides additional functionalities such as validation and serialization/deserialization of the account data when interacting with the Solana blockchain.

This macro is essential for creating and managing accounts in Anchor programs, ensuring that the data is properly structured and accessible.

   pub fn create(_ctx: Context<Create>) -> Result<()> {
        Ok(())
    }

    pub fn update(_ctx: Context<Update>) -> Result<()> {
        Ok(())
    }

    pub fn delete(_ctx: Context<Delete>) -> Result<()> {
        Ok(())
    }
}

#[derive(Accounts)]
pub struct Create {}

#[derive(Accounts)]
pub struct Update {}

#[derive(Accounts)]
pub struct Delete {}

#[account]
pub struct MessageAccount {}

Before we begin, run build in the Playground terminal to check the starter program builds successfully.

Terminal
build

Output
Terminal
$ build
Building...
Build successful. Completed in 3.50s.

Define Message Account Type #
First, let's define the structure for the message account that our program will create. This is the data that we'll store in the account created by the program.

In lib.rs, update the MessageAccount struct with the following:

lib.rs
#[account]
pub struct MessageAccount {
    pub user: Pubkey,
    pub message: String,
    pub bump: u8,
}

Diff
- #[account]
- pub struct MessageAccount {}

+ #[account]
+ pub struct MessageAccount {
+    pub user: Pubkey,
+    pub message: String,
+    pub bump: u8,
+ }

Explanation
The #[account] macro in an Anchor program is used to annotate structs that represent account data (data type to store in the AccountInfo's data field).

In this example, we're defining a MessageAccount struct to store a message created by users that contains three fields:

user - A Pubkey representing the user who created the message account


[User] What features does the CoinGecko search endpoint offer for users looking for coins, categories, and markets?

[Assistant]
The CoinGecko search endpoint offers users the ability to search for various items listed on CoinGecko, specifically focusing on the following features:

1. **Coins**: Users can search for specific cryptocurrencies by name or symbol.
2. **Categories**: The endpoint allows users to explore different categories of cryptocurrencies.
3. **Markets**: Users can also search for markets where these cryptocurrencies are traded.

This functionality helps users quickly find relevant information about cryptocurrencies, their classifications, and the trading platforms available for them.

Here is an example of how you might use the search endpoint:

```http
GET /search?query=bitcoin
```

This request would return search results related to "bitcoin," including coins, categories, and markets associated with it.

es on CoinGecko
/derivatives/exchanges	Query all the derivatives exchanges with related data (id, name, open interest, .... etc) on CoinGecko
/derivatives/exchanges/{id}	Query the derivatives exchange’s related data (id, name, open interest, .... etc) based on the exchanges’ id
/derivatives/exchanges/list	Query all the derivatives exchanges with id and name on CoinGecko

CoinGecko Endpoints: General
Endpoint	Description
/exchange_rates	Query BTC exchange rates with other currencies.
/asset_platforms	Query all the asset platforms (blockchain networks) on CoinGecko.
👑 /token_lists/{asset_platform_id}/all.json	Get full list of tokens of a blockchain network (asset platform) that is supported by Ethereum token list standard
/search	Search for coins, categories and markets listed on CoinGecko
/search/trending	Query trending search coins, nfts and categories on CoinGecko in the last 24 hours
/global	Query cryptocurrency global data including active cryptocurrencies, markets, total crypto market cap and etc
/global/decentralized_finance_defi	Query cryptocurrency global decentralized finance (defi) data including defi market cap, trading volume
💼 /global/market_cap_chart	Query historical global market cap and volume data by number of days away from now
/companies/public_treasury/{coin_id}	Query public companies’ bitcoin or ethereum holdings

💼 Onchain DEX Endpoints (GeckoTerminal)
Endpoint	Description
/onchain/simple/networks/{..}/token_price/{addresses}	Get token price based on the


[User] What is the required parameter for the 'getTokenSupply' method in Alchemy and what does it represent?

[Assistant]
The required parameter for the 'getTokenSupply' method in Alchemy is a base-58 encoded string that represents the public key (Pubkey) of the token Mint you want to query. This parameter is essential as it identifies the specific SPL Token type for which you want to retrieve the total supply.

Here’s a brief overview of the parameter:

- **Parameter**: `<base-58 encoded string>`
- **Description**: Pubkey of the token Mint to query

For example, in a request, it would look like this:

```json
"params": [
    "HfYFjMKNZygfMC8LsQ8LtpPsPxEJoXJx4M6tqi75Hajo"
]
```

In this example, `"HfYFjMKNZygfMC8LsQ8LtpPsPxEJoXJx4M6tqi75Hajo"` is the base-58 encoded string representing the public key of the token Mint.

thod": "getTokenAccountsByOwner"
}
'

Response

200
Response body
object
id
integer
jsonrpc
string
result
object
context
object

context object
value
object

value object

getTokenSupply
post
https://{network}.g.alchemy.com/v2/{apiKey}
Returns the total supply of an SPL Token type.

Parameters
<base-58 encoded string> - Pubkey of token Mint to query
<object> - (optional) Config object:
commitment: <object> - (optional) Configures the commitment level of the blocks queried
Accepts one of the following strings: ["finalized", "confirmed", "processed"]
For more info, refer to this doc.
Results
amount: <u64 string> - the raw balance without decimals
decimals: <u8> - number of base 10 digits to the right of the decimal place
uiAmountString: <string> - the balance as a string, using mint-prescribed decimals
Example
Request
cURL

curl --location --request POST 'https://solana-mainnet.g.alchemy.com/v2/demo/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getTokenSupply",
    "params": [
        "HfYFjMKNZygfMC8LsQ8LtpPsPxEJoXJx4M6tqi75Hajo"
    ]
}'
Response
JavaScript

{
    "jsonrpc": "2.0",
    "result": {
        "context": {
            "slot": 137571639
        },
        "value": {
            "amount": "999999999997060679",
            "decimals": 9,
            "uiAmount": 9.999999999970608E8,
            "uiAmountString": "999999999.997060679"
        }
    },
    "id": 1
}
Path Params
apiKey
string
required
Defa


[User] Which version of solana-core is required to use the getHighestSnapshotSlot method in QuickNode?

[Assistant] The `getHighestSnapshotSlot` method in QuickNode requires solana-core version 1.9 or newer.

ments
Want the latest news in Web3?
We send out the #Web3Vibes newsletter with the coolest stuff in Blockchain every month. Sign up below!

hi@example.com
getHealth RPC Method
Returns the current health of the node. The API credit value for this method is 30.
Updated on
Sep 20, 2024
Parameters
This method does not accept any parameters
Returns
result
Ok, if the node is healthy or JSON RPC error response, if the node is unhealthy. Please note that the specifics of the error response are UNSTABLE and may change in the future
Request

Curl
curl https://docs-demo.solana-mainnet.quiknode.pro/ \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","id":1, "method":"getHealth"}'
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free
Previous
getGenesisHash
Next
getHighestSnapshotSlot
Chat with our community
Check out our product changelog
Check on the status of our services
Read our blog for the latest announcements
Want the latest news in Web3?
We send out the #Web3Vibes newsletter with the coolest stuff in Blockchain every month. Sign up below!

hi@example.com
getHighestSnapshotSlot RPC Method
Returns the highest slot that the node has a snapshot for. This will find the highest full snapshot slot, and the highest incremental snapshot slot based on the full snapshot slot, if there is one.
Updated on
Sep 20, 2024
Please note that this method is only available in solana-core v1.9 or newer. Please use getS


[User] How can I identify the Automated Market Maker (AMM) responsible for a swap in QuickNode?

[Assistant]
To identify the Automated Market Maker (AMM) responsible for a swap in QuickNode, you can look for the `ammKey` field in the `swapInfo` object of the swap response. The `ammKey` is a string that uniquely identifies the AMM involved in the swap process.

Here's an example of how you might structure a request and handle the response to extract the `ammKey`:

### Example Request
```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "swap",
  "params": {
    "inputMint": "tokenMintAddress",
    "outputMint": "outputTokenMintAddress",
    "amount": "1000"
  }
}
```

### Example Response
```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "swapTransaction": "serializedTransactionData",
    "swapInfo": {
      "ammKey": "uniqueAmmIdentifier",
      "inputMint": "tokenMintAddress",
      "outputMint": "outputTokenMintAddress",
      "inAmount": "1000",
      "outAmount": "950",
      "feeAmount": "5",
      "feeMint": "feeTokenMintAddress",
      "percent": 100
    },
    "lastValidBlockHeight": 123456,
    "prioritizationFeeLamports": 1000
  }
}
```

In this response, you can see that the `ammKey` field within the `swapInfo` object contains the identifier for the AMM responsible for the swap. You can use this key for further reference or to query additional details about the specific AMM.

 percentage in basis points
priceImpactPct
string
REQUIRED
The percentage of price impact due to the swap
routePlan
array
REQUIRED
An array containing detailed information about each step of the swap process
swapInfo
object
REQUIRED
Detailed information about a specific swap step
ammKey
string
REQUIRED
The key identifying the Automated Market Maker (AMM) responsible for the swap
label
string
A label or identifier for the AMM
inputMint
string
REQUIRED
The mint address of the token being swapped from in this step
outputMint
string
REQUIRED
The mint address of the token being received in this step
inAmount
string
REQUIRED
The amount of the token being swapped from in this step
outAmount
string
REQUIRED
The amount of the token being received after the swap in this step
feeAmount
string
REQUIRED
The amount of fee charged for this step of the swap
feeMint
string
REQUIRED
The mint address of the token used for paying fees in this step
percent
integer
REQUIRED
The percentage allocation of the swap for this step
contextSlot
integer
A contextual identifier
timeTaken
integer
Time taken for the request to be processed
Returns
jsonrpc
string
The version of the JSON-RPC protocol being used
id
integer
A unique identifier for the request
result
object
The result of the swap
swapTransaction
string
The serialized transaction for the swap
lastValidBlockHeight
integer
The last valid block height
prioritizationFeeLamports
integer
The prioritization fee in lamports
Request

WSCAT
wscat -c wss://p


[User] How can I unsubscribe from a subscription in ChainStack, and what information do I need to provide?

[Assistant]
To unsubscribe from a subscription in ChainStack, you need to use the subscription ID that you received when you initially subscribed. The subscription ID is an integer that uniquely identifies your subscription.

Here is a general example of how to unsubscribe using the subscription ID:

```javascript
const subscriptionId = <your_subscription_id>; // Replace with your actual subscription ID

// Unsubscribe from the subscription
unsubscribe(subscriptionId)
  .then(response => {
    console.log("Unsubscribed successfully:", response);
  })
  .catch(error => {
    console.error("Error unsubscribing:", error);
  });
```

In this example, replace `<your_subscription_id>` with the actual subscription ID you received when you subscribed. The `unsubscribe` function is a placeholder for the actual method you would use to unsubscribe, which may vary depending on the specific implementation in your application.

Make sure to handle any potential errors that may occur during the unsubscribe process.

ommitment desired when querying state. Default is "finalized".
Response
result - An integer subscription id (needed to unsubscribe)
subscription - An object containing block information:
slot - The slot number of this block
blockhash - The hash of this block as a base-58 encoded string
previousBlockhash - The blockhash of this block's parent as a base-58 encoded string
parentSlot - The slot number of this block's parent
transactions - An array of transaction information:
transaction - Transaction object, either in JSON format or base-58 encoded binary data if "encoding" parameter is set to "base58"
meta - Transaction status metadata object:
err - Error if transaction failed, null if transaction succeeded
status - Transaction status, either {Ok: null} or {Err: <ERR>}
fee - Fee this transaction was charged, as u64 integer
preBalances - Array of u64 account balances from before the transaction was processed
postBalances - Array of u64 account balances after the transaction was processed
rewards - Block reward details (if requested):
pubkey - The public key of the account that received the reward, as a base-58 encoded string
lamports - The number of lamports rewarded
postBalance - The new balance of the account in lamports
rewardType - The type of reward: "fee", "rent", "voting", "staking"
blockTime - Estimated production time, as Unix timestamp (seconds since the Unix epoch)
blockHeight - The number of blocks beneath this block
blockSubscribe code examples
📘
Note that subscripti


[User] What command is used to create a new project in Solana using the Anchor framework?

[Assistant]
To create a new project in Solana using the Anchor framework, you use the command:

```bash
anchor init <project-name>
```

For example, if you want to create a project named "my-project", you would run:

```bash
anchor init my-project
```

This command creates a new directory with the specified name and sets up a default program and test file.

nd-line tool for Solana development.
Anchor CLI: Command-line tool for the Anchor framework.
To verify Anchor CLI installation, open your terminal and run:

Terminal
anchor --version

Expected output:

Terminal
anchor-cli 0.30.1

Getting Started #
This section covers the basic steps to create, build, and test your first local Anchor program.

Create a new Project #
To start a new project, use the anchor init command followed by your project's name. This command creates a new directory with the specified name and sets up a default program and test file.

Terminal
anchor init my-project

Navigate to the new project directory and open it in your code editor.

Terminal
cd my-project

The default Anchor program is located at programs/my-project/src/lib.rs.

Default Program
The value in the declare_id! macro is the program ID, a unique identifier for your program.

By default, it is the public key of the keypair generated in /target/deploy/my_project-keypair.json.

lib.rs
use anchor_lang::prelude::*;

declare_id!("3ynNB373Q3VAzKp7m4x238po36hjAGFXFJB4ybN2iTyg");

#[program]
pub mod my_project {
    use super::*;

    pub fn initialize(ctx: Context<Initialize>) -> Result<()> {
        msg!("Greetings from: {:?}", ctx.program_id);
        Ok(())
    }
}

#[derive(Accounts)]
pub struct Initialize {}

The default Typescript test file is located at /tests/my-project.ts.

Default Test File
This file demonstrates how to invoke the default program's initialize instruction in Typescript.