disconnected
docs/developers/integration-guide

Integration Guide

This guide covers everything an external integrator needs to read NAKA state, quote trades, and execute trades on behalf of a user. NAKA's protocol surface is small. Three contracts plus the canonical Uniswap V4 PoolManager.

Identity

FieldValue
StandardERC-20
Namenaka
Symbolnaka
Decimals18
Token (Mainnet)0x58CB8E0Bd8fA32ECf55867925b9198a0Fb217D03
Token (Sepolia)0xD8CFf35D2D1d197e26bd892AF8c1D47e82a99663

ABIs

Pull from the frontend repo: lib/abis/NakaToken.json, lib/abis/NakaHook.json, lib/abis/NakaSwapRouter.json. For production, pin to a tagged GitHub release.

Reading State

All useful state is on the hook contract. Common reads:

function totalSupplyExisting() external view returns (uint256);
function circulatingSupply() external view returns (uint256);
function lockedTokens() external view returns (uint256);     // tokens at 0xdEaD
function totalMintedFair() external view returns (uint256);  // cumulative net ETH
function marginalPrice() external view returns (uint256);    // 1e18-scaled ETH/token
function floorPrice() external view returns (uint256);       // 1e18-scaled ETH/token
function percentToCap() external view returns (uint256);     // bps (0..10000)
function selfDeprecated() external view returns (bool);
function actualEthBalance() external view returns (uint256); // hook's ETH reserve
function estimatedBuyOut(uint256 ethIn) external view returns (uint256);
function estimatedSellOut(uint256 tokensIn) external view returns (uint256);

The frontend calls these via useReadContracts in lib/hooks/useNakaState.ts. For backend services, batch with multicall3.

Quoting

For UI quotes, prefer on-chain estimatedBuyOut / estimatedSellOut over off-chain math. They account for the current curve state, the fee, and any active limits.

For cheap client-side approximations, the JS helpers in lib/curve.ts (supplyAt, priceAt, ethAtSupply) are accurate to ~6 decimal places.

Executing Trades

Buy

function buyNaka(uint256 minTokensOut) external payable;  // on NakaSwapRouter

Send msg.value = ethIn. minTokensOut should be the quoted tokens out reduced by your slippage tolerance (the official frontend uses 200 bps = 2%).

Reverts on:

  • ethIn > MAX_BUY_WEI (5 ETH)
  • ethIn < MIN_TX_AMOUNT (1 gwei)
  • selfDeprecated == true
  • Slippage check failed

Sell

function sellNaka(uint256 tokensIn, uint256 minEthOut) external;  // on NakaSwapRouter

Caller must first approve the router to spend NAKA: naka.approve(router, tokensIn). The standard ERC-20 flow.

Reverts on:

  • tokensIn < MIN_TX_AMOUNT
  • Caller balance < tokensIn
  • Allowance < tokensIn
  • Slippage check failed
  • Same-block anti-flip cooldown active

Slippage Recommendation

Use 200 bps (2%) as a safe default. The curve is deterministic in an empty block but realized prices drift in contested blocks due to ordering and MEV.

Event Subscription

Watch the hook for Buy, Sell, and SelfDeprecated. Watch the token for Transfer if you need balance accounting. See the event reference for full schemas.

Lifecycle Considerations

Integrators that surface NAKA pricing should handle the post-deprecation case:

  • After selfDeprecated == true, no new NAKA can be minted. Buy quotes from the curve become unavailable.
  • The token continues to exist and trade on secondary venues (DEX pools, OTC). Pricing those is independent of the curve.

Lookalikes and Trust

NAKA is naka.exchange and @naka_exchange. Token contract addresses on the addresses page are canonical. Anything else claiming to be NAKA is unaffiliated.