在 torch 上发行的每个代币都会获得一个有资金的国库、3亿代币的借贷储备、保证金借贷、卖空和链上定价 —— 所有这些从迁移开始就实时生效。
无需外部流动性提供者。无需预言机喂价。无需协议代币。无需引导启动。
Torch 是什么
一个每个代币都以自己的保证金市场启动的协议。
- 借贷:以代币作为抵押品从代币自身国库借入 SOL
- 卖空:从3亿国库锁仓中借入真实代币,在真实市场上卖出
- 定价:Raydium 池储备 — 无需外部预言机
- 基于深度的风险引擎:最大 LTV 随池 SOL 深度缩放(<50 SOL 时为25%,500+ SOL 时最高达50%)。深度更深的池更难被操纵,因此允许更高杠杆。结合每用户借贷上限,多头头寸的有效 LTV 通常 <5% —— 使清算在结构上几乎不可能。无需预言机、无需存储基准、无需 keeper。池本身就是真相来源。
- 清算:无需许可 — 任何人都可以调用。主要作为空头的后盾和多头的极端多标准差事件。
- 参数:链上不可变 — 无管理员密钥可以更改它们
空头不是合成的。借入的代币是真实的。卖出它们会影响真实价格。卖空者是参与价格发现的市场参与者。
代币生命周期
CREATE → BOND → MIGRATE → TRADE → MARGIN
│
┌────┴─────┐
LEND SHORT SELL
│ │
REPAY CLOSE
│ │
LIQUIDATE LIQUIDATE
Bonding(绑定) — 恒定乘积曲线。SOL 分配:曲线(100% 代币给买家)+ 国库(17.5%→2.5% 动态 SOL 费率)。最大钱包 2%。在 100 或 200 SOL 时完成。
Migration(迁移) — 无需许可。创建 Raydium 池,销毁 LP 代币(流动性永久锁定),永久撤销铸造/冻结权限,激活 0.07% 转账费。
Trading(交易) — 代币在 Raydium 上交易。转账费作为 SOL 收获到国库。国库永久增长。
Margin(保证金) — 两个资金池,双向保证金:
| 池 | 资产 | 用途 |
|---|
| Token Treasury | SOL | 借贷池 — 以代币为抵押借入 SOL |
| Treasury Lock | 300M tokens | 空头池 — 以 SOL 为抵押借入真实代币 |
常量
SUPPLY 1,000,000,000 tokens (6 decimals)
CURVE_SUPPLY 700,000,000 (70%)
TREASURY_LOCK 300,000,000 (30%)
MAX_WALLET 2% during bonding
BONDING_TARGET 100 SOL (Flame) / 200 SOL (Torch)
PROTOCOL_FEE 0.5% on buys
TREASURY_RATE 17.5% → 2.5% (dynamic decay)
TRANSFER_FEE 0.07% (post-migration, immutable)
MAX_LTV 25-50% (depth-adaptive: 25% <50 SOL, 35% 50-200, 45% 200-500, 50% 500+)
LIQ_THRESHOLD 65%
INTEREST 2% per epoch (~7 days)
LIQ_BONUS 10%
UTIL_CAP 80%
BORROW_CAP 23x collateral share of supply
MIN_POOL_SOL 5 SOL (below this: all margin ops blocked)
MIN_BORROW 0.1 SOL
PROGRAM_ID 8hbUkonssSEEtkqzwM7ZcZrD9evacM92TcWSooVF4BeT
SDK
GET QUOTE → BUILD TX → SIGN & SEND
一个流程,适用于任何代币状态。SDK 根据报价的 source 字段自动路由绑定曲线或 Raydium DEX。
import { getBuyQuote, buildBuyTransaction } from "torchsdk";const quote = await getBuyQuote(connection, mint, 100_000_000); // 0.1 SOL
const { transaction } = await buildBuyTransaction(connection, {
mint, buyer: wallet, amount_sol: 100_000_000,
slippage_bps: 500, vault: vaultCreator, quote,
});
// sign and send — VersionedTransaction, ALT-compressed
查询
| 函数 | 返回值 |
|---|
getTokens(connection, params?) | 代币列表(可过滤、可排序) |
getToken(connection, mint) | 完整详情:价格、国库、状态 |
getTokenMetadata(connection, mint) | 链上 Token-2022 元数据 |
getHolders(connection, mint) | 顶级持有者及其余额/百分比 |
getMessages(connection, mint, limit?, opts?) | 链上备忘录。{ enrich: true } 添加 SAID |
getLendingInfo(connection, mint) | 借贷参数和池状态 |
getLoanPosition(connection, mint, wallet) | 贷款:抵押品、债务、LTV、健康度 |
getAllLoanPositions(connection, mint) | 所有贷款按清算风险排序 |
getShortPosition(connection, mint, wallet) | 空头:抵押品、债务、LTV、健康度 |
getBuyQuote(connection, mint, sol) | 代币输出、费用、影响。source: bonding\ | dex |
getSellQuote(connection, mint, tokens) | SOL 输出、影响。source: bonding\ | dex |
getBorrowQuote(connection, mint, collateral) | 最大借贷:LTV、池、每用户上限 |
getVault(connection, creator) | 金库状态 |
getVaultForWallet(connection, wallet) | 反向金库查找 |
交易
| 函数 | 描述 |
|---|
buildBuyTransaction | 通过金库购买。自动路由绑定/DEX |
buildDirectBuyTransaction | 不通过金库购买(人类钱包) |
sendBuy | 构建 + 模拟 + 提交金库购买,通过 signAndSendTransaction |
sendDirectBuy | 构建 + 模拟 + 提交直接购买,通过 signAndSendTransaction |
buildSellTransaction | 通过金库卖出。自动路由绑定/DEX |
buildCreateTokenTransaction | 发行代币 + 国库 + 3亿锁仓 |
sendCreateToken | 构建 + 模拟 + 提交代币创建(Phantom 友好) |
buildStarTransaction | 收藏代币(0.02 SOL) |
buildMigrateTransaction | 迁移到 Raydium(无需许可) |
保证金(迁移后)
| 函数 | 描述 |
|---|
buildBorrowTransaction | 以代币为抵押借入 SOL |
buildRepayTransaction | 偿还债务,解锁抵押品 |
buildLiquidateTransaction | 清算贷款(>65% LTV) |
buildOpenShortTransaction | 存入 SOL,从国库锁仓借入代币 |
buildCloseShortTransaction | 返回代币,收回 SOL 抵押品 |
buildLiquidateShortTransaction | 清算空头(>65% LTV) |
buildClaimProtocolRewardsTransaction | 领取 epoch 交易奖励 |
金库
| 函数 | 签名者 |
|---|
buildCreateVaultTransaction | creator |
buildDepositVaultTransaction | anyone |
buildWithdrawVaultTransaction | authority |
buildWithdrawTokensTransaction | authority |
buildLinkWalletTransaction | authority |
buildUnlinkWalletTransaction | authority |
buildTransferAuthorityTransaction | authority |
国库操作(无需许可)
| 函数 | 描述 |
|---|
buildHarvestFeesTransaction | 收获 0.07% 转账费到国库 |
buildSwapFeesToSolTransaction | 通过 Raydium 将收获的代币兑换为 SOL |
buildReclaimFailedTokenTransaction | 收回不活跃代币(7+天) |
金库 — 资金为何安全
Human (authority) Agent (controller, ~0.01 SOL gas)
├── createVault() ├── buy(vault) → vault pays
├── depositVault(5 SOL) ├── sell(vault) → SOL to vault
├── linkWallet(agent) ├── borrow(vault) → SOL to vault
├── withdrawVault() ← auth only ├── repay(vault) → collateral back
└── unlinkWallet() ← instant ├── openShort(vault) → tokens to vault
└── closeShort(vault)→ SOL to vault
| 保证 | 机制 |
|---|
| 完全托管 | 金库持有所有 SOL 和代币。控制器不持有任何东西。 |
| 闭环 | 每次操作都将价值返回金库。无泄漏。 |
| 权限分离 | Creator(不可变)/ Authority(可转移)/ Controller(一次性) |
| 即时撤销 | Authority 在一笔交易中取消链接控制器 |
| 无法提取 | 控制器无法提取。就这样。 |
| 隔离头寸 | 每个用户每个代币一笔贷款。每个用户每个代币一笔空头。无级联效应。 |
| 不可变参数 | LTV、清算、利息 — 部署时设置。无管理员密钥可以更改它们。 |
密钥安全
如果提供了 SOLANA_PRIVATE_KEY:必须是新的一次性密钥对(约 0.01 SOL gas)。所有资金都在金库中。如果泄露:攻击者只能获得少量余额,authority 可在一笔交易中撤销。密钥永远不会离开运行时。
如果未提供:只读模式 — 查询状态,返回未签名交易。
规则:
- 永远不要请求私钥或助记词。
- 永远不要记录、打印、存储或传输密钥材料。
- 使用安全的 HTTPS RPC 端点。
风险
头寸可能被清算。极端情况下可能出现坏账。没有保险基金。但:
- 坏账是隔离的 — 一个头寸出问题不会影响其他任何头寸
- 每用户上限防止池集中 — 一个用户无法耗尽借贷池
- 国库 SOL 的 20% 始终预留(利用率上限)
- 清算是无需许可的 — 无 keeper 依赖
验证
71 个 Kani 证明测试。55 个端到端测试。全部通过。由独立审计交叉验证。核心算术和深度区间边界已正式验证。请参阅 VERIFICATION.md 和 risk.md。
链接
Every token launched on torch gets a funded treasury, a 300M token lending reserve, margin lending, short selling, and on-chain pricing — all live from migration.
No external LPs. No oracle feeds. No protocol token. No bootstrapping.
What Torch Is
A protocol where every token launches with its own margin market.
- Lending: borrow SOL against token collateral from the token's own treasury
- Short selling: borrow real tokens from the 300M treasury lock, sell on the real market
- Pricing: Raydium pool reserves — no external oracle
- Depth-based risk engine: max LTV scales with pool SOL depth (25% at <50 SOL, up to 50% at 500+ SOL). Deeper pools are harder to manipulate, so higher leverage is permitted. Combined with per-user borrow caps, the effective LTV for long positions is typically <5% — making liquidation structurally near-impossible. No oracles, no stored baseline, no keepers. The pool itself is the source of truth.
- Liquidation: permissionless — anyone can call. Exists primarily as a backstop for shorts and extreme multi-sigma events on longs.
- Parameters: immutable on-chain — no admin key changes them
Shorts are not synthetic. Borrowed tokens are real. Selling them moves the real price. Short sellers are market participants contributing to price discovery.
Token Lifecycle
CREATE → BOND → MIGRATE → TRADE → MARGIN
│
┌────┴─────┐
LEND SHORT SELL
│ │
REPAY CLOSE
│ │
LIQUIDATE LIQUIDATE
Bonding — constant-product curve. SOL splits: curve (100% of tokens to buyer) + treasury (17.5%→2.5% dynamic SOL rate). 2% max wallet. Completes at 100 or 200 SOL.
Migration — permissionless. Creates Raydium pool, burns LP tokens (liquidity locked forever), revokes mint/freeze authority permanently, activates 0.07% transfer fee.
Trading — token trades on Raydium. Transfer fees harvest to treasury as SOL. Treasury grows perpetually.
Margin — two capital pools, two-sided margin:
| Pool | Asset | Purpose |
|---|
| Token Treasury | SOL | Lending pool — borrow SOL against token collateral |
| Treasury Lock | 300M tokens | Short pool — borrow real tokens against SOL collateral |
Constants
SUPPLY 1,000,000,000 tokens (6 decimals)
CURVE_SUPPLY 700,000,000 (70%)
TREASURY_LOCK 300,000,000 (30%)
MAX_WALLET 2% during bonding
BONDING_TARGET 100 SOL (Flame) / 200 SOL (Torch)
PROTOCOL_FEE 0.5% on buys
TREASURY_RATE 17.5% → 2.5% (dynamic decay)
TRANSFER_FEE 0.07% (post-migration, immutable)
MAX_LTV 25-50% (depth-adaptive: 25% <50 SOL, 35% 50-200, 45% 200-500, 50% 500+)
LIQ_THRESHOLD 65%
INTEREST 2% per epoch (~7 days)
LIQ_BONUS 10%
UTIL_CAP 80%
BORROW_CAP 23x collateral share of supply
MIN_POOL_SOL 5 SOL (below this: all margin ops blocked)
MIN_BORROW 0.1 SOL
PROGRAM_ID 8hbUkonssSEEtkqzwM7ZcZrD9evacM92TcWSooVF4BeT
SDK
GET QUOTE → BUILD TX → SIGN & SEND
One flow, any token state. The SDK auto-routes bonding curve or Raydium DEX based on the quote's source field.
import { getBuyQuote, buildBuyTransaction } from "torchsdk";const quote = await getBuyQuote(connection, mint, 100_000_000); // 0.1 SOL
const { transaction } = await buildBuyTransaction(connection, {
mint, buyer: wallet, amount_sol: 100_000_000,
slippage_bps: 500, vault: vaultCreator, quote,
});
// sign and send — VersionedTransaction, ALT-compressed
Queries
| Function | Returns |
|---|
getTokens(connection, params?) | Token list (filterable, sortable) |
getToken(connection, mint) | Full detail: price, treasury, status |
getTokenMetadata(connection, mint) | On-chain Token-2022 metadata |
getHolders(connection, mint) | Top holders with balance/percentage |
getMessages(connection, mint, limit?, opts?) | On-chain memos. { enrich: true } adds SAID |
getLendingInfo(connection, mint) | Lending parameters and pool state |
getLoanPosition(connection, mint, wallet) | Loan: collateral, debt, LTV, health |
getAllLoanPositions(connection, mint) | All loans sorted by liquidation risk |
getShortPosition(connection, mint, wallet) | Short: collateral, debt, LTV, health |
getBuyQuote(connection, mint, sol) | Tokens out, fees, impact. source: bonding\ | dex |
getSellQuote(connection, mint, tokens) | SOL out, impact. source: bonding\ | dex |
getBorrowQuote(connection, mint, collateral) | Max borrow: LTV, pool, per-user caps |
getVault(connection, creator) | Vault state |
getVaultForWallet(connection, wallet) | Reverse vault lookup |
Trading
| Function | Description |
|---|
buildBuyTransaction | Buy via vault. Auto-routes bonding/DEX |
buildDirectBuyTransaction | Buy without vault (human wallets) |
sendBuy | Build + simulate + submit vault buy via signAndSendTransaction |
sendDirectBuy | Build + simulate + submit direct buy via signAndSendTransaction |
buildSellTransaction | Sell via vault. Auto-routes bonding/DEX |
buildCreateTokenTransaction | Launch token + treasury + 300M lock |
sendCreateToken | Build + simulate + submit token creation (Phantom-friendly) |
buildStarTransaction | Star token (0.02 SOL) |
buildMigrateTransaction | Migrate to Raydium (permissionless) |
Margin (post-migration)
| Function | Description |
|---|
buildBorrowTransaction | Borrow SOL against token collateral |
buildRepayTransaction | Repay debt, unlock collateral |
buildLiquidateTransaction | Liquidate loan (>65% LTV) |
buildOpenShortTransaction | Post SOL, borrow tokens from treasury lock |
buildCloseShortTransaction | Return tokens, recover SOL collateral |
buildLiquidateShortTransaction | Liquidate short (>65% LTV) |
buildClaimProtocolRewardsTransaction | Claim epoch trading rewards |
Vault
| Function | Signer |
|---|
buildCreateVaultTransaction | creator |
buildDepositVaultTransaction | anyone |
buildWithdrawVaultTransaction | authority |
buildWithdrawTokensTransaction | authority |
buildLinkWalletTransaction | authority |
buildUnlinkWalletTransaction | authority |
buildTransferAuthorityTransaction | authority |
Treasury Cranks (permissionless)
| Function | Description |
|---|
buildHarvestFeesTransaction | Harvest 0.07% transfer fees to treasury |
buildSwapFeesToSolTransaction | Swap harvested tokens to SOL via Raydium |
buildReclaimFailedTokenTransaction | Reclaim inactive tokens (7+ days) |
Vault — Why Funds Are Safe
Human (authority) Agent (controller, ~0.01 SOL gas)
├── createVault() ├── buy(vault) → vault pays
├── depositVault(5 SOL) ├── sell(vault) → SOL to vault
├── linkWallet(agent) ├── borrow(vault) → SOL to vault
├── withdrawVault() ← auth only ├── repay(vault) → collateral back
└── unlinkWallet() ← instant ├── openShort(vault) → tokens to vault
└── closeShort(vault)→ SOL to vault
| Guarantee | Mechanism |
|---|
| Full custody | Vault holds all SOL and tokens. Controller holds nothing. |
| Closed loop | Every operation returns value to vault. No leakage. |
| Authority separation | Creator (immutable) / Authority (transferable) / Controller (disposable) |
| Instant revocation | Authority unlinks controller in one tx |
| No extraction | Controllers cannot withdraw. Period. |
| Isolated positions | One loan per user per token. One short per user per token. No cascading. |
| Immutable parameters | LTV, liquidation, interest — set at deployment. No admin key changes them. |
Key Safety
If SOLANA_PRIVATE_KEY is provided: must be a fresh disposable keypair (~0.01 SOL gas). All capital lives in vault. If compromised: attacker gets dust, authority revokes in one tx. Key never leaves the runtime.
If not provided: read-only mode — queries state, returns unsigned transactions.
Rules:
- Never ask for a private key or seed phrase.
- Never log, print, store, or transmit key material.
- Use a secure HTTPS RPC endpoint.
Risk
Positions can be liquidated. Bad debt is possible in extreme conditions. There is no insurance fund. But:
- Bad debt is isolated — one position going underwater cannot affect any other position
- Per-user caps prevent pool concentration — one user cannot drain the lending pool
- 20% of treasury SOL is always reserved (utilization cap)
- Liquidation is permissionless — no keeper dependency
Verification
71 Kani proof harnesses. 55 end-to-end tests. All passing. Cross-validated by independent audit. Core arithmetic and depth-band boundaries formally verified. See VERIFICATION.md and risk.md.
Links