Model the transaction as separate responsibilities
A crypto transaction is not one operation. It is a sequence of decisions and state changes: a user or service chooses an action, a wallet authorizes it, a network executes it, and a market or bridge may determine what the action is worth or where its result can move. Treating these as one “swap” or “transfer” hides distinct failure modes. A valid signature can authorize a harmful transaction; a transaction can execute while a user receives an unfavorable amount; and a bridge can create a second trust boundary after the first chain has settled.
For a product flow, draw each step with five fields: actor, input, authority, state changed, and evidence returned. For example, an interface might collect a recipient and amount, a wallet signs a transaction, a chain records execution, and an indexer later reports a balance. These are not interchangeable sources of truth. The wallet proves authorization under its key model; chain data proves what was included and executed; an indexer is a convenient interpretation that should be checked against an authoritative source when the consequence matters.
This decomposition also makes architecture review more useful. Ask which components hold secrets, which can initiate an irreversible action, and which only report information. Then identify the recovery route for each failure: reject before signing, replace or cancel a pending transaction where the network permits it, reconcile a delayed deposit, or pause withdrawals. Do not assume every chain or protocol offers every recovery option. The product should state what it can actually do, and tests should cover cases where recovery is unavailable.
Choose custody and signing boundaries deliberately
Custody is about who can use the key, not merely where a wallet screen appears. In a self-custody design, the user controls the signing key and the application requests authorization. In a custodial service, the operator controls or coordinates key access and takes on operational responsibilities such as withdrawal policy, key protection, reconciliation, and incident response. A backend that can trigger signing is a privileged system even if a separate component physically holds the secret. Cex Wallet is a useful reference point for the custodial case: its described components include wallet management, a signer and key management, deposit scanning, risk controls, and fund rebalancing. Builders can study these as separate responsibilities rather than importing the whole system as a single wallet feature. In particular, isolate the signer behind a narrow interface, require explicit authorization context, and log decisions without exposing secret material.
A practical withdrawal design should validate intent before the signing boundary. Check the destination format and network, amount and available balance, configured limits, and any policy requiring additional review. Bind approval to the exact transaction fields that will be signed; otherwise, a request can be altered between review and execution. Keep the policy decision and signer result separately observable, so operators can distinguish a rejected request, an unavailable signer, and a transaction that was signed but not yet confirmed.
Hardware signing changes the key-exposure profile, but it does not eliminate transaction risk. A device can keep a private key off the application host and still sign a transaction that the user has misunderstood or that the application constructed incorrectly. For a Tezos-specific flow, Tezos Ledger Application describes a Ledger application that keeps keys on the device and performs signing for activities such as baking or trading. A companion application should show the intended network, destination, amount, and relevant operation details before requesting approval, and should test rejection and device-disconnection paths as carefully as success.
Treat bridges as a new trust boundary
Moving value between networks is not just another transfer. A bridge workflow usually involves a source-chain action, some mechanism for observing or validating that action, and a destination-chain result. The exact mechanism varies by bridge, so builders must inspect its actual security model rather than infer guarantees from a user interface or token label. Questions include who or what attests to the source event, how destination execution is authorized, what happens during a pause, and whether users have a defined recovery process if the sequence stalls.
Represent a cross-network action as a state machine, not a single pending flag. Useful states include prepared, source transaction submitted, source transaction confirmed to the required standard, bridge processing, destination transaction submitted, completed, and failed or held for review. Persist transaction identifiers and network context for both sides. A timeout should trigger investigation, not an automatic retry that might duplicate an action. Make the user-facing status distinguish “source confirmed” from “destination available”; they are different claims.
Before supporting a bridge, define the application’s acceptable delay and failure behavior. Test source-chain reorganization or delayed confirmation where relevant, incorrect network selection, unavailable bridge services, and destination execution failure. Confirm how fees are displayed and whether the quoted amount can change before completion. Do not present a bridge as risk-free merely because the interface abstracts its steps. If your product cannot explain who controls a pause or how a stuck transfer is handled, that is a product limitation to disclose and a reason to defer integration.
Separate a trading signal from safe execution
Automated trading adds another layer: a program interprets market conditions and turns a strategy into signed orders or transactions. Strategy checks can reduce some classes of bad decisions, but they do not establish that a token is safe, that a pool has adequate depth, or that the eventual execution price will match an observed quote. A program’s ability to act repeatedly makes limits, monitoring, and a clear stop mechanism essential. Begin with a narrow strategy and explicit conditions rather than granting an automated process an unrestricted wallet.
For a Solana-oriented example, Solana Trading Bot is described as a TypeScript bot that monitors token-market conditions and automates buying and selling according to user-defined parameters, including checks related to pool burn and mint-renunciation indicators. That makes it a reference for studying how a strategy can consume conditions and produce actions; it does not make those indicators a complete safety assessment. A builder should inspect how conditions are obtained, how stale data is handled, and whether the execution path enforces independent spending and slippage limits.
Build a paper-trading or test environment before enabling real execution. Record the signal, the data timestamp, the proposed transaction, the simulated outcome, and the reason an action was rejected. Then test volatility, thin liquidity, failed transactions, partial service outages, and a sudden loss of access to the market data source. A useful guardrail is to cap exposure and require a human approval step while the strategy is being validated. Those controls reduce the scope of an error; they cannot guarantee favorable execution or prevent every market loss.
Measure liquidity at the point of execution
Liquidity is a property of a particular market and trade size, not a general endorsement of an asset. A displayed price may reflect a small trade, while a larger order moves through multiple price levels or changes a pool’s reserves. In an automated market maker, the pool’s current balances and pricing rule affect the amount received; in an order-book venue, available orders and their depth matter. In both cases, quotes are snapshots, not guarantees.
For each route, estimate the expected output and compare it with a user-approved minimum. Include network fees and any applicable protocol or service fees in the amount presentation. Set a deadline or quote-expiry policy where the execution mechanism supports it, and make the transaction fail rather than silently accept an outcome outside the user’s bound. Test the calculation against edge cases: very small trades, trade sizes near available depth, stale quotes, rounding, token decimal differences, and a route that becomes unavailable between quoting and submission.
Do not collapse liquidity checks into a single “safe” badge. Pool indicators, ownership or mint controls, and observed depth answer different questions and can be incomplete or change after inspection. A trading service should expose the evidence behind a decision, its age, and the limits of that evidence. When a product relies on an external quote or data provider, design for disagreement and outage: compare critical results with the execution source where feasible, reject implausible values, and avoid retrying a trade with looser safeguards simply to improve completion rates.
Make the path observable before expanding it
Start implementation with a transaction ledger that records intent and outcome without storing secrets. Capture a stable internal request identifier, user-authorized parameters, chain and asset identifiers, signing status, transaction identifiers, confirmation state, and the final observed balance change. Keep sensitive fields out of logs, and control access to operational records. This ledger makes it possible to reconcile what the application requested with what the network reports, and to investigate a gap between a signed operation and a credited balance.
A wallet that keeps keys on a device offers a different operational model from a server-side signer. Openwallet is described as an Android light wallet with on-device keys and mnemonic-based recovery across multiple currencies. Builders can use that distinction to frame a recovery review: explain what the user must preserve, test restoration in a controlled environment, and ensure the application does not accidentally send recovery material to telemetry or backend services. Recovery language should be precise; a mnemonic is sensitive key material, not an ordinary account password.
Before connecting custody, bridge, and market components into one product, test each boundary independently and then test the handoffs. Use a mock signer to verify policy enforcement, a controlled chain environment to exercise confirmation and retry behavior, and simulated market data to test slippage limits. These are test strategies, not evidence that independently developed repositories interoperate. Integration should proceed only after you have verified supported networks, transaction formats, dependencies, and failure semantics for the exact versions you intend to use.
The next useful step is a threat model tied to the user journey. For every irreversible action, name the authority that permits it, the evidence presented to the user, and the system that can stop it. Then assign an owner for monitoring, reconciliation, and incident response. A product may ultimately combine self-custody, custodial services, bridging, and trading, but those are separate design decisions. Keeping them separate makes the transaction easier to explain, test, and constrain when one component fails.

