[User] What are the limitations of the warranties provided by Magic Eden for its APIs?

[Assistant]
Magic Eden provides its APIs on an “AS IS” and “AS AVAILABLE” basis, which means that there are several limitations to the warranties offered. Specifically, Magic Eden (and its suppliers) make no warranties that the Magic Eden APIs will:

1. Meet your requirements.
2. Be available on an uninterrupted, timely, secure, or error-free basis.
3. Be accurate, reliable, complete, legal, or safe.

Additionally, Magic Eden disclaims all other warranties or conditions, both express and implied, including but not limited to:

- Implied warranty of merchantability.
- Fitness for a particular purpose.
- Quiet enjoyment.
- Non-infringement.

These disclaimers are provided to the maximum extent permitted by applicable law, indicating that users should be aware of the potential limitations and risks associated with using the Magic Eden APIs.

E PROVIDED ON AN “AS IS” AND “AS AVAILABLE” BASIS WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. MAGIC EDEN (AND ITS SUPPLIERS) MAKE NO WARRANTY THAT THE MAGIC EDEN APIS: (I) WILL MEET YOUR REQUIREMENTS; (II) WILL BE AVAILABLE ON AN UNINTERRUPTED, TIMELY, SECURE, OR ERROR-FREE BASIS; OR (III) WILL BE ACCURATE, RELIABLE, COMPLETE, LEGAL, OR SAFE. MAGIC EDEN DISCLAIMS ALL OTHER WARRANTIES OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT, TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, AS TO THE MAGIC EDEN APIS, ANY CONTENT CONTAINED THEREIN AND ANY NFTS LISTED THEREIN.

WE FURTHER EXPRESSLY DISCLAIM ALL LIABILITY OR RESPONSIBILITY IN CONNECTION WITH THIRD PARTY SERVICES. NOTHING HEREIN NOR ANY USE OF THE MAGIC EDEN APIS IN CONNECTION WITH THIRD PARTY SERVICES CONSTITUTES OUR ENDORSEMENT, RECOMMENDATION OR ANY OTHER AFFILIATION OF OR WITH ANY THIRD PARTY SERVICES.

MAGIC EDEN DOES NOT REPRESENT OR WARRANT THAT ANY CONTENT ON THE MAGIC EDEN APIS IS ACCURATE, COMPLETE, RELIABLE, CURRENT OR ERROR-FREE. WE WILL NOT BE LIABLE FOR ANY LOSS OF ANY KIND FROM ANY ACTION TAKEN OR TAKEN IN RELIANCE ON MATERIAL OR INFORMATION, CONTAINED IN THE MAGIC EDEN APIS. WHILE MAGIC EDEN ATTEMPTS TO MAKE YOUR ACCESS TO AND USE OF THE MAGIC EDEN APIS AND ANY CONTENT THEREIN SAFE, MAGIC EDEN CANNOT AND DOES NOT REPRESENT OR WARRANT THAT


[User] What challenges does Value Averaging (VA) address compared to lump-sum investing in Jupiter?

[Assistant]
Value Averaging (VA) addresses several challenges compared to lump-sum investing in Jupiter:

1. **Market Timing Risk**: One of the primary challenges of lump-sum investing is the difficulty in timing the market. Investors risk buying at a peak, which can lead to significant losses if the market subsequently declines. VA mitigates this risk by allowing investors to adjust their investment amounts based on market performance, helping to smooth out the overall cost.

2. **Cost Basis Management**: VA helps in managing the cost basis of investments more effectively. By investing more when prices are low and less when prices are high, VA can potentially lower the average cost of the investment over time, enhancing long-term profitability.

3. **Emotional Decision Making**: Lump-sum investing can lead to emotional decision-making, especially in volatile markets. VA provides a systematic approach to investing, reducing the likelihood of emotional reactions to market fluctuations.

4. **Investment Discipline**: VA encourages a disciplined investment strategy. Instead of making a one-time investment, VA requires regular assessments and adjustments, promoting consistent investment behavior.

5. **Adaptability to Market Conditions**: VA is particularly beneficial in volatile markets, such as cryptocurrency, where prices can swing dramatically. By adjusting the investment amount based on market conditions, VA allows investors to capitalize on these fluctuations rather than being locked into a fixed investment amount.

Overall, Value Averaging offers a more flexible and potentially less risky approach to investing compared to lump-sum investing, particularly in uncertain or volatile markets.

-running activities.

VA Explainer and Use Cases
What is Value Averaging (VA)?
Forecasting whether prices have reached their peak or bottomed out in the short term is one of the most challenging aspects of asset investment. Instead of investing a lump sum all at once, which risks buying at a peak, Value Averaging (VA) provides a systematic approach to accumulating investments over time. VA not only helps to smooth out the overall cost but also adjusts the investment amount based on market performance, potentially lowering the cost basis and enhancing long-term profitability.

If you have confidence in the value of an asset, adopting a VA strategy proves to be an effective method for gradually accumulating it over time.

How VA works?
Value Averaging (VA) involves setting a target value for your investment portfolio at regular intervals. You then adjust your investment amount to meet this target, investing more when prices are low and less when prices are high. This method contrasts with Dollar-Cost Averaging (DCA), where you invest a fixed amount at regular intervals. Jupiter's VA automates these adjustments for you.

When to VA?
Volatile Markets
Cryptocurrency is a highly volatile market, prices can swing dramatically within short periods. VA helps to mitigate the impact of these fluctuations by adjusting investment amounts based on market performance. When prices drop, you invest more, and when prices rise, you invest less, effectively capitalizing on market volatility.

Lo


[User] What is the HTTP method used to access the CoinGecko API for getting exchange tickers by ID?

[Assistant]
The HTTP method used to access the CoinGecko API for getting exchange tickers by ID is `GET`.

Here is an example of how to use it with a `curl` command:

```bash
curl --request GET \
     --url https://pro-api.coingecko.com/api/v3/exchanges/id \
     --header 'accept: application/json'
```

In this command, replace `id` with the specific exchange ID you want to query.

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/exchanges/id \
3
     --header 'accept: application/json'

Try It!
RESPONSE
25
  "tickers": [
26
    {
27
      "base": "BTC",
28
      "target": "USDT",
29
      "market": {
30
        "name": "Binance",
31
        "identifier": "binance",
32
        "has_trading_incentive": false,
33
        "logo": "https://assets.coingecko.com/markets/images/52/small/binance.jpg?1706864274"
34
      },
35
      "last": 69476,
36
      "volume": 20242.03975,
37
      "cost_to_move_up_usd": 19320706.3958517,
38
      "cost_to_move_down_usd": 16360235.3694131,
39
      "converted_last": {
40
        "btc": 1.000205,
41
        "eth": 20.291404,
42
        "usd": 69498
43
      },
44
      "converted_volume": {
45
        "btc": 20249,
46
        "eth": 410802,
47
        "usd": 1406996874
48
      },
49
      "trust_score": "green",
50
      "bid_ask_spread_percentage": 0.010014,
51
      "timestamp": "2024-04-08T04:02:01+00:00",
52
      "last_traded_at": "2024-04-08T04:02:01+00:00",
53
      "last_fetch_at": "2024-04-08T04:03:00+00:00",
54
      "is_anomaly": false,
55
      "is_stale": false,
56
      "trade_url": "https://www.binance.com/en/trade/BTC_USDT?ref=37754157",
57
      "token_info_url": null,
58
      "coin_id": "bitcoin",
59
      "target_coin_id": "tether"
60
    }
61
  ]
62
}

Exchange Tickers by ID
get
https://pro-api.coinge


[User] What specific attributes are available for the Wrapped Ether token in CoinGecko's API response?

[Assistant]
In CoinGecko's API response for the Wrapped Ether (WETH) token, the specific attributes available are as follows:

- **address**: The contract address of the token, which is `0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2`.
- **name**: The name of the token, which is `Wrapped Ether`.
- **symbol**: The symbol used to represent the token, which is `WETH`.
- **image_url**: A URL to an image representing the token, which is `https://assets.coingecko.com/coins/images/2518/small/weth.png?1696503332`.
- **coingecko_coin_id**: The CoinGecko ID for the token, which is `weth`.

These attributes provide essential information about the Wrapped Ether token as returned by the CoinGecko API.

3606eb48",
74
            "type": "token"
75
          }
76
        },
77
        "dex": {
78
          "data": {
79
            "id": "uniswap_v3",
80
            "type": "dex"
81
          }
82
        }
83
      }
84
    }
85
  ],
86
  "included": [
87
    {
88
      "id": "eth_0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
89
      "type": "token",
90
      "attributes": {
91
        "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
92
        "name": "Wrapped Ether",
93
        "symbol": "WETH",
94
        "image_url": "https://assets.coingecko.com/coins/images/2518/small/weth.png?1696503332",
95
        "coingecko_coin_id": "weth"
96
      }
97
    }
98
  ]
99
}

Token Data by Token Address
get
https://pro-api.coingecko.com/api/v3/onchain/networks/{network}/tokens/{address}
This endpoint allows you to query specific token data based on the provided token contract address on a network

👍
Tips

You may add values such as top_pools in the include param to include top pools along with the pools information
If you would like to query token information such as socials, websites, description and etc. You can go to this endpoint /networks/{network}/tokens/{address}/info instead
📘
Notes

If the token's market cap is not verified by the team, the API response will return null for its market cap value, even though it has a displayed value on GeckoTerminal, which might not be accurate as it often matches the Fully Diluted Valuation (FDV)
Market Cap can be verified by and sour


[User] How does Jupiter auto-detect wallet balances after connecting?

[Assistant]
The documentation does not provide specific technical details on how Jupiter auto-detects wallet balances after connecting. However, it mentions that once you connect your source wallet using the "Connect Wallet" button, the UI will update and automatically detect the wallet balances, populating the user interface accordingly.

This likely involves the use of wallet APIs or blockchain explorers that query the connected wallet's address to retrieve the balance information for the assets held in that wallet. Unfortunately, without additional details from the documentation, we cannot provide a specific code example or further technical insight into the implementation.

 on exchange rates of the bridging route.
Connect Wallet: This button allows you to connect your source wallet to begin the bridging process. Once you connect, the UI will update and it will auto-detect the wallet balances and populate the UI.
Part two continues below, with the updated interface after connecting your wallet.

deBridge UI

Transaction ETA & Fee Breakdown: Here you can review the fees on each blockchain as well as the bridging fee and destination address.
Routing: Expandable routing display to review the entire bridge route for the simulated transaction.
Destination Wallet Address: If displayed, enter your destination wallet address here.
Confirm Trade: After reviewing the route, fees, and token inputs, click this button to confirm the trade and begin the bridging transactions.

Fiat On-ramps to Solana
Jupiter has integrated with Onramper to power a direct Onramp application from dirty fiat directly into the Solana asset of your choosing.

