A decentralized subscription and creator economy protocol built on Cosmos SDK using CosmWasm smart contracts.
Bluechip is a DeFi protocol that enables content creators to launch their own tokens and build portable, decentralized subscription communities. Unlike traditional subscription platforms where audiences are locked to a single platform, Bluechip allows creators to take their community anywhere while subscribers earn tokens proportional to their support.
Decentralized Subscriptions
- Subscription transactions (carried out onchain as commit transactions) are recorded onchain, not controlled by any central platform
- Creators own their subscriber relationships directly
- Websites are connected to the Subscription contract not vice versa
- Subscription data is capable of being connected across multiple websites and platforms
Portable Communities
- Creators can integrate the "subscription button" into any website, app, or platform
- Community follows the creator, not the platform
- High engagement from community members who are also tokenholders
Subscriber Token Rewards
- When subscribing (committing), users receive an equal value of creator tokens
- Subscribers become tokenholders in the creator's success
- Tokens can be reinvested into the liquidity pool to earn trading fees
Collaboration & Sponsorship Ready
- Built-in fee structure supports creator revenue and protocol sustainability
- Sponsors can integrate with creator pools
- Cross-creator collaborations enabled through the token ecosystem
The protocol consists of three main contracts:
┌─────────────────────────────────────────────────────────────┐
│ FACTORY CONTRACT │
│ - Creates new creator pools │
│ - Manages global configuration │
│ - Handles CW20 and CW721 contract instantiation │
│ - Internal oracle for bluechip/USD pricing │
│ - Triggers expand economy on pool creation │
└─────────────────────────────────────────────────────────────┘
│ │
│ creates │ requests expansion
▼ ▼
┌──────────────────────────────┐ ┌──────────────────────────────┐
│ POOL CONTRACT │ │ EXPAND ECONOMY CONTRACT │
│ - Handles commits │ │ - Mints bluechip tokens on │
│ - Manages threshold │ │ pool creation │
│ - Executes swaps & LP ops │ │ - Decreasing supply curve │
│ - Mints NFT LP positions │ │ - Factory-gated access │
│ - Distributes fees │ │ - Owner admin functions │
│ - Creator excess liquidity │ │ │
└──────────────────────────────┘ └──────────────────────────────┘
Creators can launch their own token pool by calling the factory contract. Calling the contract can be done via the BlueChip website or by using the below JSON.
{
"create": {
"pair_msg": {
"asset_infos": [
{ "native_token": { "denom": "bluechip" } },
{ "token": { "contract_addr": "CREATED_BY_FACTORY" } }
],
"token_code_id": 1,
"factory_addr": "factory_contract_address",
"fee_info": {
"bluechip_address": "protocol_wallet",
"creator_address": "creator_wallet",
"bluechip_fee": "0.01",
"creator_fee": "0.05"
},
"commit_limit_usd": "25000000000",
"oracle_addr": "pyth_oracle_address"
},
"token_info": {
"name": "Creator Token Name",
"symbol": "TICKER",
"decimal": 6
}
}
}Each pool receives:
- A unique CW20 token for the creator (mint cap: 1,500,000)
- A CW721 NFT contract for liquidity positions
- Configurable fee structure (default: 1% protocol + 5% creator)
- bluechip tokens minted via the Expand Economy contract (up to 500M per creation, decreasing over time)
Before a pool reaches its $25,000 USD threshold, only commit transactions are allowed. This phase:
- Tracks all commits in a ledger by USD value (not token quantity)
- Provides price stability during the funding period
- Ensures fair valuation regardless of when users commit
- Prevents liquidity provision and normal swaps
During this phase:
- Users send bluechip tokens to subscribe/commit
- Commits are tracked by their USD value at time of commitment
- 6% fee is collected (1% protocol + 5% creator)
- All committers are recorded for proportional token distribution
When total USD committed reaches the threshold ($25,000 default):
- Creator tokens minted: ~1,200,000 creator tokens are minted and distributed
- Creator reward: 325,000 creator tokens sent to the creator's wallet
- Protocol reward: 25,000 creator tokens sent to the Bluechip protocol wallet
- Pool seeded: 350,000 creator tokens + committed bluechip used to initialize AMM liquidity
- Committer distribution: 500,000 creator tokens distributed to committers proportionally
- Excess handling: If bluechip exceeds
max_bluechip_lock_per_pool, excess bluechip and proportional creator tokens are sent directly to the creator's wallet (see Creator Limits) - State transition: Pool moves to active trading phase
Token Distribution Formula:
user_tokens = (user_usd_contribution / total_usd_committed) × 500,000
Once the threshold is crossed, the pool operates as a full AMM:
Available Operations:
- Commits (Subscriptions): Still available with 6% fee, provides subscription tracking
- Simple Swaps: Standard AMM swaps with LP fees only (no protocol fees)
- Add Liquidity: Provide liquidity and receive NFT position
- Remove Liquidity: Withdraw liquidity (partial or full)
- Collect Fees: Claim accumulated trading fees without burning position
The commit function is the core user interaction for subscriptions:
{
"commit": {
"asset": {
"info": { "bluechip": { "denom": "ubluechip" } },
"amount": "1000000"
},
"transaction_deadline": null,
"belief_price": null,
"max_spread": null
}
}Send with: Native bluechip tokens attached to the transaction, in the same amount as asset.amount. Commit transactions can only be carried out with bluechip tokens.
Pre-Threshold:
- USD value calculated using oracle price
- 6% fee deducted and distributed (1% protocol, 5% creator)
- Commitment recorded in ledger
- If threshold crossed, triggers token distribution
Post-Threshold:
- 6% fee deducted and distributed
- Remaining amount swapped through AMM
- User receives creator tokens
- Transaction flagged as subscription for tracking
Rate Limiting: A minimum of 13 seconds must elapse between commits from the same wallet to prevent spam.
| Fee Type | Recipient | Amount | When Applied |
|---|---|---|---|
| Protocol Fee | Bluechip Wallet | 1% | Commits only |
| Creator Fee | Creator Wallet | 5% | Commits only |
| LP Fee | Liquidity Providers | ~0.3% | All swaps |
Note: Regular swaps (non-commits) only pay LP fees, not the 6% subscription fee.
Unlike traditional AMMs that issue fungible LP tokens, Bluechip uses NFTs to represent liquidity positions.
- Fee Collection Without Burning: Claim accumulated fees while keeping your position
- Transferable Positions: Sell or transfer your liquidity position as an NFT
- Position Tracking: Each position tracks its own fee accumulation history
- Partial Withdrawals: Remove part of your liquidity while keeping the NFT
{
"add_liquidity": {
"amount0": "1000000",
"amount1": "1000000",
"min_liquidity": "900000"
}
}Returns: NFT representing your liquidity position
{
"add_to_position": {
"position_id": "123",
"amount0": "500000",
"amount1": "500000"
}
}Note: Any uncollected fees are automatically claimed when adding to a position.
{
"collect_fees": {
"position_id": "123"
}
}Fees are calculated using a global fee growth accumulator:
fees_owed = (fee_growth_global - fee_growth_at_last_collection) × position_liquidity
{
"remove_liquidity": {
"position_id": "123",
"liquidity_amount": "500000"
}
}Partial removal keeps the NFT; full removal burns it.
Bluechip uses an internal oracle to price the native bluechip token in USD.
┌─────────────────────────────────────────────────────────────┐
│ PYTH ORACLE │
│ (ATOM/USD Price) │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ ATOM/bluechip POOL │
│ (Primary Price Reference) │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ INTERNAL ORACLE (FACTORY) │
│ - Weighted average from multiple pools │
│ - TWAP for manipulation resistance │
│ - Random pool rotation for security │
└─────────────────────────────────────────────────────────────┘
- ATOM/bluechip price from the primary liquidity pool
- ATOM/USD price from Pyth Network oracle
- bluechip/USD = ATOM/USD × ATOM/bluechip
- TWAP (Time-Weighted Average Price): Smooths out temporary price spikes
- Pool Rotation: Randomly selects pools to prevent targeted manipulation
- Liquidity Weighting: Higher liquidity pools have more influence
- Outlier Detection: Rejects prices that deviate significantly from TWAP
{
"get_pool_state": {}
}Returns:
{
"reserve0": "1000000000",
"reserve1": "5000000000",
"total_liquidity": "2000000000",
"is_threshold_hit": true
}{
"get_commit_status": {}
}Returns:
{
"total_usd_raised": "25000000000",
"threshold": "25000000000",
"is_active": true
}{
"get_position": {
"position_id": "123"
}
}Returns:
{
"position_id": "123",
"owner": "bluechip1...",
"liquidity": "1000000",
"fee_growth_inside_0_last": "0.001",
"fee_growth_inside_1_last": "0.002"
}{
"simulate_swap": {
"offer_asset": {
"native_token": { "denom": "bluechip" }
},
"offer_amount": "1000000"
}
}{
"analytics": {}
}Returns:
{
"analytics": { "total_swaps": 42, "total_commits": 10, "..." : "..." },
"current_price_0_to_1": "5.0",
"current_price_1_to_0": "0.2",
"total_value_locked_0": "1000000000",
"total_value_locked_1": "5000000000",
"fee_reserve_0": "50000",
"fee_reserve_1": "250000",
"threshold_status": { "total_usd_raised": "25000000000", "threshold": "25000000000", "is_active": true },
"total_usd_raised": "25000000000",
"total_bluechip_raised": "100000000",
"total_positions": 15
}Provides a comprehensive snapshot of pool state for indexers and analytics dashboards, including pricing, TVL, fee reserves, and threshold status.
The commit function can be called from any frontend that supports Cosmos transactions:
// Using CosmJS
const amount = "1000000"; // micro-units
const msg = {
commit: {
asset: {
info: { bluechip: { denom: "ubluechip" } },
amount
},
transaction_deadline: null,
belief_price: null,
max_spread: null
}
};
const result = await client.execute(
senderAddress,
poolContractAddress,
msg,
"auto",
undefined,
[{ denom: "ubluechip", amount }]
);Query the commit ledger to verify subscription status:
{
"get_commit_info": {
"address": "bluechip1..."
}
}- Guard implemented on commit transactions
- State updates occur before external calls
- TWAP (3600-second window) prevents flash loan price manipulation
- Multiple pool sampling (5 pools: 4 random + ATOM anchor) reduces single-point-of-failure risk
- Price update rate-limited to every 300 seconds
- Stale price detection (3000-second max age)
- Pool rotation every 3600 seconds to prevent targeted manipulation
- Threshold can only be crossed once (irreversible)
- Atomic state transitions during threshold crossing
- USD-based tracking prevents token price manipulation
- Batched distribution for large committer sets (>40)
- Stuck state recovery mechanism (factory admin, after 1 hour timeout)
- Zero-amount CW20 swaps are rejected
- Creator tokens are enforced to use 6 decimals to match hardcoded payout amounts
- Minimum 13 seconds between commits per wallet
- USD payment tolerance of 1% (100 bps) for oracle price drift, capped at a maximum of 10% (1000 bps)
- Excess swap at threshold crossing is capped at 20% of pool reserves, preventing a single large committer from dominating the first trade on a freshly seeded pool
- Any excess beyond the cap is refunded to the committer
- All threshold payout components validated (no zero amounts)
- No individual component can exceed total
Each creator pool mints a total of 1,200,000 creator tokens at threshold crossing, distributed as follows:
| Recipient | Amount | % of Total | Purpose |
|---|---|---|---|
| Committers | 500,000 | ~41.7% | Proportional to USD committed |
| Creator | 325,000 | ~27.1% | Creator reward |
| Protocol (Bluechip Wallet) | 25,000 | ~2.1% | Protocol sustainability |
| Pool Liquidity Seed | 350,000 | ~29.2% | Initial AMM liquidity |
The CW20 token contract is instantiated with a mint cap of 1,500,000,, allowing for future controlled minting beyond the initial threshold distribution.
Commit Transaction (5000 bluechip)
│
├── 1% (50) → Protocol Wallet
├── 5% (250) → Creator Wallet
└── 94% (4700) → Pool/Swap
The Expand Economy contract manages bluechip token inflation by minting new tokens each time a creator pool is created. This incentivizes early adoption while gradually reducing emissions as the ecosystem grows.
┌──────────────┐ ┌───────────────────┐ ┌──────────────────┐
│ Creator │ ──────► │ Factory Contract │ ──────► │ Expand Economy │
│ creates pool │ │ calculate_mint() │ │ RequestExpansion│
└──────────────┘ └───────────────────┘ └──────────────────┘
│
▼
Mints bluechip tokens
to protocol wallet
- A creator calls the factory to create a new pool
- The factory calculates a mint amount based on time elapsed and total pools created
- The factory sends a
RequestExpansionmessage to the Expand Economy contract - The Expand Economy contract sends the calculated amount of bluechip (
stake) tokens to the protocol wallet
mint_amount = 500 - ((5x² + x) / ((s / 6) + 333x))
Where:
- x = total pools created
- s = seconds elapsed since the first pool was created
- Result is in whole tokens (multiplied by 10⁶ for micro-denomination)
Properties:
- Maximum mint: 500
staketokens per pool creation - Decreasing curve: Mint amount decreases as more pools are created
- Time decay: Longer time between pool creations further reduces the mint
- Floor: Mint amount cannot go below zero
| Action | Who Can Call |
|---|---|
RequestExpansion |
Factory contract only |
UpdateConfig |
Owner only |
Withdraw |
Owner only |
{ "get_config": {} }Returns the factory address and owner.
{ "get_balance": { "denom": "stake" } }Returns the contract's balance of the specified denomination.
Each pool enforces a maximum amount of bluechip tokens that can be locked as liquidity upon the threshold being crossed. This is to preotect the ecosystem from having all the bluechips getting locked in unowned liquidity positions (max_bluechip_lock_per_pool). When the bluechip tokens committed to a pool exceed this limit at threshold crossing, the excess is not lost, it is held in a time-locked escrow for the creator. The maximum amount of bluechips is therefore, also used as an incentive for creators to join the network while bluechips are lower in value.
When bluechips exceed the per-pool maximum:
- The excess bluechip and proportional creator tokens are stored in a
CreatorExcessLiquidityrecord - An unlock timestamp is set based on
creator_excess_liquidity_lock_days(configured at the factory level) - After the lock period expires, the creator can claim the excess tokens directly to their wallet
Threshold Crossing (e.g., 15M bluechip committed, 10M max per pool)
│
├── 10B bluechip → Pool liquidity (immediate)
└── 5B bluechip + proportional creator tokens → Time-locked
│
└── Unlocks after X days → Creator calls ClaimCreatorExcessLiquidity
│
├── Bluechip tokens → Sent directly to creator wallet
└── Creator tokens → Sent directly to creator wallet
{
"claim_creator_excess_liquidity": {}
}Tokens are sent directly to the creator's wallet (not deposited as liquidity). The creator can then choose to deposit them as liquidity or use them as they wish.
Requirements:
- Caller must be the creator of the pool
- The lock period must have expired
- Can only be claimed once
| Parameter | Default | Description |
|---|---|---|
max_bluechip_lock_per_pool |
10,000,000,000 (10B) | Max bluechip tokens locked as liquidity in a single pool |
creator_excess_liquidity_lock_days |
7 days | Time lock before creator can claim excess |
When a pool crosses its USD threshold, creator tokens must be distributed to all committers proportionally. For pools with many committers, this is handled in batches.
- Small pools (≤ 40 committers): All distributions happen in a single transaction
- Large pools (> 40 committers): Distributions are batched across multiple transactions using a
DistributionStatetracker
Distribution State Machine:
┌──────────┐ ┌───────────┐ ┌───────────┐
│ Start │ ──► │ Batch N │ ──► │ Complete │
│ │ │ (≤40 each)│ │ │
└──────────┘ └───────────┘ └───────────┘
│ ▲
└──┘ (continue until all distributed)
Each committer receives tokens proportional to their USD contribution:
user_tokens = (user_usd_contribution / total_usd_committed) × commit_return_amount
If distribution gets stuck (>1 hour or 5+ consecutive failures), the factory admin can trigger RecoverStuckStates to resume processing.
Configuration updates use a timelock mechanism:
- Admin calls
ProposeConfigUpdatewith new values - A 48-hour timelock is applied
- After the timelock expires,
UpdateConfigapplies the pending changes
Individual pool settings can also be updated through a timelocked process:
- Admin calls
ProposePoolConfigUpdatewith the pool ID and new values - A 48-hour timelock is applied
- After the timelock expires,
ExecutePoolConfigUpdateapplies the changes to the target pool
Pools can be migrated to new contract code in batches:
{
"upgrade_pools": {
"new_code_id": 42,
"pool_ids": [1, 2, 3],
"migrate_msg": "<binary>"
}
}- Processes up to 10 pools per transaction
- Automatically continues with
ContinuePoolUpgradeuntil all pools are migrated - Can target specific pools or upgrade all pools
The factory admin can pause individual pools, disabling all swap and liquidity operations while preserving state.
| Parameter | Value | Description |
|---|---|---|
| Commit threshold (USD) | 25,000 | USD value required to activate pool |
| Commit threshold (bluechip) | 100,000,000 | bluechip token threshold |
| Creator token mint cap | 1,500,000 | Max CW20 supply per pool |
| Max bluechip lock per pool | 10,000,000,000 | Excess is time-locked for creator |
| Creator excess lock period | 7 days | Time before creator can claim excess |
| Commit fee (protocol) | 1% | Sent to Bluechip wallet |
| Commit fee (creator) | 5% | Sent to creator wallet |
| LP swap fee | 0.3% | Distributed to liquidity providers |
| Max excess swap at threshold | 20% of pool reserves | Prevents single committer from dominating first trade |
| Max usd_payment_tolerance_bps | 1000 (10%) | Hard cap on oracle price drift tolerance |
| Creator token decimals | 6 | Enforced to match hardcoded payout amounts |
| Min commit interval | 13 seconds | Rate limit per wallet |
| Expand economy max mint | 500 | Max bluechip minted per pool creation |
| Oracle TWAP window | 3600 seconds | Time-weighted average price window |
| Oracle update interval | 300 seconds | Min time between price updates |
| Oracle price max age | 3000 seconds | Price considered stale after this |
| Min pool liquidity | 1,000 | Liquidity required to unpause pool |
| Distribution batch size | 40 | Max committers per distribution tx |
| Default slippage | 0.5% | Default max slippage for swaps |
| Max slippage | 50% | Hard cap on swap slippage |
# Build all contracts
cargo wasm
# Optimize for deployment
docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/optimizer:0.16.0cargo test- Deploy CW20-base contract (store code)
- Deploy CW721-base contract (store code)
- Deploy Expand Economy contract
- Deploy Factory contract with code IDs and Expand Economy address
- Create ATOM/bluechip oracle pool first
- Initialize internal oracle
- Creators can now create pools
To deploy to Bluechip Mainnet:
- Configure your wallet (ensure you have
bluechipdCLI tool) - Run the deployment script:
./deploy_mainnet.sh
- Update specific configurations in
deploy_mainnet.sh(Oracle address, Price Feed ID) if necessary.
- Website: https://www.bluechip.link/home
- Discord: https://discord.gg/gfdWgHFY
- Twitter: https://x.com/BlueChipCreate