Skip to content

Commit

Permalink
Merge branch 'develop' into fix-multi-hop-thorchain
Browse files Browse the repository at this point in the history
  • Loading branch information
gomesalexandre authored Dec 13, 2023
2 parents 8090297 + dbbd6c4 commit fae8c33
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions packages/chain-adapters/src/utxo/UtxoBaseAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,20 @@ export abstract class UtxoBaseAdapter<T extends UtxoChainId> implements IChainAd
const { fee: averageFee } = utxoSelect({ ...utxoSelectInput, satoshiPerByte: averagePerByte })
const { fee: slowFee } = utxoSelect({ ...utxoSelectInput, satoshiPerByte: slowPerByte })

// Special, temporary case for DOGE to provide a workable fee value when the node is struggling
const isDoge = pubkey.startsWith('dgub')
const allFeesDefined =
fastFee !== undefined && averageFee !== undefined && slowFee !== undefined
if (isDoge && !allFeesDefined) {
const satoshiPerByte = '20000'
const fee = utxoSelect({ ...utxoSelectInput, satoshiPerByte }).fee
return {
fast: { txFee: String(fee), chainSpecific: { satoshiPerByte } },
average: { txFee: String(fee), chainSpecific: { satoshiPerByte } },
slow: { txFee: String(fee), chainSpecific: { satoshiPerByte } },
} as FeeDataEstimate<T>
}

return {
fast: { txFee: String(fastFee), chainSpecific: { satoshiPerByte: fastPerByte } },
average: { txFee: String(averageFee), chainSpecific: { satoshiPerByte: averagePerByte } },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function getTradeType(
switch (true) {
case !!sellAssetPool && !!buyAssetPool:
case !!buyAssetPool && !sellAssetPool && sellPoolId === 'THOR.RUNE':
case !!sellAssetPool && !buyAssetPool && buyPoolId !== 'THOR.RUNE':
case !!sellAssetPool && !buyAssetPool && buyPoolId === 'THOR.RUNE':
return TradeType.L1ToL1
case !sellAssetPool && !buyAssetPool:
return TradeType.LongTailToLongTail
Expand Down

0 comments on commit fae8c33

Please sign in to comment.