# About Sugar 🍩

Sugar is an infrastructural layer on Solana for token creation.

Sugar aims to remove all possible losses and make coin trading and creation a positive-sum game for everyone.

Sugar is for creators, traders, brands and opinion leaders.

For tech documentation, see [API documentation](/documentation/api)


# Saving liquidity - pSOL 🍯

Before Sugar, when tokens graduated to bigger liquidity like Raydium/Pumpswap/Meteora, about **\~20 SOL** out of 90 SOL were permanently lost in liquidity.&#x20;

Sugar introduces **pSOL**, a **magical wrapper** for SOL, designed to solve this issue.

How it works:

* Upon graduation, liquidity is migrated against pSOL, and that liquidity is permanently locked, preventing rugs.
* At the same time, a mirrored 20 pSOL is minted to represent the 20 pSOL that is permanently locked.

This way, Sugar saves funds and redistributes them to the users. Primarily to liquidity or directly to the users.

The amount of value saved this way is comparable to trading fees charged by major platforms, allowing Sugar to deliver enormous value to its users while staying competitive.

pSOL is built to be backed 1:1 by SOL. pSOL is minted only when SOL is permanently locked.\
You can swap between pSOL and SOL at any time and in any amount.


# Value distribution

Initially, 100% of revenue (trading fees + pSOL minted) is redistributed back to users directly in the form of a referral program, dev incentives, giveaway, or increased liquidity.

From \~20 pSOL minted each migration:

* **10 pSOL** goes to liquidity, making it 100 instead of 90
* **2 pSOL** goes to dev as an incentive for graduation
* **8 pSOL** goes to the revenue pool to be redistributed.

From the revenue pool:

* **15%** Directed to the referral pool.
* **85%** Allocated to the giveaway pool.

Note: The distribution system might evolve to better adjust to the ecosystem's needs.


# Giveaway

Every trade you make earns you **tickets**—a key to unlocking the **giveaway**!

Initially, all platform revenue, left from referral and dev incentives, is redistributed to the giveaway system.

Each ticket is a chance to play a fun game of luck where you can multiply your cashback rewards.

Not feeling lucky today? Skip the game and claim **discounted rewards** directly—because everyone deserves a win.

Ticket prices and exchange rates update in real time, shifting dynamically with trading fees, migrations, and other platform magic.

Note: The reward system might evolve to better adjust to the ecosystem's needs.

Note: Washtrading and other manipulations are discouraged and might lead to receiving fewer or no tickets at all.


# The Mathematics Behind Ticket Valuation

**Why EV Matters**\
Expected Value (EV) is a core concept in understanding the potential long-term benefits of holding tickets in a rewards-based system. It helps estimate the average value a ticket will return over time, taking into account current platform dynamics.

***

#### Calculating Expected Value (EV)

The expected value of a single ticket depends on two key variables:

* **Available\_rewards**: This includes 85% of platform fees plus some of pSOL mints (post-migration) that are continuously added to the rewards pool.
* **Tickets\_held**: The total number of tickets currently in circulation across all users.

**EV Formula:**

$$
EV\_{\text{per ticket}} = \left( \frac{\text{Available\_rewards}}{\text{Tickets\_held}} \right) \times \text{Multiplier} \times \text{Balancing\_Factor}
$$

Where:

* **Multiplier** reflects any game or user-specific reward multipliers.
* **Balancing\_Factor** is an internal scaling variable (currently set to 0.5) to ensure long-term sustainability.

***

#### Why Holding Tickets Is Strategic

* **Compounding Value Over Time**: Since the EV grows as more users play and contribute to the rewards pool, each ticket becomes more valuable the longer you hold it—assuming others continue to participate.
* **Increased Share of Rewards**: When someone plays before you, they reduce the total rewards available, but also reduce the number of tickets in competition (if tickets are burned or spent), potentially increasing your share.
* **Better Risk-Reward Ratio**: Given that each ticket's EV is around 90% of its cost even in the short term, holding for higher pool accumulation can easily tip the balance in your favor.

***

#### Points allocation

* **Base rate:** Each ticket grants **4 base points**. Your final total is multiplied by the personal multiplier you receive and the amount of tickets you use to play.
* **Time-limited:** This feature (and its point value) is available only during the first season. It may return in the future, but with fewer rewards.
* **Additional incentives:**
  * Although the point amount doesn’t scale with the ticket’s underlying rewards, it still offers a fixed bonus for exchanging tickets.
  * The season-end cutoff encourages users to spend at least some tickets now rather than hoard them.


# Referrals

Sugar referral system lets users generate a custom referral link. When others follow your link and start trading on the platform, you’ll see them listed in this tab.

As a referrer, you earn **up to 20%** of all trading fees generated by your referrals.

**Note:** Referrals are only counted if the user's **first** visit to the website occurs after clicking your referral link. Users who have previously visited Sugar are not eligible as referrals.


# Points

Points are your rewards for trading and creating on Sugar. Whether you’re actively trading or a creator launching coins, you’re earning points.

You also earn points by taking part in a giveaway—whether you play the game or redeem tickets directly. Just be sure to exchange all your tickets for rewards before the season ends.

Trading Sugar coins on Raydium counts too! Every trade there earns you extra points, giving you even more ways to climb higher and unlock rewards.


# Airdrop bonus

Sugar distributes a huge point allocation to past pump.fun and Raydium traders.

The total amount of points is 160 million, around \~50% of all points being distributed in Season 1.

This airdrop distribution's goal is to incentivise those who were left behind and align Sugar with Solana traders.

The points are locked by default.

**Unlocking Bonus Points**\
Here’s how users can unlock these bonus points:

* **First ⅓ of Bonus Points:** For every real point earned, users receive 3 bonus points.
* **Second ⅓ of Bonus Points:** For every real point earned, users receive 2 bonus points.
* **Final ⅓ of Bonus Points:** For every real point earned, users receive 1 bonus point.

This scaling system incentivises users to start using our platform. We’re confident you’ll enjoy the experience and stick around after getting a taste, so the bonus gradually tapers off over time.

**Points distribution**

We took our time to ensure a fair distribution of bonus points across many different user groups, resulting in over 8 million wallets qualifying for the final giveaway.\
To find out if you qualify, check the details at <https://sugar.money/points>.


# Leagues

Leagues let you compare your progress with others in the community, giving you a clear picture of where you stand. It’s a fun and easy way to track your activity and compete with other users.

| Wood League   | None                                      | 0-5%            |
| ------------- | ----------------------------------------- | --------------- |
| Bronze League | Additional rewards will be revealed later | 5%-33%          |
| Silver League | Additional rewards will be revealed later | 33%-53%         |
| Golden League | Additional rewards will be revealed later | 53%+(Initially) |
|               | More leagues will be added later          |                 |


# Creator rewards

**Migration bonus**

When a coin that you created graduates to Raydium, you get a 2 SOL creator bonus, ready to claim the moment migration finishes.

**Raydium fees**

As a creator, you get 10% of SOL trading fees on Raydium: your SOL is yours to claim—all in the same interface. That means you’re rewarded not just for launching, but for growing your community and keeping your coin thriving long after takeoff.

**Community Takeover**

Was the project abandonden by it's creator? We support Community takeovers with redirection of fees. Please be aware that you/your team will have to provide indisputable proof that CTO is needed for the community to strive and that the developer has abandoned the project. If you/your team believe you have a valid cause please contact us via: <https://forms.gle/uMRJN4JY5EnvxM78A>


# Fees

Sugar charges 0.9% trading fees on trading on its platform.


# 👩‍🍳Coin Creation

