# Integration Guide

Developers can integrate with Spheres.fun by calling our smart contracts directly through any HyperEVM RPC endpoint.

Below you'll find the complete contract interface and deployment details for our protocol:

**Network Configuration:**

* **Chain ID**: 999 (HyperEVM)
* **RPC URL**: <https://rpc.hyperliquid.xyz/evm>
* **Block Explorer**: [ https://purrsec.com/](< https://purrsec.com/>)

**Official Deployment Addresses:**

```
TOKEN_FACTORY = 0x604181Fd9182820c8c6D9cD43a699eCFb678F9Af
BONDING_CURVE = 0x106A8AE46EB4579d1C88b2F6018b3c511E0C0d57
TOKEN_REGISTRY = 0x056aF20fd18Ca0F7e199727706455f5461c735e5
DEX_MIGRATION = 0x2F1fEa33c56d992d1406e1E8BD8f7173bbf21Ca9
```

**Core Trading Functions:**

```solidity
solidity"function buyTokens(address token, uint256 minTokenAmount) external payable"
```

```solidity
solidity"function sellTokens(address token, uint256 tokenAmount, uint256 minHypeAmount) external"
```

```solidity
solidity"function getCurrentPrice(address token) public view returns (uint256)"
```

```solidity
solidity"function calculateBuyAmount(address token, uint256 hypeAmount) public view returns (uint256)"
```

```solidity
solidity"function calculateSellAmount(address token, uint256 tokenAmount) public view returns (uint256)"
```

**Token Discovery Functions:**

```solidity
solidity"function getAllTokensCount() public view returns (uint256)"
```

```solidity
solidity"function allTokens(uint256 index) public view returns (address)"
```

```solidity
solidity"function getCreatorTokens(address creator) public view returns (address[])"
```

**Token Information Functions:**

```solidity
solidity"function getTokenInfo(address token) public view returns (address creator, uint256 hypeCollected, uint256 tokensSold, uint256 tokenReserve, bool graduated, uint256 createdAt)"
```

```solidity
solidity"function getTokenMetadata(address token) public view returns (string description, string imageUrl, string twitter, string telegram, string website)"
```

```solidity
solidity"function getBondingCurveProgress(address token) public view returns (uint256 currentHype, uint256 targetHype, uint256 progressPercentage)"
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hypes-organization.gitbook.io/hypesphere-whitepaper/core-pillars/spheres.fun/integration-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
