Alkanex Trading Bot Docs

What it takes to make Bitcoin DeFi feel simple

You paste a token id and tap Buy. Underneath: packages that confirm in one block, routing by realized output, and locks so two flows can never grab the same coin.

Trading on Bitcoin L1 is not like trading on a chain with accounts. There is no balance sitting in a slot waiting to be decremented. There is no nonce keeping your transactions in order. There are UTXOs, and every single trade is a UTXO problem before it is a trading problem.

Alkanex is a Telegram bot. You paste a token id, you tap Buy, you get the token. That is the whole surface.

Underneath it is a machine built specifically for how Bitcoin actually works. Here is what is down there.

1. A trade is two transactions, and they land in the same block

To buy an Alkanes token with BTC, your BTC has to become frBTC first, and then that frBTC gets swapped. That is two transactions, and the second one spends an output of the first.

The obvious way to do this is to broadcast the first transaction, wait for it to confirm, then broadcast the second. That is two to five blocks of standing still while the price moves without you.

We do not wait.

We build both transactions up front, we never broadcast the parent on its own, and we hand them to the network as a single package where the child pays the fee for both. Miners take them as one unit. Parent and child confirm in the same block.

This is not a diagram. It runs on mainnet, with real money, in both directions, buys and sells.

2. The best route is not the shortest route

The obvious path is often the wrong one. A single hop through a shallow pool can cost you far more than a longer path through a deep one, because what you lose to impact on thin liquidity dwarfs anything you save by skipping a hop.

So our router does not rank by hop count. It ranks by what you actually end up holding, with a depth rule on the frBTC leg so a deep pool always beats a thin one.

The difference is not academic. We have watched trades that were headed for real damage on a shallow route land on a deep pool with almost none.

Fewest hops is a habit. Realized output is the answer.

3. Your slippage protection is enforced by Bitcoin, not by us

Every swap we build carries a minimum output, taken from your slippage setting and written into the transaction itself.

If the pool moves against you between the quote and the block, the contract reverts and your funds come back. This is not a check our server runs and hopes for the best. It is a condition Bitcoin enforces.

We could go offline in the middle of your trade and that guarantee would still hold.

4. Concurrency is solved with locks, not with luck

The real way a Bitcoin trading bot loses money is two operations reaching for the same UTXO at the same time. A trade funding its fee from the same output a withdrawal already committed to. A wrap and an unwrap picking the same coin. Nothing looks wrong until money is gone.

So we built one global lock table. Every flow that touches a coin, trade fees, wrap, unwrap, withdraw, auto split, has to claim it there in the same database transaction that writes its own state, behind an index that allows exactly one live claim per coin. When two flows race, one of them loses cleanly, before anything is signed.

And once a transaction has been signed, its claim can never be released without on chain proof that it was invalidated. That is not a rule we ask developers to remember. It is enforced inside the query itself, so no code path can get it wrong, including code we have not written yet.

5. UTXO hygiene, handled while you trade

Alkanes swaps can hand you back a single output with your new token and your leftover frBTC sitting on it together. It looks fine. Then your next trade fails, because there is no clean single asset input left to spend.

We detect that and un mix the output while your trade is still in progress. No button, no maintenance screen, no support ticket. The split is a pure protorune edict transaction that pins each asset to its own output, so nothing can burn.

The rules around it are strict. The fee comes only from confirmed plain BTC. An output carrying assets is never spent as a fee input. And if there is no safe way to fund the split, we stop before signing anything at all.

On a money path, the only acceptable way to fail is cleanly.

6. Shipping code does not eat your trade

When we deploy, the running bot drains and hands off cleanly, and the new one reads the database at boot and picks up every in flight trade, unwrap, bridge and withdrawal exactly where it left off. On top of that, a heal loop runs continuously and re drives anything that stalled.

We ship often. Your trade never finds out.

7. A failed read is an error, never a zero

If a balance read fails, you get an error and a retry. We never render a zero.

This sounds like a detail. It is not. A zero shown for a failed read is exactly how a person concludes their money is gone, and how downstream code concludes there is nothing left to spend. Both of those are expensive.

So the rule is absolute. A read either succeeded or it did not, and we say which.

8. Your keys, and the layers around them

Alkanex signs for you, because one tap is the entire point of the product. That makes how we hold your keys the most important engineering decision in the whole system, and we treat it that way.

Your seed never exists in plain text anywhere we keep data. Not in the database, not in the logs, not in a backup. It is encrypted with a key unique to your wallet, and that key is itself sealed under a master key held in a managed key service, the same envelope pattern used for data at rest at cloud scale. Backups land in write once storage that cannot be edited after the fact, not even by us.

On top of that, you can put a PIN and 2FA in front of your money. Both optional, both worth turning on. Once they are on, moving funds out requires something that lives with you and nowhere else, so a session someone else got hold of is not enough to move a satoshi.

And your wallet is genuinely yours. You can reveal your seed whenever you want, import it anywhere, and walk out with everything. No ticket, no waiting period, no permission.

9. Your buy mines DIESEL on the way through

DIESEL is not bought into existence. It is minted by transactions. Which means every Bitcoin transaction you were already going to pay for is a mint you are leaving on the table.

So we take it for you. When you buy through Alkanex, the DIESEL mint rides on the exact same transaction that carries your swap. Same transaction, same fee you were already paying, no extra step, no second button, nothing to opt into.

And it mints to your wallet. Not ours.

You came to buy a token. You leave holding the token and DIESEL.

10. The things that come along for free

Your choice of payout on a sell, native BTC or frBTC. Fee tiers you set once and forget. Live token cards with price, liquidity, holders, route and chart. A portfolio with real cost basis and PnL. Withdraw to any Bitcoin address. Full English and 中文, in the bot and in the docs.

What is next, starting this week

The biggest thing standing between most people and Alkanes has never been the trading. It has been getting to Bitcoin in the first place. If your money is sitting on another chain, the road here is long enough that plenty of people simply never arrive.

That road is what we are removing this week. Bridging from any chain straight into Alkanex, so you show up holding whatever you already hold and start trading. Full announcement Monday.

Right behind it: pizza.fun integration. Trading pizza.fun launches directly inside the bot, in a couple of taps, with everything above already running underneath them. New launches are where speed matters most, and this whole machine was built for exactly that moment.

Why this matters

None of the work above is visible. Nobody opens a Telegram bot to admire a lock table.

But it is the difference between a trade that goes through and a trade that quietly dies, between a fee spent and a fee wasted, between "it worked" and "it works every time". Bitcoin does not forgive sloppiness at the UTXO layer, and every shortcut gets paid for in someone's real money.

We are not trying to make Bitcoin look like something it is not. We did the UTXO work so you never have to.

Try it: https://t.me/AlkanexBot

Docs: alkanex.app/docs


阅读中文版: 让比特币 DeFi 变简单,底下要做多少事

On this page