To make your very first coin, head to Sugar.[money](https://sugar.money), connect your wallet, and hit **“Create Coin.”**

You’ll need a few basics:

* **Ticker** – Keep it short and catchy.
* **Name** – What’s your coin called?
* **Image** – Upload a PNG, JPEG, or even a GIF. Square formats work best.
* **About** – Give it some flavor. What’s your coin about?
* **Social Links (optional)** – Add  X or any other links your community might need to connect and grow.

***

#### Creator Options

Once you’ve filled everything in, you have a choice:

* **Be the first buyer** – You’ll pay a tiny creator fee (\~0.03 SOL).
* **Let someone else buy first** – They’ll pay the fee instead.

Either way, your coin gets launched and listed for others to discover and trade.

> 💡 **Note:** The first buy and the initial trades right after launch **don’t earn points or tickets**.

***

#### Why pSOL?

By default, your coin uses the **pSOL wrapper**.\
Choosing pSOL:

* Saves you up to 18 SOL compared to other platforms
* Unlocks giveaways, cashback, and extra liquidity
* Strengthens your coin launch on Raydium

You can opt out and pair with regular SOL instead, but you’ll lose these benefits.


# 🔄Coin trading

Once your coin is live, it’s ready to be traded by anyone—*including you!*\
Our trading interface makes it simple:

* **Interactive chart** – Watch price action in real-time.
* **Holder list** – See who’s stacking your coin.
* **Trade feed** – Track recent buys and sells.
* **Message board** – Chat with your community.

***

#### How Trading Works

All trades start on a **bonding curve** with a capacity of **87.713 SOL**.\
A total of **780,000,000 coins** are sold to users through this curve.\
Once the curve is filled, your coin automatically **graduates to Raydium**.

***

#### Migration Details (pSOL vs SOL)

* **pSOL** → **220 M coins** migrate to liquidity
* **SOL** → **200 M coins** migrate to liquidity

This migration ensures **strong initial liquidity** right from the start.


# 🍒Coin migration

Once the bonding curve fills up to its max capacity, migration kicks in automatically—no waiting. Trading pauses just briefly while the magic happens behind the scenes.

After migration, your coin's chart updates seamlessly, and trading continues through the same interface. The big change? Trades are now executed against Raydium instead of the bonding curve.

**Note:** Depending on whether you use pSOL or SOL, trading will happen against that respective coin after migration.

Thanks to our pSOL wrapper, liquidity doesn’t just survive migration—it gets a **boost**. Additional 10 SOL is added on top of the money collected by the bonding curve, launching with a tasty total of **97.9 SOL**.

This enhancement helps your coin during its most fragile phase, making the initial launch smoother and more robust than on competing platforms.


# Information

| Website         | <https://sugar.money/>                      |
| --------------- | ------------------------------------------- |
| Twitter         | <https://x.com/sugardotmoney>               |
| SDK(Typescript) | <https://www.npmjs.com/package/sugar-money> |


# Security

Our contracts were audited by [Guvenkaya ](https://www.guvenkaya.co/)

{% file src="/files/p5qzwCSt5V5bDja1V7AZ" %}

{% file src="/files/kymIy8edcvICvGUONyHz" %}

and [Peckshield](https://peckshield.com/)

{% file src="/files/lbfmyp7bibRe0fQMtVbI" %}


# API

This page documents the API that powers sugar.money

### SDKs

To make integration easier, we provide official SDKs:

* [**Node.js SDK**](https://www.npmjs.com/package/sugar-money)
* [**Rust SDK**](https://crates.io/crates/sugar-money)

Please open an issue [here](https://github.com/Sugar-Money/sdk-issues) if you run into issues using any of our SDKs.

### Authentication

Most endpoints require authentication via a session cookie (`__Secure-next-auth.session-token`). To extract this cookie from your browser session, please refer to our [authentication guide](https://github.com/Sugar-Money/examples) for detailed instructions. Alternatively, use the SDKs listed above.

### Rate Limiting

Please note that most API endpoints are rate-limited to ensure fair usage and platform stability.

### API Features

Our API includes:

* 📈 Coins & Trading: Coin creation, candlestick data, holder information, and search capabilities
* 🎮 Rewards: Automate collecting rewards
* 💰 Payouts & Rewards: Unified payout system for rewards, referrals, ticket redeeming, and creator rewards.

### Base URL

All API endpoints are available at: `https://sugar.money/api/v1`

## GET /coin/{address}/candlestick

> Get coin candlestick data

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"paths":{"/coin/{address}/candlestick":{"get":{"tags":["Coins"],"summary":"Get coin candlestick data","parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string"},"description":"Coin address/mint"},{"name":"resolution","in":"query","required":true,"schema":{"type":"string","enum":["1S","5S","1","3","60","360","1D","5D"]},"description":"Time resolution for candlestick data"},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0},"description":"Offset for pagination"},{"name":"limit","in":"query","required":true,"schema":{"type":"integer","minimum":1},"description":"Number of candlesticks to return"},{"name":"toTimestamp","in":"query","required":true,"schema":{"type":"integer","minimum":1},"description":"End timestamp"},{"name":"isFirstDataRequest","in":"query","schema":{"type":"boolean"},"description":"Whether this is the first data request"}],"responses":{"200":{"description":"Candlestick data retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CandlestickData"}},"message":{"type":"string"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"CandlestickData":{"type":"object","properties":{"time":{"type":"number"},"open":{"type":"string"},"high":{"type":"string"},"low":{"type":"string"},"close":{"type":"string"},"volume":{"type":"string"}}},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}}
```

## POST /coin/{address}/comment

> Create a coin comment

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"CoinCommentCreateResponse":{"type":"object","properties":{"id":{"type":"string","description":"Comment ID"},"mint":{"type":"string","description":"Coin mint address"},"message":{"type":"string","description":"Comment message"},"userId":{"type":"string","description":"User ID who created the comment"},"createdAt":{"type":"string","format":"date-time","description":"When the comment was created"}}},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/coin/{address}/comment":{"post":{"tags":["Coins"],"summary":"Create a coin comment","parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string"},"description":"Coin address/mint"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["comment"],"properties":{"comment":{"type":"string","description":"Comment text"}}}}}},"responses":{"200":{"description":"Comment created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CoinCommentCreateResponse"},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## GET /coin/{address}/comments

> Get coin comments

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"paths":{"/coin/{address}/comments":{"get":{"tags":["Coins"],"summary":"Get coin comments","parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string"},"description":"Coin address/mint"},{"name":"page","in":"query","schema":{"type":"integer","default":0},"description":"Page number"},{"name":"limit","in":"query","schema":{"type":"integer","default":40},"description":"Number of comments per page"}],"responses":{"200":{"description":"Comments retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CoinComment"}},"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"CoinComment":{"type":"object","properties":{"id":{"type":"string"},"message":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"user":{"type":"object","properties":{"username":{"type":"string"},"image":{"type":"string"},"publicKey":{"type":"string"}}}}},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}}
```

## GET /coin/{address}

> Get coin details

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"paths":{"/coin/{address}":{"get":{"tags":["Coins"],"summary":"Get coin details","parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string"},"description":"Coin address/mint"}],"responses":{"200":{"description":"Coin details retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Coin"},"message":{"type":"string"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Coin not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"Coin":{"type":"object","properties":{"address":{"type":"string"},"coinSymbol":{"type":"string"},"coinName":{"type":"string"},"coinSrc":{"type":"string"},"coinCreationTime":{"type":"number"},"coinMarketCap":{"type":"number"},"username":{"type":"string"},"holders":{"type":"number"},"comments":{"type":"number"},"xUrl":{"type":"string"},"websiteUrl":{"type":"string"},"featured":{"type":"boolean"},"coinAmount":{"type":"string"},"solPrice":{"type":"number"},"solAmount":{"type":"string"},"bondingCurve":{"type":"string"},"creator":{"type":"string"},"coinDescription":{"type":"string"},"bondingCurveComplete":{"type":"boolean"},"raydiumPoolAddress":{"type":"string"},"migratedToRaydiumAt":{"type":"string","nullable":true}}},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}}
```

## POST /coin/{address}/delete

> Delete a coin

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/coin/{address}/delete":{"post":{"tags":["Coins"],"summary":"Delete a coin","parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string"},"description":"Coin address/mint"}],"responses":{"200":{"description":"Coin deletion result","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"boolean"},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## POST /coin/{address}/favorite

> Mark coin as favorite

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/coin/{address}/favorite":{"post":{"tags":["Coins"],"summary":"Mark coin as favorite","parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string"},"description":"Coin address/mint"}],"responses":{"200":{"description":"Coin marked as favorite","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"boolean"},"message":{"type":"string"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## POST /coin/{address}/unfavorite

> Remove coin from favorites

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/coin/{address}/unfavorite":{"post":{"tags":["Coins"],"summary":"Remove coin from favorites","parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string"},"description":"Coin address/mint"}],"responses":{"200":{"description":"Coin removed from favorites","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"boolean"},"message":{"type":"string"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## GET /coin/{address}/holders

> Get coin holders

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"paths":{"/coin/{address}/holders":{"get":{"tags":["Coins"],"summary":"Get coin holders","parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string"},"description":"Coin address/mint"}],"responses":{"200":{"description":"Coin holders retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CoinHolder"}},"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"CoinHolder":{"type":"object","properties":{"address":{"type":"string"},"amount":{"type":"string"}}},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}}
```

## GET /coin/{address}/trades

> Get coin trading history

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"paths":{"/coin/{address}/trades":{"get":{"tags":["Coins"],"summary":"Get coin trading history","parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string"},"description":"Coin address/mint"},{"name":"page","in":"query","schema":{"type":"integer","default":0},"description":"Page number"},{"name":"limit","in":"query","schema":{"type":"integer","default":20},"description":"Number of trades per page"}],"responses":{"200":{"description":"Trading history retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CoinTrade"}},"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"CoinTrade":{"type":"object","properties":{"publicKey":{"type":"string"},"isBuy":{"type":"boolean"},"time":{"type":"number"},"price":{"type":"string"},"amount":{"type":"number"},"totalUsd":{"type":"number"},"signature":{"type":"string"},"solAmount":{"type":"number"}}},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}}
```

## GET /coin/featured

> Get featured coin

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"paths":{"/coin/featured":{"get":{"tags":["Coins"],"summary":"Get featured coin","responses":{"200":{"description":"Featured coin retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"oneOf":[{"$ref":"#/components/schemas/Coin"},{"type":"null"}]},"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"Coin":{"type":"object","properties":{"address":{"type":"string"},"coinSymbol":{"type":"string"},"coinName":{"type":"string"},"coinSrc":{"type":"string"},"coinCreationTime":{"type":"number"},"coinMarketCap":{"type":"number"},"username":{"type":"string"},"holders":{"type":"number"},"comments":{"type":"number"},"xUrl":{"type":"string"},"websiteUrl":{"type":"string"},"featured":{"type":"boolean"},"coinAmount":{"type":"string"},"solPrice":{"type":"number"},"solAmount":{"type":"string"},"bondingCurve":{"type":"string"},"creator":{"type":"string"},"coinDescription":{"type":"string"},"bondingCurveComplete":{"type":"boolean"},"raydiumPoolAddress":{"type":"string"},"migratedToRaydiumAt":{"type":"string","nullable":true}}},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}}
```

## POST /coin/metadata

> Upload coin metadata

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/coin/metadata":{"post":{"tags":["Coins"],"summary":"Upload coin metadata","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["fileId","chunkIndex","totalChunks","chunk","operation"],"properties":{"fileId":{"type":"string","description":"Unique file identifier"},"chunkIndex":{"type":"integer","minimum":0,"description":"Current chunk index"},"totalChunks":{"type":"integer","minimum":1,"description":"Total number of chunks"},"chunk":{"type":"string","description":"Base64 encoded chunk data"},"operation":{"type":"string","enum":["coin-creation-via-api","ipfs-url-for-metadata"],"description":"Operation type (coin-creation-via-api or ipfs-url-for-metadata)"},"metadata":{"type":"object","properties":{"name":{"type":"string"},"symbol":{"type":"string"},"description":{"type":"string"},"twitter":{"type":"string"},"website":{"type":"string"},"migration_in_psol":{"type":"boolean"}}}}}}}},"responses":{"200":{"description":"Metadata uploaded successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"oneOf":[{"type":"object","properties":{"ipfsUrlOriginalImage":{"type":"string"},"ipfsUrlMetadata":{"type":"string"},"fileId":{"type":"string"},"status":{"type":"string"}},"description":"Object response for coin-creation-via-api operation"},{"type":"string","description":"IPFS URL string response for ipfs-url-for-metadata operation"}]},"message":{"type":"string"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## GET /coin/mint

> Get coin minting information

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"CoinMintResponse":{"type":"string","description":"Coin mint information"},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/coin/mint":{"get":{"tags":["Coins"],"summary":"Get coin minting information","responses":{"200":{"description":"Coin minting information retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CoinMintResponse"},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## POST /coin/mint

> Create a new coin

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"Coin":{"type":"object","properties":{"address":{"type":"string"},"coinSymbol":{"type":"string"},"coinName":{"type":"string"},"coinSrc":{"type":"string"},"coinCreationTime":{"type":"number"},"coinMarketCap":{"type":"number"},"username":{"type":"string"},"holders":{"type":"number"},"comments":{"type":"number"},"xUrl":{"type":"string"},"websiteUrl":{"type":"string"},"featured":{"type":"boolean"},"coinAmount":{"type":"string"},"solPrice":{"type":"number"},"solAmount":{"type":"string"},"bondingCurve":{"type":"string"},"creator":{"type":"string"},"coinDescription":{"type":"string"},"bondingCurveComplete":{"type":"boolean"},"raydiumPoolAddress":{"type":"string"},"migratedToRaydiumAt":{"type":"string","nullable":true}}},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/coin/mint":{"post":{"tags":["Coins"],"summary":"Create a new coin","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["fileId"],"properties":{"fileId":{"type":"string","description":"File ID from metadata upload"},"ipfsUrlOriginalImage":{"type":"string","description":"IPFS URL for original image"},"ipfsUrlMetadata":{"type":"string","description":"IPFS URL for metadata"},"migrationInPsol":{"type":"boolean","description":"Whether to migrate in PSOL"}}}}}},"responses":{"200":{"description":"Coin created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Coin"},"message":{"type":"string"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## GET /coins

> Get paginated list of coins

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"paths":{"/coins":{"get":{"tags":["Coins"],"summary":"Get paginated list of coins","parameters":[{"name":"page","in":"query","schema":{"type":"integer","default":0},"description":"Page number"},{"name":"filter","in":"query","schema":{"type":"string"},"description":"Filter type"},{"name":"bondingCurveFrom","in":"query","schema":{"type":"number"},"description":"Minimum bonding curve value"},{"name":"bondingCurveTo","in":"query","schema":{"type":"number"},"description":"Maximum bonding curve value"},{"name":"marketCapFrom","in":"query","schema":{"type":"number"},"description":"Minimum market cap"},{"name":"marketCapTo","in":"query","schema":{"type":"number"},"description":"Maximum market cap"},{"name":"coinAgeFrom","in":"query","schema":{"type":"number"},"description":"Minimum coin age"},{"name":"coinAgeTo","in":"query","schema":{"type":"number"},"description":"Maximum coin age"},{"name":"toShow","in":"query","schema":{"type":"string"},"description":"Comma-separated strings to include"},{"name":"doNotShow","in":"query","schema":{"type":"string"},"description":"Comma-separated strings to exclude"},{"name":"coinHoldersFrom","in":"query","schema":{"type":"number"},"description":"Minimum number of coin holders"},{"name":"coinHoldersTo","in":"query","schema":{"type":"number"},"description":"Maximum number of coin holders"},{"name":"hideNsfw","in":"query","schema":{"type":"boolean"},"description":"Hide NSFW content"},{"name":"solPriceUsd","in":"query","schema":{"type":"number"},"description":"SOL price in USD"}],"responses":{"200":{"description":"Coins retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"coins":{"type":"array","items":{"$ref":"#/components/schemas/Coin"}},"totalCount":{"type":"number"},"page":{"type":"number"}}},"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"Coin":{"type":"object","properties":{"address":{"type":"string"},"coinSymbol":{"type":"string"},"coinName":{"type":"string"},"coinSrc":{"type":"string"},"coinCreationTime":{"type":"number"},"coinMarketCap":{"type":"number"},"username":{"type":"string"},"holders":{"type":"number"},"comments":{"type":"number"},"xUrl":{"type":"string"},"websiteUrl":{"type":"string"},"featured":{"type":"boolean"},"coinAmount":{"type":"string"},"solPrice":{"type":"number"},"solAmount":{"type":"string"},"bondingCurve":{"type":"string"},"creator":{"type":"string"},"coinDescription":{"type":"string"},"bondingCurveComplete":{"type":"boolean"},"raydiumPoolAddress":{"type":"string"},"migratedToRaydiumAt":{"type":"string","nullable":true}}},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}}
```

## GET /coins/search

> Search coins

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"paths":{"/coins/search":{"get":{"tags":["Coins"],"summary":"Search coins","parameters":[{"name":"searchTerm","in":"query","schema":{"type":"string"},"description":"Search term"},{"name":"page","in":"query","schema":{"type":"integer","default":0},"description":"Page number"}],"responses":{"200":{"description":"Search results retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"mint":{"type":"string"},"name":{"type":"string"},"symbol":{"type":"string"},"image_uri":{"type":"string"},"coinMarketCap":{"type":"number"},"solPrice":{"type":"string"}}}},"nextPage":{"type":"integer","nullable":true}}},"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}}
```

## GET /fees

> Get fees information

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/fees":{"get":{"tags":["General"],"summary":"Get fees information","responses":{"200":{"description":"Fees information retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jito":{"type":"object","properties":{"landedTips25thPercentile":{"type":"number"},"landedTips50thPercentile":{"type":"number"},"landedTips75thPercentile":{"type":"number"},"landedTips95thPercentile":{"type":"number"},"landedTips99thPercentile":{"type":"number"},"emaLandedTips50thPercentile":{"type":"number"}}},"regular":{"type":"object","properties":{"extreme":{"type":"number"},"high":{"type":"number"},"low":{"type":"number"},"medium":{"type":"number"}}},"coinCreationFee":{"type":"number"}}},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## GET /price/sol

> Get SOL price

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"paths":{"/price/sol":{"get":{"tags":["Price"],"summary":"Get SOL price","responses":{"200":{"description":"SOL price retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"number","description":"Current SOL price"},"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}}
```

## POST /game/create

> Create a new game

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"GameCreateResponse":{"type":"object","properties":{"gameId":{"type":"string","description":"Unique identifier for the created game"},"updatedTickets":{"type":"number","description":"User's remaining tickets after game creation"},"gameHashed":{"type":"string","description":"Hashed game data for verification"}}},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/game/create":{"post":{"tags":["Game"],"summary":"Create a new game","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["tickets"],"properties":{"tickets":{"type":"integer","minimum":1,"description":"Number of tickets to use"}}}}}},"responses":{"200":{"description":"Game created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/GameCreateResponse"},"message":{"type":"string"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## GET /game/current

> Get current game

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/game/current":{"get":{"tags":["Game"],"summary":"Get current game","responses":{"200":{"description":"Current game retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"revealedPositions":{"type":"array","items":{"type":"number"}},"tickets":{"type":"number"}}},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## GET /game/history

> Get game history

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"GameHistory":{"type":"object","properties":{"id":{"type":"string"},"tickets":{"type":"number"},"solAmount":{"type":"string"},"createdAt":{"type":"string"},"multiplier":{"type":"number"},"signature":{"type":"string"},"status":{"type":"string"},"hash":{"type":"string"},"seed":{"type":"string"},"state":{"type":"array","items":{"type":"number"},"nullable":true,"description":"Game state as array of numbers"},"updatedAt":{"type":"string"},"awardedPoints":{"type":"number"}}},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/game/history":{"get":{"tags":["Game"],"summary":"Get game history","parameters":[{"name":"page","in":"query","schema":{"type":"integer","default":0},"description":"Page number"},{"name":"pageSize","in":"query","schema":{"type":"integer","default":10},"description":"Page size"}],"responses":{"200":{"description":"Game history retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GameHistory"}},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## GET /game/payout/in-progress

> Check game payout progress

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"PayoutProgress":{"type":"object","properties":{"expiresAt":{"type":"number","description":"Unix timestamp when the payout process expires"},"inProgress":{"type":"boolean","description":"Whether a payout is currently in progress"}}},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/game/payout/in-progress":{"get":{"tags":["Game"],"summary":"Check game payout progress","responses":{"200":{"description":"Payout progress retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PayoutProgress"},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## POST /game/update

> Update game state

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"GameUpdateResponse":{"type":"object","properties":{"newPositions":{"type":"array","items":{"type":"number"},"description":"New revealed positions in the game grid"},"multiplier":{"type":"number","description":"Current multiplier for the game"},"isMatch":{"type":"boolean","description":"Whether the current move resulted in a match"},"payoutAmount":{"type":"string","nullable":true,"description":"Payout amount if game is won"},"state":{"type":"array","items":{"type":"number"},"nullable":true,"description":"Current game state"}}},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/game/update":{"post":{"tags":["Game"],"summary":"Update game state","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["index","gameId"],"properties":{"index":{"type":"integer","minimum":0,"maximum":19,"description":"Grid index to reveal"},"gameId":{"type":"string","description":"Game ID"}}}}}},"responses":{"200":{"description":"Game updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/GameUpdateResponse"},"message":{"type":"string"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## POST /game/payout/request

> Request game payout

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"PayoutRequestResponse":{"type":"object","properties":{"serialisedTransaction":{"type":"string","description":"Serialized transaction ready for signing"},"blockhash":{"type":"string","description":"Recent blockhash for the transaction"},"lastValidBlockHeight":{"type":"number","description":"Last valid block height for the transaction"},"nonce":{"type":"number","description":"Transaction nonce"}}},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/game/payout/request":{"post":{"tags":["Game"],"summary":"Request game payout","responses":{"200":{"description":"Payout requested successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PayoutRequestResponse"},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## POST /game/payout/submit

> Submit game payout transaction

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"CheckTransactionResponse":{"type":"object","properties":{"signature":{"type":"string","description":"Transaction signature"},"status":{"$ref":"#/components/schemas/TransactionStatus"}},"required":["signature","status"]},"TransactionStatus":{"type":"string","enum":["processing","success","failed","dropped","not_found"],"description":"Status of a blockchain transaction"},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/game/payout/submit":{"post":{"tags":["Game"],"summary":"Submit game payout transaction","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["signed_tx","blockhash","lastValidBlockHeight","nonce"],"properties":{"signed_tx":{"type":"string","description":"Signed transaction"},"blockhash":{"type":"string","description":"Recent blockhash"},"lastValidBlockHeight":{"type":"number","description":"Last valid block height"},"nonce":{"type":"string","description":"Transaction nonce"}}}}}},"responses":{"200":{"description":"Payout submitted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CheckTransactionResponse"},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## GET /games/recent

> Get recent games

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"paths":{"/games/recent":{"get":{"tags":["Game"],"summary":"Get recent games","responses":{"200":{"description":"Recent games retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RecentGamesResponse"},"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"RecentGamesResponse":{"type":"array","items":{"$ref":"#/components/schemas/RecentGameItem"},"description":"Array of recent game results"},"RecentGameItem":{"type":"object","properties":{"username":{"type":"string","description":"Username of the player"},"solReward":{"type":"string","description":"SOL reward amount"},"numberOfTickets":{"type":"number","description":"Number of tickets used"},"timestamp":{"type":"number","description":"Game timestamp"},"gameId":{"type":"string","description":"Game identifier"}}},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}}
```

## GET /points/tickets-rate

> Get points to tickets exchange rate

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"PointsTicketsRateResponse":{"type":"number","description":"Exchange rate value for converting points to tickets"},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/points/tickets-rate":{"get":{"tags":["Points"],"summary":"Get points to tickets exchange rate","responses":{"200":{"description":"Exchange rate retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PointsTicketsRateResponse"},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## GET /ranks

> Get user ranks

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"RanksDataResponse":{"type":"object","properties":{"ranks":{"type":"array","items":{"type":"object","properties":{"rank":{"type":"string","description":"Rank level"},"minPoints":{"type":"string","description":"Minimum points required for this rank"}}}},"rate":{"type":"number","description":"Points calculation rate"}}},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/ranks":{"get":{"tags":["General"],"summary":"Get user ranks","responses":{"200":{"description":"Ranks retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RanksDataResponse"},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## GET /referrals/code-exists

> Check if referral code exists

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/referrals/code-exists":{"get":{"tags":["Referrals"],"summary":"Check if referral code exists","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string"},"description":"Referral code to check"}],"responses":{"200":{"description":"Code existence checked successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"boolean"},"message":{"type":"string"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## POST /referrals/link

> Link referral code

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/referrals/link":{"post":{"tags":["Referrals"],"summary":"Link referral code","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string","description":"Referral code to link"}}}}}},"responses":{"200":{"description":"Referral code linked successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"boolean"},"message":{"type":"string"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## GET /referrals/me

> Get user referral data

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"UserReferralDataResponse":{"type":"object","properties":{"referralPendingPayout":{"type":"number","description":"Pending referral payout amount"},"tradingFees":{"type":"number","description":"Trading fees from referrals"},"ownReferralCode":{"type":"string","nullable":true,"description":"User's own referral code"},"ownReferralCodeEarnPercentage":{"type":"number","nullable":true,"description":"Percentage earned from own referral code"},"referredUsers":{"type":"array","items":{"type":"object","properties":{"referralGeneratedAmount":{"type":"number","description":"Amount generated from this referral"},"referralTradingVolume":{"type":"number","description":"Trading volume from this referral"},"createdAt":{"type":"string","description":"When the referral was created"},"publicKey":{"type":"string","description":"Public key of the referred user"}}}},"referredByPublicKey":{"type":"string","nullable":true,"description":"Public key of the user who referred this user"},"totalReferredUsers":{"type":"number","description":"Total number of referred users"}}},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/referrals/me":{"get":{"tags":["Referrals"],"summary":"Get user referral data","responses":{"200":{"description":"User referral data retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UserReferralDataResponse"},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## POST /referrals/me

> Create referral code

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"CreateReferralCodeResponse":{"type":"object","properties":{"code":{"type":"string","description":"The created referral code"},"earnPercentage":{"type":"number","description":"Percentage earned from referrals"}}},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/referrals/me":{"post":{"tags":["Referrals"],"summary":"Create referral code","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string","description":"Referral code to create"}}}}}},"responses":{"200":{"description":"Referral code created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CreateReferralCodeResponse"},"message":{"type":"string"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## GET /referrals/me/payout/in-progress

> Check referral payout progress

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"PayoutProgress":{"type":"object","properties":{"expiresAt":{"type":"number","description":"Unix timestamp when the payout process expires"},"inProgress":{"type":"boolean","description":"Whether a payout is currently in progress"}}},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/referrals/me/payout/in-progress":{"get":{"tags":["Referrals"],"summary":"Check referral payout progress","responses":{"200":{"description":"Payout progress retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PayoutProgress"},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## POST /referrals/me/payout/request

> Request referral payout

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"PayoutRequestResponse":{"type":"object","properties":{"serialisedTransaction":{"type":"string","description":"Serialized transaction ready for signing"},"blockhash":{"type":"string","description":"Recent blockhash for the transaction"},"lastValidBlockHeight":{"type":"number","description":"Last valid block height for the transaction"},"nonce":{"type":"number","description":"Transaction nonce"}}},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/referrals/me/payout/request":{"post":{"tags":["Referrals"],"summary":"Request referral payout","responses":{"200":{"description":"Payout requested successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PayoutRequestResponse"},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## POST /referrals/me/payout/submit

> Submit referral payout transaction

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"CheckTransactionResponse":{"type":"object","properties":{"signature":{"type":"string","description":"Transaction signature"},"status":{"$ref":"#/components/schemas/TransactionStatus"}},"required":["signature","status"]},"TransactionStatus":{"type":"string","enum":["processing","success","failed","dropped","not_found"],"description":"Status of a blockchain transaction"},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/referrals/me/payout/submit":{"post":{"tags":["Referrals"],"summary":"Submit referral payout transaction","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["signed_tx","blockhash","lastValidBlockHeight","nonce"],"properties":{"signed_tx":{"type":"string","description":"Signed transaction"},"blockhash":{"type":"string","description":"Recent blockhash"},"lastValidBlockHeight":{"type":"number","description":"Last valid block height"},"nonce":{"type":"string","description":"Transaction nonce"}}}}}},"responses":{"200":{"description":"Payout submitted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CheckTransactionResponse"},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## GET /tickets/exchange-rate

> Get ticket exchange rate

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"TicketsExchangeRateResponse":{"type":"number","description":"Exchange rate for tickets to SOL"},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/tickets/exchange-rate":{"get":{"tags":["Tickets"],"summary":"Get ticket exchange rate","responses":{"200":{"description":"Exchange rate retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TicketsExchangeRateResponse"},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## GET /tickets/max-amount

> Get maximum ticket amount

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"TicketsMaxAmountResponse":{"type":"number","description":"Maximum number of tickets that can be cashed out"},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/tickets/max-amount":{"get":{"tags":["Tickets"],"summary":"Get maximum ticket amount","responses":{"200":{"description":"Maximum amount retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TicketsMaxAmountResponse"},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## GET /tickets/payout/in-progress

> Check ticket payout progress

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"PayoutProgress":{"type":"object","properties":{"expiresAt":{"type":"number","description":"Unix timestamp when the payout process expires"},"inProgress":{"type":"boolean","description":"Whether a payout is currently in progress"}}},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/tickets/payout/in-progress":{"get":{"tags":["Tickets"],"summary":"Check ticket payout progress","responses":{"200":{"description":"Payout progress retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PayoutProgress"},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## POST /tickets/payout/request

> Request ticket payout

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"PayoutRequestResponse":{"type":"object","properties":{"serialisedTransaction":{"type":"string","description":"Serialized transaction ready for signing"},"blockhash":{"type":"string","description":"Recent blockhash for the transaction"},"lastValidBlockHeight":{"type":"number","description":"Last valid block height for the transaction"},"nonce":{"type":"number","description":"Transaction nonce"}}},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/tickets/payout/request":{"post":{"tags":["Tickets"],"summary":"Request ticket payout","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["tickets"],"properties":{"tickets":{"type":"integer","minimum":1,"description":"Number of tickets to cash out"}}}}}},"responses":{"200":{"description":"Payout requested successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PayoutRequestResponse"},"message":{"type":"string"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## POST /tickets/payout/submit

> Submit ticket payout transaction

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"CheckTransactionResponse":{"type":"object","properties":{"signature":{"type":"string","description":"Transaction signature"},"status":{"$ref":"#/components/schemas/TransactionStatus"}},"required":["signature","status"]},"TransactionStatus":{"type":"string","enum":["processing","success","failed","dropped","not_found"],"description":"Status of a blockchain transaction"},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/tickets/payout/submit":{"post":{"tags":["Tickets"],"summary":"Submit ticket payout transaction","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["signed_tx","blockhash","lastValidBlockHeight","nonce"],"properties":{"signed_tx":{"type":"string","description":"Signed transaction"},"blockhash":{"type":"string","description":"Recent blockhash"},"lastValidBlockHeight":{"type":"number","description":"Last valid block height"},"nonce":{"type":"string","description":"Transaction nonce"}}}}}},"responses":{"200":{"description":"Payout submitted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CheckTransactionResponse"},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## GET /transaction/status

> Check transaction status

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"CheckTransactionResponse":{"type":"object","properties":{"signature":{"type":"string","description":"Transaction signature"},"status":{"$ref":"#/components/schemas/TransactionStatus"}},"required":["signature","status"]},"TransactionStatus":{"type":"string","enum":["processing","success","failed","dropped","not_found"],"description":"Status of a blockchain transaction"},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/transaction/status":{"get":{"tags":["Transactions"],"summary":"Check transaction status","parameters":[{"name":"signature","in":"query","required":true,"schema":{"type":"string"},"description":"Transaction signature to check"}],"responses":{"200":{"description":"Transaction status retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CheckTransactionResponse"},"message":{"type":"string"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## POST /transaction/sign

> Sign a transaction

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"CheckTransactionResponse":{"type":"object","properties":{"signature":{"type":"string","description":"Transaction signature"},"status":{"$ref":"#/components/schemas/TransactionStatus"}},"required":["signature","status"]},"TransactionStatus":{"type":"string","enum":["processing","success","failed","dropped","not_found"],"description":"Status of a blockchain transaction"},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/transaction/sign":{"post":{"tags":["Transactions"],"summary":"Sign a transaction","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["serialisedTx","mint","blockhash","lastValidBlockHeight"],"properties":{"serialisedTx":{"type":"string","description":"Serialized transaction data"},"mint":{"type":"string","description":"Coin mint address"},"blockhash":{"type":"string","description":"Recent blockhash for the transaction"},"lastValidBlockHeight":{"type":"number","description":"Last valid block height for the transaction"}}}}}},"responses":{"200":{"description":"Transaction signed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CheckTransactionResponse"},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## GET /user/coin/{address}/trade-metrics

> Get user coin trade metrics

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"UserTradeMetricsResponse":{"type":"object","nullable":true,"properties":{"totalBoughtCoin":{"type":"string","description":"Total coins bought"},"totalSoldCoin":{"type":"string","description":"Total coins sold"},"costBasisSol":{"type":"string","description":"Cost basis in SOL"},"costBasisUsd":{"type":"string","description":"Cost basis in USD"},"realizedPnlSol":{"type":"string","description":"Realized PnL in SOL"},"realizedPnlUsd":{"type":"string","description":"Realized PnL in USD"},"volumeSol":{"type":"string","description":"Trading volume in SOL"},"volumeUsd":{"type":"string","description":"Trading volume in USD"}}},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/user/coin/{address}/trade-metrics":{"get":{"tags":["User"],"summary":"Get user coin trade metrics","parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string"},"description":"Coin address/mint"}],"responses":{"200":{"description":"Trade metrics retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UserTradeMetricsResponse"},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## GET /user/coins

> Get user created coins

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"Coin":{"type":"object","properties":{"address":{"type":"string"},"coinSymbol":{"type":"string"},"coinName":{"type":"string"},"coinSrc":{"type":"string"},"coinCreationTime":{"type":"number"},"coinMarketCap":{"type":"number"},"username":{"type":"string"},"holders":{"type":"number"},"comments":{"type":"number"},"xUrl":{"type":"string"},"websiteUrl":{"type":"string"},"featured":{"type":"boolean"},"coinAmount":{"type":"string"},"solPrice":{"type":"number"},"solAmount":{"type":"string"},"bondingCurve":{"type":"string"},"creator":{"type":"string"},"coinDescription":{"type":"string"},"bondingCurveComplete":{"type":"boolean"},"raydiumPoolAddress":{"type":"string"},"migratedToRaydiumAt":{"type":"string","nullable":true}}},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/user/coins":{"get":{"tags":["User"],"summary":"Get user created coins","responses":{"200":{"description":"User created coins retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Coin"}},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## GET /user/creator-rewards/payout/in-progress

> Check creator rewards payout progress

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"PayoutProgress":{"type":"object","properties":{"expiresAt":{"type":"number","description":"Unix timestamp when the payout process expires"},"inProgress":{"type":"boolean","description":"Whether a payout is currently in progress"}}},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/user/creator-rewards/payout/in-progress":{"get":{"tags":["User"],"summary":"Check creator rewards payout progress","responses":{"200":{"description":"Payout progress retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PayoutProgress"},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## POST /user/creator-rewards/payout/request

> Request creator rewards payout

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"PayoutRequestResponse":{"type":"object","properties":{"serialisedTransaction":{"type":"string","description":"Serialized transaction ready for signing"},"blockhash":{"type":"string","description":"Recent blockhash for the transaction"},"lastValidBlockHeight":{"type":"number","description":"Last valid block height for the transaction"},"nonce":{"type":"number","description":"Transaction nonce"}}},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/user/creator-rewards/payout/request":{"post":{"tags":["User"],"summary":"Request creator rewards payout","responses":{"200":{"description":"Payout requested successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PayoutRequestResponse"},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## POST /user/creator-rewards/payout/submit

> Submit creator rewards payout transaction

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"CheckTransactionResponse":{"type":"object","properties":{"signature":{"type":"string","description":"Transaction signature"},"status":{"$ref":"#/components/schemas/TransactionStatus"}},"required":["signature","status"]},"TransactionStatus":{"type":"string","enum":["processing","success","failed","dropped","not_found"],"description":"Status of a blockchain transaction"},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/user/creator-rewards/payout/submit":{"post":{"tags":["User"],"summary":"Submit creator rewards payout transaction","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["signed_tx","blockhash","lastValidBlockHeight","nonce"],"properties":{"signed_tx":{"type":"string","description":"Signed transaction"},"blockhash":{"type":"string","description":"Recent blockhash"},"lastValidBlockHeight":{"type":"number","description":"Last valid block height"},"nonce":{"type":"string","description":"Transaction nonce"}}}}}},"responses":{"200":{"description":"Payout submitted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CheckTransactionResponse"},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## GET /user/favorites

> Get user favorite coins

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"Coin":{"type":"object","properties":{"address":{"type":"string"},"coinSymbol":{"type":"string"},"coinName":{"type":"string"},"coinSrc":{"type":"string"},"coinCreationTime":{"type":"number"},"coinMarketCap":{"type":"number"},"username":{"type":"string"},"holders":{"type":"number"},"comments":{"type":"number"},"xUrl":{"type":"string"},"websiteUrl":{"type":"string"},"featured":{"type":"boolean"},"coinAmount":{"type":"string"},"solPrice":{"type":"number"},"solAmount":{"type":"string"},"bondingCurve":{"type":"string"},"creator":{"type":"string"},"coinDescription":{"type":"string"},"bondingCurveComplete":{"type":"boolean"},"raydiumPoolAddress":{"type":"string"},"migratedToRaydiumAt":{"type":"string","nullable":true}}},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/user/favorites":{"get":{"tags":["User"],"summary":"Get user favorite coins","responses":{"200":{"description":"User favorites retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Coin"}},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## GET /user/holdings

> Get user coin holdings

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"UserHolding":{"type":"object","properties":{"amount":{"type":"string"},"coin":{"$ref":"#/components/schemas/Coin"}}},"Coin":{"type":"object","properties":{"address":{"type":"string"},"coinSymbol":{"type":"string"},"coinName":{"type":"string"},"coinSrc":{"type":"string"},"coinCreationTime":{"type":"number"},"coinMarketCap":{"type":"number"},"username":{"type":"string"},"holders":{"type":"number"},"comments":{"type":"number"},"xUrl":{"type":"string"},"websiteUrl":{"type":"string"},"featured":{"type":"boolean"},"coinAmount":{"type":"string"},"solPrice":{"type":"number"},"solAmount":{"type":"string"},"bondingCurve":{"type":"string"},"creator":{"type":"string"},"coinDescription":{"type":"string"},"bondingCurveComplete":{"type":"boolean"},"raydiumPoolAddress":{"type":"string"},"migratedToRaydiumAt":{"type":"string","nullable":true}}},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/user/holdings":{"get":{"tags":["User"],"summary":"Get user coin holdings","parameters":[{"name":"solPriceUsd","in":"query","schema":{"type":"number"},"description":"SOL price in USD"}],"responses":{"200":{"description":"User holdings retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/UserHolding"}},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## GET /user/points/history

> Get user points history

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"PointsHistoryResponse":{"type":"array","items":{"$ref":"#/components/schemas/PointsHistoryItem"},"description":"Array of user points history"},"PointsHistoryItem":{"type":"object","properties":{"timestamp":{"type":"number","description":"Unix timestamp"},"points":{"type":"number","description":"Points amount"},"tradingVolume":{"type":"number","description":"Trading volume amount"}}},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/user/points/history":{"get":{"tags":["User"],"summary":"Get user points history","responses":{"200":{"description":"Points history retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PointsHistoryResponse"},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## GET /user/preferences

> Get user preferences

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"paths":{"/user/preferences":{"get":{"tags":["User"],"summary":"Get user preferences","responses":{"200":{"description":"User preferences retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UserPreferences"},"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"UserPreferences":{"type":"object","properties":{"bribeAmount":{"type":"number","nullable":true},"priorityFeeAmount":{"type":"number","nullable":true},"maxFee":{"type":"number","nullable":true},"quickBuy":{"type":"boolean"},"quickBuy1":{"type":"number"},"quickBuy2":{"type":"number"},"quickBuy3":{"type":"number"},"sellPrefersCoin":{"type":"boolean"},"hideNsfw":{"type":"boolean"},"maxSlippage":{"type":"number","nullable":true},"selectedQuickBuy":{"type":"number"},"autoSortingEnabled":{"type":"boolean"},"username":{"type":"string","nullable":true},"usernameUpdatedAt":{"type":"string","nullable":true},"points":{"type":"number"},"tickets":{"type":"number"},"creatorPayout":{"type":"number"},"pointsPumpFun":{"type":"number"},"antiMevProtection":{"type":"boolean"},"tradingSettingsAuto":{"type":"boolean"},"sidebarOpen":{"type":"boolean"},"revealedBonusPoints":{"type":"boolean"}},"required":["quickBuy","quickBuy1","quickBuy2","quickBuy3","sellPrefersCoin","hideNsfw","selectedQuickBuy","autoSortingEnabled","points","tickets","creatorPayout","pointsPumpFun","antiMevProtection","tradingSettingsAuto","sidebarOpen","revealedBonusPoints"]},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}}
```

## PATCH /user/preferences

> Update user preferences

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"UserPreferences":{"type":"object","properties":{"bribeAmount":{"type":"number","nullable":true},"priorityFeeAmount":{"type":"number","nullable":true},"maxFee":{"type":"number","nullable":true},"quickBuy":{"type":"boolean"},"quickBuy1":{"type":"number"},"quickBuy2":{"type":"number"},"quickBuy3":{"type":"number"},"sellPrefersCoin":{"type":"boolean"},"hideNsfw":{"type":"boolean"},"maxSlippage":{"type":"number","nullable":true},"selectedQuickBuy":{"type":"number"},"autoSortingEnabled":{"type":"boolean"},"username":{"type":"string","nullable":true},"usernameUpdatedAt":{"type":"string","nullable":true},"points":{"type":"number"},"tickets":{"type":"number"},"creatorPayout":{"type":"number"},"pointsPumpFun":{"type":"number"},"antiMevProtection":{"type":"boolean"},"tradingSettingsAuto":{"type":"boolean"},"sidebarOpen":{"type":"boolean"},"revealedBonusPoints":{"type":"boolean"}},"required":["quickBuy","quickBuy1","quickBuy2","quickBuy3","sellPrefersCoin","hideNsfw","selectedQuickBuy","autoSortingEnabled","points","tickets","creatorPayout","pointsPumpFun","antiMevProtection","tradingSettingsAuto","sidebarOpen","revealedBonusPoints"]},"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/user/preferences":{"patch":{"tags":["User"],"summary":"Update user preferences","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPreferences"}}}},"responses":{"200":{"description":"User preferences updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UserPreferences"},"message":{"type":"string"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## GET /user/tickets

> Get user tickets

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"servers":[{"url":"/api/v1","description":"API v1 endpoints"}],"security":[{"sessionAuth":[]}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Session authentication cookie"}},"schemas":{"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/user/tickets":{"get":{"tags":["User"],"summary":"Get user tickets","responses":{"200":{"description":"User tickets retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"number"},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## The Error object

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"components":{"schemas":{"Error":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}}
```

## The Coin object

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"components":{"schemas":{"Coin":{"type":"object","properties":{"address":{"type":"string"},"coinSymbol":{"type":"string"},"coinName":{"type":"string"},"coinSrc":{"type":"string"},"coinCreationTime":{"type":"number"},"coinMarketCap":{"type":"number"},"username":{"type":"string"},"holders":{"type":"number"},"comments":{"type":"number"},"xUrl":{"type":"string"},"websiteUrl":{"type":"string"},"featured":{"type":"boolean"},"coinAmount":{"type":"string"},"solPrice":{"type":"number"},"solAmount":{"type":"string"},"bondingCurve":{"type":"string"},"creator":{"type":"string"},"coinDescription":{"type":"string"},"bondingCurveComplete":{"type":"boolean"},"raydiumPoolAddress":{"type":"string"},"migratedToRaydiumAt":{"type":"string","nullable":true}}}}}}
```

## The CandlestickData object

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"components":{"schemas":{"CandlestickData":{"type":"object","properties":{"time":{"type":"number"},"open":{"type":"string"},"high":{"type":"string"},"low":{"type":"string"},"close":{"type":"string"},"volume":{"type":"string"}}}}}}
```

## The CoinComment object

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"components":{"schemas":{"CoinComment":{"type":"object","properties":{"id":{"type":"string"},"message":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"user":{"type":"object","properties":{"username":{"type":"string"},"image":{"type":"string"},"publicKey":{"type":"string"}}}}}}}}
```

## The CoinTrade object

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"components":{"schemas":{"CoinTrade":{"type":"object","properties":{"publicKey":{"type":"string"},"isBuy":{"type":"boolean"},"time":{"type":"number"},"price":{"type":"string"},"amount":{"type":"number"},"totalUsd":{"type":"number"},"signature":{"type":"string"},"solAmount":{"type":"number"}}}}}}
```

## The CoinHolder object

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"components":{"schemas":{"CoinHolder":{"type":"object","properties":{"address":{"type":"string"},"amount":{"type":"string"}}}}}}
```

## The UserPreferences object

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"components":{"schemas":{"UserPreferences":{"type":"object","properties":{"bribeAmount":{"type":"number","nullable":true},"priorityFeeAmount":{"type":"number","nullable":true},"maxFee":{"type":"number","nullable":true},"quickBuy":{"type":"boolean"},"quickBuy1":{"type":"number"},"quickBuy2":{"type":"number"},"quickBuy3":{"type":"number"},"sellPrefersCoin":{"type":"boolean"},"hideNsfw":{"type":"boolean"},"maxSlippage":{"type":"number","nullable":true},"selectedQuickBuy":{"type":"number"},"autoSortingEnabled":{"type":"boolean"},"username":{"type":"string","nullable":true},"usernameUpdatedAt":{"type":"string","nullable":true},"points":{"type":"number"},"tickets":{"type":"number"},"creatorPayout":{"type":"number"},"pointsPumpFun":{"type":"number"},"antiMevProtection":{"type":"boolean"},"tradingSettingsAuto":{"type":"boolean"},"sidebarOpen":{"type":"boolean"},"revealedBonusPoints":{"type":"boolean"}},"required":["quickBuy","quickBuy1","quickBuy2","quickBuy3","sellPrefersCoin","hideNsfw","selectedQuickBuy","autoSortingEnabled","points","tickets","creatorPayout","pointsPumpFun","antiMevProtection","tradingSettingsAuto","sidebarOpen","revealedBonusPoints"]}}}}
```

## The GameHistory object

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"components":{"schemas":{"GameHistory":{"type":"object","properties":{"id":{"type":"string"},"tickets":{"type":"number"},"solAmount":{"type":"string"},"createdAt":{"type":"string"},"multiplier":{"type":"number"},"signature":{"type":"string"},"status":{"type":"string"},"hash":{"type":"string"},"seed":{"type":"string"},"state":{"type":"array","items":{"type":"number"},"nullable":true,"description":"Game state as array of numbers"},"updatedAt":{"type":"string"},"awardedPoints":{"type":"number"}}}}}}
```

## The GameCreateResponse object

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"components":{"schemas":{"GameCreateResponse":{"type":"object","properties":{"gameId":{"type":"string","description":"Unique identifier for the created game"},"updatedTickets":{"type":"number","description":"User's remaining tickets after game creation"},"gameHashed":{"type":"string","description":"Hashed game data for verification"}}}}}}
```

## The GameUpdateResponse object

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"components":{"schemas":{"GameUpdateResponse":{"type":"object","properties":{"newPositions":{"type":"array","items":{"type":"number"},"description":"New revealed positions in the game grid"},"multiplier":{"type":"number","description":"Current multiplier for the game"},"isMatch":{"type":"boolean","description":"Whether the current move resulted in a match"},"payoutAmount":{"type":"string","nullable":true,"description":"Payout amount if game is won"},"state":{"type":"array","items":{"type":"number"},"nullable":true,"description":"Current game state"}}}}}}
```

## The PayoutRequestResponse object

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"components":{"schemas":{"PayoutRequestResponse":{"type":"object","properties":{"serialisedTransaction":{"type":"string","description":"Serialized transaction ready for signing"},"blockhash":{"type":"string","description":"Recent blockhash for the transaction"},"lastValidBlockHeight":{"type":"number","description":"Last valid block height for the transaction"},"nonce":{"type":"number","description":"Transaction nonce"}}}}}}
```