Onramper is an on-ramp aggregator, helping users around the world get on-chain quickly and easily with the best prices. The Onramp application includes the top on-ramp services (Stripe, Banxa and Topper) to provide the best routing and options based on your region, desired amount and payment preference.

info
Jupiter will never charge any additional fees for using the Onramp service and Onramper is offering a reduced fee promotional period for the first six months of the integration. This reduced fee promotional period will e


[User] How would you format a Curl request to use the requestAirdrop method in QuickNode?

[Assistant]
To format a Curl request to use the `requestAirdrop` method in QuickNode, you can use the following example:

```bash
curl https://docs-demo.solana-mainnet.quiknode.pro/ \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0", "id":1, "method":"requestAirdrop", "params": ["YOUR_WALLET_ADDRESS", 1000000000]}'
```

In this request:
- Replace `YOUR_WALLET_ADDRESS` with the actual wallet address you want to request the airdrop for.
- The second parameter `1000000000` specifies the amount of lamports you are requesting, which is 1 SOL in this case (since 1 SOL = 1,000,000,000 lamports).

Make sure to adjust the endpoint URL if you are using a different QuickNode endpoint.

ay
The configuration object with the following fields:
commitment
string
The level of commitment required for the query. The options include:
finalized
string
The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized
confirmed
string
The node will query the most recent block that has been voted on by the supermajority of the cluster
processed
string
The node will query its most recent block. Note that the block may not be complete
Returns
result
The transaction signature of the airdrop, as a base-58 encoded string
Request

Curl
curl https://docs-demo.solana-mainnet.quiknode.pro/ \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0", "id":1, "method":"requestAirdrop", "params": ["YOUR_WALLET_ADDRESS", 1000000000]}'
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free
Previous
minimumLedgerSlot
Next
sendTransaction
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
sendTransaction RPC Method
Submits a signed transaction to the cluster for processing. The API credit value for this method is 30.
Updated on
Sep 20, 2024
Parameters
transaction
string


[User] What does a response of 'true' indicate when unsubscribing using Helius?

[Assistant]
A response of 'true' when unsubscribing using Helius indicates that the unsubscribe operation succeeded. This means that the subscription has been successfully canceled.

