kodadot/snek

Implement spread

Opened this issue · 2 comments

To the series insight we can implement spread.

What is spread?

the difference or gap between two prices, rates, or yields

We would count it as a difference between lowest LIST and lowest BUY

LAST BUY: 131 KSM
LAST LIST 130.74 KSM

Formula:

const top = Math.abs(LIST - BUY)
const bottom = (LIST + BUY) / 2
const diff = (top / bottom) * 100

SOURCE

ht/ @yangwao

Where are the SQL wizards when we need them? 🧙

Sending one cute witch for you 💜

out-2-62