## The CreateReferralCodeResponse object

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"components":{"schemas":{"CreateReferralCodeResponse":{"type":"object","properties":{"code":{"type":"string","description":"The created referral code"},"earnPercentage":{"type":"number","description":"Percentage earned from referrals"}}}}}}
```

## The TicketsMaxAmountResponse object

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"components":{"schemas":{"TicketsMaxAmountResponse":{"type":"number","description":"Maximum number of tickets that can be cashed out"}}}}
```

## The TicketsExchangeRateResponse object

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"components":{"schemas":{"TicketsExchangeRateResponse":{"type":"number","description":"Exchange rate for tickets to SOL"}}}}
```

## The PointsTicketsRateResponse object

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"components":{"schemas":{"PointsTicketsRateResponse":{"type":"number","description":"Exchange rate value for converting points to tickets"}}}}
```

## The CoinMintResponse object

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"components":{"schemas":{"CoinMintResponse":{"type":"string","description":"Coin mint information"}}}}
```

## The RecentGameItem object

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"components":{"schemas":{"RecentGameItem":{"type":"object","properties":{"username":{"type":"string","description":"Username of the player"},"solReward":{"type":"string","description":"SOL reward amount"},"numberOfTickets":{"type":"number","description":"Number of tickets used"},"timestamp":{"type":"number","description":"Game timestamp"},"gameId":{"type":"string","description":"Game identifier"}}}}}}
```