For example, if you send a request to unsubscribe like this:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "slotUnsubscribe",
  "params": [0]
}
```

You would expect a response like this if the operation was successful:

```json
{
  "jsonrpc": "2.0",
  "result": true,
  "id": 1
}
```

In this case, the `result` field being `true` confirms that the unsubscribe operation was successful.

rent slot.

root (u64): The current root slot.

slot (u64): The newly set slot value.

Example Notification
Copy
{
  "jsonrpc": "2.0",
  "method": "slotNotification",
  "params": {
    "result": {
      "parent": 75,
      "root": 44,
      "slot": 76
    },
    "subscription": 0
  }
}
Previous
signatureUnsubscribe
Next
slotUnsubscribe
Last updated 1 month ago

Parameters
Result
Code Sample
Was this helpful?

Export as PDF
RPC
🔌
Websocket
slotUnsubscribe
Unsubscribe from slot notifications

Parameters
integer (required)
The subscription ID to cancel.

Result
Returns a <bool> indicating whether the unsubscribe operation was successful:

true: Unsubscribe operation succeeded.

false: Unsubscribe operation failed.

Code Sample
Request Example:

Copy
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "slotUnsubscribe",
  "params": [0]
}
Response Example:

Copy
{
  "jsonrpc": "2.0",
  "result": true,
  "id": 1
}
Previous
slotSubscribe
Next
slotsUpdatesSubscribe
Last updated 1 month ago

Parameters
Result
Code Sample
Notification Format
Was this helpful?

Export as PDF
RPC
🔌
Websocket
slotsUpdatesSubscribe
Subscribe to receive a notification from the validator on a variety of updates on every slot

slotsUpdatesSubscribe is marked as unstable in the Solana documentation. As a result, Helius does not support this method.

Parameters
None
No parameters are required for this method.

Result
Returns an <integer> representing the subscription ID. This ID is required to unsubscribe


[User] What kind of return value should I expect when calling Tatum's getSlotLeaders method?

[Assistant]
When you call Tatum's `getSlotLeaders` method, you can expect a return value that is an array of strings. Each string represents a Node identity public key encoded in base-58 format.

Here’s a brief overview of the return object structure:

- **Return Object**: An array of Node identity public keys as base-58 encoded strings.

### Example of the JSON-RPC Response

```json
{
  "jsonrpc": "2.0",
  "result": [
    "Vote111111111111111111111111111111111111111",
    "AnotherNodePublicKey111111111111111111111111111111111111"
    // More public keys...
  ],
  "id": 1
}
```

In this example, the `result` field contains an array of public keys of the slot leaders for the specified slot range.

  "Vote111111111111111111111111111111111111111",
    {
      "limit": 1
    }
  ]
}
JSON-RPC Response Example
JSON

{
  "jsonrpc": "2.0",
  "result": [
    {
      "err": null,
      "memo": null,
      "signature": "5h6xBEauJ3PK6SWCZ1PGjBvj8vDdWG3KpwATGy1ARAXFSDwt8GFXM7W5Ncn16wmqokgpiKRLuS83KUxyZyv2sUYv",
      "slot": 114,
      "blockTime": null
    }
    // More signatures...
  ],
  "id": 1
}

getslotleaders
Solana RPC

Archive Method
Only on the full archive nodes. Complex queries might take longer and incur additional cost

How to Use It
JavaScript

// yarn add @tatumio/tatum

import { TatumSDK, Solana, Network } from '@tatumio/tatum'

const tatum = (await TatumSDK.init) < Solana > { network: Network.SOLANA }

const res = await tatum.rpc.getSlotLeaders(100, 10)

await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs
Overview
The getSlotLeaders method returns an array of the slot leaders for a given slot range. In the Solana network, a slot leader is responsible for producing blocks for the network during their assigned slot time. This method could be used to monitor the network's operation, for analysis of network activity, or to understand which nodes have been assigned to produce blocks in the upcoming slots.

Parameters
startSlot (number, optional)
limit (number, optional): Integer between 1 and 5,000.
Return Object
The method returns an array of strings that represents an array of Node identity public keys as base-58 encoded strings.

JSON-


[User] What types of rewards are represented in the 'rewards' array in Helius?

[Assistant]
In the Helius documentation snippet provided, the `rewards` array is shown as an empty array (`"rewards": []`). This indicates that there are currently no rewards represented in the `rewards` array for the specific transaction or context being referenced.

If there were rewards, they would typically be listed within this array, but since it is empty, it implies that no rewards are applicable or available at this time.

    3654000,
        1,
        1461600,
        5616720,
        934087680,
        1009200,
        731913600,
        457953014766
      ],
      "preTokenBalances": [
        {
          "accountIndex": 6,
          "mint": "FdsNQE5EeCe57tbEYCRV1JwW5dzNCof7MUTaGWhmzYqu",
          "owner": "1BWutmTvYPwDtmw9abTkS4Ssr8no61spGAvW1X6NDix",
          "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
          "uiTokenAmount": {
            "amount": "1",
            "decimals": 0,
            "uiAmount": 1,
            "uiAmountString": "1"
          }
        }
      ],
      "rewards": []
    },
    "slot": 171942732,
    "transaction": {
      "message": {
        "accountKeys": [
          "CKs1E69a2e9TmH4mKKLrXFF8kD3ZnwKjoEuXa6sz9WqX",
          "NTYeYJ1wr4bpM5xo6zx5En44SvJFAd35zTxxNoERYqd",
          "AAaTGaA3uVqikfVEwoSG7EwkCb4bBDsMEyueiVUS5CaU",
          "autMW8SgBkVYeBgqYiTuJZnkvDZMVU2MHJh9Jh7CSQ2",
          "D8TxfGwdu9MiNMoJmUoC9wQfNfNT7Lnm6DzifQHRTy6B",
          "5DxD5ViWjvRZEkxQEaJHZw2sBsso6xoXx3wGFNKgXUzE",
          "25DTUAd1roBFoUQaxJQByL6Qy2cKQCBp4bK9sgfy9UiM",
          "DTYuh7gAGGZg2okM7hdFfU1yMY9LUemCiPyD5Z5GCs6Z",
          "rFqFJ9g7TGBD8Ed7TPDnvGKZ5pWLPDyxLcvcH2eRCtt",
          "CgXS5xC3qAGSg9txD9bS7BUgugZwshivGXpCJcGmdwrd",
          "M2mx93ekt1fmXSVkTrUL9xVFHkmME8HTUi5Cyc5aF7K",
          "E8cU1WiRWjanGxmn96ewBgk9vPTcL6AEZ1t6F6fkgUWe",
          "11111111111111111111111111111111",
          "FdsNQE5EeCe57tbEYCRV1JwW5dzNCof7MUTaGWhmzYqu",


[User] Where can I find more comprehensive explanations of core concepts related to Solana?

[Assistant]
You can find more comprehensive explanations of core concepts related to Solana by visiting the Core Concepts pages. These pages provide detailed information on various topics covered in the Solana Quickstart guide, including accounts, transactions, Program Derived Addresses (PDAs), and Cross-Program Invocations (CPIs).

Additionally, for further learning resources, you can check the Developer Resources page, which includes a variety of materials to help you deepen your understanding of Solana.

..
  anchor.test.ts:
  pda
    {
  "user": "3z9vL1zjN6qyAFHhHQdWYRTFAcy69pJydkZmSFBKHg1R",
  "message": "Hello, World!",
  "bump": 254
}
    Transaction Signature: https://solana.fm/tx/qGsYb87mUUjeyh7Ha7r9VXkACw32HxVBujo2NUxqHiUc8qxRMFB7kdH2D4JyYtPBx171ddS91VyVrFXypgYaKUr?cluster=devnet-solana
    ✔ Create Message Account (842ms)
    {
  "user": "3z9vL1zjN6qyAFHhHQdWYRTFAcy69pJydkZmSFBKHg1R",
  "message": "Hello, Solana!",
  "bump": 254
}
    Transaction Signature: https://solana.fm/tx/3KCDnNSfDDfmSy8kpiSrJsGGkzgxx2mt18KejuV2vmJjeyenkSoEfs2ghUQ6cMoYYgd9Qax9CbnYRcvF2zzumNt8?cluster=devnet-solana
    ✔ Update Message Account (946ms)
    Expect Null: null
    Transaction Signature: https://solana.fm/tx/3M7Z7Mea3TtQc6m9z386B9QuEgvLKxD999mt2RyVtJ26FgaAzV1QA5mxox3eXie3bpBkNpDQ4mEANr3trVHCWMC2?cluster=devnet-solana
    ✔ Delete Message Account (859ms)
  3 passing (3s)

You can then inspect the SolanFM links to view the transaction details, where you'll find the CPIs for the transfer instructions within the update and delete instructions.

Update CPI
Update CPI

Delete CPI
Delete CPI

If you encounter any errors, you can reference the final code.

Next Steps #
You've completed the Solana Quickstart guide! You've learned about accounts, transactions, PDAs, CPIs, and deployed your own programs.

Visit the Core Concepts pages for more comprehensive explanations of the topics covered in this guide.

Additional learning resources can be found on the Developer Resources page.

Explore More


[User] What is Solana Playground and how does it facilitate program development?

[Assistant]
Solana Playground (Solpg) is a browser-based development environment designed to facilitate the development, deployment, and testing of Solana programs. It provides a user-friendly interface that allows developers to quickly create and interact with Solana applications without the need for local installations or complex setups.

### Key Features of Solana Playground:

1. **No Installation Required**: Developers can start building immediately using just a web browser, making it accessible for those who may not have a development environment set up on their local machines.

2. **Wallet Integration**: Users can create a Playground Wallet directly within the environment, allowing them to interact with the Solana network seamlessly. This wallet is essential for sending transactions and managing accounts.

3. **Immediate Feedback**: The platform allows developers to copy and paste code, run it, and see results in real-time. This immediate feedback loop is beneficial for learning and experimentation.

4. **Support for Program Development**: Solana Playground provides tools and features that support the entire lifecycle of program development, from writing code to deploying it on the Solana network.

### Getting Started with Solana Playground:

To start using Solana Playground, follow these steps:

1. **Open Solana Playground**: Navigate to [Solana Playground](https://beta.solpg.io/) in your web browser.

2. **Create a Playground Wallet**: Click the "Not connected" button at the bottom left of the interface to create your wallet, which will allow you to interact with the Solana network.

By using Solana Playground, developers can focus on building and testing their applications without the overhead of setting up a local development environment, making it an excellent tool for both beginners and experienced developers looking to streamline their workflow.

 a basic foundation in Solana development and be ready to explore more advanced topics.

What You'll Learn #
In this tutorial, you'll learn about:

Understanding Accounts: Explore how data is stored on the Solana network.
Sending Transactions: Learn to interact with the Solana network by sending transactions.
Building and Deploying Programs: Create your first Solana program and deploy it to the network.
Program Derived Addresses (PDAs): Learn how to use PDAs to create deterministic addresses for accounts.
Cross-Program Invocations (CPIs): Learn how to make your programs interact with other programs on Solana.
The best part? You don't need to install anything! We'll be using Solana Playground, a browser-based development environment, for all our examples. This means you can follow along, copy and paste code, and see results immediately, all from your web browser. Basic programming knowledge is helpful but not required.

Let's dive in and start building on Solana!

Solana Playground #
Solana Playground (Solpg) is a browser-based development environment that allows you to quickly develop, deploy, and test Solana programs!

Open a new tab in your web browser and navigate to https://beta.solpg.io/.

Create Playground Wallet #
If you're new to Solana Playground, the first step is to create your Playground Wallet. This wallet will allow you to interact with the Solana network right from your browser.

Step 1. Connect to Playground #
Click the "Not connected" button at the bottom lef


[User] What is the significance of providing a human-readable patternDescription in Solana's user input validation?

[Assistant]
In Solana's user input validation, providing a human-readable `patternDescription` is significant for several reasons:

1. **User Guidance**: The `patternDescription` serves as a clear and concise explanation of the expected input format. This helps users understand what is required from them, reducing confusion and improving the overall user experience.

2. **Error Communication**: If the user input does not match the specified `pattern`, the `patternDescription` can be displayed as an error message. This informs the user why their input was rejected, allowing them to correct it more effectively.

3. **Requirement for Pattern**: The documentation specifies that if a `pattern` is provided, a corresponding `patternDescription` is required. This ensures that there is always a human-readable reference available to explain the input constraints, which enhances the usability of the input field.

Overall, the `patternDescription` is essential for effective communication between the application and the user, facilitating better input validation and reducing the likelihood of user errors.

ext for the user input field */
  label?: string;
  /** declare if this field is required (defaults to `false`) */
  required?: boolean;
  /** regular expression pattern to validate user input client side */
  pattern?: string;
  /** human-readable description of the `type` and/or `pattern`, represents a caption and error, if value doesn't match */
  patternDescription?: string;
  /** the minimum value allowed based on the `type` */
  min?: string | number;
  /** the maximum value allowed based on the `type` */
  max?: string | number;
}

The pattern should be a string equivalent of a valid regular expression. This regular expression pattern should by used by blink-clients to validate user input before making the POST request. If the pattern is not a valid regular expression, it should be ignored by clients.

The patternDescription is a human readable description of the expected input requests from the user. If pattern is provided, the patternDescription is required to be provided.

The min and max values allows the input to set a lower and/or upper bounds of the input requested from the user (i.e. min/max number and or min/max character length), and should be used for client side validation. For input types of date or datetime-local, these values should be a string dates. For other string based input types, the values should be numbers representing their min/max character length.

If the user input value is not considered valid per the pattern, the user should receive a clie


[User] How do you subscribe to a transaction signature using QuickNode's signatureSubscribe RPC method?

[Assistant]
To subscribe to a transaction signature using QuickNode's `signatureSubscribe` RPC method, you can utilize the Solana Web3.js library. This method allows you to receive notifications when a transaction is confirmed. Once the notification is received, the subscription is automatically canceled.

Here’s how you can implement it:

1. **Install the Solana Web3.js library** if you haven't already:

   ```bash
   npm install @solana/web3.js
   ```

2. **Use the following code snippet** to subscribe to a transaction signature:

   ```javascript
   const web3 = require("@solana/web3.js");

   (async () => {
     // Create a connection to your QuickNode endpoint
     const solanaConnection = new web3.Connection("https://docs-demo.solana-mainnet.quiknode.pro/", {
       wsEndpoint: "wss://docs-demo.solana-mainnet.quiknode.pro/",
     });

     // Replace 'your_transaction_signature' with the actual transaction signature you want to subscribe to
     const tx_sig = 'your_transaction_signature';

     // Subscribe to the transaction signature
     const subscriptionId = await solanaConnection.signatureSubscribe(tx_sig, (notification) => {
       console.log("Transaction notification:", notification);
     });

     console.log(`Subscribed to transaction signature: ${tx_sig} with subscription ID: ${subscriptionId}`);
   })();
   ```

### Parameters:
- **tx_sig**: This is the transaction signature you want to subscribe to, provided as a base-58 encoded string.

### Notification:
When the transaction is confirmed, the callback function provided in the `signatureSubscribe` method will be executed, and you will receive the notification in the form of a JSON object.

### Important Note:
The subscription will automatically be canceled once the notification is received, so you do not need to manage the unsubscription manually.

By following this example, you can effectively subscribe to transaction signatures using QuickNode's `signatureSubscribe` RPC method.

ll be an RpcResponse JSON object with unsubscribed success message
Request

Solana Web3.js (v1.x)
const web3 = require("@solana/web3.js");
(async () => {
  const solanaConnection = new web3.Connection("https://docs-demo.solana-mainnet.quiknode.pro/", {
    wsEndpoint: "wss://docs-demo.solana-mainnet.quiknode.pro/",
  });
  solanaConnection.removeRootChangeListener(0);
})();

Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free
Previous
rootSubscribe
Next
signatureSubscribe
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
signatureSubscribe RPC Method
(Subscription Websocket) Subscribe to a transaction signature to receive notification when the transaction is confirmed On signatureNotification, the subscription is automatically cancelled.
Updated on
Oct 4, 2023
Parameters
tx_sig
The transaction signature as base-58 encoded string
object
array
The configuration object with the following fields:
commitment
All fields are strings.
finalized
the node will query the most recent block confirmed by supermajority 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 s


[User] What is the significance of the 'maxSupportedTransactionVersion' parameter in Solana's 'getTransaction' method?

[Assistant]
The `maxSupportedTransactionVersion` parameter in Solana's `getTransaction` method is used to specify the maximum transaction version that the response should return. This allows clients to request transaction details that are compatible with a specific version of the transaction format.

However, it's important to note that the documentation indicates that the `processed` option is not supported for this parameter. This means that while you can set the `maxSupportedTransactionVersion`, it won't apply to processed transactions.

In summary, the `maxSupportedTransactionVersion` parameter helps ensure that the transaction details returned are in a format that the client can handle, especially if there have been changes to the transaction structure in newer versions.

to query, as base-58 encoded string

object optional

Configuration object containing the following fields:

commitment string optional

Result #
The result will be an RpcResponse JSON object with value equal to a JSON object containing:

amount: <string> - the raw total token supply without decimals, a string representation of u64
decimals: <u8> - number of base 10 digits to the right of the decimal place
uiAmount: <number|null> - the total token supply, using mint-prescribed decimals DEPRECATED
uiAmountString: <string> - the total token supply as a string, using mint-prescribed decimals
Code sample #
curl https://api.devnet.solana.com -s -X POST -H "Content-Type: application/json" -d '
  {
    "jsonrpc": "2.0", "id": 1,
    "method": "getTokenSupply",
    "params": [
      "3wyAj7Rt1TWVPZVteFJPLa26JmLvdb1CAKEFZm3NY75E"
    ]
  }
'

Response #
{
  "jsonrpc": "2.0",
  "result": {
    "context": {
      "slot": 1114
    },
    "value": {
      "amount": "100000",
      "decimals": 2,
      "uiAmount": 1000,
      "uiAmountString": "1000"
    }
  },
  "id": 1
}

getTransaction RPC Method
Edit Page
Returns transaction details for a confirmed transaction

Parameters #
string required

Transaction signature, as base-58 encoded string

object optional

Configuration object containing the following fields:

commitment string optional

processed is not supported.
maxSupportedTransactionVersion number optional

Set the max transaction version to return in responses. If the requested t


[User] What should be included in the headers when making a webhook edit request in Helius?

[Assistant]
When making a webhook edit request in Helius, the headers should include the following:

- `Content-Type`: This should be set to `application/json`.

Here is an example of how to set the headers in a request:

```javascript
const editWebhook = async (webhookID, apiKey, webhookURL, transactionTypes) => {
  try {
    const response = await fetch(`https://api.helius.xyz/v0/webhooks/${webhookID}`, {
      method: 'PUT',
      headers: {
        'Content-Type': 'application/json',
        'api-key': apiKey // Include the API key in the headers
      },
      body: JSON.stringify({
        webhookURL: webhookURL,
        transactionTypes: transactionTypes
      })
    });
    const data = await response.json();
    console.log({ data });
  } catch (e) {
    console.error("error", e);
  }
};
```

In this example, you would replace `webhookID`, `apiKey`, `webhookURL`, and `transactionTypes` with the appropriate values for your request.

od: 'GET',
          headers: {
            'Content-Type': 'application/json',
          }
        }
      );
      const data = await response.json();
      console.log({ data });
    } catch (e) {
      console.error("error", e);
    }
  };
  getWebhook();
Previous
Get All Webhooks
Next
Edit Webhook
Last updated 1 month ago

On this page
Data Streaming
🪝
Webhooks
📘
API Reference
Edit Webhook
Programatically edit a Helius webhook.

Note: It may take up to 2 minutes for webhook changes to take effect!

PUT /webhooks/:webhookID
Edits a webhook.
PUThttps://api.helius.xyz/v0/webhooks/{webhookID}
Path parameters

webhookIDstring
The webhook ID.

Query parameters

api-keystring
The api key.

Body

application/json
webhookURLstring
transactionTypesarray of TransactionType (enum)

itemsTransactionType (enum)
UNKNOWN
NFT_BID
NFT_BID_CANCELLED
NFT_LISTING
NFT_CANCEL_LISTING
NFT_SALE
NFT_MINT
NFT_AUCTION_CREATED
NFT_AUCTION_UPDATED
NFT_AUCTION_CANCELLED
NFT_PARTICIPATION_REWARD
NFT_MINT_REJECTED
CREATE_STORE
WHITELIST_CREATOR
ADD_TO_WHITELIST
REMOVE_FROM_WHITELIST
AUCTION_MANAGER_CLAIM_BID
EMPTY_PAYMENT_ACCOUNT
UPDATE_PRIMARY_SALE_METADATA
ADD_TOKEN_TO_VAULT
ACTIVATE_VAULT
INIT_VAULT
INIT_BANK
INIT_STAKE
MERGE_STAKE
SPLIT_STAKE
SET_BANK_FLAGS
SET_VAULT_LOCK
UPDATE_VAULT_OWNER
UPDATE_BANK_MANAGER
RECORD_RARITY_POINTS
ADD_RARITIES_TO_BANK
INIT_FARM
INIT_FARMER
REFRESH_FARMER
UPDATE_FARM
AUTHORIZE_FUNDER
DEAUTHORIZE_FUNDER
FUND_REWARD
CANCEL_REWARD
LOCK_REWARD
PAYOUT
VALIDATE_SAFETY_DEPO


[User] What is the purpose of the `depositorProof` in the context of Meteora's deposit operation?

[Assistant]
In the context of Meteora's deposit operation, the `depositorProof` serves as a cryptographic proof that verifies the legitimacy of a user's deposit request. Specifically, it is used to confirm that the user (identified by their public key) is authorized to make a deposit into the alpha vault, adhering to the rules set by the vault's configuration.

The `depositorProof` is generated by calling the `getProof` method on the `tree` object, which likely represents a Merkle tree structure. This proof is then transformed into an array format that can be used in the deposit transaction. The proof ensures that the user is part of a whitelist or meets certain criteria defined by the vault, thus enhancing the security and integrity of the deposit process.

Here’s the relevant code snippet that illustrates how `depositorProof` is created:

```javascript
const depositorProof = tree
    .getProof(payer.publicKey, nativeDepositCap)
    .map((buffer) => {
      return Array.from(new Uint8Array(buffer));
    });
