Skip to content

Commit

Permalink
docs: Add taker comments
Browse files Browse the repository at this point in the history
  • Loading branch information
duanyytop committed Aug 22, 2024
1 parent 51ebcdd commit f1743d9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/order/taker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export const matchOrderOutputs = (orderCells: CKBComponents.LiveCell[]) => {

for (const orderCell of orderCells) {
const orderArgs = OrderArgs.fromHex(orderCell.output.lock.args)
// The UDT price DOES NOT include list package fee, so the output cell capacity of the seller in the taker transaction includes
// the UDT price and the capacity of the UDT DEX input capacity
const paySellerCapacity = orderArgs.totalValue + BigInt(append0x(orderCell.output.capacity))
sumSellerCapacity += paySellerCapacity
const output: CKBComponents.CellOutput = {
Expand All @@ -54,6 +56,7 @@ export const matchNftOrderCells = (orderCells: CKBComponents.LiveCell[], buyerLo
for (const orderCell of orderCells) {
const orderArgs = OrderArgs.fromHex(orderCell.output.lock.args)
const sellerLock = orderArgs.ownerLock
// The NFT price includes list package fee, so the output cell capacity of the seller in the taker transaction is same as the NFT price
dexSellerOutputsCapacity += orderArgs.totalValue
const output: CKBComponents.CellOutput = {
lock: sellerLock,
Expand Down

0 comments on commit f1743d9

Please sign in to comment.