# overview

Build on top of Durianfun. No API keys, no rate limits, no sign-ups — just raw Ethereum JSON-RPC calls to Bitkub Chain.

## What you can build

| Use case                   | How                                                                        |
| -------------------------- | -------------------------------------------------------------------------- |
| **Token explorer / chart** | `factory.getTokens()` + `market.kubRaised()` + event logs                  |
| **Trading bot**            | `market.buyToken()` / `market.sellToken()` with slippage                   |
| **Portfolio tracker**      | standard ERC-20 `balanceOf` across all tokens                              |
| **Subgraph / indexer**     | index `TokenCreated`, `TokensBought`, `TokensSold`, `Graduated` events     |
| **Discord/Telegram bot**   | watch event logs, ping on new launches or graduations                      |
| **DEX aggregator route**   | post-graduation AMMs are standard x·y=k — pair them via `market.ammPool()` |
| **Analytics dashboard**    | read `getTokens(0, N)`, compute TVL / volume from events                   |

## Networks

| Network               | Chain ID | RPC                                      |
| --------------------- | -------- | ---------------------------------------- |
| **KUB Mainnet**       | `96`     | `https://rpc.bitkubchain.io`             |
| Bitkub public archive | `96`     | (contact Bitkub team for archive access) |

## What to connect

The factory address is your starting point. From there, every token's market and (post-grad) AMM can be discovered.

```
Factory V4.5: 0xdf4f3dB298A9aDe853191F58b4b2a322D47EC005
```

## Quick start flow

{% stepper %}
{% step %}

#### List all tokens

```javascript
const { Contract, JsonRpcProvider } = require("ethers");

const provider = new JsonRpcProvider("https://rpc.bitkubchain.io");
const factory = new Contract(
  "0xdf4f3dB298A9aDe853191F58b4b2a322D47EC005",
  FACTORY_ABI, // see /integration/abis
  provider
);

const total = await factory.totalTokens();
const tokens = await factory.getTokens(0, total);

tokens.forEach(t => console.log(t.symbol, t.token, t.market));
```

{% endstep %}

{% step %}

#### Read live state for one token

```javascript
const market = new Contract(tokenInfo.market, BONDING_CURVE_ABI, provider);

const [kubRaised, graduated, price, progress] = await Promise.all([
  market.kubRaised(),
  market.graduated(),
  market.currentPricePerToken(),
  market.graduationProgress(),
]);
```

{% endstep %}

{% step %}

#### Quote a buy / sell

```javascript
const tokensOut = await market.getTokensOut(kubInWei);
const kubOut    = await market.getKubOut(tokenInWei);
```

{% endstep %}
{% endstepper %}

## Next docs

* [Read Tokens](broken://pages/9a692566ac4729233ae7f4a1c4129b886e34af48) — discover every token on the platform
* [Trade Programmatically](broken://pages/d04eb48907ac29511bc2bb75f1db373cdd392256) — submit buys / sells from code
* [Contract ABIs](broken://pages/0288dd9d3647d628f7e5eb84805d50a53fe64a91) — copy-paste ABI snippets
* [RPC Endpoints](broken://pages/649265de40a04b267d4ee6546c26248b5ce2df48) — endpoint reliability tips

## Support

* Contact: **<durianandfun@gmail.com>**
* Twitter/X: [@duriandotfun](https://x.com/duriandotfun)
* Telegram: [@durianfunxyz](https://t.me/durianfunxyz)

For integration issues, include your code snippet + expected behavior + what you're seeing. Don't post private keys 💀


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://durianandfun.gitbook.io/durianfun/durian-launchpad/integration/overview.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.