```

In this code, `payer.publicKey` is the public key of the user attempting to make the deposit, and `nativeDepositCap` likely represents the maximum deposit limit or a specific condition that must be met. The resulting `depositorProof` is then included in the deposit transaction to validate the user's eligibility.

const depositorProof = tree
    .getProof(payer.publicKey, nativeDepositCap)
    .map((buffer) => {
      return Array.from(new Uint8Array(buffer));
    });

  const [merkleRootConfig] = deriveMerkleRootConfig(
    alphaVault.pubkey,
    new BN(0),
    new PublicKey(PROGRAM_ID["mainnet-beta"])
  );

  // 4. Deposit
  const depositTx = await alphaVault.deposit(depositAmount, payer.publicKey, {
    merkleRootConfig,
    maxCap: nativeDepositCap,
    proof: depositorProof,
  });

  console.log(`Depositing ${depositAmount.toString()}`);
  const txHash = await sendAndConfirmTransaction(connection, depositTx, [
    payer,
  ]);
  console.log(txHash);

  const escrow = await alphaVault.getEscrow(payer.publicKey);
  console.log("Escrow info");
  console.log(escrow);
}

// Alpha vault to be deposited to
const vault = new PublicKey("ARGqVVUPPqtqH9UeBHvYsv7AtZv623YdEaEziZ1pdDUs");
const depositAmount = new BN(100_000);
const payer = loadKeypairFromFile(process.env.KEYPAIR_PATH);
const whitelistWalletCsvFilepath =
  "src/examples/permissioned/whitelist_wallet.csv";

/**
 * This example shows how to deposit to permissioned alpha vault. Deposit can only happen before the deposit close.
 */
depositToPermissionedAlphaVault(
  vault,
  depositAmount,
  whitelistWalletCsvFilepath,
  payer
)
  .then(() => {
    console.log("Done");
  })
  .catch(console.error);
5. Configure Alpha Vault Timings
If you are integrating the Alpha Vault program and need to view and select the predefined timings for


[User] How does Jupiter ensure that users trade the right tokens through the Ecosystem Token API?

[Assistant]
Jupiter ensures that users trade the right tokens through the Ecosystem Token API by allowing protocols to submit their lists of tokens, which are then tagged automatically. This process helps users identify and trade the correct tokens.

To facilitate this, protocols need to provide:

1. A URL endpoint that points to a simple .csv file containing a mint address per row.
2. Information on how often the API should poll for updates.
3. A public endpoint with the necessary IP whitelisting for rate limits.

By following these steps, protocols can ensure their tokens are properly tagged and made accessible for users, enhancing the trading experience.

nd and History
Introducing the Ecosystem Token API and standard

API Standard for Partners
API Standard for Partners
How to get your protocol's tokens tagged
We can ingest your list of tokens and get them tagged automatically, to help your users to trade the right tokens. For example, we have Sanctum's LSTs, pump.fun tokens, clone protocol, and birdeye trending tokens. Read more on the main API page

We need:

A url endpoint
That points to a simple .csv file with a mint address per row -- click on link to see sample.
That we can poll at a set interval (tell us how often you expect updates to happen)
The endpoint should be public, with our IP whitelisted for rate limits where necessary.

Tell us if you have a preferred word or acronym for your tag, one that's short and mobile friendly.

That's it!

Composing With Versioned Transactions
versioned_txn

Jupiter's V4 API improves composability by utilizing Solana's Versioned Transactions and Address Lookup Tables so all Jupiter routes can be done in a single transaction.

For anyone developing on Solana, one of the biggest hurdles in composing protocols has been dealing with the transaction size limit of 1232 bytes. Given that each account takes 32 bytes and each signature takes 64 bytes, it is easy to hit the transaction size limit frequently. For Jupiter, this meant that we were limited to two-hop swaps and used up all the transaction size just to fit the two swaps into a single transaction.

Summary of constraints that affect c


[User] What does the sendAndConfirmTransaction function do in Solana?

[Assistant]
The `sendAndConfirmTransaction` function in Solana is used to send a transaction to the Solana blockchain and wait for its confirmation. This function is crucial for ensuring that the transaction has been successfully processed and included in a block.

Here’s a breakdown of its functionality:

1. **Sending the Transaction**: The function takes a transaction object and sends it to the Solana network for processing.

2. **Confirmation**: After sending the transaction, it waits for the transaction to be confirmed by the network. Confirmation means that the transaction has been included in a block and is considered final.

3. **Error Handling**: If the transaction fails or is not confirmed within a certain timeframe, the function will throw an error, allowing the developer to handle it appropriately.

Here’s a basic example of how `sendAndConfirmTransaction` can be used:

```javascript
import { Connection, Keypair, Transaction, sendAndConfirmTransaction } from '@solana/web3.js';

const connection = new Connection(clusterApiUrl("devnet"), "confirmed");
const feePayer = Keypair.generate();
const transaction = new Transaction();
// Add instructions to the transaction here

// Send and confirm the transaction
const txHash = await sendAndConfirmTransaction(connection, transaction, [feePayer]);
console.log(`Transaction confirmed with hash: ${txHash}`);
```

In this example, a transaction is created and sent to the network, and the function waits for confirmation before logging the transaction hash.

t
  const connection = new Connection(clusterApiUrl("devnet"), "confirmed");
  const feePayer = Keypair.generate();

  // Fund our wallet with 1 SOL
  const airdropSignature = await connection.requestAirdrop(
    feePayer.publicKey,
    LAMPORTS_PER_SOL,
  );
  await connection.confirmTransaction(airdropSignature);

  // you can use any keypair as nonce account authority,
  // this uses the default Solana keypair file (id.json) as the nonce account authority
  const nonceAccountAuth = await getKeypairFromFile();

  let nonceAccount = Keypair.generate();
  console.log(`nonce account: ${nonceAccount.publicKey.toBase58()}`);

  let tx = new Transaction().add(
    // create nonce account
    SystemProgram.createAccount({
      fromPubkey: feePayer.publicKey,
      newAccountPubkey: nonceAccount.publicKey,
      lamports:
        await connection.getMinimumBalanceForRentExemption(
          NONCE_ACCOUNT_LENGTH,
        ),
      space: NONCE_ACCOUNT_LENGTH,
      programId: SystemProgram.programId,
    }),
    // init nonce account
    SystemProgram.nonceInitialize({
      noncePubkey: nonceAccount.publicKey, // nonce account pubkey
      authorizedPubkey: nonceAccountAuth.publicKey, // nonce account authority (for advance and close)
    }),
  );

  console.log(
    `txhash: ${await sendAndConfirmTransaction(connection, tx, [feePayer, nonceAccount])}`,
  );
})();

Get Nonce Account #
get-nonce-account.ts
import {
  clusterApiUrl,
  Connection,
  PublicKey,
  Keypair,
  NonceA


[User] What are the required query parameters for using the /price endpoint in QuickNode?

[Assistant]
To use the `/price` endpoint in QuickNode, the required query parameter is:

- **ids**: This is a string that is REQUIRED. It supports either the symbol or the address of a token. You can also pass in an array of ids separated by commas. Note that both address and symbol modes are case-sensitive.

Additionally, there are other optional parameters you can use to customize your request, but the `ids` parameter is the only one that is mandatory.

ut 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
/price REST API Endpoint
Returns the precise and real-time pricing for all SPL tokens.
Updated on
Sep 20, 2024
Please note that this method is only available for paid subscribers of Metis - Jupiter V6 Swap API.
Solana Web3.js 2.0 includes the ability to customize RPC methods and transports, allowing you to seamlessly integrate QuickNode Marketplace add-ons into your applications. For more information on how to use QuickNode Marketplace add-ons with Solana Web3.js 2.0, check out these guides: How to Use QuickNode Add-ons using Solana Web3.js 2.0 (Part 1) and How to Use QuickNode Add-ons using Solana Web3.js 2.0 (Part 2)
Query Parameters
ids
string
REQUIRED
Supports symbol or address of a token. You can also pass in an array of ids with a comma as a separator. Address and symbol modes both are case-sensitive
vsToken
string
The token to compare price versus (supports symbol or address of a token). The default value is set to USDC
useQNMarketCache
boolean
When set to true, the response includes your added pools/markets
restrictIntermediateTokens
boolean
Default is true. Restrict intermediate tokens to a top token set that has stable liquidity. This will help improve latency on /price requests.
onlyDirectRoutes
boolean
Default is fa


[User] How can I specify the precision of the currency price value when using CoinGecko's OHLC API?

[Assistant]
To specify the precision of the currency price value when using CoinGecko's OHLC API, you can use the `precision` query parameter in your request. This parameter allows you to define the number of decimal places for the currency price value.

Here’s an example of how to include the `precision` parameter in your API request:

```shell
curl --request GET \
     --url 'https://pro-api.coingecko.com/api/v3/coins/{id}/ohlc?days=1&precision=2' \
     --header 'accept: application/json'