## The RecentGamesResponse object

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"components":{"schemas":{"RecentGamesResponse":{"type":"array","items":{"$ref":"#/components/schemas/RecentGameItem"},"description":"Array of recent game results"},"RecentGameItem":{"type":"object","properties":{"username":{"type":"string","description":"Username of the player"},"solReward":{"type":"string","description":"SOL reward amount"},"numberOfTickets":{"type":"number","description":"Number of tickets used"},"timestamp":{"type":"number","description":"Game timestamp"},"gameId":{"type":"string","description":"Game identifier"}}}}}}
```

## The RanksDataResponse object

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"components":{"schemas":{"RanksDataResponse":{"type":"object","properties":{"ranks":{"type":"array","items":{"type":"object","properties":{"rank":{"type":"string","description":"Rank level"},"minPoints":{"type":"string","description":"Minimum points required for this rank"}}}},"rate":{"type":"number","description":"Points calculation rate"}}}}}}
```

## The PointsHistoryItem object

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"components":{"schemas":{"PointsHistoryItem":{"type":"object","properties":{"timestamp":{"type":"number","description":"Unix timestamp"},"points":{"type":"number","description":"Points amount"},"tradingVolume":{"type":"number","description":"Trading volume amount"}}}}}}
```

## The PointsHistoryResponse object

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"components":{"schemas":{"PointsHistoryResponse":{"type":"array","items":{"$ref":"#/components/schemas/PointsHistoryItem"},"description":"Array of user points history"},"PointsHistoryItem":{"type":"object","properties":{"timestamp":{"type":"number","description":"Unix timestamp"},"points":{"type":"number","description":"Points amount"},"tradingVolume":{"type":"number","description":"Trading volume amount"}}}}}}
```

