Developers Forum for XinFin XDC Network

Galaxy
Galaxy

Posted on

Single-token LP staking on XDC: approvals, exits and risk-aware UX

I'm part of the BBBFiSwap team. We have added a single-token entry path for the BBB/XDC liquidity pool, and this write-up explains the transaction model and the UX decisions. We would welcome developer feedback, especially on communicating LP exposure and withdrawal choices.

A simpler input does not change the underlying position

The new default, Easy stake, accepts BBB or native XDC. It swaps part of the input, supplies both assets to the BBB/XDC pool and stakes the resulting liquidity-provider tokens. This is an LP position, not XDC validator staking or a principal-protected single-asset deposit.

The original LP staking / Advanced entry remains available for people who already have LP. Existing positions do not need to migrate just to continue using that path.

Approval and execution are different states

For a first BBB deposit, the wallet may need to approve token spending before submitting the deposit transaction. Approval alone does not create LP or start earning rewards. Native XDC input still requires a transaction and enough XDC left for gas.

A useful mental model is:

  1. Select the input asset and amount.
  2. Review the current quote, price impact, slippage and minimum output.
  3. Approve BBB if the current allowance is insufficient.
  4. Submit the deposit and wait for confirmation before treating the position as created.

Quotes are estimates, not executed results. Direct transfers to a contract are not a substitute for calling the entry function and may be unrecoverable. The interface keeps high-price-impact warnings visible; a warning should not be interpreted as an assurance that proceeding is economical.

Why exits have three output choices

The default withdrawal asset follows the original deposit bucket, but the user can choose BBB, XDC or LP. Partial withdrawals are supported.

Returning the original token type does not guarantee returning the original amount. Pool price changes, impermanent loss, swap costs and transaction ordering can affect the result. Users should inspect the exit quote rather than assuming that an input of N tokens implies an exit of N tokens.

LP-only withdrawal avoids converting the LP into a single token. It does not claim rewards: BBB rewards remain separately claimable. For other exit routes, the interface offers a separate reward-claim option, and claimed rewards are paid in BBB regardless of the selected withdrawal asset. Receiving LP is also different from removing liquidity into its underlying tokens.

Rates, fees and verification boundaries

The convenience feature adds no reward allocation and does not restart the existing 90-day season. The deposit preview estimates APR using the post-deposit state. Participation, valuations and prices change that estimate; an annualized rate is neither a guaranteed return nor the return over the remaining season.

There is no additional Easy stake service fee. DEX swap fees and network gas still apply. LP price risk, impermanent loss, price impact, smart-contract risk and execution risk remain.

The deployed XDC entry contract is 0x2737D88a098Ec597F5eFE96f3d6F46CC3Bc766a6. Its implementation is 0x685f96614792a898080A62D5EF93970cF4D76377. Explorer source verification and our automated tests are not an independent security audit or a guarantee of safety.

Reference interface and discussion

The walkthrough uses real production-interface screenshots with English captions; it does not demonstrate completed mainnet transactions.

For builders: how would you distinguish the selected exit asset from the underlying LP exposure? Should the input-token bucket, LP amount, minimum output and separately claimable BBB be shown together before confirmation? We'd appreciate concrete feedback on these choices. This is a team-authored implementation note, not an XDC Foundation endorsement or investment recommendation.

Discussion (0)