```

In this example, replace `{id}` with the actual coin ID you are querying. The `precision=2` specifies that the price value should be rounded to two decimal places. Adjust the value of `precision` as needed for your specific requirements.

e OHLC data
Data granularity (candle's body) is automatic:
1 - 2 days: 30 minutes
3 - 30 days: 4 hours
31 days and beyond: 4 days
Cache / Update Frequency:
every 15 minutes for all the API plans
The last completed UTC day (00:00) is available 35 minutes after midnight on the next UTC day (00:35)
Exclusive daily and hourly candle interval parameter for all paid plan subscribers (interval = daily, interval=hourly)
'daily' interval is available for 1 / 7 / 14 / 30 / 90 / 180 days only.
'hourly' interval is available for 1 /7 / 14 / 30 / 90 days only.
Path Params
id
string
required
coin id
*refers to /coins/list.

Query Params
vs_currency
string
required
target currency of price data
*refers to /simple/supported_vs_currencies.

days
string
required
data up to number of days ago

1
interval
string
data interval, leave empty for auto granularity

precision
string
decimal place for currency price value

Response

200
Get coin's OHLC

Response body
array of arrays of numbers
array of numbers
Updated 4 months ago

What’s Next
Experiment with /coins/{id}/market_chart endpoint 👇 for better data granularity!

Coin Historical Chart Data by ID
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/coins/id/ohlc?days=1' \
3
     --header 'accept: application/json'

Try It!
RESPONSE
1
[
2
  [
3
    1709395200000,
4
    61942,
5
    62211,
6
    6172


[User] Why is the 'associatedTokenProgram' important in the context of Jupiter?

[Assistant]
The `associatedTokenProgram` is important in the context of Jupiter because it is responsible for managing the associated token accounts for the tokens being used in the Decentralized Currency Aggregator (DCA) program. Specifically, it allows for the creation and management of associated token accounts, which are necessary for holding the tokens that are being bought or sold in the DCA transactions.

In the provided documentation, the `associatedTokenProgram` is referenced with the following details:

- **Public Key**: `new PublicKey('ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL');`
- **Significance**: It is used to ensure that the associated token accounts are correctly initialized and managed, which is crucial for the functioning of the DCA program.

When integrating DCA in JavaScript or TypeScript, you would typically include the `associatedTokenProgram` in your transaction setup to ensure that any necessary associated token accounts are created or referenced correctly.

Here’s a brief example of how you might include it in a transaction:

```javascript
const transaction = new Transaction().add(
    new TransactionInstruction({
        keys: [
            { pubkey: userPublicKey, isSigner: true, isWritable: true },
            { pubkey: dcaPublicKey, isSigner: false, isWritable: true },
            { pubkey: inputMint, isSigner: false, isWritable: false },
            { pubkey: outputMint, isSigner: false, isWritable: false },
            { pubkey: inAta, isSigner: false, isWritable: true },
            { pubkey: outAta, isSigner: false, isWritable: true },
            { pubkey: userInAta, isSigner: false, isWritable: true },
            { pubkey: userOutAta, isSigner: false, isWritable: true },
            { pubkey: systemProgram, isSigner: false, isWritable: false },
            { pubkey: tokenProgram, isSigner: false, isWritable: false },
            { pubkey: associatedTokenProgram, isSigner: false, isWritable: false },
            { pubkey: eventAuthority, isSigner: false, isWritable: false },
            { pubkey: program, isSigner: false, isWritable: false },
        ],
        programId: program,
        data: Buffer.alloc(0), // Replace with actual data
    })
);
```

In this example, the `associatedTokenProgram` is included in the keys array, which is essential for ensuring that the transaction can properly manage associated token accounts.

 necessary are

Accounts needed:

Accounts	Description	isSigner?	isWritable?
user	This is the user's account that owns the DCA Account. This account will also be the signer and payer of the transaction	true	true
dca	The DCA account you want to close	false	true
inputMint	Token to sell	false	false
outputMint	Token to buy	false	false
inAta	The associated token account's address of DCA PDA for inputMint. Example: getAssociatedTokenAddressSync(inputMint, dcaPubKey, true) from @solana/spl-token library	false	true
outAta	The associated token account's address of DCA PDA for outputMint. Example: getAssociatedTokenAddressSync(outputMint, dcaPubKey, true) from @solana/spl-token library	false	true
userInAta	User's token account for input_mint. If not initialized, will initialize.	false	true
userOutAta	User's token account for output_mint. If not initialized, will initialize.	false	true
systemProgram	The usual new PublicKey("11111111111111111111111111111111")	false	false
tokenProgram	new PublicKey('TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'); DCA has not been tested to work with Token 2022 yet	false	false
associatedTokenProgram	new PublicKey('ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL');	false	false
eventAuthority	new PublicKey('Cspp27eGUDMXxPEdhmEXFVRn6Lt1L7xJyALF3nmnWoBj') This is DCA Program's event authority for Anchor 0.28.0's event CPI feature.	false	false
program	The DCA program itself new PublicKey('DCA265Vj8a9CEuX1eb1LWRnDT7uK6q1xMipnNyatn23M')

Integrating DCA (JS/TS)
Foll


[User] What does the `#[account(init)]` annotation indicate about the Solana account being created?

[Assistant]
The `#[account(init)]` annotation in Solana indicates that a new account is being initialized. This annotation is used in the context of the Anchor framework, which simplifies the process of creating and managing accounts in Solana programs.

When you use `#[account(init)]`, it signifies that:

1. **Account Creation**: The account will be created for the first time. This means that the account does not exist prior to this instruction being executed.

2. **Initialization**: The account will be initialized with specific data. In the context of the code, this often involves specifying the space required for the account and the initial state of the account's data.

3. **Payer**: The `payer` attribute indicates which account will cover the transaction fees for creating the new account.

4. **Seeds and Bump**: The `seeds` attribute is used to derive a Program Derived Address (PDA), and the `bump` attribute is used to ensure that the derived address is unique and valid.

Here is an example from the documentation:

```rust
#[account(
    init,
    seeds = [b"data", user.key().as_ref()],
    bump,
    payer = user,
    space = 8 + DataAccount::INIT_SPACE
)]
pub pda_account: Account<'info, DataAccount>,
```

In this example:
- A new account `pda_account` is being initialized.
- The account's address is derived from the provided seeds.
- The user account will pay for the creation of this new account.
- The space allocated for the account is defined by `8 + DataAccount::INIT_SPACE`, ensuring that enough space is reserved for the account's data.

mp
        account_data.bump = ctx.bumps.pda_account;
        Ok(())
    }
}

#[derive(Accounts)]
pub struct Initialize<'info> {
    #[account(mut)]
    pub user: Signer<'info>,

    #[account(
        init,
        // set the seeds to derive the PDA
        seeds = [b"data", user.key().as_ref()],
        // use the canonical bump
        bump,
        payer = user,
        space = 8 + DataAccount::INIT_SPACE
    )]
    pub pda_account: Account<'info, DataAccount>,
    pub system_program: Program<'info, System>,
}

#[account]

#[derive(InitSpace)]
pub struct DataAccount {
    pub user: Pubkey,
    pub bump: u8,
}

The seeds used to derive the PDA include the hardcoded string data and the address of the user account provided in the instruction. The Anchor framework automatically derives the canonical bump seed.

#[account(
    init,
    seeds = [b"data", user.key().as_ref()],
    bump,
    payer = user,
    space = 8 + DataAccount::INIT_SPACE
)]
pub pda_account: Account<'info, DataAccount>,

The init constraint instructs Anchor to invoke the System Program to create a new account using the PDA as the address. Under the hood, this is done through a CPI.

#[account(
    init,
    seeds = [b"data", user.key().as_ref()],
    bump,
    payer = user,
    space = 8 + DataAccount::INIT_SPACE
)]
pub pda_account: Account<'info, DataAccount>,

In the test file (pda-account.test.ts) located within the Solana Playground link provided above, you will find the Javascript equivalent to de


[User] Does the Privacy Policy associated with Jupiter provide information on data collection?

[Assistant] Yes, the Privacy Policy associated with Jupiter describes the ways in which data is collected, used, stored, and disclosed. However, the specific details regarding the types of data collected or the methods of collection are not provided in the snippet you shared. For comprehensive information, you would need to refer directly to the Privacy Policy itself.

 by these Terms and applicable arbitration rules, the arbitrator will have: (a) the exclusive authority and jurisdiction to make all procedural and substantive decisions regarding a Dispute; and (b) the authority to grant any remedy that would otherwise be available in court. The arbitrator may only conduct an individual arbitration and may not consolidate more than one individual s claims, preside over any type of class or representative proceeding or preside over any proceeding involving more than one individual.

11. Miscellaneous
Changes. We may amend any portion of these Terms at any time by posting the revised version of these Terms with an updated revision date. The changes will become effective and shall be deemed accepted by you, the first time you use or access the Interface after the initial posting of the revised Terms and shall apply on a going-forward basis with respect to your use of the Interface including any transactions initiated after the posting date. In the event that you do not agree with any such modification, your sole and exclusive remedy are to terminate your use of the Interface.

Entire Agreement. These Terms (and any additional terms, rules, and conditions of participation that may be posted on the website of Jupiter) including the Privacy Policy constitute the entire agreement with respect to the Interface and supersedes any prior agreements, oral or written.

Privacy Policy. The Privacy Policy describes the ways we collect, use, store and disc


[User] What is the purpose of the `AccountMeta` struct in the context of Solana transactions?

[Assistant]
In the context of Solana transactions, the `AccountMeta` struct is used to specify metadata about accounts that are involved in a transaction instruction. Each `AccountMeta` instance provides information about an account's public key, whether the account is writable, and whether it is a signer of the transaction.

Here are the key components of `AccountMeta`:

