JPEG Trading protocol
Curve pricing, pool activation and perpetual position accounting.
Current status
Version 0.4 adds creator-selected opening reserves through JPEGCurveFactoryV2 and JPEGCurveMarketV2 on Robinhood Chain mainnet (4663). The V2 factory is 0xe8e5Aaad6a313Fb76ed97DcA59b3e528f4C6E384; its successful sequencer receipt and exact deployed runtime were checked. Factory deployment created no NFTs, collection or funded position. The original Test Curve at 0x44B249896fCEB7aED0C27693416aDF79f4b921Da remains a v0.3 JPEGCurveMarket with its original fixed target. Both factory registries are shown in the site. Users fund activation through NFT trading fees.
The earlier v0.2 Test collection and JPEGPoolMarket remain separate contracts. Their free mint, manual reporter, LP shares, capped 1x payouts and seven-day settlement rules do not apply to JPEGCurveMarketV2. Existing NFTs, positions, balances and credits are not migrated or upgraded by this release.
Local tests and runtime checks are development verification, not an independent security audit. The project token is separate from the curve contracts. No independent price feed or promised keeper service is included.
Curve and capital model
A collection contains numbered ERC-721 editions of one artwork. Let S be the maximum circulating supply, b the starting price in ETH wei, and d the fixed price step. The constructor sets d = ceil(b / S) and maximumPrice = b + d * S. At circulation s, the reference price is P(s) = b + d * s. It is the next purchase's principal price before fees when capacity remains; at full circulation it is the upper reference boundary and another buy is unavailable.
The principal needed to back circulation s is R(s) = s * b + d * s * (s - 1) / 2, with R(0) = 0. Buying k editions costs principal R(s + k) - R(s). Selling k editions releases principal R(s) - R(s - k). These are sums of the intervening curve steps, not k multiplied by the final displayed price.
Every buy and sell charges ceil(principal * 500 / 10000), a 5% fee rounded up to wei. Buyers pay principal plus fee; sellers receive principal minus fee. All curve fees enter that collection's perp reserve. The purchase principal continues to back NFT redemption and cannot finance positions.
Let F = ceil(R(S) * 500 / 10000). The creator selects an immutable activation target from ceil(F / 4) to F inclusive. Leaving the optional target field blank uses ceil(F / 4). Earlier v0.3 markets keep that minimum as their fixed target. Fee rounding on actual individual trades can differ. Fees from both buys and sells count. The trade that brings perpReserve to the target enables positions in that same transaction and emits PerpsActivated. Activation is permanent, although every later position still needs free reserves and exposure capacity.
For the interface defaults S = 1,000 and b = 0.0001 ETH, d = 0.0000001 ETH, the maximum reference price is 0.0002 ETH and the target is 0.001874375 ETH. These are also Test Curve’s fixed terms. Its activation depends on real fees being collected.
Position payouts and charges
Each position has one owner and separate ETH collateral M, between 0.000001 and 100 ETH, subject to stricter available reserve and exposure limits. Leverage L is an integer from 1 through 3. Entry notional is N = M * L. At entry price P0, quantity is q = floor(N * 1e18 / P0). Quantity uses 18 decimal places; it does not represent NFT ownership.
At reference price P, Long price P/L is q * (P - P0) / 1e18; Short uses q * (P0 - P) / 1e18. Positive results round down, and loss magnitudes round up. P/L is linear in quantity and the price change. There is no v0.2 rule limiting a profitable payout to twice the collateral. Instead, possible profit is bounded by this curve's immutable minimum b and maximum price.
Opening reserves the entire maximum possible price profit: ceil(q * (maximumPrice - P0) / 1e18) for Long, or ceil(q * (P0 - b) / 1e18) for Short. This amount remains assigned to the position until settlement, even if its current profit is smaller. The opening fee can contribute to the free reserve used by that opening.
- Opening fee:
ceil(N * 10 / 10000), or 0.1% of entry notional, paid separately alongside M. - Borrow charge:
ceil(N * elapsedSeconds * 5 / (10000 * 86400)), or 0.05% of entry notional per elapsed day. It is prorated by seconds and rounded up to wei. - Equity: the greater of zero and M plus price P/L minus the accrued borrow charge.
- Closing fee:
ceil(floor(q * P / 1e18) * 10 / 10000), limited to remaining equity. This is 0.1% of current notional after quantity rounding. - Settlement payout before any liquidation reward: equity minus closing fee.
Borrowing is a charge to the reserve, not a funding payment between Long and Short traders. It does not balance the two sides. Accrued borrowing may exceed the position's available value; settlement collects only what remains, and the position owner owes no further collateral debt. Borrow and closing charges remain in perpReserve through settlement accounting. Gas is separate.
Positions have no fixed expiry. An owner can close any still-open position within accepted price bounds, including one that is eligible for liquidation. Price losses and charges can exhaust all collateral. Separately paid opening fees and network gas are additional costs.
Buying, selling and settlement
buy accepts 1–20 editions, an inclusive maximum cost and a deadline. The transaction must send exactly maxCost. The contract executes its current quote if it fits that limit and credits unused payment tolerance for later withdrawal. Each purchase mints new token IDs in increasing order, starting at 1.
sell accepts 1–20 distinct token IDs, an inclusive minimum received amount and a deadline. The sender must own each NFT; operator approval alone is insufficient. The contract burns the NFTs, reduces circulation and credits net proceeds. Selling frees circulation capacity, but burned IDs are never reused. Transfers between wallets do not change circulation or the curve price.
openPosition requires activation, valid margin and leverage, inclusive minimum and maximum entry prices, a deadline, sufficient free profit reserve and remaining global quantity. The exact payment is collateral plus opening fee. It does not require NFT ownership, a counterparty trader or a separate market deployment.
closePosition is owner-only and accepts inclusive exit-price bounds and a deadline. The interface prepares buy, sell, opening and owner-close protections using 1% tolerance and a five-minute deadline. These are interface defaults; the contract checks the supplied limits against execution state. An unchanged preview is not a guaranteed fill.
A position is liquidatable when equity before its closing fee is at most ceil(N * 500 / 10000), or 5% of entry notional. Anyone can call liquidate at the current curve price if that condition holds. There is no owner price bound on liquidation. Eligibility does not automatically execute a transaction.
The liquidation executor receives min(payout, floor(q * d / 1e18)). This caps the reward at one edition's price-step exposure and takes it from the position payout; it is not an additional reserve subsidy. The trader receives the remainder. Small or exhausted positions may offer little or no reward, so execution is not guaranteed.
Sale proceeds, settlement payouts, liquidation rewards and unused buy tolerance become credits. withdraw sends the caller's full credit to a chosen nonzero recipient. Failed transfers revert and restore the credit. The financial entry points use reentrancy protection. There is no stale-report refund or seven-day public settlement in v0.4.
Price, chart and history
The only settlement reference is this contract's deterministic curve price. There is no independent oracle, manual reporter, TWAP, external marketplace floor or off-platform price guarantee. NFT transfers and project-token prices do not update it. Buys and burns through the paid curve change it immediately, including multiple changes within the same block.
The chart is reconstructed from CurveTrade events and groups their before/after curve prices into the selected candle interval. Volume is NFT curve principal, excluding fees and position notional. Empty history and failed history requests are distinguished; the live market chart does not insert example trades. Candles are a presentation of those events, not a second settlement source.
History reads use bounded block ranges and support loading older trades. Recent PositionOpened events and device-local remembered IDs assist position discovery; an older position can be read directly by ID. A loaded list or chart can be incomplete, and its displayed state is from the last successful refresh. Contract execution always uses current onchain state.
Reserve accounting and exposure capacity
- curveReserve equals R(circulatingSupply) and backs NFT redemption principal.
- perpReserve contains collected curve and position fees plus realized trader losses, less realized trader profits.
- reservedProfit is the sum of maximum possible profits assigned to open positions. It is a subset of perpReserve, not a second ETH balance.
- totalMargin is open trader collateral. totalCredits is ETH already owed through pull withdrawals.
- availableLiquidity equals perpReserve minus reservedProfit. Neither trader collateral nor credits can fund a new position.
The accounting invariant is contractBalance >= curveReserve + perpReserve + totalMargin + totalCredits, with perpReserve >= reservedProfit. At settlement, let U be the payout before a liquidation reward. The contract releases the position's reserved profit and quantity, removes M from totalMargin and changes perpReserve by M - U. It credits a total of U to the trader and any executor. This preserves separate redemption backing.
There are no LP deposits, redeemable shares, reserve withdrawals, reserve owner or yield claims. The recorded creator has no privileged withdrawal or fee entitlement. Unsolicited or forced ETH does not increase the ledgers or capacity and has no recovery function.
The global quantity ceiling is Qmax = floor(b * 500 * 1e18 / (20000 * d)). grossQuantity sums q for every open position, including both directions and all wallets. Each opening must satisfy grossQuantity + q <= Qmax; closing or liquidation releases q. Opposite positions do not cancel for this limit. There is no separate 32-position limit inherited from v0.2; active-position reads are paginated, with at most 50 IDs per call.
The cap ties exposure to the cost of moving this curve. Moving circulation by k editions changes price by d times k, while curve fees are at least 5% of b times k. In unrounded exposure terms, Qmax limits the favorable aggregate price P/L from that move to at most half that lower fee bound. The keeper reward separately uses one edition's step, rather than a fixed share of a large position. These constraints reduce economic incentives for manipulating the reference; they are not a proof that every sequence, integer-rounding effect or ordering strategy is harmless.
The constructor also requires enough global quantity for at least two minimum-margin units valued at b and enough activation target to reserve the specified minimum-margin boundary profit. Some small supply/starting-price combinations are therefore rejected even within the basic input ranges.
Risks and operational limits
The curve is an internal pricing rule for redeemable editions, not an appraisal of the artwork. Trading may move it sharply. Traders and NFT holders can influence the same reference; multi-transaction strategies and transaction ordering require consideration even with reserve and quantity limits.
Full maximum-profit reservation is an accounting guarantee conditional on correct contract execution. It does not establish economic fairness, an independent asset value, a liquid secondary market or audited code. Curve fees, opening and closing fees, borrowing and gas can make round trips costly even when the price returns to its start.
Borrowing continues while a position is open. Reserve capacity can remain assigned until the owner closes or someone executes an eligible liquidation. Liquidation availability depends on transactions being submitted, included and economically worthwhile. There is no promised keeper operation, insurance fund, cross-collection backstop or automatic deleveraging process.
Public RPC limits, network ordering, outages and sequencer downtime may delay reads or execution. Borrowing and deadlines use block timestamps, not a count of blocks or an independent wall-clock service. A sequencer receipt is not Ethereum finality. Check uncertain submissions before retrying.
Collections and registry
JPEGCurveFactoryV2 has no administrator. createCollection deploys one JPEGCurveMarketV2, records it in collections and isCollection, and emits CollectionCreated. The caller becomes the recorded creator. Creation charges only network gas, mints no NFTs and supplies no capital. The collection itself also contains its perpetual market; no second position contract is created at activation.
Contract terms require a nonempty name of at most 64 bytes, a symbol of 2–10 bytes, a nonzero creator, supply from 10 to 10,000 and a starting price from 0.000001 to 1 ETH, plus the capacity checks above. The interface restricts symbols to letters and numbers. Description is at most 1,500 bytes and image URI at most 500 bytes. The contract checks an HTTPS or IPFS prefix; the interface applies stricter URL validation. Neither proves that the content is publicly reachable or permanent.
Metadata is generated onchain for existing NFTs, with the fixed name, edition ID, description and image URI. Images are externally hosted. The interface can supply the JPEG Test artwork URL when its image field is left empty. There is no upload or IPFS pinning service. HTTPS content can change at a fixed URL; IPFS content still needs hosting.
The creator cannot change pricing or fees, pause trading, premint for free, withdraw reserves or upgrade the contract. ERC-721 transfers and approvals remain available to NFT owners. The supply limit counts simultaneous circulation, so cumulative minted IDs can eventually exceed maxSupply after burns and repurchases.
The collection directory reads the configured v0.3 and V2 factory registries, loads pages of collections and filters those already loaded. It is not a registry of every NFT contract or every factory on the chain. Runtime and immutable-term validation identify the supported release; they do not verify artistic provenance or endorsement.
JpegDotTrading project token
JpegDotTrading (JPEG) is the project token on Robinhood Chain, chain ID 4663. Official contract: 0xD19cE53Ef144dfB381e5FF7D0F2AFe9710c0B031 ↗. Its ERC-20 name, symbol, 18 decimals and total supply of 1,000,000,000 JPEG were read at block 62388742. This is the supply observed at that block, not a claim about future minting permissions.
Official project account: @jpegdottrading on X ↗. Open Pons ↗ links to the launchpad; it is not a token-specific trading URL.
The project token is not an NFT edition, position collateral or a reserve share and is not required for this flow. Positions use native ETH. JPEG spot liquidity does not back collection reserves. No yield, dividend, buyback, fee share or governance entitlement is announced. The token’s market is separate from the NFT curves described above.
Network and deployment
Robinhood Chain mainnet uses chain ID 4663, hexadecimal 0x1237, and native ETH. The canonical public RPC is https://rpc.mainnet.chain.robinhood.com and the explorer is https://robinhoodchain.blockscout.com. Public RPC service may be rate-limited. The browser uses EIP-1193 wallets and EIP-6963 discovery, and binds reviewed transactions to the selected sender and network.
The public manifest at /contracts/curve-deployment.json records both registries, the original Test Curve and history blocks. The V2 factory receipt ↗ records the new deployment. The original factory receipt ↗ and Test Curve receipt ↗ identify v0.3. Ethereum finality was not separately checked.
The V2 operator deploys the new factory with zero value, verifies the receipt and exact runtime, then publishes the updated registry configuration. Users create their own collections through the site. There is no automatic deployment performed by the website build.
Local deployment tooling keeps signing credentials and journals outside the published build. Sending requires explicit broadcast mode, mainnet and signer checks, sufficient balance, and an ETH gas cap. A submission hash is journaled before broadcasting. A missing or uncertain receipt is inspected before any retry; confirmed receipts still need code and term verification. The current deployment instructions and verified manifest govern the available CLI options.
Release boundaries
Implemented v0.4 components are the permissionless factory registry, fixed NFT curve, mint-on-buy and burn-on-sell, fee-funded automatic activation, isolated 1–3x positions without a fixed expiry, bounded maximum-profit reserves, global quantity limits, borrowing, permissionless eligible liquidation, pull credits and event-based chart history.
Not included are an independent oracle, external NFT floor trading, TWAP, creator revenue withdrawals, LP shares, hosted keeper operations, permanent image hosting or a completed independent audit. The wallet-free demonstration is simulated and does not represent funded mainnet activity.
Legacy JPEGCollection, JPEGPoolMarket and the earlier JPEGPositionMarket are retained separately where needed for historical contracts and regression tests. They do not share the curve ledger or automatically migrate balances. Their routes, artifacts, calculators and payout rules must be identified as legacy wherever they remain accessible.
Glossary
- Circulation: the number of currently existing curve NFTs, excluding burned editions.
- Curve principal: the sum of curve steps exchanged before the 5% fee.
- Curve price: this contract's deterministic reference value in ETH per NFT.
- Perp reserve: the collection's fee-funded capital covering position profits.
- Profit reserve: the part of perpReserve assigned to a position's maximum possible gain.
- Quantity: a position's fixed 18-decimal exposure derived from entry notional and price.
- Borrowing: the time-based charge on entry notional, paid from settlement value.
- Credit: ETH owed to an address and withdrawn in a separate transaction.
- Activation: the permanent enablement of positions when collected reserves reach the target.
- Registry: the configured factory's onchain list of the collections it created.
Sources and files
- Robinhood Chain connection ↗
- Robinhood Chain differences from Ethereum ↗
- Transaction finality ↗
- OpenZeppelin contracts ↗
- EIP-1193 ↗
- EIP-6963 ↗
- Pons v2 ↗
JPEGCurveMarketV2.sol and JPEGCurveFactoryV2.sol define the v0.4 behavior. The build publishes their ABI, creation and runtime bytecode, immutable bindings, checksums and exact compiler input under /contracts/. A compiled artifact is not a deployment record. Legacy artifacts describe different contracts.
Configurable collection release
Version 0.4 adds a chosen graduationReserve argument after basePrice in JPEGCurveFactoryV2.createCollection. The circulation limit accepts any integer from 10 to 10,000. Starting prices range from 0.000001 to 1 ETH, subject to minimum-position viability. The target lies between one quarter and all of the rounded 5% fees on the full-supply purchase principal. All terms are immutable. Collection creation only costs network gas.
The first NFT purchase includes a 5% pool fee. Later prices follow the fixed linear curve. Target estimates assume single-NFT purchases from an empty curve and no sells or positions. A maximum target can activate at the price ceiling, where a new Long has no further upward price range.
The interface separately previews pool cash and shared exposure capacity. Increasing the target alone cannot increase the quantity cap. At 1,000 NFTs, a 0.05 ETH base price and the minimum target, 323 single-NFT purchases put the curve at 0.06615 ETH with 0.9375075 ETH in the reserve. A single 0.5 ETH collateral / 3x position fits either direction at this snapshot; two such positions do not fit together. The displayed conservative capacity excludes an incoming order’s fee and respects the 100 ETH per-position collateral ceiling.
This release adds no redeemable LP shares, admin access, external oracle, free liquidity or changed exposure formula. Curve fees remain permanently owned by the market. Earlier JPEGCurveFactory / JPEGCurveMarket contracts remain unchanged and accessible through the directory. No balances are moved.