What is Perpetuals?
Perpetuals lets anyone launch a token with a built-in perp strategy. A share of the token’s trading taxes goes into its vault, and the vault uses those funds to trade perpetual futures on Lighter.
At launch, the creator picks the token’s trading pair, buy and sell taxes, perp markets, long or short positions, leverage, and who can update the strategy. The creator also chooses how profits are split between token buybacks and holder dividends.
Perpetuals atomically creates the token, vault, custody contract, and initial strategy in the same transaction. From there, trading taxes fund the vault. When the perp strategy returns a profit, that profit can buy back the token, pay additional holder dividends, or do both.
How it works
The user launches through Perpetuals. The launch coordinator calls the Perpetuals vault factory and Flap’s VaultPortal, then completes the full setup atomically. If any part fails, the whole transaction reverts.
1. Launch the token and vault
The creator signs one launch transaction through Perpetuals. That transaction creates the Flap Tax Token V3, its launch market, the token’s strategy vault, its custody contract, and the initial strategy settings.
The custody contract is created during the launch. Its Lighter account is assigned later, when the custody contract makes its first USDG deposit to Lighter. The custody contract becomes the onchain owner of that account.
2. Trading taxes fund the vault
The token charges the buy and sell taxes chosen by the creator. Those taxes can be split between the vault, direct holder dividends, token burns, and liquidity.
When tax income reaches the vault, it is swapped into USDG and sent to the revenue router. The router assigns 75% to the token’s perp strategy and 25% to the protocol treasury.
USDG waiting to be deployed is held in one shared router, but every token’s balance is tracked separately.
3. The vault trades perps on Lighter
The router sends trading capital to the token’s custody contract. That contract deposits the USDG into the Lighter account it owns. A keeper then opens and manages the long and short positions saved in the token’s strategy.
The strategy settings are stored onchain. Orders, positions, balances, and PnL are handled on Lighter.
4. Profits return to the token
When funds come back from Lighter, the router separates the original trading capital from the profit. The original capital can be used again, while profit is split between:
- Buybacks: buy the launched token through Flap and send it to the burn address.
- Perp-profit dividends: convert profit into the chosen dividend asset and deposit it for holders.
5. Who controls the strategy
The deployer chooses the first strategy at launch. The control mode decides who can update it later:
- Fixed: the deployer sets the first strategy, then the vault follows the saved Fixed-mode strategy.
- DAO: the deployer sets the first strategy, then staked tokenholders vote on updates.
- Delegated: the deployer chooses a manager who can update the strategy.
The keeper reads the saved strategy and trades the token’s Lighter account to follow it.
How strategy withdrawals are protected
Every token receives a dedicated custody contract. That contract is the onchain owner of the token’s Lighter account, so strategy capital moves through a fixed path:
- The router releases capital only to that token’s custody contract.
- Custody deposits into the Lighter account it owns.
- Lighter secure withdrawals return to the same custody contract.
- Custody settles returned funds back to the revenue router.
Why an API key cannot change the withdrawal wallet
A smart contract has an address but no Ethereum private key, so nobody can produce a normal wallet signature for the custody address. The keeper uses a separate Lighter API key to trade the account.
Lighter allows that API key to request a secure withdrawal, but its secure-withdrawal rule fixes the destination to the same onchain address that created the Lighter account. Because the custody contract created and owns the account, withdrawn funds return to that custody contract.
Lighter’s Fast Withdrawal and Transfer features can send funds to another address only with the account owner’s Ethereum private-key signature. No such private key exists for the custody smart contract.
After the funds return, the custody contract can settle them only back to the Perpetuals revenue router. The custody and security page covers the complete role and contract-upgrade model.
Key terms
- Vault revenue
- The share of token tax sent to the strategy vault.
- Converted revenue
- Vault tax income after it has been swapped into USDG.
- Strategy capital
- The 75% share of converted revenue used by the Lighter strategy.
- Principal
- The vault’s original trading capital in custody or Lighter.
- Settled profit
- USDG brought back from Lighter after returned capital and recovered losses are separated.
- Protocol revenue
- The 25% share of converted revenue sent to the protocol treasury.
End-to-end flow
- The creator chooses the token, trading pair, taxes, perp strategy, control mode, and profit split.
- One launch creates the Flap token, vault, custody contract, and strategy settings.
- Trading taxes are split using the percentages chosen at launch. The vault share goes to the token’s vault.
- The vault swaps its tax income into USDG.
- The USDG is split: 75% funds the strategy and 25% goes to the protocol treasury.
- A keeper sends the strategy funds through the token’s custody contract into its Lighter account.
- The keeper opens and manages the requested perp positions.
- Withdrawn funds return to the same custody contract and then to the router, where returned capital and profit are separated.
- Profit is split between token buybacks and holder dividends using the percentages chosen at launch.
Where the money goes
Trading-tax allocation
The launch creator divides the token’s collected tax among four destinations. The percentages must add to 100%, and the vault must receive at least the protocol minimum.
- Vault
- Funds the strategy-capital and protocol-treasury split described below.
- Direct dividends
- Sends trading-tax revenue to eligible holders through the token’s Flap dividend system.
- Deflation
- Allocates trading-tax revenue to token burn.
- Liquidity
- Allocates trading-tax revenue to Flap liquidity handling.
Vault revenue split
100 USDG received by the revenue router
├── 75 USDG strategy capital
└── 25 USDG protocol treasury
├── 20 USDG protocol buyback budget
└── 5 USDG operating budgetThis split happens after the vault’s tax income has been swapped into USDG.
Strategy profit
When funds return from Lighter, the keeper states how much is original trading capital. That amount goes back into the strategy balance. Any amount recorded as profit is added to the token’s buyback and dividend balances.
The creator chooses what percentage of profit goes to holder dividends. The rest goes to token buybacks.
The tokenholder relationship
Tokenholders own the launched token in their wallets. Depending on the launch configuration, they may also be eligible for direct tax dividends, strategy-profit dividends, or DAO voting after staking.
The vault is not divided into shares for tokenholders. Its connection to the token comes through buybacks, dividends, and DAO voting when those options are enabled.
Continue reading
Start with Launching a token if you are preparing a launch. Read Strategy vaults and Perpetual strategies for the capital and execution model. Technical users can go directly to the contract reference.