1. **Public Key**: This is the unique identifier for the account on the Solana blockchain.
2. **Is Writable**: A boolean value indicating whether the account can be modified by the transaction. If `true`, the transaction can write data to this account; if `false`, the account is read-only.
3. **Is Signer**: A boolean value indicating whether the account must sign the transaction. If `true`, the account's private key must be used to authorize the transaction.

In a typical Solana transaction, you would create an `AccountMeta` for each account that the instruction will interact with. For example, when creating an instruction to initialize a counter, you might have `AccountMeta` entries for the counter account, the payer account, and the system program.

Here is a code snippet illustrating the use of `AccountMeta`:

```rust
let initialize_instruction = Instruction::new_with_bytes(
    program_id,
    &init_instruction_data,
    vec![
        AccountMeta::new(counter_keypair.pubkey(), true), // Counter account (writable)
        AccountMeta::new(payer.pubkey(), true),           // Payer account (writable and signer)
        AccountMeta::new_readonly(system_program::id(), false), // System program (read-only)
    ],
);
```

In this example:
- The `counter_keypair.pubkey()` is marked as writable because the instruction will modify the counter account.
- The `payer.pubkey()` is both writable and a signer, as it is responsible for paying the transaction fees.
- The `system_program::id()` is marked as read-only since it does not need to be modified by this instruction.

Overall, `AccountMeta` is essential for defining the roles and permissions of accounts involved in a Solana transaction.

; // 0 = initialize instruction
        init_instruction_data.extend_from_slice(&initial_value.to_le_bytes());

        let initialize_instruction = Instruction::new_with_bytes(
            program_id,
            &init_instruction_data,
            vec![
                AccountMeta::new(counter_keypair.pubkey(), true),
                AccountMeta::new(payer.pubkey(), true),
                AccountMeta::new_readonly(system_program::id(), false),
            ],
        );

        // Send transaction with initialize instruction
        let mut transaction =
            Transaction::new_with_payer(&[initialize_instruction], Some(&payer.pubkey()));
        transaction.sign(&[&payer, &counter_keypair], recent_blockhash);
        banks_client.process_transaction(transaction).await.unwrap();

        // Check account data
        let account = banks_client
            .get_account(counter_keypair.pubkey())
            .await
            .expect("Failed to get counter account");

        if let Some(account_data) = account {
            let counter: CounterAccount = CounterAccount::try_from_slice(&account_data.data)
                .expect("Failed to deserialize counter data");
            assert_eq!(counter.count, 42);
            println!(
                "✅ Counter initialized successfully with value: {}",
                counter.count
            );
        }

        // Step 2: Increment the counter
        println!("Testing counter increment...");

        // Create incr


[User] How can a developer access account keys in a transaction using Alchemy?

[Assistant]
To access account keys in a transaction using Alchemy, a developer can utilize the response structure from the Alchemy API that includes transaction details. Specifically, the account keys can be found within the `transaction.message.accountKeys` array in the response.

Here's a simplified example of how the relevant part of the response looks:

```json
{
  "transaction": {
    "message": {
      "accountKeys": [
        "3UVYmECPPMZSCqWKfENfuoTv51fTDTWicX9xmBD2euKe",
        "AjozzgE83A3x1sHNUR64hfH7zaEBWeMaFuAN9kQgujrc",
        "SysvarS1otHashes111111111111111111111111111",
        "SysvarC1ock11111111111111111111111111111111",
        "Vote111111111111111111111111111111111111111"
      ]
    }
  }
}
```

In this example, the `accountKeys` array contains multiple account keys associated with the transaction. Developers can access this array to retrieve the keys they need for further processing or analysis.

To implement this in code, you would typically make a request to the Alchemy API to fetch the transaction details and then parse the response to extract the account keys. Here's a pseudo-code example:

```javascript
const fetchTransaction = async (transactionId) => {
  const response = await fetch(`https://api.alchemy.com/v2/your-api-key/transaction/${transactionId}`);
  const data = await response.json();

  const accountKeys = data.transaction.message.accountKeys;
  console.log(accountKeys);
};

// Example usage
fetchTransaction('your-transaction-id');
```

In this example, replace `your-api-key` and `your-transaction-id` with the actual API key and transaction ID you are working with. This will log the account keys to the console.

,
          "postTokenBalances": [],
          "preBalances": [499998937500, 26858640, 1, 1, 1],
          "preTokenBalances": [],
          "status": {
            "Ok": null
          }
        },
        "transaction": {
          "message": {
            "accountKeys": [
              "3UVYmECPPMZSCqWKfENfuoTv51fTDTWicX9xmBD2euKe",
              "AjozzgE83A3x1sHNUR64hfH7zaEBWeMaFuAN9kQgujrc",
              "SysvarS1otHashes111111111111111111111111111",
              "SysvarC1ock11111111111111111111111111111111",
              "Vote111111111111111111111111111111111111111"
            ],
            "header": {
              "numReadonlySignedAccounts": 0,
              "numReadonlyUnsignedAccounts": 3,
              "numRequiredSignatures": 1
            },
            "instructions": [
              {
                "accounts": [1, 2, 3, 0],
                "data": "37u9WtQpcm6ULa3WRQHmj49EPs4if7o9f1jSRVZpm2dvihR9C8jY4NqEwXUbLwx15HBSNcP1",
                "programIdIndex": 4
              }
            ],
            "recentBlockhash": "mfcyqEXB3DnHXki6KjjmZck6YjmZLvpAByy2fj4nh6B"
          },
          "signatures": [
            "2nBhEBYYvfaAe16UMNqRHre4YNSskvuYgx3M6E4JP1oDYvZEJHvoPzyUidNgNX5r9sTyN1J9UxtbCXy2rqYcuyuv"
          ]
        }
      }
    ]
  },
  "id": 1
}
Path Params
apiKey
string
required
Defaults to docs-demo
For higher throughput, create your own API key

docs-demo
Body Params
id
integer
Defaults to 1
1
jsonrpc
string
Defaults to 2.0
2.0
method
string


[User] How can you initialize a Nonce Account in Solana using the SystemProgram?

[Assistant]
To initialize a Nonce Account in Solana using the SystemProgram, you can follow these steps:

1. **Create a connection** to the Solana cluster (e.g., devnet).
2. **Generate a fee payer** and fund it with SOL.
3. **Create a nonce account** using the `SystemProgram.createAccount` method.
4. **Initialize the nonce account** using the `SystemProgram.nonceInitialize` method.

Here’s a detailed code example demonstrating these steps:

```javascript
import {
  clusterApiUrl,
  Connection,
  Keypair,
  SystemProgram,
  Transaction,
  sendAndConfirmTransaction,
  LAMPORTS_PER_SOL,
} from '@solana/web3.js';

