Skip to content

Commit

Permalink
Remove swap fees from calcSpotPrice (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
saboonikhil committed Aug 28, 2022
1 parent 117d32b commit 55a4a92
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/processor/swaps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,7 @@ async function calcSpotPrice(tokenBalanceIn: number, tokenWeightIn: number, toke
if (tokenBalanceOut == 0) return 0
const numer = tokenBalanceIn/tokenWeightIn
const denom = tokenBalanceOut/tokenWeightOut
const ratio = numer/denom
const scale = 1/(1-swapFee)
const spotPrice = ratio*scale
const spotPrice = numer/denom
return spotPrice
}

Expand Down

0 comments on commit 55a4a92

Please sign in to comment.