04 / DOCUMENTATION
The rulebook.
Technical notes on the contracts in this repository. These notes describe the latest Ethereum mainnet deployment recorded in this repository.
00 / DEPLOYMENT
Ethereum mainnet
The website is pinned to the latest successful deployment broadcast in this repository. The deployment was completed at block 26,096,491. Check each address before signing a wallet transaction.
01 / OVERVIEW
Contract map
UniKing connects a fixed-supply token, a Uniswap v4 Hook, a pool locker, an NFT account system, and a buyback reserve.
02 / TRADING
The UNIK pool
The official ETH / UNIK pool is initialized by the liquidity locker. Its Hook permits swaps and restricts liquidity changes; the locker contains no liquidity withdrawal path.
- UNIK has an initial fixed supply of 100 billion.
- The bundled router handles exact-input buys and sells and realizes fees automatically.
- Other routers can interact with the official pool, including exact-output swaps, but must call realizeFees() to settle recorded fees.
- A qualifying buy can mint one NFT for each full 100 million UNIK delivered by a single pool-manager token withdrawal.
03 / FEES & REWARDS
ETH fee allocation
The Hook records a 1.5% ETH fee on supported swaps. On realization, the fee is split 90% to NFT rewards, 5% to a treasury claimable balance, and 5% to the buyback reserve.
NFT rewards use account reward weights. Accounts without positions accrue one Rainbow per block. Active accounts use their last processed equity, including position PnL, as cached weight. Each swap checks at most 20 active accounts in rotation, so weights are not an exact current-price snapshot of every account on every swap.
The buyback owner must execute a separate transaction to spend reserved ETH on UNIK and burn the purchased tokens.
04 / NFT CONTRACTS
Positions inside an NFT
The NFT owner or its account delegate can open and reduce simulated positions. The administrator must first list a market with an oracle and a maximum leverage between 1× and 100×. Each NFT can hold one position per market; a close-only market accepts reductions but no new position.
- Opening specifies a market, notional in the oracle's quote units, leverage, and long or short direction. The contract converts notional to a signed base quantity at the current spot price.
- Account equity is Rainbow plus unrealized position PnL. At opening, equity must cover the sum of current position notionals divided by their leverage.
- Reducing a position realizes PnL into Rainbow. A full reduction closes that market's position. No ETH or UNIK changes hands when a position opens or closes.
- Maintenance margin is 0.5% of current notional. If equity falls below it, liquidation first cuts the largest position in half, then closes remaining positions if the account is still below maintenance.
Spot oracles can be manipulated, and a position's Rainbow can affect its share of real ETH fee rewards. The Contracts page reads live market and NFT state, simulates each action, and uses the connected wallet to submit the Accounts contract call.
05 / NFT ACCOUNTS
Ownership and identity
Each NFT account requires backing of 100 million UNIK. A single qualifying transfer of at least that amount may move supported NFTs to the recipient. Smaller transfers do not move an NFT, and excess unsupported NFTs can be burned.
Accounts can hold simulated leveraged positions in administrator-listed markets. A market uses a spot oracle and an administrator-set maximum leverage from 1 to 100. Equity checks may liquidate positions.
The NFT renderer generates each SVG and JSON metadata directly from Solidity. Twelve traits determine its pixel-art appearance and are fixed by token ID after minting. The metadata also reports live Rainbow and claimable ETH when the token URI is read.
06 / RISKS & LIMITS
Review before use
This code has not been audited. Direct pool spot prices can be manipulated. Simulated profit can increase a claim on real ETH fees. Large buys may exceed transaction gas limits because an NFT is minted for every qualifying 100 million UNIK. The contracts have no pause function.
This website points to live Ethereum mainnet contracts. An independent security and economic review remains necessary before using them with substantial funds.