(async () => {
  const connection = new Connection(clusterApiUrl("devnet"), "confirmed");
  const feePayer = Keypair.generate();

  // Fund our wallet with 1 SOL
  const airdropSignature = await connection.requestAirdrop(
    feePayer.publicKey,
    LAMPORTS_PER_SOL,
  );
  await connection.confirmTransaction(airdropSignature);

  // You can use any keypair as nonce account authority
  const nonceAccountAuth = Keypair.generate(); // Replace with your keypair retrieval method

  let nonceAccount = Keypair.generate();
  console.log(`nonce account: ${nonceAccount.publicKey.toBase58()}`);

  let tx = new Transaction().add(
    // Create nonce account
    SystemProgram.createAccount({
      fromPubkey: feePayer.publicKey,
      newAccountPubkey: nonceAccount.publicKey,
      lamports: await connection.getMinimumBalanceForRentExemption(NonceAccountLayout.span),
      space: NonceAccountLayout.span,
      programId: SystemProgram.programId,
    }),
    // Initialize nonce account
    SystemProgram.nonceInitialize({
      noncePubkey: nonceAccount.publicKey, // Nonce account pubkey
      authorizedPubkey: nonceAccountAuth.publicKey, // Nonce account authority
    }),
  );

  console.log(
    `txhash: ${await sendAndConfirmTransaction(connection, tx, [feePayer, nonceAccount])}`,
  );
})();
```

### Explanation:
- **Connection**: Establishes a connection to the Solana devnet.
- **Fee Payer**: A new keypair is generated to act as the fee payer for transactions.
- **Airdrop**: The fee payer is funded with 1 SOL to cover transaction fees.
- **Nonce Account Authority**: A keypair is generated to serve as the authority for the nonce account.
- **Nonce Account Creation**: The `SystemProgram.createAccount` method is used to create a new nonce account.
- **Nonce Account Initialization**: The `SystemProgram.nonceInitialize` method initializes the nonce account with the specified authority.

Make sure to replace the nonce account authority retrieval method with your actual implementation if needed.


[User] What security measures do Anchor's account constraints provide when creating PDAs in Solana?

[Assistant]
Anchor's account constraints provide several security measures when creating Program Derived Addresses (PDAs) in Solana. These measures ensure that the correct address is derived and that the PDA is valid. The key constraints used in Anchor for PDAs include:

1. **Seeds**: This is an array of optional seeds used to derive the PDA. Seeds can be static values or dynamic references to account data. By using specific seeds, you can ensure that the derived address is unique and predictable based on the input values.

2. **Bump**: The bump seed is used to ensure that the derived address falls off the Ed25519 curve, making it a valid PDA. This is crucial because it prevents the generation of invalid addresses that could lead to security vulnerabilities.

3. **Seeds::program**: This optional constraint allows you to specify the program ID used to derive the PDA address. This is particularly useful when the PDA is derived from a program ID that is different from the current program, adding an additional layer of specificity and security.

These constraints work together to enforce that the derived PDA is not only unique but also valid, reducing the risk of address collisions and ensuring that the program operates securely.

Here’s a brief example of how you might define these constraints in an Anchor program:

```rust
#[derive(Accounts)]
pub struct MyAccount<'info> {
    #[account(
        init,
        payer = user,
        seeds = [b"my_seed", user.key().as_ref()],
        bump
    )]
    pub my_account: Account<'info, MyAccountData>,
    pub user: Signer<'info>,
    pub system_program: Program<'info, System>,
}
```

In this example, the `seeds` constraint uses a static seed (`b"my_seed"`) and a dynamic reference (`user.key().as_ref()`) to derive the PDA, while the `bump` ensures the address is valid.

t followed by the name of the account type defined in the IDL. Anchor provides multiple methods for fetching accounts.

all
memcmp
fetch
fetchMultiple
Use all() to fetch all existing accounts for a specific account type.

const accounts = await program.account.newAccount.all();

PDAs with Anchor
Program Derived Addresses (PDA) refer to a feature of Solana development that allows you to create a unique address derived deterministically from pre-defined inputs (seeds) and a program ID.

This section will cover basic examples of how to use PDAs in an Anchor program.

Anchor PDA Constraints #
When using PDAs in an Anchor program, you generally use Anchor's account constraints to define the seeds used to derive the PDA. These constraints serve as security checks to ensure that the correct address is derived.

The constraints used to define the PDA seeds include:

seeds: An array of optional seeds used to derive the PDA. Seeds can be static values or dynamic references to account data.
bump: The bump seed used to derive the PDA. Used to ensure the address falls off the Ed25519 curve and is a valid PDA.
seeds::program - (Optional) The program ID used to derive the PDA address. This constraint is only used to derive a PDA where the program ID is not the current program.
The seeds and bump constraints are required to be used together.

Usage Examples #
Below are examples demonstrating how to use PDA constraints in an Anchor program.

seeds
bump
seeds::program
init
The seeds constraint


[User] What is the default rate limit for unauthorized requests on the Magic Eden Ordinals API?

[Assistant] The default rate limit for unauthorized requests on the Magic Eden Ordinals API is 30 requests per minute (QPM).

giceden.dev/v2/ord - this uses the real Ordinals Mainnet cluster, the tokens are real and this is consistent with the data seen on https://magiceden.io/ordinals
Updated about 1 year ago

Frequently Asked Questions (FAQs)
Ordinals API Keys
Did this page help you?
Table of Contents
Clusters

Ordinals API Keys
Rate Limiting
This public API is free to use, and the default limit is 30 QPM. The unauthorized requests share the same "demo" key of the 30 QPM, so it's possible that you will see some 429 status code when trying it.
If you need a higher limit, please fill out the relevant form to get an API key.
US FORM: https://airtable.com/appe8frCT8yj415Us/pagDL0gFwzsrLUxIB/form
NON-US FORM: https://airtable.com/appe8frCT8yj415Us/pagqgEFcpBlbm2DAF/form
If calling the endpoints in batch, please add a small timeout between requests to avoid connection refusal (this applies to both users with and without API keys).
Feel free to join us on Discord!
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

Ordinals API Overview
Blocks
Did this page help you?
Table of Contents
Rate Limiting
Authorization Header

Get block activities
get
https://api-mainnet.magiceden.dev/v2/ord/btc/block/activities
Get block activitie


[User] What is the current rewardType supported by Solana, and are there any plans to add more types in the future?

[Assistant] The current rewardType supported by Solana is "rent." There are indications that other types may be added in the future, but specific details about these potential types are not provided in the documentation.

d
rewardType: <string> - type of reward: currently only "rent", other types may be added in the future
commission: <u8|undefined> - vote account commission when the reward was credited, only present for voting and staking rewards
loadedAddresses: <object|undefined> - Transaction addresses loaded from address lookup tables. Undefined if maxSupportedTransactionVersion is not set in request params, or if jsonParsed encoding is set in request params.
writable: <array[string]> - Ordered list of base-58 encoded addresses for writable loaded accounts
readonly: <array[string]> - Ordered list of base-58 encoded addresses for readonly loaded accounts
returnData: <object|undefined> - 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: <[string, encoding]> - the return data itself, as base-64 encoded binary data
computeUnitsConsumed: <u64|undefined> - number of compute units consumed by the transaction
version: <"legacy"|number|undefined> - Transaction version. Undefined if maxSupportedTransactionVersion is not set in request params.
Code sample #
curl https://api.devnet.solana.com -s -X POST -H "Content-Type: application/json" -d '
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getTransaction",
    "params": [
      "2nBhEBYYvfaAe16UMNqRHre4YNSskvuYgx3M6E4JP1oDYvZEJHvoPzyUidNgNX5r9sTyN1J9UxtbCXy2rqYcuyuv",
      "json"
    ]
  }
'

R


[User] What does the transaction confirmation timeout error mean in the context of Jupiter?

[Assistant]
The transaction confirmation timeout error in the context of Jupiter indicates that a transaction was not confirmed within the specified time limit, typically 60 seconds. This situation arises because each block on the Solana blockchain has a fixed allocation of compute units, and each account can only utilize a certain number of these units within a block.

When you are swapping tokens through a popular trading pair, many users may be competing for the limited compute units available. If your transaction is consistently outbid by others, it may fail to be confirmed within the allotted time, leading to the timeout error.

To mitigate this issue, you can refer to the article on Solana transactions for strategies to improve your transaction confirmation chances. Additionally, the Jupiter API provides a parameter called `prioritizationFeeLamports` on the `/swap` endpoint, which can help you outbid others and increase the likelihood of your transaction being confirmed in a timely manner.

bleshooting Tips
Swap Execution
Common transaction error:

Program log: Custom program error: 0x1771

Program Jupiter Aggregator v6 consumed 67018 of 200000 compute units

Program returned error: custom program error: 0x1771

0x1771 occurs when the slippage tolerance is exceeded, so when the final out amount is less than the minimum out amount.

Wrap and Unwrap SOL
You can refer to the documentation here: https://solanacookbook.com/references/token.html#how-to-manage-wrapped-sol. For the Jupiter API, there is also a wrapAndUnwrapSol parameter that you can use as well.

Transaction Confirmation Timeout
From time to time, you may see an error message like Transaction was not confirmed in 60.00 seconds., this means that your transaction expires without being confirmed. Each block on Solana has a fixed compute unit allocation. Each account can only take up certain compute units in the block. So, if you are swapping through a very hot pair, that means that many people will compete with you for those limited compute units. You will have to outbid others to get your transaction in. This usually happens if you are consistently being outbid by others to get your transaction in.

To learn how to mitigate this problem, you should read this article about Solana transaction here: https://jstarry.notion.site/Transaction-confirmation-d5b8f4e09b9c4a70a1f263f82307d7ce

The Jupiter API cannot fix this for you but we do have a few things that can help you:

prioritizationFeeLamports on /swap: Y


[User] What library or method does Meteora use to send and confirm transactions?

[Assistant]
Meteora uses the `sendAndConfirmTransaction` method from the Solana Web3.js library to send and confirm transactions. This method is typically used to send a transaction to the Solana network and wait for its confirmation.

Here’s an example of how it is used in the provided code snippet:

```javascript
const txHash = await sendAndConfirmTransaction(connection, tx, [payer]);
```

In this line, `connection` represents the connection to the Solana cluster, `tx` is the transaction being sent, and `[payer]` is an array of signers for the transaction. After sending the transaction, it waits for confirmation and returns the transaction hash (`txHash`).

publicKey,
      {
        activationPoint,
      }
    );

  console.log("Creating pool");
  for (const tx of transactions) {
    const txHash = await sendAndConfirmTransaction(connection, tx, [payer]);
    console.log(txHash);
  }

  const poolPubkey = derivePoolAddressWithConfig(
    mintAInfo.mint,
    mintBInfo.mint,
    poolConfig.publicKey,
    DYNAMIC_AMM_PROGRAM_ID
  );

  console.log("Pool created", poolPubkey.toBase58());

  // 3. Create the alpha vault
  const initPermissionlessVaultTx = await AlphaVault.createPermissionlessVault(
    connection,
    {
      baseMint: mintAInfo.mint,
      quoteMint: mintBInfo.mint,
      poolType: PoolType.DYNAMIC,
      vaultMode: VaultMode.PRORATA,
      poolAddress: poolPubkey,
      config: poolConfig.account.vaultConfigKey,
    },
    payer.publicKey
  );

  console.log("Creating vault");
  const txHash = await sendAndConfirmTransaction(
    connection,
    initPermissionlessVaultTx,
    [payer]
  );
  console.log(txHash);
}

const connection = new Connection(clusterApiUrl("devnet"));
const payer = loadKeypairFromFile(process.env.KEYPAIR_PATH);

/**
 * This example shows how to create dynamic pool with permissionless vault
 * Please contact meteora team if the existing pool and vault config doesn't meet the requirement
 * Currently only dynamic pool support permissionless vault
 */
createDynamicPoolWithPermissionlessVault(connection, payer)
  .then(() => {
    console.log("Done");
  })
  .catch(console.error);
Note for token


[User] How does CoinGecko indicate that a user's request has been blocked by the server?

[Assistant] CoinGecko indicates that a user's request has been blocked by the server by returning a status code of **403 (Forbidden)**. This status code suggests that the server is unable to authorize the user's request, likely due to access being blocked.

pools	Query all the pools based on the provided category id

❌ Common Errors & Rate Limit
Common Errors
The server responds to a user’s request by issuing status codes when the request is made to the server. Kindly refer to the table below to further understand the status codes when indicating the success or failure of an API call.

Status Codes	Description
400 (Bad Request)	This is due to an invalid request and the server could not process the user's request
401 (Unauthorized)	This is due to the lack of valid authentication credentials for the requested resource by the user
403 (Forbidden)	This is likely indicating that your access is blocked by our server, and we're unable to authorize your request
429 (Too many requests)	This is likely indicating that the rate limit has reached. The user should reduce the number of calls made, or consider scaling their service plan that has much higher rate limits and call credits
500 (Internal Server Error)	This is a generic error response indicating that the server has encountered an unexpected issue that prevented it from fulfilling the request
503 (Service Unavailable)	The service is currently unavailable. Please check the API status and updates on https://status.coingecko.com
1020 (Access Denied)	This is due to violation of CDN firewall rule
10002 (Api Key Missing)	You have provided incorrect API key credentials. Please check your keys in developer dashboard and ensure that your request is authorized
10005	You may not have access to t


[User] What is the LP fee percentage example provided for a memecoin pool in Meteora?

[Assistant] The example provided for a memecoin pool in Meteora indicates that the LP (Liquidity Provider) fee is 15% of the swap value. From this LP fee, 20% is awarded to the volume referrer, which means that if a user swaps using a referred blink, the referrer earns 20% of 15%, resulting in a 3% fee from the swap.

 When trading volume drops, creators will still be able to earn lending yield from their locked USDC or SOL in their pools. Lending yield also auto-compounds.

Protocol Fee
20% of the Dynamic Fee is allocated as a Protocol Fee that goes to the Protocol or integrators or trading bots that bring volume to the memecoin pool. This helps grow the Meteora Treasury or incentivize more integrations with Meteora and consequently increase volume to the pool. The remaining 80% goes to the memecoin pool creator / LPs.

Only the Meteora team is able to change the Protocol Fee.

Dialect's Referral Blink (Update: Currently removed)
Thanks to Dialect's Blink feature, memecoins launching on Meteora are able to generate referral blinks (blockchain links) on their pools to share across the internet. The aim is to drive volume to the meme pools by incentivizing influencers, KOLs, or meme creators themselves to share the referral blink with their community.

Both creators and referrers will instantly share the fees from any trading that happens on these Blinks. Blink referrers get the some volume referral fee if swaps occur on the meme pool using the blink, while creators (the liquidity providers) get the remaining LP fee.

Example:

A memecoin pool is created and has an LP fee of 15% of the swap value

20% of this LP fee is awarded to the volume referrer, in this case the blink referrer

So if a user swaps using the referred blink, the referrer earns 20% of 15% = 3% fee from the swap

Remaini


[User] What is the significance of the 'transactionDetails' option in the Tatum getBlock method?

[Assistant]
The 'transactionDetails' option in the Tatum `getBlock` method specifies the level of transaction detail that will be returned for each transaction within the block. This option allows you to choose how much information you want about the transactions.

The possible values for 'transactionDetails' are:

- **full**: This option returns comprehensive details about each transaction, including pre and post transaction balances, transaction status, fees charged, and more.
- **minimal**: This option returns only the essential information about the transactions, which may include just the transaction IDs and basic status.

Using the 'transactionDetails' option is significant because it allows developers to tailor the amount of data returned based on their application's needs. For example, a blockchain explorer or a wallet application may require full transaction details to provide users with in-depth information about their transactions, while a simpler application might only need minimal details.

Here’s an example of how to use the 'transactionDetails' option in the `getBlock` method:

```javascript
const config = {
  encoding: 'jsonParsed',
  transactionDetails: 'full', // or 'minimal'
  rewards: false,
  maxSupportedTransactionVersion: 0,
};

