return 0 for swap from same source to same target
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
This commit is contained in:
parent
03dbac82f9
commit
20c915f0ee
|
@ -234,6 +234,10 @@ export class MangoAccount {
|
|||
targetTokenName: string,
|
||||
slippageAndFeesFactor: number,
|
||||
): I80F48 {
|
||||
if (sourceTokenName === targetTokenName) {
|
||||
return ZERO_I80F48;
|
||||
}
|
||||
|
||||
return this.accountData.healthCache
|
||||
.getMaxSourceForTokenSwap(
|
||||
group,
|
||||
|
|
|
@ -91,6 +91,7 @@ async function debugUser(client, group, mangoAccount) {
|
|||
);
|
||||
}
|
||||
getMaxSourceForTokenSwapWrapper('SOL', 'BTC');
|
||||
getMaxSourceForTokenSwapWrapper('USDC', 'USDC');
|
||||
}
|
||||
|
||||
async function main() {
|
||||
|
|
Loading…
Reference in New Issue