概述Overview
博弈 Gambit 是 BNB 智能链上的点对点场外交易台。持有者可以把一整包 BEP-20 代币直接卖给愿意接手的人;买家也可以存入 BNB,公开或私下求购一整包。成交不经过任何 AMM 池子。
为什么需要它:大多数小币的流动性只在一两个池子里。池子按曲线定价,单笔越大价格越差,K 线也被砸得越狠。拆单要花时间、价格照样流失;在群里找买家先打款,则要把信任交给陌生人。交易台把"一手交钱、一手交货"写进合约:代币和 BNB 在同一笔交易里换手,要么都成功,要么都不发生。
- 卖单(Ask):代币留在卖方钱包,交易台只拿到挂出数量的授权。
- 买单(Bid):买方的 BNB 托管在合约里,报价有真金白银支撑,买方随时可撤。
- 私密报价:指定一个对手钱包,只有它能成交;把链接发给对方即可。
- 无后台:报价簿就是合约存储,本站通过公共节点读取,交易由你自己的钱包签名。
它不是做市商:没人给你报价,需要真有人愿意站在另一边。它也不是路由器:交易台不碰 PancakeSwap,不会给你更好的池价。
博弈 Gambit is a peer-to-peer OTC desk on BNB Smart Chain. A holder can sell a whole bag of a BEP-20 token straight to someone who wants it; a buyer can escrow BNB and bid for a bag, openly or privately. No fill touches an AMM pool.
Why: most small caps keep their liquidity in one or two pools. A pool prices on a curve — the bigger the trade, the worse the price and the harder the chart drops. Splitting a sale over days still leaks value; finding a buyer in a chat and sending first means trusting a stranger. The desk writes "cash on delivery" into a contract: tokens and BNB change hands in one transaction, or nothing happens.
- Asks: tokens stay in the seller's wallet; the desk only holds an approval for the listed amount.
- Bids: the buyer's BNB is escrowed in the contract, so the bid is real. The buyer can cancel at any time.
- Private offers: name one wallet and only it can fill. Send it the link.
- No backend: the book is the contract's storage. This site reads it through public nodes; you sign with your own wallet.
It is not a market maker — someone has to want the other side. It is not a router either — the desk never touches PancakeSwap and cannot get you a better pool price.
交割流程How settlement works
卖单An ask
- 卖方对交易台
approve正好挂出的数量。 - 卖方调用
postAsk(token, amount, priceWei, taker, expiry, partialOk),合约检查余额与授权后写入存储。 - 买方调用
takeAsk(id, amount)并附带 BNB。合约按比例计算价格(向上取整),从卖方钱包把代币直接转给买方,把 BNB 扣除手续费后付给卖方,多付的退回。 - 允许部分成交时可以多次吃单;最后一笔正好支付剩余价格,总额精确到 wei,不留尘埃。
- The seller
approves the desk for exactly the listed amount. - The seller calls
postAsk(token, amount, priceWei, taker, expiry, partialOk); the contract checks balance and approval, then stores it. - A buyer calls
takeAsk(id, amount)with BNB. The cost is pro rata, rounded up; tokens go seller → buyer directly, the seller is paid in BNB minus the fee, and any extra BNB is refunded. - With partial fills on, it can be taken in pieces; the last piece pays exactly what remains, so the total is exact to the wei.
买单A bid
- 买方调用
postBid(token, amount, taker, expiry, partialOk),把 BNB 作为msg.value存入。 - 持有者授权后调用
takeBid(id, amount):代币转给买方,持有者从托管中收到 BNB(向下取整,扣手续费);最后一笔拿走全部剩余托管。 - 买方随时可
cancelBid取回剩余 BNB;过期后任何人都可以关闭,退款仍然只回到买方。
- The buyer calls
postBid(token, amount, taker, expiry, partialOk)with the BNB asmsg.value. - A holder approves and calls
takeBid(id, amount): tokens go to the buyer, the holder is paid from escrow (rounded down, minus the fee); the last piece takes everything left. - The buyer can
cancelBidany time for the remaining BNB; after expiry anyone can close it, and the refund still only goes to the buyer.
合约会检查What the contract checks
- 每次代币转移都测量收款方前后余额;收到的少于约定数量(转账税、通缩)就整笔回滚,报
TokenTaxed。只在池子买卖时收税、钱包间转账不收税的代币可以正常成交。 - 卖单直接从卖方钱包扣币:卖方若已卖掉或撤销授权,成交失败,买方 BNB 不动。
- 有效期必须在现在到 30 天之间;不能和自己成交;所有状态变更都有重入锁。
- Every token move is measured at the receiver before and after. If less arrives than agreed (transfer tax, rebase down) the whole fill reverts with
TokenTaxed. Tokens that only tax pool buys/sells and leave wallet-to-wallet transfers alone settle normally. - An ask is filled straight from the seller's wallet: if the tokens or the approval are gone, the fill fails and the buyer's BNB stays put.
- Expiry must be between now and 30 days; self-trades revert; every state change sits behind a reentrancy lock.
快速上手Quickstart
- 打开报价簿,点"连接钱包",按提示切换到 BNB 智能链(56)。
- 在右侧(手机在下方)"发布报价"选"卖一包"或"收一包",搜索代币或粘贴地址。
- 填数量,点 −10% / −5% / 池价 / +5% 或手动输入 BNB 总价。
- 选有效期、是否允许部分成交,需要的话填写对手钱包。
- 在钱包中确认。卖单先授权再挂单;买单一次签名。挂出后复制分享链接
offer.html#ask/编号。
- Open Offers, press Connect and switch to BNB Smart Chain (56) when asked.
- In "Post an offer" choose Sell a bag or Buy a bag and search the token or paste its address.
- Type the amount, then press −10% / −5% / Pool / +5% or type a total in BNB.
- Choose the expiry, partial fills, and optionally one private taker.
- Confirm in your wallet — an ask is approve then post; a bid is one signature. Then copy the share link
offer.html#ask/<id>.
命令行(Foundry cast):From the command line (Foundry cast):
RPC=https://bsc-dataseed.bnbchain.org # approve 1,000,000 tokens (18 decimals) cast send $TOKEN "approve(address,uint256)" $DESK 1000000ether --rpc-url $RPC --account me # ask 5 BNB for all of it, anyone, 3 days, partial ok cast send $DESK "postAsk(address,uint256,uint256,address,uint64,bool)" \ $TOKEN 1000000ether 5ether 0x0000000000000000000000000000000000000000 \ $(( $(date +%s) + 259200 )) true --rpc-url $RPC --account me # quote a fill of 250,000 on ask 0 (kind 0 = ask, 1 = bid) cast call $DESK "quoteFill(uint8,uint256,uint256)(uint256)" 0 0 250000ether --rpc-url $RPC # take it cast send $DESK "takeAsk(uint256,uint256)" 0 250000ether --value 1.25ether --rpc-url $RPC --account buyer
术语Terms
| 词Term | 含义Meaning |
|---|---|
| 一包Bag | 某个代币的一笔整量,在一笔交易里换手。A size of one token that changes hands in one transaction. |
| 卖单 / 买单Ask / Bid | 以 BNB 总价卖出 / 买入一定数量。卖单不托管任何东西,买单托管 BNB。Sell / buy an amount for a total in BNB. Asks hold nothing; bids escrow BNB. |
| 挂单者 / 接单者Maker / Taker | 发布报价的钱包 / 成交报价的钱包。The wallet that posted / the wallet that fills. |
| 对比池价vs pool | 报价单价相对池子中间价的偏离。−5% 即比池价低 5%。注意池子中间价在大额下根本成交不到。The offer's per-token price against the pool mid price. −5% = 5% below. The mid price is not something you can actually get at size. |
| 编号Serial | 卖单 A000012、买单 B000003,分别计数。A000012 for asks, B000003 for bids, counted separately. |
| 通行证Fee pass | 任一方持有足量通行证代币,该笔成交免手续费。If either side holds enough of the pass token, that fill is fee-free. |
池子冲击怎么算How pool impact is estimated
按 PancakeSwap v2 的恒定乘积模型。池子单边价值为 R(报告流动性 L = 2R),按中间价价值 D 的一包卖进去:Using the constant-product model of PancakeSwap v2. One side of the pool is worth R (reported liquidity L = 2R). Selling a bag worth D at mid:
proceeds = D · R / (R + D) · 0.9975 # 0.25% LP fee price after = price · (R / (R + D))² lost = D − proceeds desk fee = D · 0.003 # 0 with the pass; chart unchanged
示例:总流动性 $2,000,000(单边 $1,000,000)Example: a $2,000,000 pool ($1,000,000 per side)
| 规模Size | K 线Chart | 池子付Pool pays | 损失Lost | 交易台费Desk fee |
|---|---|---|---|---|
| $25,000 | −4.82% | $24,329 | $671 (2.68%) | $75 |
| $75,000 | −13.47% | $69,593 | $5,407 (7.21%) | $225 |
| $150,000 | −24.39% | $130,109 | $19,891 (13.26%) | $450 |
| $300,000 | −40.83% | $230,192 | $69,808 (23.27%) | $900 |
| $600,000 | −60.94% | $374,062 | $225,938 (37.66%) | $1,800 |
- V3 集中流动性:价格附近可能比公式更深,超出区间则更薄。
- 多个池子:本站把该代币 BNB 链上所有池子的流动性加总,近似一次良好路由。
- 套利:砸盘后机器人会回补一部分,表中为瞬时冲击。
- 数据来自 DexScreener,仅供参考,从不进入交易。仍在发射平台(如 Flap、four.meme)曲线上的代币没有池子数据,估算不适用。
- v3 pools: concentrated liquidity can be deeper than the formula near the price and much thinner past the range.
- Several pools: the site sums the liquidity of every BNB Chain pool of the token, close to what a well-routed sale gets.
- Arbitrage: bots buy back part of a dump; the table shows the instant move.
- Market data comes from DexScreener, is for reference only and never enters a transaction. Tokens still on a launchpad curve (e.g. Flap, four.meme) have no pool data, so the estimate does not apply.
费用与通行证Fees & the pass
- 只在成交时收取,按 BNB 成交额的
feeBps,部署时为 30(0.30%),由卖方承担(从卖方所得中扣除)。挂单、撤单只花 gas。 - 所有者可调整费率,但代码写死上限
MAX_FEE_BPS = 50(0.50%)。调整只影响之后的成交,不改变任何报价的价格。 - 通行证:
passToken与passMin由所有者设置;成交双方任一方持有 ≥passMin,手续费为 0。当前:持有 ≥ 1,000,000 博弈(0xb323…7777)免手续费。 - 手续费带 gas 上限推送到
feeTo;推送失败则记入feesOwed,任何人都可以调用flushFees()补发。手续费钱包出问题永远不会卡住成交。
- Charged on fills only:
feeBpsof the BNB, 30 (0.30%) at deploy, paid by the seller (taken from what the seller receives). Posting and cancelling cost gas only. - The owner can change the rate, but the code caps it at
MAX_FEE_BPS = 50(0.50%). A change applies to later fills and never touches an offer's price. - Fee pass: the owner sets
passTokenandpassMin; if either side holds ≥passMin, the fee is 0. Now: hold ≥ 1,000,000 博弈 (0xb323…7777) to trade fee-free. - Fees are pushed to
feeTowith a gas cap. If the push fails the fee is kept infeesOwedand anyone can callflushFees(). A broken fee wallet can never block a trade.
合约Contract
BoyiDesk,Solidity 0.8.26,无代理、无外部依赖、不可升级、无暂停。所有者只能改费率(有上限)、手续费钱包和通行证,没有任何触碰用户资金的管理路径。BoyiDesk, Solidity 0.8.26: no proxy, no external dependencies, no upgrade, no pause. The owner can only change the fee (capped), the fee wallet and the pass — there is no admin path to user funds.
写函数Write functions
postAsk(token, amount, priceWei, taker, expiry, partialOk) | 挂卖单,需余额与授权,返回编号List; needs balance + approval; returns id |
takeAsk(id, amount) payable | 买入;价格向上取整,多付退回Buy; cost rounds up; extra refunded |
cancelAsk(id) | 仅挂单者Maker only |
postBid(token, amount, taker, expiry, partialOk) payable | 托管 msg.value 求购,返回编号Escrow msg.value; returns id |
takeBid(id, amount) | 卖给买单;所得向下取整Sell into it; payout rounds down |
cancelBid(id) | 挂单者随时;过期后任何人;退款给挂单者Maker anytime, anyone after expiry; refund to maker |
flushFees() | 任何人;补发推送失败的手续费Anyone; sends fees whose push failed |
读函数Read functions
getAsk(id) · getBid(id) → (maker, expiry, partialOk, cancelled, token, taker, amount, remaining, price, remainingPrice) · nextAskId() · nextBidId() · quoteFill(kind, id, amount) · quoteFee(payer, counterparty, gross) · settings() · escrowTotal() · feesOwed()
事件Events
AskPosted(id, maker, token, taker, amount, priceWei, expiry, partialOk) BidPosted(id, maker, token, taker, amount, priceWei, expiry, partialOk) AskTaken(id, maker, taker, token, amount, ethGross, fee) BidTaken(id, maker, taker, token, amount, ethGross, fee) Cancelled(kind, id, by) FeeSet(feeBps) · FeeToSet(feeTo) · PassSet(token, minBalance) FeesFlushed(to, amount) · FeeDeferred(amount) · OwnershipTransferred(from, to)
错误Errors
NoBalance NoAllowance Expired Closed NotFound NotTaker NotMaker NotExpired ExceedsRemaining PartialNotAllowed InsufficientValue TokenTaxed SelfTrade BadExpiry BadAmount BadPrice BadToken TransferFailed Reentrancy
FAQ
为什么不直接在池子里卖?Why not just sell in the pool?
小额就去池子,又快又随时可用。交易台适合那些曲线会吃掉真金白银、或者你和社区在意 K 线的规模。For small sizes, do — the pool is fast and always there. The desk is for sizes where the curve costs real money, or where the chart matters to you or your community.
交易台会拿着我的代币吗?Does the desk hold my tokens?
卖单不会,代币直到成交那一刻都在你钱包里。买单期间,合约托管买方的 BNB,直到成交、撤单或过期关闭。For an ask, no — the tokens stay in your wallet until the moment of the fill. For a bid, the contract holds the buyer's BNB until it is filled, cancelled or closed after expiry.
有人能不付钱就吃我的单吗?Can someone fill my ask without paying?
不能。附带的 BNB 不够,takeAsk 直接回滚;代币和 BNB 在同一次调用里移动。No. takeAsk reverts unless the attached BNB covers the cost, and the tokens move in the same call.
支持哪些代币?Which tokens work?
BNB 智能链上的标准 BEP-20,无白名单。每笔转账都扣税或通缩的代币会在成交时被拒。还在 Flap 等发射平台曲线上的代币,只要钱包间可以转账,也能在这里交易。Any standard BEP-20 on BNB Smart Chain; there is no allowlist. Tokens that tax every transfer or rebase down are rejected at fill time. Tokens still on a launchpad curve such as Flap can trade here as long as wallet-to-wallet transfers work.
能改价吗?Can I change the price?
可以,在报价详情页"改价"。链上价格不会被修改,网站会撤掉旧单再按新价挂出剩余数量,需要两次签名。Yes, from the offer page. A posted price never changes on chain; the site cancels the old offer and posts the remaining size at the new price, in two signatures.
买家会在 K 线上看到吗?Does it show on the chart?
不会,成交不经过池子。但转账本身在 BscScan 上是公开的。No — nothing touches a pool. The transfer itself is public on BscScan like any other.
有最小金额吗?Is there a minimum size?
没有,但太小的单子 gas 不划算。No, but gas makes tiny offers pointless.
密封拍卖呢?What about sealed auctions?
计划在第二阶段推出,当前合约不包含。Planned for phase two; not in the current contract.