rubic-sdk-next
Version:
Simplify dApp creation
15 lines • 447 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSolanaFee = getSolanaFee;
const DEFAULT_FEE_PERCENT = 0.02;
function getSolanaFee(from) {
if (!from.price) {
return DEFAULT_FEE_PERCENT;
}
const usdTokenAmount = from.tokenAmount.multipliedBy(from.price);
if (usdTokenAmount.gt(100)) {
return DEFAULT_FEE_PERCENT;
}
return 0;
}
//# sourceMappingURL=get-solana-fee.js.map