TBD54566975 / tbdex

56 stars 25 forks source link

Clarify what's included in `fee` and `amount` in tbdex Quote #331

Closed jiyoontbd closed 1 month ago

jiyoontbd commented 2 months ago

alice is using USD to send bob some MXN.

given this offering:

offering = {
    payoutUnitsPerPayinUnit: 16.00,
    payin: {
        methods: [
            {
                kind: 'CREDIT_CARD',
                fee: 0.25,
                min: 10,
                max: 100000,
            }
        ]
    },
    ...
}

then we can submit the RFQ like this

rfq = {
    payin: {
        amount: 100,
        kind: 'CREDIT_CARD',
        ...
    }
...
}

we can represent the quote in 3 ways. there's a couple questions:

  1. how much should the PFI charge alice?
    • Option A: $100.00 (same as rfq.payin.amount, that includes PFI's fee)
    • Option B: $100.25 (rfq.payin.amount plus PFI's fee on top)
  2. which representation is the correct one?
  3. how should the wallet consume and display the amount and fee returned from the Quote?

// alice pays $100.25 in total. bob gets 1661 MXN ($100.00 USD equivalent)
quote1 = {
    payin: {
        rate: 16.00,
        amount: 100, // <- this amount reflects actual USD to be converted to MXN, fee is NOT subtracted before conversion
        fee: 0.25
    },
    payout: {
        amount: 1600 // 100.00 * 16.00
    }
}

// alice pays $100.00 in total. bob gets 1596 MXN ($99.75 USD equivalent)
quote2 = {
    payin: {
        rate: 16.00,
        amount: 100, // <- this amount reflects total USD alice pays, including fees. fee IS subtracted before conversion
        fee: 0.25
    },
    payout: {
        amount: 1596 // 99.75 * 16.00
    }

}

// alice pays $100.00 in total. bob gets 1596 MXN ($99.75 USD equivalent)
quote3 = {
    payin: {
        rate: 16.00,
        amount: 99.75, // <- this amount reflects actual USD to be converted to MXN, fee IS subtracted before conversion
        fee: 0.25
    },
    payout: {
        amount: 1596 // 99.75 * 16.00
    }

}
jiyoontbd commented 2 months ago

@corcillo @mistermoe @ethan-tbd @yuntianlong2002

jiyoontbd commented 2 months ago

relevant PR w/ comments: https://github.com/TBD54566975/tbdex/pull/198

nburgess48 commented 2 months ago

Was wiring funds to a business today via Bank of America, and thought the way they handled this was pretty intuitive. The amount I wanted to send the business (i.e. the amount I entered in via my BofA wallet) was $1,162.58: IMG_3998

jiyoontbd commented 1 month ago

so per our last meeting i think we decided:

gonna work on spec changes given this is the correct decision

cc @mistermoe