Search…
⌃K

Claim rewards

After payments have been done to a loan, all liquidity providers earn a share of the BTC rewards. They claim this by completing a reward withdrawal.

Withdraw rewards

The withdraw-rewards() function on the supplier-interface contract is called to lock the rewards in the supplier-interface contract:
(define-public (withdraw-rewards
(btc-version (buff 1))
(btc-hash (buff 20))
(supplier-id uint)
(lp-token <lp-token>)
(token-id uint)
(lv <lv>)
(xbtc <ft>))
)

Parameters

Field name
Type
Description
btc-version
buff
Single byte representing the address type. 0x00 for P2PKH, 0x05 for P2SH.
btc-hash
buff
The hash in the bitcoin output address (see Magic Contract).
supplier-id
uint
Supplier-id of the chosen supplier on the Magic contract.
lp-token
lp-token
Contract principal using the lp-token-trait trait (current deployment is .lp-token).
token-id
uint
Token ID associated to the pool that we're withdrawing from.
lv
lv
Contract principal using the liquidity-vault-trait.
xbtc
ft
Contract principal of the fungible token representing bitcoin on the stacks blockchain.