## The UserReferralDataResponse object

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"components":{"schemas":{"UserReferralDataResponse":{"type":"object","properties":{"referralPendingPayout":{"type":"number","description":"Pending referral payout amount"},"tradingFees":{"type":"number","description":"Trading fees from referrals"},"ownReferralCode":{"type":"string","nullable":true,"description":"User's own referral code"},"ownReferralCodeEarnPercentage":{"type":"number","nullable":true,"description":"Percentage earned from own referral code"},"referredUsers":{"type":"array","items":{"type":"object","properties":{"referralGeneratedAmount":{"type":"number","description":"Amount generated from this referral"},"referralTradingVolume":{"type":"number","description":"Trading volume from this referral"},"createdAt":{"type":"string","description":"When the referral was created"},"publicKey":{"type":"string","description":"Public key of the referred user"}}}},"referredByPublicKey":{"type":"string","nullable":true,"description":"Public key of the user who referred this user"},"totalReferredUsers":{"type":"number","description":"Total number of referred users"}}}}}}
```

## The UserTradeMetricsResponse object

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"components":{"schemas":{"UserTradeMetricsResponse":{"type":"object","nullable":true,"properties":{"totalBoughtCoin":{"type":"string","description":"Total coins bought"},"totalSoldCoin":{"type":"string","description":"Total coins sold"},"costBasisSol":{"type":"string","description":"Cost basis in SOL"},"costBasisUsd":{"type":"string","description":"Cost basis in USD"},"realizedPnlSol":{"type":"string","description":"Realized PnL in SOL"},"realizedPnlUsd":{"type":"string","description":"Realized PnL in USD"},"volumeSol":{"type":"string","description":"Trading volume in SOL"},"volumeUsd":{"type":"string","description":"Trading volume in USD"}}}}}}
```

## The CoinCommentCreateResponse object

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"components":{"schemas":{"CoinCommentCreateResponse":{"type":"object","properties":{"id":{"type":"string","description":"Comment ID"},"mint":{"type":"string","description":"Coin mint address"},"message":{"type":"string","description":"Comment message"},"userId":{"type":"string","description":"User ID who created the comment"},"createdAt":{"type":"string","format":"date-time","description":"When the comment was created"}}}}}}
```

## The PayoutProgress object

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"components":{"schemas":{"PayoutProgress":{"type":"object","properties":{"expiresAt":{"type":"number","description":"Unix timestamp when the payout process expires"},"inProgress":{"type":"boolean","description":"Whether a payout is currently in progress"}}}}}}
```

## The UserHolding object

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"components":{"schemas":{"UserHolding":{"type":"object","properties":{"amount":{"type":"string"},"coin":{"$ref":"#/components/schemas/Coin"}}},"Coin":{"type":"object","properties":{"address":{"type":"string"},"coinSymbol":{"type":"string"},"coinName":{"type":"string"},"coinSrc":{"type":"string"},"coinCreationTime":{"type":"number"},"coinMarketCap":{"type":"number"},"username":{"type":"string"},"holders":{"type":"number"},"comments":{"type":"number"},"xUrl":{"type":"string"},"websiteUrl":{"type":"string"},"featured":{"type":"boolean"},"coinAmount":{"type":"string"},"solPrice":{"type":"number"},"solAmount":{"type":"string"},"bondingCurve":{"type":"string"},"creator":{"type":"string"},"coinDescription":{"type":"string"},"bondingCurveComplete":{"type":"boolean"},"raydiumPoolAddress":{"type":"string"},"migratedToRaydiumAt":{"type":"string","nullable":true}}}}}}
```

## The TransactionStatus object

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"components":{"schemas":{"TransactionStatus":{"type":"string","enum":["processing","success","failed","dropped","not_found"],"description":"Status of a blockchain transaction"}}}}
```

## The CheckTransactionResponse object

```json
{"openapi":"3.1.0","info":{"title":"API v1","version":"1.0.0"},"components":{"schemas":{"CheckTransactionResponse":{"type":"object","properties":{"signature":{"type":"string","description":"Transaction signature"},"status":{"$ref":"#/components/schemas/TransactionStatus"}},"required":["signature","status"]},"TransactionStatus":{"type":"string","enum":["processing","success","failed","dropped","not_found"],"description":"Status of a blockchain transaction"}}}}
```


# Websocket

This page documents the WebSocket API for real-time updates available at ws.sugar.money

The API delivers real-time updates on coin events like new launches, trades, and migrations. Each coin event follows a common schema, **Coin**. Specifically, the **CoinTradeEvent** event includes a **trade\_data** attribute, defined by **CoinTradeData**.

### SDKs

To make integration easier, we provide official SDKs:

