A comprehensive guide to how Vypr Pad is designed and functions
Vypr Pad is a headless token launchpad built on Base chain using Vyper smart contracts. The system enables connectionless, approval-free token creation and trading through bonding curve economics. Unlike traditional DEXs that require wallet connections, function calls, and token approvals, Vypr Pad allows users to interact with tokens using simple ETH transfers and ERC20 transfers.
Sequence diagram showing the three main user interactions: token creation, buying tokens, and selling tokens
The platform is designed with AI agents, scripts, and autonomous systems in mind—any system that can send ETH or transfer tokens can interact with Vypr Pad without complex integration requirements.
Vypr Pad contracts are deployed on Base Mainnet and Base Sepolia. The factory contracts are accessible via ENS names for easy interaction.
vypr.eth| Contract | Address |
|---|---|
| Factory | 0x458366909fE9CfCB6baEC17F6adA9FFb6aA07bC5 |
| Token Blueprint | 0xF431C8C16a25AECf1aa7B2cF409659e429b0ac56 |
| Pool Blueprint | 0x5C64257aFf80B690341D1905Ea1FEcB17a151882 |
sepolia.vypr.eth| Contract | Address |
|---|---|
| Factory | 0x1278962a31fd330fA7eCF99756a502088C44353D |
| Token Blueprint | 0x21Ca1900466969aC909612560d9e460230f2b0Bd |
| Pool Blueprint | 0x458366909fE9CfCB6baEC17F6adA9FFb6aA07bC5 |
Note: Individual token and pool contracts are deployed dynamically when tokens are created. Use the factory address (or ENS name) to create new tokens, or query the factory to discover existing tokens.
The system uses a two-contract architecture to solve a critical UX problem with wallet software. Initially, a single contract was designed to handle both token and pool functionality. However, MetaMask and other wallet software block sending ETH directly to token contracts as a safety measure.
This separation allows users to send ETH to the pool contract (which MetaMask doesn't block) while maintaining full headless functionality. From the user's perspective, they interact with one canonical address (the pool), but the architecture works seamlessly with wallet UX constraints.
The BondingCurveFactory deploys pairs of BondingCurvePool and
BondingCurveToken contracts. Each pool and token are tightly coupled:
The factory contract is responsible for deploying new token/pool pairs. It uses blueprint contracts
for gas-efficient deployments via create_from_blueprint.
create_curve() - Deploy a new token/pool pair with custom parameters__default__() - Headless token creation: send ETH to factory to auto-create a tokenget_curve() - Retrieve token and pool addresses by index
The factory maintains mappings to track all created curves: pool_to_token,
token_to_pool, and creator_of for indexing and discovery.
The pool contract is the core of the bonding curve system. It holds the ETH reserve, calculates prices, and handles all buy/sell operations.
token - Address of the associated token contractreserve - Current ETH reserve (18 decimals)base_price - Starting price in 1e18 fixed pointslope - Price increase per token in 1e18 fixed pointfee_buy_bps / fee_sell_bps - Trading fees in basis pointsfee_recipient - Creator address (receives 80% of fees)protocol_recipient - Factory owner (receives 20% of fees)buy() - Explicit function to buy tokens with ETH__default__() - Headless minting: send ETH directly to pool addresssell() - Explicit function to sell tokens for ETHon_redeem() - Callback from token contract for headless redemptionget_price() - Calculate price at a given supply levelget_buy_amount_out() - Calculate tokens received for ETH inputget_sell_amount_out() - Calculate ETH received for token inputA standard ERC20 token with restricted mint/burn permissions. Only the associated pool can mint or burn tokens. The token implements headless redemption by detecting transfers to the pool address.
transfer() - Standard ERC20 transfer, with special handling for pool addresstransferFrom() - Standard ERC20 transferFrom, with special handling for pool addressmint() - Only callable by pool contractburn() - Only callable by pool contractWhen tokens are transferred to the pool address, the token contract automatically:
pool.on_redeem() with the sender's addressVypr Pad uses a linear bonding curve model where price increases linearly with supply. This creates predictable price discovery without requiring order books or liquidity pools.
The price at any supply level is calculated as:
P(s) = base_price + slope * s
Where:
P(s) = Price at supply level s (in ETH per token, 18 decimals)base_price = Starting price (1e18 fixed point)slope = Price increase per token (1e18 fixed point)s = Current token supply (18 decimals)When buying tokens, the cost is calculated by integrating the price function over the supply range:
cost = base_price * Δs + slope * ((s + Δs)² - s²) / 2
This is solved using the quadratic formula to determine how many tokens can be bought with a given
amount of ETH. The pool contract implements this in _calculate_tokens_for_eth().
When selling tokens, the refund is calculated using the average price over the tokens being sold:
refund = Δs * (base_price + slope * (2s - Δs) / 2)
This ensures sellers receive a fair price based on the bonding curve. The pool contract implements
this in _calculate_eth_for_tokens().
With base_price = 0.01 ETH and slope = 0.000001 ETH:
"Headless" refers to operations that don't require explicit function calls. Users can interact with tokens using simple transfers, making the system compatible with any wallet or script that can send ETH or transfer ERC20 tokens.
Users can buy tokens by simply sending ETH directly to the pool contract address. The pool's
__default__() fallback function automatically:
Users can sell tokens by transferring them to the pool contract address. The token contract's
transfer() function detects when the recipient is the pool and:
pool.on_redeem() with the sender's address
Users can create new tokens by sending ETH directly to the factory contract. The factory's
__default__() function:
The factory contract uses a blueprint pattern for gas-efficient deployments. Blueprint contracts are pre-deployed contracts whose bytecode is reused when creating new instances.
The factory maintains several mappings for indexing and discovery:
curves[index] - Array-like mapping of pool addressespool_to_token[pool] - Get token address from pooltoken_to_pool[token] - Get pool address from tokencreator_of[pool] - Get creator address from poolThese mappings enable the front-end to discover all tokens, link tokens to pools, and display creator information.
Trading fees are configurable per curve (up to 10% maximum) and are collected in ETH on both buy and sell operations. Fees are split between the token creator and the protocol.
fee_recipient (token creator)protocol_recipient (factory owner)
This split is hardcoded at PROTOCOL_FEE_SHARE_BPS = 2000 (20% of total fees).
fee = eth_in × fee_buy_bps ÷ 10000fee = eth_out_gross × fee_sell_bps ÷ 10000send() which will revert if the recipient is a contract
without a payable fallback function.
The front-end is a static web application built with Vue.js that provides real-time visibility into bonding curve activity. It connects to The Graph subgraph for efficient blockchain data querying.
The front-end supports multiple networks through the networks.js configuration file.
Each network specifies:
Users can switch networks via a dropdown, and the preference is saved in localStorage.
The Graph Studio API requires an API key for authentication, but API keys must never be exposed in client-side code. To solve this, Vypr Pad uses Netlify Edge Functions as a secure proxy.
/api/subgraph acts as a proxyGRAPH_API_KEY - The Graph Studio API keyGRAPH_STUDIO_URL - The Graph Studio query endpoint/api/subgraphFor local development, the front-end automatically detects when running on localhost and uses a public Graph Studio testing URL instead of the Netlify edge function. This allows developers to work locally without needing Netlify's environment variables.
The URL resolution logic in graph.js:
function resolveGraphApiUrl() {
// Check for localStorage override (for testing)
const override = window.localStorage?.getItem('vypr-pad-graph-endpoint');
if (override) {
return override;
}
// Detect localhost
const host = window.location?.hostname || '';
const isLocalhost = host === 'localhost' || host === '127.0.0.1' || host === '[::1]';
// Use testing URL for localhost, production edge function otherwise
return isLocalhost ? DEV_GRAPH_API_URL : PROD_GRAPH_API_URL;
}
This means:
/api/subgraph edge function with secure API key
Both pool and token contracts use boolean reentrancy guards (locked flag) to prevent
reentrancy attacks. All external calls are protected:
buy(), sell(), __default__(), on_redeem()transfer(), transferFrom()pool.on_redeem()Vyper's built-in safe math prevents integer overflow/underflow. All calculations use fixed-point arithmetic with 18 decimals for precision.
Sell operations verify that the calculated ETH output doesn't exceed the available reserve, preventing reserve depletion attacks.
The front-end uses The Graph subgraph for efficient data querying. The subgraph indexes:
CurveCreated events - New token deploymentsBought events - Token purchasesSold events - Token redemptionsTransfer events - Token transfers (for holder tracking)This allows the front-end to display comprehensive token information, trading history, and holder data without making expensive direct RPC calls for every piece of data.