# FBX Protocol — Full technical documentation > Every FBX Protocol contract on Polygon PoS (chain id 137): what it does, its address, and the functions the app calls against it. This mirrors the human docs at https://firebot.gg/docs. For a short overview see https://firebot.gg/llms.txt; for live metrics see https://firebot.gg/api (JSON). The protocol is a small set of immutable contracts — no upgrade proxy, no admin path to mint FBX. Contracts fall into three groups: tokens (the ERC-20s users hold), vaults & venues (where they go), and the swap. Each contract says who controls it, if anyone, under its address. ## Tokens ### Protocol tokens | Symbol | Name | Role | Decimals | Address | | --- | --- | --- | --- | --- | | FBX | FireBot Token | token | 18 | `0xd125443f38a69d776177c2b9c041f462936f8218` | | EP | Elemental Particles | token | 18 | `0x60ed6acef3a96f8cdaf0c0d207bbafa66e751af2` | | wstEP | Wrapped Staked EP | share | 18 | `0xE3Df997CAd0476954196fDFe94A9Bc090365caD9` | | fireFBX | FireVault FBX | share | 18 | `0x960d43BE128585Ca45365CD74a7773B9d814dfBE` | | FPT | Fire Pool Token | share | 18 | `0xE20E046B230a5530438d32ABfBCC3E61d7670234` | | FUSD | FireLabs USD | receipt | 6 | `0x3c56f017D9cE85350dF8f4B495033AAA15563A99` | ### Other tokens the app uses | Symbol | Name | Role | Decimals | Address | | --- | --- | --- | --- | --- | | USDT0 | Tether USD | deposit | 6 | `0xc2132d05d31c914a87c6611c10748aeb04b58e8f` | | DCI | Dynamic Composite Index | reward | 18 | `0xc91953E110EbB0039859304A0d1b64f8450763fC` | POL (the native gas token) has no ERC-20 address — balances are read via `eth_getBalance`. ## Vaults & venues ### FireVaultFBXV2 — Auto-FBX vault · fireFBX receipt - Address: `0x960d43BE128585Ca45365CD74a7773B9d814dfBE` - Admin: No owner. Auto-compounding FBX vault. Users deposit FBX and receive fireFBX shares; the vault claims and reinvests rewards on every interaction. The share price (FBX per fireFBX) only moves up. | Function | Type | Signature | Purpose | | --- | --- | --- | --- | | deposit | write | `deposit(uint256 amountFBX) returns (uint256 amountFireFBX)` | Deposit FBX, mint fireFBX shares pro-rata against the current rate. | | withdraw | write | `withdraw(uint256 amountFireFBX) returns (uint256 amountFBX)` | Burn fireFBX shares, return the underlying FBX at the current rate. | | claimRewardsAndBalance | write | `claimRewardsAndBalance()` | Force a compound — anyone can call to refresh the share price. | | withdrawalRate | read | `withdrawalRate() returns (uint256)` | Current FBX-per-share rate, scaled by 1e18. Used to convert shares ↔ FBX. | | totalFBXBalance | read | `totalFBXBalance() returns (uint256)` | Total FBX under management — vault TVL in token units. | > Note: The contract itself is the fireFBX ERC-20: balanceOf(user) returns share balance. ### WrappedStakedEP — wstEP vault · ERC-4626 · replaced Auto-EP - Address: `0xE3Df997CAd0476954196fDFe94A9Bc090365caD9` - Admin: No owner, no admin, no upgrade. Auto-compounding EP vault and ERC-4626 share (wstEP). It stakes every EP it holds and auctions the FBX rewards for more EP along a curve, instead of minting at 300 FBX per EP. Each gain drips into the share price over 30 days. | Function | Type | Signature | Purpose | | --- | --- | --- | --- | | deposit | write | `deposit(uint256 assets, address receiver) returns (uint256 shares)` | Deposit EP, mint wstEP to `receiver`. Harvests first. Standard ERC-4626; `mint(shares, receiver)` also exists. | | redeem | write | `redeem(uint256 shares, address receiver, address owner) returns (uint256 assets)` | Burn wstEP, send the EP to `receiver`. `withdraw(assets, receiver, owner)` is the same by EP amount. No lock-up. | | harvest | write | `harvest() returns (uint256 epMinted)` | Permissionless. Claims staking rewards, mints away FBX above the 2,700 FBX cap, stakes idle EP and books any gain into the drip. Deposits and auction takes call it too. | | takeAuction | write | `takeAuction(uint256 amountEP, uint256 minFbxOut) returns (uint256 fbxOut)` | Pay `amountEP` EP, receive `pool × amountEP / (amountEP + 9 EP)` FBX from the book (1 EP takes 10%, 9 EP half). Reverts below `minFbxOut`. Needs an EP approval. | | auctionPreview | read | `auctionPreview(uint256 amountEP) returns (uint256 fbxPool, uint256 fbxOut)` | Exactly what `takeAuction` would pay right now, unclaimed rewards and the harvest included. | | withdrawalRate | read | `withdrawalRate() returns (uint256)` | EP per wstEP, scaled by 1e18 (= convertToAssets(1e18)). Starts at 1 and never falls. | | totalAssets / undripped | read | `totalAssets() returns (uint256), undripped() returns (uint256)` | EP owned by shareholders, and booked profit still dripping in (released linearly over DRIP_PERIOD = 30 days from the last booked gain). | | heldEP / bookValue / pendingFBX | read | `heldEP() returns (uint256), bookValue() returns (uint256), pendingFBX() returns (uint256)` | EP staked plus idle; the FBX book counted at 300 FBX per EP (at most 9 EP); rewards accrued but not yet claimed. | > Note: The contract itself is the wstEP ERC-20: balanceOf(user) returns shares. Leaving forfeits your share of the profit still dripping in to the holders who stay, which favours long-term depositors. ### FirePool — EP + FBX Fire Pool · FPT receipt - Address: `0xE20E046B230a5530438d32ABfBCC3E61d7670234` - Admin: No owner. Auto-compounding liquidity for the EP/FBX pair, with FPT as the LP share. The same reserves are a constant-product EP/FBX market with no fee (`swapExactEPForFBX`, `swapExactFBXForEP`), one of the venues the swap router uses. | Function | Type | Signature | Purpose | | --- | --- | --- | --- | | addLiquidity | write | `addLiquidity(uint256 amountInEP, uint256 amountInFBX, uint256 minFPT, uint256 deadline)` | Deposit a paired EP + FBX amount, receive FPT LP tokens. minFPT is your slippage floor. | | removeLiquidity | write | `removeLiquidity(uint256 amountInFPT, uint256 minEP, uint256 minFBX, uint256 deadline)` | Burn FPT, withdraw your EP + FBX share of the reserves. | | swapExactEPForFBX | write | `swapExactEPForFBX(uint256 amountInEP, uint256 minAmountOutFBX, uint256 deadline)` | Trade EP for FBX along the pool curve. Reverts if output < minAmountOutFBX. | | swapExactFBXForEP | write | `swapExactFBXForEP(uint256 amountInFBX, uint256 minAmountOutEP, uint256 deadline)` | Trade FBX for EP along the pool curve. Reverts if output < minAmountOutEP. | | claimRewards | write | `claimRewards()` | Force a compound on the LP rewards. | | reserveEP / reserveFBX | read | `reserveEP() returns (uint256), reserveFBX() returns (uint256)` | The pool's tracked EP and FBX reserves — used to quote swaps off-chain. | | poolRate | read | `poolRate() returns (uint256)` | EP-per-FBX (or inverse, depending on orientation), scaled by 1e18. | ### FUSDv2 — USDT0 → DCI vault · FUSD receipt - Address: `0x3c56f017D9cE85350dF8f4B495033AAA15563A99` Deposit USDT0 and mint FUSD 1:1; the USDT0 is supplied to Compound. The interest above the deposits is swapped for DCI through the oracle pool and shared pro-rata by points (FUSD held × time). | Function | Type | Signature | Purpose | | --- | --- | --- | --- | | mint | write | `mint(uint256 amountUSDT)` | Deposit USDT0, receive an equal amount of FUSD. Starts accruing points immediately. | | redeem | write | `redeem(uint256 amountFUSD)` | Burn FUSD, withdraw the underlying USDT0 1:1. | | forceRedeem | write | `forceRedeem(uint256 shares, uint256 minAmountOut) returns (uint256 payout)` | The exit if Compound fails: burn FUSD and receive your share of the vault’s Compound position (cUSDT0) as a plain token transfer. | | claim | write | `claim(address account)` | Claim accrued DCI rewards for an account (any caller can trigger). | | points | read | `points(address account) returns (uint256)` | Accrued points for an account. Drives the DCI claim share. | | totalPoints | read | `totalPoints() returns (uint256)` | Denominator for the pro-rata DCI distribution. | ### ElementalParticles — EP token + EP→FBX staking - Address: `0x60Ed6aCEF3a96F8CDaF0c0D207BbAfA66e751af2` - Admin: No owner. The EP ERC-20 with staking baked into the token contract. Stakers earn FBX from a daily emission set at the protocol level. Accrual caps at 30 days since the last claim — claim within that window to keep earning at the full rate. | Function | Type | Signature | Purpose | | --- | --- | --- | --- | | stakeEP | write | `stakeEP(uint256 amountEP)` | Stake EP from the caller. Reward accrual starts on the next emission tick. | | unstakeEP | write | `unstakeEP(uint256 amountEP)` | Withdraw staked EP. Pending FBX must be claimed separately. | | claimRewards | write | `claimRewards() returns (uint256)` | Sweep accrued FBX rewards to the caller. | | claimableRewards | read | `claimableRewards(address account) returns (uint256, uint256, uint256)` | Currently-claimable FBX for an account + bookkeeping fields. | | userInfos | read | `userInfos(address account) returns (uint256, uint256, uint256)` | Per-user state: tuple[0] = staked EP, then internal accumulators. | > Note: EP is the same token used as the staking surface — the EP balance returned by balanceOf is *unstaked* EP. ### FireNFTMarket — FireBots floor market · instant buy/sell in FBX - Address: `0x93B8054F51b749ded58fBEae8b63539D49519DF2` An always-on market maker for the FireBots ERC-721 collection, priced in FBX: buying a bot costs 1.00% of its FBX reserve, selling one pays 0.99%. After each sale in, the bid drops to zero and recovers along 1 − 0.01^t (t in days): 90% after 12 hours, 99% after a day. Buys are never throttled. | Function | Type | Signature | Purpose | | --- | --- | --- | --- | | buy | write | `buy(uint256 tokenId, uint256 maxCost) returns (uint256 cost)` | Buy one FireBot from inventory for 1% of the reserve. Requires an FBX approval; maxCost caps the price, which is quoted on the reserve before your payment lands. | | buyAny | write | `buyAny(uint256 maxCost) returns (uint256 tokenId, uint256 cost)` | Same as buy, but takes whichever bot is cheapest to dequeue — they all cost the same. | | sell | write | `sell(uint256 tokenId, uint256 minProceeds) returns (uint256 proceeds)` | Sell one FireBot at the live (decayed) bid and reset it to zero. Requires setApprovalForAll on the collection. minProceeds is your floor — passing 0 accepts any price, including free. | | buyPrice | read | `buyPrice() returns (uint256)` | What one bot costs right now — 1% of the reserve, rounded up. Never throttled. | | sellPrice | read | `sellPrice() returns (uint256)` | The live bid: fullSellPrice scaled by sellRecovery. Zero in the block of any sale. | | fullSellPrice | read | `fullSellPrice() returns (uint256)` | The bid ceiling with no decay applied — 0.99% of the reserve. | | sellRecovery | read | `sellRecovery() returns (uint256)` | Share of fullSellPrice currently on offer, in WAD. 0 right after a sale, 0.99e18 a day later, 1e18 once fully recovered. | | reserve | read | `reserve() returns (uint256)` | FBX held by the market. Both prices are a fraction of this, so funding it is a plain ERC-20 transfer in. | | inventory | read | `inventory() returns (uint256[])` | Every token id the market holds and will sell. Also inventoryCount() and isHeld(tokenId). | | lastSaleAt | read | `lastSaleAt() returns (uint256)` | Timestamp of the most recent sale in — the anchor the bid recovers from. | > Note: The 1 bp gap between the two quotes stays in the reserve, so every round trip leaves the market holding more FBX and the floor only ratchets up. The recovering bid means a queue of sellers cannot drain the reserve in one block, while a patient seller gets essentially the full floor (exactly full after nine days). The market starts with no bots, so the first trade must be a sell. It implements no ERC721Receiver hook: a safeTransferFrom into it reverts, and a bot sent via raw transferFrom is unrecoverable — always use sell(). The collection is FireBots at 0xE9eeE7294dc7c3bb64FD57A514E755022a333295 (10,000 tokens, ids 1-10000). ### FireVaultEP — Auto-EP vault · fireEP receipt · replaced by wstEP (retired: withdraw only) - Address: `0xA2b205F8C0F0E30b3f73B7716a718C53cB8E5cC3` - Admin: No owner. The previous auto-compounding EP vault, replaced by wstEP on 2026-09-15 and no longer shown on the dashboard. It stays fully withdrawable: holders see their Auto-EP inside the wstEP card, with a one-click move into wstEP. Its reward path mints EP from the EP-staking emissions at 300 FBX per EP. | Function | Type | Signature | Purpose | | --- | --- | --- | --- | | deposit | write | `deposit(uint256 amountEP) returns (uint256 amountFireEP)` | Deposit EP, mint fireEP shares at the current rate. | | withdraw | write | `withdraw(uint256 amountFireEP) returns (uint256 amountEP)` | Burn fireEP shares, return the underlying EP. | | claimAndMint | write | `claimAndMint()` | Force a compound — claims pending FBX, mints EP from it, restakes. | | withdrawalRate | read | `withdrawalRate() returns (uint256)` | EP-per-share rate, scaled by 1e18. | | getReserveEP / getReserveFBX | read | `getReserveEP() returns (uint256), getReserveFBX() returns (uint256)` | Vault-side accounting of EP staked and FBX held pre-mint. | ## Swap & liquidity The Swap page calls FireSwapRouter, which picks the best venue for each hop: the Fire Pool (EP/FBX, constant product, no fee), the Uniswap V2 pairs (0.3%) or the DCI oracle pool (bid/ask spread). `quote()` prices a trade; `swapExactTokensForTokens(…, minOut, deadline)` fills it. The router has no owner and no admin. ### FireSwapRouter — One swap for EP, FBX, USDT0 and DCI - Address: `0x2e21720b99C460688435EFC31761627E1423b28F` - Admin: No owner, no admin. The four tokens sit on one line, EP – FBX – USDT0 – DCI, and a trade walks it hop by hop. At each hop the router reads live state and takes the venue that pays most: the Fire Pool for EP ↔ FBX, the Uniswap V2 pair for FBX ↔ USDT0, and the Uniswap V2 pair, the oracle pool or a split of the two for USDT0 ↔ DCI. | Function | Type | Signature | Purpose | | --- | --- | --- | --- | | quote | read | `quote(address tokenIn, address tokenOut, uint256 amountIn) returns (uint256 amountOut, uint8[] venues)` | What a trade pays right now, and the venue of each hop. `(0, [])` when nothing can serve it. | | swapExactTokensForTokens | write | `swapExactTokensForTokens(address tokenIn, address tokenOut, uint256 amountIn, uint256 minAmountOut, address to, uint256 deadline) returns (uint256 amountOut)` | Fill the trade along the same route. Reverts past `deadline` (unix seconds) or below `minAmountOut`. Needs an approval on `tokenIn`. | | route / tokens | read | `route(address tokenIn, address tokenOut) returns (address[] path), tokens() returns (address[] list)` | The tokens a trade passes through, and the four tokens in line order. | | venuesFor / venueName | read | `venuesFor(address tokenA, address tokenB) returns (uint8[] venues), venueName(uint8 venue) returns (string)` | The venues that can serve a hop, and their names. | > Note: Each hop is filled with a minimum of 0 on purpose: the route is atomic, so `minAmountOut` on the whole trade is your guarantee. EP → FBX through the Fire Pool can land one wei under the quote. ### OracleLiquidityPoolV3 — DCI / USDT0 oracle pool - Address: `0xe68137Ac7a58Dd9108F85a04712334d0338b5b40` A DCI/USDT0 pool priced by the oracle submitters on its DciSubmitters list (five today, at most seven) rather than by its reserves. It sells DCI at `ask()` and buys it at `bid()`, 0.15% outside the highest and lowest submitted prices. It halts while `trust()` is false: fewer than two thirds of the submitters (never fewer than four) fresh within 6 hours, or a spread above 1%. | Function | Type | Signature | Purpose | | --- | --- | --- | --- | | price / bid / ask | read | `price() returns (uint256), bid() returns (uint256), ask() returns (uint256)` | The median of the submitted prices, and the two quotes the pool trades at. | | SUBMITTERS | read | `SUBMITTERS() returns (address)` | The DciSubmitters list the prices come from. A submitter added to it counts 24 hours later. | | trust / spread | read | `trust() returns (bool), spread() returns (uint256)` | Whether the pool trades right now, and `ask / bid − 1` (WAD). | | quoteExactUsdt0ForToken / quoteExactTokenForUsdt0 | read | `quoteExactUsdt0ForToken(uint256 amountIn) returns (uint256 amountOut), quoteExactTokenForUsdt0(uint256 amountIn) returns (uint256 amountOut)` | Exactly what a swap would return now, or 0 when it would revert. | | swapExactUsdt0ForToken / swapExactTokenForUsdt0 | write | `swapExactUsdt0ForToken(uint256 amountIn, uint256 minAmountOut, uint256 deadline) returns (uint256 amountOut), swapExactTokenForUsdt0(uint256 amountIn, uint256 minAmountOut, uint256 deadline) returns (uint256 amountOut)` | Buy DCI with USDT0 at the ask, or sell it at the bid. Both refuse to fill while `trust()` is false. | > Note: Idle USDT0 in the pool is supplied to Aave. The DCI vault converts its interest into DCI here. ## Price references Tokens with a Chainlink Data Feed on Polygon (ETH, BTC, MATIC/POL, wstETH) read `latestAnswer()`. FBX and DCI have no Chainlink feed, so they fall back to their Uniswap-V2 pair against USDT. EP has no direct USDT pair — it is priced through the Fire Pool FBX rate (`reserveFBX / reserveEP`) then through the FBX/USDT pair. ### Chainlink Data Feeds | Feed | Address | Notes | | --- | --- | --- | | ETH / USD | `0xF9680D99D6C9589e2a93a78A04A279e509205945` | Chainlink AggregatorV3. latestAnswer() returns ETH/USD scaled by 1e8. | | BTC / USD | `0xc907E116054Ad103354f2D350FD2514433D57F6f` | Chainlink AggregatorV3. latestAnswer() returns BTC/USD scaled by 1e8. | | MATIC / USD (POL) | `0xAB594600376Ec9fD91F8e885dADF0CE036862dE0` | Chainlink AggregatorV3. POL is the rebranded MATIC, same token — this feed prices both. | | wstETH / ETH | `0x10f964234cae09cB6a9854B56FF7D4F38Cda5E6a` | Chainlink ratio feed (1e18-scaled). Multiply by ETH/USD for the wstETH/USD price. | ### Uniswap-V2 fallback pools | Pool | Address | Notes | | --- | --- | --- | | FBX / USDT pool | `0x1000bb854fbc6d98dc9d859d6cb47e22a31eb8f9` | Uniswap-V2 pair. FBX has no Chainlink feed — spot price = reserves(USDT) / reserves(FBX), decimal-adjusted. | | DCI / USDT pool | `0xe7b7cf919e2798defc1f08133312cd151e5a5bed` | Uniswap-V2 pair. DCI has no Chainlink feed — same reserve-ratio formula gives DCI/USDT. | ## Contract ABIs Machine-readable ABIs (JSON) are published under `/abi/`. Start with the manifest at https://firebot.gg/abi/index.json — it maps every deployed address to its ABI file. Raw ABIs: https://firebot.gg/abi/.json (erc20, fbxVault, epVault, wstEp, firePool, fusd, epStaking, chainlinkFeed, univ2Pair, nftMarket, erc721, router, firestone, firestoneArt, firestoneAlchemist). These cover the functions the app calls; token contracts also implement the full ERC-20 standard.