const res = await tatum.rpc.getBlock(slotNumber, config);
```

In this example, setting `transactionDetails` to 'full' will ensure that the response includes all the detailed information about each transaction in the specified block.

/tatum

import { TatumSDK, Solana, Network } from '@tatumio/tatum'

const tatum = (await TatumSDK.init) < Solana > { network: Network.SOLANA }

const slotNumber = 430

const config = {
  encoding: 'jsonParsed',
  transactionDetails: 'full',
  rewards: false,
  maxSupportedTransactionVersion: 0,
}

const res = await tatum.rpc.getBlock(slotNumber, config)

await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs
Overview
The getBlock method returns identity and transaction information about a confirmed block in the ledger. It provides detailed data about each transaction within the block, including pre and post transaction balances, transaction status, fees charged, and more.

This method is essential for blockchain explorers or any application that needs to track and represent blockchain transaction data. For instance, it could be used by a wallet application to show transaction details or by a network analytics tool for data gathering and analysis.

Parameters
This method takes the following parameters:

slot (number, required): Slot number
options (object, optional): This object can contain the following fields:
commitment(string, optional): Specifies the level of commitment to apply when fetching data.
Values: finalized confirmed processed
encoding (string, optional): Encoding format for each returned transaction. The default is json. Other possible values include: jsonParsed, base58, base64.
transactionDetails (string, optional): Level of transacti


[User] What is the purpose of the 'commitment' parameter in the Solana airdrop request?

[Assistant]
The 'commitment' parameter in the Solana airdrop request specifies the level of assurance that the transaction has been confirmed. It indicates how many confirmations the client should wait for before considering the transaction finalized.

In the context of the airdrop request, setting the 'commitment' to "confirmed" means that the client will wait until the transaction is confirmed by the cluster, ensuring that the airdrop has been successfully processed before proceeding with any subsequent actions.

Here is an example of how the 'commitment' parameter is used in an airdrop request:

```javascript
await airdrop({
  commitment: "confirmed",
  lamports: lamports(1000_000n),
  recipientAddress: keypairSigner.address,
});
```

In this example, the airdrop will only be considered complete once the transaction has received confirmation, providing a level of reliability for the operation.

ount with address", keypairSigner.address);
  console.log("Requesting airdrop");
  await airdrop({
    commitment: "confirmed",
    lamports: lamports(1000_000n),
    recipientAddress: keypairSigner.address,
  });
  console.log("Airdrop confirmed");

  // Create a memo transaction.
  console.log("Creating a memo transaction");
  const { value: latestBlockhash } = await rpc.getLatestBlockhash().send();
  const transactionMessage = pipe(
    createTransactionMessage({ version: "legacy" }),
    m => setTransactionMessageFeePayerSigner(keypairSigner, m),
    m => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, m),
    m =>
      appendTransactionMessageInstructions(
        [
          getSetComputeUnitPriceInstruction({ microLamports: 5000n }),
          getAddMemoInstruction({ memo: message }),
        ],
        m,
      ),
  );

  // Figure out how many compute units to budget for this transaction
  // so that you can right-size the compute budget to maximize the
  // chance that it will be selected for inclusion into a block.
  console.log("Estimating the compute consumption of the transaction");
  var estimatedComputeUnits = await getComputeUnitEstimate(transactionMessage);
  // While these estimates are quite accurate they are not perfect. So you may want to add a
  // buffer if you expect that the transaction may consume more compute units than estimated.
  // Its not possible to exactly know what the transaction will consume when
  // you send it in the fu


[User] Why might a user want to utilize the getBlockTime method in Tatum for analysis or audit purposes?

[Assistant]
A user might want to utilize the `getBlockTime` method in Tatum for analysis or audit purposes for several reasons:

1. **Understanding Block Production Timing**: The method provides the estimated production time of a specific block in the Solana network. This information is crucial for analyzing the performance and efficiency of the network, as well as understanding the timing of transactions.

2. **Analyzing Network Activity**: By retrieving the production time of various blocks, users can analyze patterns of network activity, such as peak times for block production or delays in block confirmations. This can help in identifying trends or anomalies in network behavior.

3. **Auditing Transactions**: For auditing purposes, knowing when a block was produced can help verify the timing of transactions included in that block. This is essential for ensuring the integrity and accuracy of transaction records.

4. **Stake-Weighted Mean Calculation**: The method uses a stake-weighted mean of vote timestamps from validators, which provides a more accurate representation of block production time. This can be important for users who need precise data for their analyses.

5. **Historical Data Analysis**: Users may want to analyze historical block production times to assess changes in network performance over time, which can inform decisions related to development, investment, or usage of the Solana network.

Overall, the `getBlockTime` method serves as a valuable tool for users who require detailed insights into the timing and efficiency of block production on the Solana blockchain.

rk: Network.SOLANA }

const res = await tatum.rpc.getBlockTime(5)

await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs
Overview
The getBlockTime method returns the estimated production time of a block. Each validator in the Solana network reports their UTC time to the ledger at regular intervals by intermittently adding a timestamp to a vote for a specific block. A requested block's time is then calculated from the stake-weighted mean of these vote timestamps recorded on the ledger in a set of recent blocks.

This method is useful in understanding when a particular block was produced, which is essential for various analysis and audit purposes.

Parameters
blockNumber (number, required): This is the number of the block for which you want to retrieve the production time. The block number is identified by its slot.
Return Object
The method returns an integer or null:

If the production time of the block is available, the method returns the estimated production time as a Unix timestamp (seconds since the Unix epoch).
If the production time of the block is not available, the method returns null.
JSON-RPC Request Example
JSON

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getBlockTime",
  "params": [5]
}
JSON-RPC Response Example
JSON

{
  "jsonrpc": "2.0",
  "result": 1574721591,
  "id": 1
}
Updated about 2 months ago

getfeeformessage
getversion
Did this page help you?
Table of Contents
How to Use It
Overview
Parameters
Return Object
JSON-RPC Request


[User] What does the 'computeUnitLimit' represent in a Jupiter transaction response?

[Assistant]
In a Jupiter transaction response, the `computeUnitLimit` represents the maximum number of compute units that are allocated for the transaction execution. This limit is set to ensure that the transaction does not exceed the computational resources available on the network. It helps in managing the performance and efficiency of the transaction processing by defining how much computational work can be done during the execution of the transaction.

For example, in the response snippet provided, the `computeUnitLimit` is set to `107468`, indicating that this is the cap on the compute units that can be used for the transaction.

 api
      quoteResponse,
      // user public key to be used for the swap
      userPublicKey: wallet.publicKey.toString(),
      // auto wrap and unwrap SOL. default is true
      wrapAndUnwrapSol: true,
      // jup.ag frontend default max for user
      dynamicSlippage: { "maxBps": 300 },
      // feeAccount is optional. Use if you want to charge a fee.  feeBps must have been passed in /quote API.
      // feeAccount: "fee_account_public_key"
    })
  })
).json();

The backend returns a response with a serialized transaction that is already using the final optimized slippage and a dynamicSlippageReport for visibility/error catching.

{
    "swapTransaction": "// serialized transaction",
    "lastValidBlockHeight": 266691690,
    "prioritizationFeeLamports": 384,
    "computeUnitLimit": 107468,
    "prioritizationType": {
        "computeBudget": {
            "microLamports": 3577,
            "estimatedMicroLamports": 3577
        }
    },
    "dynamicSlippageReport": {
        // the final optimized slippage bps used in the serialized transaction
        "slippageBps": 12,
        // the incurred out amount observed from simulating the transaction
        "otherAmount": 8759842,
        // the simulated incurred slippage during optimization
        // negative integer refers to the loss in bps while positive refers to the gain
        "simulatedIncurredSlippageBps": -8,
        // an amplification ratio we use to add a buffer to the estimated slippage
        "amplific


[User] What are the required query parameters for the CoinGecko top_gainers_losers endpoint?

[Assistant]
The required query parameters for the CoinGecko `top_gainers_losers` endpoint are:

1. **vs_currency** (string): This parameter is required and specifies the target currency of the coins. It refers to the supported currencies listed in the `/simple/supported_vs_currencies` endpoint.

2. **duration** (string): This parameter is optional and allows you to filter the result by a specific time range. The default value is `24h`.

These parameters help in retrieving the top 30 coins with the largest price gain and loss over a specified duration, ensuring that the results are relevant to the user's currency preference.

Updated 8 months ago

Supported Currencies List
💼 Top Gainers & Losers
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/coins/list \
3
     --header 'accept: application/json'

Try It!
RESPONSE
1
[
2
  {
3
    "id": "0chain",
4
    "symbol": "zcn",
5
    "name": "Zus",
6
    "platforms": {
7
      "ethereum": "0xb9ef770b6a5e12e45983c5d80545258aa38f3b78",
8
      "polygon-pos": "0x8bb30e0e67b11b978a5040144c410e1ccddcba30"
9
    }
10
  },
11
  {
12
    "id": "01coin",
13
    "symbol": "zoc",
14
    "name": "01coin",
15
    "platforms": {}
16
  }
17
]

💼 Top Gainers & Losers
get
https://pro-api.coingecko.com/api/v3/coins/top_gainers_losers
This endpoint allows you to query the top 30 coins with largest price gain and loss by a specific time duration

📘
Notes

The endpoint response only includes coins with a 24-hour trading volume of at least $50,000
CoinGecko equivalent page: https://www.coingecko.com/en/crypto-gainers-losers
Cache/Update Frequency: Every 5 minutes
Exclusive for all Paid Plan Subscribers (Analyst, Lite, Pro and Enterprise)
Query Params
vs_currency
string
required
target currency of coins
*refers to /simple/supported_vs_currencies.

duration
string
filter result by time range
Default value: 24h

top_coins
string
filter result by market cap ranking (top 300 to 1000) or all coins (including coins that do not have marke