* [**Node.js SDK**](https://www.npmjs.com/package/sugar-money)
* [**Rust SDK**](https://crates.io/crates/sugar-money)

Please open an issue [here](https://github.com/Sugar-Money/sdk-issues) if you run into issues using any of the SDKs.

### **Generic Message Format**

All events are sent as generic messages with the following format:

```typoscript
{
  type: string;
  data: object;
};
```

### **Available Event Types:**

* **SolanaPrice**: `'solana_price'`
* **NewCoin**: `'new_coin'`
* **CoinCreate**: `'coin_create'`
* **CoinTrade**: `'coin_trade'`
* **CoinMigrated**: `'coin_migrate'`
* **CoinCompleted**: `'coin_complete'`
* **CoinFeatured**: `'coin_featured'`
* **CoinComment**: `'coin_comment'`

## The SolanaPrice object

```json
{"openapi":"3.1.0","info":{"title":"WebSocket API","version":"1.0.0"},"components":{"schemas":{"SolanaPrice":{"type":"object","properties":{"price":{"type":"number"}}}}}}
```

## The Coin object

```json
{"openapi":"3.1.0","info":{"title":"WebSocket API","version":"1.0.0"},"components":{"schemas":{"Coin":{"type":"object","properties":{"mint":{"type":"string"},"user_public_key":{"type":"string"},"metadata_uri":{"type":"string"},"raydium_pool":{"type":"string","nullable":true},"twitter":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"bonding_curve":{"type":"string"},"name":{"type":"string"},"symbol":{"type":"string"},"description":{"type":"string","nullable":true},"image_uri":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"featured_at":{"type":"string","format":"date-time","nullable":true},"migrated_to_raydium_at":{"type":"string","format":"date-time","nullable":true},"is_live":{"type":"boolean"},"nsfw":{"type":"boolean"},"slot":{"type":"integer"},"timestamp":{"type":"integer"},"sol_price":{"type":"string"},"real_sol_reserves":{"type":"string"},"real_coin_reserves":{"type":"string"},"virtual_sol_reserves":{"type":"string"},"virtual_coin_reserves":{"type":"string"},"created_off_chain":{"type":"boolean"},"signature":{"type":"string","nullable":true},"instruction_index":{"type":"integer","nullable":true},"versioned":{"type":"boolean","nullable":true},"duplicated_tx_signature":{"type":"boolean","nullable":true},"bonding_curve_progress":{"type":"string"},"largest_trade_sol_amount":{"type":"string"},"largest_trade_usd_amount":{"type":"string"},"holders":{"type":"integer"},"volume_sol":{"type":"string"},"volume_usd":{"type":"string"},"migration_in_psol":{"type":"boolean"}}}}}}
```

## The CoinTradeData object

```json
{"openapi":"3.1.0","info":{"title":"WebSocket API","version":"1.0.0"},"components":{"schemas":{"CoinTradeData":{"type":"object","properties":{"is_buy":{"type":"boolean"},"total_usd":{"type":"string"},"sol_amount":{"type":"string"},"coin_amount":{"type":"string"},"timestamp":{"type":"integer"},"signature":{"type":"string"},"user":{"type":"string"}}}}}}
```

## The CoinWithTradeData object

```json
{"openapi":"3.1.0","info":{"title":"WebSocket API","version":"1.0.0"},"components":{"schemas":{"CoinWithTradeData":{"allOf":[{"$ref":"#/components/schemas/Coin"},{"type":"object","properties":{"trade_data":{"$ref":"#/components/schemas/CoinTradeData"}}}]},"Coin":{"type":"object","properties":{"mint":{"type":"string"},"user_public_key":{"type":"string"},"metadata_uri":{"type":"string"},"raydium_pool":{"type":"string","nullable":true},"twitter":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"bonding_curve":{"type":"string"},"name":{"type":"string"},"symbol":{"type":"string"},"description":{"type":"string","nullable":true},"image_uri":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"featured_at":{"type":"string","format":"date-time","nullable":true},"migrated_to_raydium_at":{"type":"string","format":"date-time","nullable":true},"is_live":{"type":"boolean"},"nsfw":{"type":"boolean"},"slot":{"type":"integer"},"timestamp":{"type":"integer"},"sol_price":{"type":"string"},"real_sol_reserves":{"type":"string"},"real_coin_reserves":{"type":"string"},"virtual_sol_reserves":{"type":"string"},"virtual_coin_reserves":{"type":"string"},"created_off_chain":{"type":"boolean"},"signature":{"type":"string","nullable":true},"instruction_index":{"type":"integer","nullable":true},"versioned":{"type":"boolean","nullable":true},"duplicated_tx_signature":{"type":"boolean","nullable":true},"bonding_curve_progress":{"type":"string"},"largest_trade_sol_amount":{"type":"string"},"largest_trade_usd_amount":{"type":"string"},"holders":{"type":"integer"},"volume_sol":{"type":"string"},"volume_usd":{"type":"string"},"migration_in_psol":{"type":"boolean"}}},"CoinTradeData":{"type":"object","properties":{"is_buy":{"type":"boolean"},"total_usd":{"type":"string"},"sol_amount":{"type":"string"},"coin_amount":{"type":"string"},"timestamp":{"type":"integer"},"signature":{"type":"string"},"user":{"type":"string"}}}}}}
```

## The CoinComment object

```json
{"openapi":"3.1.0","info":{"title":"WebSocket API","version":"1.0.0"},"components":{"schemas":{"CoinComment":{"type":"object","properties":{"mint":{"type":"string"},"id":{"type":"integer"},"image_uri":{"type":"string"},"message":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"user":{"type":"object","properties":{"username":{"type":"string"},"image":{"type":"string"},"public_key":{"type":"string"}}}}}}}}
```

## The SolanaPriceEvent object

```json
{"openapi":"3.1.0","info":{"title":"WebSocket API","version":"1.0.0"},"components":{"schemas":{"SolanaPriceEvent":{"type":"object","properties":{"type":{"type":"string","enum":["solana_price"]},"data":{"$ref":"#/components/schemas/SolanaPrice"}}},"SolanaPrice":{"type":"object","properties":{"price":{"type":"number"}}}}}}
```

## The NewCoinEvent object

```json
{"openapi":"3.1.0","info":{"title":"WebSocket API","version":"1.0.0"},"components":{"schemas":{"NewCoinEvent":{"type":"object","properties":{"type":{"type":"string","enum":["new_coin"]},"data":{"$ref":"#/components/schemas/Coin"}}},"Coin":{"type":"object","properties":{"mint":{"type":"string"},"user_public_key":{"type":"string"},"metadata_uri":{"type":"string"},"raydium_pool":{"type":"string","nullable":true},"twitter":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"bonding_curve":{"type":"string"},"name":{"type":"string"},"symbol":{"type":"string"},"description":{"type":"string","nullable":true},"image_uri":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"featured_at":{"type":"string","format":"date-time","nullable":true},"migrated_to_raydium_at":{"type":"string","format":"date-time","nullable":true},"is_live":{"type":"boolean"},"nsfw":{"type":"boolean"},"slot":{"type":"integer"},"timestamp":{"type":"integer"},"sol_price":{"type":"string"},"real_sol_reserves":{"type":"string"},"real_coin_reserves":{"type":"string"},"virtual_sol_reserves":{"type":"string"},"virtual_coin_reserves":{"type":"string"},"created_off_chain":{"type":"boolean"},"signature":{"type":"string","nullable":true},"instruction_index":{"type":"integer","nullable":true},"versioned":{"type":"boolean","nullable":true},"duplicated_tx_signature":{"type":"boolean","nullable":true},"bonding_curve_progress":{"type":"string"},"largest_trade_sol_amount":{"type":"string"},"largest_trade_usd_amount":{"type":"string"},"holders":{"type":"integer"},"volume_sol":{"type":"string"},"volume_usd":{"type":"string"},"migration_in_psol":{"type":"boolean"}}}}}}
```

## The CoinCreateEvent object

```json
{"openapi":"3.1.0","info":{"title":"WebSocket API","version":"1.0.0"},"components":{"schemas":{"CoinCreateEvent":{"type":"object","properties":{"type":{"type":"string","enum":["coin_create"]},"data":{"$ref":"#/components/schemas/Coin"}}},"Coin":{"type":"object","properties":{"mint":{"type":"string"},"user_public_key":{"type":"string"},"metadata_uri":{"type":"string"},"raydium_pool":{"type":"string","nullable":true},"twitter":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"bonding_curve":{"type":"string"},"name":{"type":"string"},"symbol":{"type":"string"},"description":{"type":"string","nullable":true},"image_uri":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"featured_at":{"type":"string","format":"date-time","nullable":true},"migrated_to_raydium_at":{"type":"string","format":"date-time","nullable":true},"is_live":{"type":"boolean"},"nsfw":{"type":"boolean"},"slot":{"type":"integer"},"timestamp":{"type":"integer"},"sol_price":{"type":"string"},"real_sol_reserves":{"type":"string"},"real_coin_reserves":{"type":"string"},"virtual_sol_reserves":{"type":"string"},"virtual_coin_reserves":{"type":"string"},"created_off_chain":{"type":"boolean"},"signature":{"type":"string","nullable":true},"instruction_index":{"type":"integer","nullable":true},"versioned":{"type":"boolean","nullable":true},"duplicated_tx_signature":{"type":"boolean","nullable":true},"bonding_curve_progress":{"type":"string"},"largest_trade_sol_amount":{"type":"string"},"largest_trade_usd_amount":{"type":"string"},"holders":{"type":"integer"},"volume_sol":{"type":"string"},"volume_usd":{"type":"string"},"migration_in_psol":{"type":"boolean"}}}}}}
```

## The CoinTradeEvent object

```json
{"openapi":"3.1.0","info":{"title":"WebSocket API","version":"1.0.0"},"components":{"schemas":{"CoinTradeEvent":{"type":"object","properties":{"type":{"type":"string","enum":["coin_trade"]},"data":{"$ref":"#/components/schemas/CoinWithTradeData"}}},"CoinWithTradeData":{"allOf":[{"$ref":"#/components/schemas/Coin"},{"type":"object","properties":{"trade_data":{"$ref":"#/components/schemas/CoinTradeData"}}}]},"Coin":{"type":"object","properties":{"mint":{"type":"string"},"user_public_key":{"type":"string"},"metadata_uri":{"type":"string"},"raydium_pool":{"type":"string","nullable":true},"twitter":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"bonding_curve":{"type":"string"},"name":{"type":"string"},"symbol":{"type":"string"},"description":{"type":"string","nullable":true},"image_uri":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"featured_at":{"type":"string","format":"date-time","nullable":true},"migrated_to_raydium_at":{"type":"string","format":"date-time","nullable":true},"is_live":{"type":"boolean"},"nsfw":{"type":"boolean"},"slot":{"type":"integer"},"timestamp":{"type":"integer"},"sol_price":{"type":"string"},"real_sol_reserves":{"type":"string"},"real_coin_reserves":{"type":"string"},"virtual_sol_reserves":{"type":"string"},"virtual_coin_reserves":{"type":"string"},"created_off_chain":{"type":"boolean"},"signature":{"type":"string","nullable":true},"instruction_index":{"type":"integer","nullable":true},"versioned":{"type":"boolean","nullable":true},"duplicated_tx_signature":{"type":"boolean","nullable":true},"bonding_curve_progress":{"type":"string"},"largest_trade_sol_amount":{"type":"string"},"largest_trade_usd_amount":{"type":"string"},"holders":{"type":"integer"},"volume_sol":{"type":"string"},"volume_usd":{"type":"string"},"migration_in_psol":{"type":"boolean"}}},"CoinTradeData":{"type":"object","properties":{"is_buy":{"type":"boolean"},"total_usd":{"type":"string"},"sol_amount":{"type":"string"},"coin_amount":{"type":"string"},"timestamp":{"type":"integer"},"signature":{"type":"string"},"user":{"type":"string"}}}}}}
```

## The CoinMigratedEvent object

```json
{"openapi":"3.1.0","info":{"title":"WebSocket API","version":"1.0.0"},"components":{"schemas":{"CoinMigratedEvent":{"type":"object","properties":{"type":{"type":"string","enum":["coin_migrate"]},"data":{"$ref":"#/components/schemas/Coin"}}},"Coin":{"type":"object","properties":{"mint":{"type":"string"},"user_public_key":{"type":"string"},"metadata_uri":{"type":"string"},"raydium_pool":{"type":"string","nullable":true},"twitter":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"bonding_curve":{"type":"string"},"name":{"type":"string"},"symbol":{"type":"string"},"description":{"type":"string","nullable":true},"image_uri":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"featured_at":{"type":"string","format":"date-time","nullable":true},"migrated_to_raydium_at":{"type":"string","format":"date-time","nullable":true},"is_live":{"type":"boolean"},"nsfw":{"type":"boolean"},"slot":{"type":"integer"},"timestamp":{"type":"integer"},"sol_price":{"type":"string"},"real_sol_reserves":{"type":"string"},"real_coin_reserves":{"type":"string"},"virtual_sol_reserves":{"type":"string"},"virtual_coin_reserves":{"type":"string"},"created_off_chain":{"type":"boolean"},"signature":{"type":"string","nullable":true},"instruction_index":{"type":"integer","nullable":true},"versioned":{"type":"boolean","nullable":true},"duplicated_tx_signature":{"type":"boolean","nullable":true},"bonding_curve_progress":{"type":"string"},"largest_trade_sol_amount":{"type":"string"},"largest_trade_usd_amount":{"type":"string"},"holders":{"type":"integer"},"volume_sol":{"type":"string"},"volume_usd":{"type":"string"},"migration_in_psol":{"type":"boolean"}}}}}}
```

## The CoinCompletedEvent object

```json
{"openapi":"3.1.0","info":{"title":"WebSocket API","version":"1.0.0"},"components":{"schemas":{"CoinCompletedEvent":{"type":"object","properties":{"type":{"type":"string","enum":["coin_complete"]},"data":{"$ref":"#/components/schemas/Coin"}}},"Coin":{"type":"object","properties":{"mint":{"type":"string"},"user_public_key":{"type":"string"},"metadata_uri":{"type":"string"},"raydium_pool":{"type":"string","nullable":true},"twitter":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"bonding_curve":{"type":"string"},"name":{"type":"string"},"symbol":{"type":"string"},"description":{"type":"string","nullable":true},"image_uri":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"featured_at":{"type":"string","format":"date-time","nullable":true},"migrated_to_raydium_at":{"type":"string","format":"date-time","nullable":true},"is_live":{"type":"boolean"},"nsfw":{"type":"boolean"},"slot":{"type":"integer"},"timestamp":{"type":"integer"},"sol_price":{"type":"string"},"real_sol_reserves":{"type":"string"},"real_coin_reserves":{"type":"string"},"virtual_sol_reserves":{"type":"string"},"virtual_coin_reserves":{"type":"string"},"created_off_chain":{"type":"boolean"},"signature":{"type":"string","nullable":true},"instruction_index":{"type":"integer","nullable":true},"versioned":{"type":"boolean","nullable":true},"duplicated_tx_signature":{"type":"boolean","nullable":true},"bonding_curve_progress":{"type":"string"},"largest_trade_sol_amount":{"type":"string"},"largest_trade_usd_amount":{"type":"string"},"holders":{"type":"integer"},"volume_sol":{"type":"string"},"volume_usd":{"type":"string"},"migration_in_psol":{"type":"boolean"}}}}}}
```

## The CoinFeaturedEvent object

```json
{"openapi":"3.1.0","info":{"title":"WebSocket API","version":"1.0.0"},"components":{"schemas":{"CoinFeaturedEvent":{"type":"object","properties":{"type":{"type":"string","enum":["coin_featured"]},"data":{"$ref":"#/components/schemas/Coin"}}},"Coin":{"type":"object","properties":{"mint":{"type":"string"},"user_public_key":{"type":"string"},"metadata_uri":{"type":"string"},"raydium_pool":{"type":"string","nullable":true},"twitter":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"bonding_curve":{"type":"string"},"name":{"type":"string"},"symbol":{"type":"string"},"description":{"type":"string","nullable":true},"image_uri":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"featured_at":{"type":"string","format":"date-time","nullable":true},"migrated_to_raydium_at":{"type":"string","format":"date-time","nullable":true},"is_live":{"type":"boolean"},"nsfw":{"type":"boolean"},"slot":{"type":"integer"},"timestamp":{"type":"integer"},"sol_price":{"type":"string"},"real_sol_reserves":{"type":"string"},"real_coin_reserves":{"type":"string"},"virtual_sol_reserves":{"type":"string"},"virtual_coin_reserves":{"type":"string"},"created_off_chain":{"type":"boolean"},"signature":{"type":"string","nullable":true},"instruction_index":{"type":"integer","nullable":true},"versioned":{"type":"boolean","nullable":true},"duplicated_tx_signature":{"type":"boolean","nullable":true},"bonding_curve_progress":{"type":"string"},"largest_trade_sol_amount":{"type":"string"},"largest_trade_usd_amount":{"type":"string"},"holders":{"type":"integer"},"volume_sol":{"type":"string"},"volume_usd":{"type":"string"},"migration_in_psol":{"type":"boolean"}}}}}}
```

## The CoinCommentEvent object

```json
{"openapi":"3.1.0","info":{"title":"WebSocket API","version":"1.0.0"},"components":{"schemas":{"CoinCommentEvent":{"type":"object","properties":{"type":{"type":"string","enum":["coin_comment"]},"data":{"$ref":"#/components/schemas/CoinComment"}}},"CoinComment":{"type":"object","properties":{"mint":{"type":"string"},"id":{"type":"integer"},"image_uri":{"type":"string"},"message":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"user":{"type":"object","properties":{"username":{"type":"string"},"image":{"type":"string"},"public_key":{"type":"string"}}}}}}}}
```

## The Message object

```json
{"openapi":"3.1.0","info":{"title":"WebSocket API","version":"1.0.0"},"components":{"schemas":{"Message":{"oneOf":[{"$ref":"#/components/schemas/SolanaPriceEvent"},{"$ref":"#/components/schemas/NewCoinEvent"},{"$ref":"#/components/schemas/CoinCreateEvent"},{"$ref":"#/components/schemas/CoinTradeEvent"},{"$ref":"#/components/schemas/CoinMigratedEvent"},{"$ref":"#/components/schemas/CoinCompletedEvent"},{"$ref":"#/components/schemas/CoinFeaturedEvent"},{"$ref":"#/components/schemas/CoinCommentEvent"}]},"SolanaPriceEvent":{"type":"object","properties":{"type":{"type":"string","enum":["solana_price"]},"data":{"$ref":"#/components/schemas/SolanaPrice"}}},"SolanaPrice":{"type":"object","properties":{"price":{"type":"number"}}},"NewCoinEvent":{"type":"object","properties":{"type":{"type":"string","enum":["new_coin"]},"data":{"$ref":"#/components/schemas/Coin"}}},"Coin":{"type":"object","properties":{"mint":{"type":"string"},"user_public_key":{"type":"string"},"metadata_uri":{"type":"string"},"raydium_pool":{"type":"string","nullable":true},"twitter":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"bonding_curve":{"type":"string"},"name":{"type":"string"},"symbol":{"type":"string"},"description":{"type":"string","nullable":true},"image_uri":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"featured_at":{"type":"string","format":"date-time","nullable":true},"migrated_to_raydium_at":{"type":"string","format":"date-time","nullable":true},"is_live":{"type":"boolean"},"nsfw":{"type":"boolean"},"slot":{"type":"integer"},"timestamp":{"type":"integer"},"sol_price":{"type":"string"},"real_sol_reserves":{"type":"string"},"real_coin_reserves":{"type":"string"},"virtual_sol_reserves":{"type":"string"},"virtual_coin_reserves":{"type":"string"},"created_off_chain":{"type":"boolean"},"signature":{"type":"string","nullable":true},"instruction_index":{"type":"integer","nullable":true},"versioned":{"type":"boolean","nullable":true},"duplicated_tx_signature":{"type":"boolean","nullable":true},"bonding_curve_progress":{"type":"string"},"largest_trade_sol_amount":{"type":"string"},"largest_trade_usd_amount":{"type":"string"},"holders":{"type":"integer"},"volume_sol":{"type":"string"},"volume_usd":{"type":"string"},"migration_in_psol":{"type":"boolean"}}},"CoinCreateEvent":{"type":"object","properties":{"type":{"type":"string","enum":["coin_create"]},"data":{"$ref":"#/components/schemas/Coin"}}},"CoinTradeEvent":{"type":"object","properties":{"type":{"type":"string","enum":["coin_trade"]},"data":{"$ref":"#/components/schemas/CoinWithTradeData"}}},"CoinWithTradeData":{"allOf":[{"$ref":"#/components/schemas/Coin"},{"type":"object","properties":{"trade_data":{"$ref":"#/components/schemas/CoinTradeData"}}}]},"CoinTradeData":{"type":"object","properties":{"is_buy":{"type":"boolean"},"total_usd":{"type":"string"},"sol_amount":{"type":"string"},"coin_amount":{"type":"string"},"timestamp":{"type":"integer"},"signature":{"type":"string"},"user":{"type":"string"}}},"CoinMigratedEvent":{"type":"object","properties":{"type":{"type":"string","enum":["coin_migrate"]},"data":{"$ref":"#/components/schemas/Coin"}}},"CoinCompletedEvent":{"type":"object","properties":{"type":{"type":"string","enum":["coin_complete"]},"data":{"$ref":"#/components/schemas/Coin"}}},"CoinFeaturedEvent":{"type":"object","properties":{"type":{"type":"string","enum":["coin_featured"]},"data":{"$ref":"#/components/schemas/Coin"}}},"CoinCommentEvent":{"type":"object","properties":{"type":{"type":"string","enum":["coin_comment"]},"data":{"$ref":"#/components/schemas/CoinComment"}}},"CoinComment":{"type":"object","properties":{"mint":{"type":"string"},"id":{"type":"integer"},"image_uri":{"type":"string"},"message":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"user":{"type":"object","properties":{"username":{"type":"string"},"image":{"type":"string"},"public_key":{"type":"string"}}}}}}}}
```


# Important Addresses

**Token creation will be enabled on official release: 2025-08-22 5PM UTC**

\
**Sugar program:** [deus4Bvftd5QKcEkE5muQaWGWDoma8GrySvPFrBPjhS](https://solscan.io/account/deus4Bvftd5QKcEkE5muQaWGWDoma8GrySvPFrBPjhS)

**pSOL**: [pSoL47GE52V2bgUUyQvs9LSdWQZsokarp2yNsWQaLYy](https://solscan.io/account/pSoL47GE52V2bgUUyQvs9LSdWQZsokarp2yNsWQaLYy)

**Wrapper program**: [pBasedTVV99yFBmg2u6Uvka9fJueRcs7SB9PJ2HfrEn](https://solscan.io/account/pBasedTVV99yFBmg2u6Uvka9fJueRcs7SB9PJ2HfrEn)

**Distributor program:** [vu1t7ReSFRLfUsnbkQWh1x2JKDVLgecp86zR1iphmDo](https://solscan.io/account/vu1t7ReSFRLfUsnbkQWh1x2JKDVLgecp86zR1iphmDo)

**Distributor authority**: [D1STcfsoXZMGtLXSBPUEpTFy2SxrqGD6bNB1Bj7egauD](https://solscan.io/account/D1STcfsoXZMGtLXSBPUEpTFy2SxrqGD6bNB1Bj7egauD)

**Distributor pool:** [2UsBp9iCcykgP1E5kHwwPVJSyi9D1snZYbnkhKUuecPt](https://solscan.io/account/2UsBp9iCcykgP1E5kHwwPVJSyi9D1snZYbnkhKUuecPt)

**Referral authority:** [LUPAWVcrtcffairnhHCiJmqEJ7quTZa1y1iLBS5eypc](https://solscan.io/account/LUPAWVcrtcffairnhHCiJmqEJ7quTZa1y1iLBS5eypc)

**Referral pool:** [6UVU3R6YkaJKPdskPjcogUsm6RQqqX5n4pJp3YKwjoLP](https://solscan.io/account/6UVU3R6YkaJKPdskPjcogUsm6RQqqX5n4pJp3YKwjoLP)

**Raffle authority:** [PUPAMf3xCKqQgciSYv6ggZzjMirMdMVs4UW6fnz6kBr](https://solscan.io/account/PUPAMf3xCKqQgciSYv6ggZzjMirMdMVs4UW6fnz6kBr)

**Raffle pool:** [9r4rNed3kKU9qpyTwZYYpmGCphu7vRib4Vcf9D5uXZS8](https://solscan.io/account/9r4rNed3kKU9qpyTwZYYpmGCphu7vRib4Vcf9D5uXZS8)

**Migration autority:** [M1GRXEz1gSDigQhBqV8BDonqD1GeyeqvMu5ffmHrsQE](https://solscan.io/account/M1GRXEz1gSDigQhBqV8BDonqD1GeyeqvMu5ffmHrsQE)


