Skip to content

tBTC Bridge fees reimbursement in SDK and UI #943

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

r-czajkowski
Copy link
Contributor

@r-czajkowski r-czajkowski commented May 8, 2025

Depends on: #942

For deposits below a certain threshold, the fees will be reimbursed from the fees reimbursement pool, funded by the Acre protocol.

UI changes

We want to display information that some of the fees may be covered by Acre.

Screenshots

obraz

SDK changes

BitcoinDepositor.calculateDepositFee

Check if the tBTC bridge fees will be reimbursed. The deposit amount must be below the reimbursement threshold. This function also takes into account the tBTC balance of the reimbursement pool balance - it means fees may be covered partially.

Protocol.estimateDepositFee

Checks if the tBTC fees can be fully covered.

Some of the fees may be covered by Acre, so we want to display
information about this in the tooltip.
Copy link

netlify bot commented May 8, 2025

Deploy Preview for acre-dapp failed.

Name Link
🔨 Latest commit 5cd3a99
🔍 Latest deploy log https://app.netlify.com/sites/acre-dapp/deploys/681f8811d8c3590008e4e2a7

Copy link

netlify bot commented May 8, 2025

Deploy Preview for acre-dapp-testnet failed.

Name Link
🔨 Latest commit 5cd3a99
🔍 Latest deploy log https://app.netlify.com/sites/acre-dapp-testnet/deploys/681f8811c6f2cb000821a4fd

@r-czajkowski r-czajkowski marked this pull request as draft May 8, 2025 19:55
@r-czajkowski r-czajkowski changed the title Deposit fees tBTC Bridge fees reimbursement in SDK and UI May 8, 2025
@r-czajkowski r-czajkowski added 🎨 dApp dApp 🔌 SDK TypeScript SDK Library labels May 8, 2025
It represents the `ERC20` token. We need to fetch the tBTC token balance
of the `ReimbursementPool` contract.
Add `bridgeFeesReimbursementThreshold` function it returns minimum
deposit amount threshold for tBTC Bridge fees reimbursement. For
deposits below this threshold, the fees will be reimbursed from the fees
reimbursement pool.
We need to get tBTC token balance of `ReimbursementPool` contract to
calculate the deposit fees correctly.
The tBTC bridge fees can be reimbursed when the deposit amount is less
than or equal the reimbursement threshold. We should also take into
account tBTC balance of the reimbursement pool. If there is insufficient
balance in the pool, fees will be partially reimbursed.
@r-czajkowski r-czajkowski requested a review from nkuba May 10, 2025 16:56
@r-czajkowski r-czajkowski self-assigned this May 10, 2025
We updated the `estimateDepositFee` function interface and we need to
adjust it in the dapp.
Update copy in the tooltip.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎨 dApp dApp 🔌 SDK TypeScript SDK Library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant