Skip to content

Commit

Permalink
fix: change delta formule
Browse files Browse the repository at this point in the history
baptistr committed Nov 10, 2024
1 parent 1630090 commit e25b0e3
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions discord/index.js
Original file line number Diff line number Diff line change
@@ -81,7 +81,7 @@ const yamOffer = async () => {
if (highOffer <= lastId) {
return;
}

const rememberLastId = lastId;

lastId = highOffer;
@@ -105,8 +105,6 @@ const yamOffer = async () => {

const { availableAmount, offerToken, buyerToken, buyer, price } = offer;

console.log('offer', offer);

if (buyer) { // if the offer is private
continue;
}
@@ -118,15 +116,16 @@ const yamOffer = async () => {
continue;
}

const { tokenPrice, imageLink, propertyType, annualPercentageYield, name } = property;
const { imageLink, propertyType, annualPercentageYield, name } = property;
const tokenPrice = +property.tokenPrice;

if (!tokenPrice) {
console.error('No token price found');
continue;
}

const newYield = (annualPercentageYield * +tokenPrice) / price
const deltaPrice = (+tokenPrice / price) * 100 - 100;
const newYield = (annualPercentageYield * tokenPrice) / price;
const deltaPrice = ((price - tokenPrice) / tokenPrice) * 100 * -1;

const users = NODE_ENV === 'prod' ? (
await UserController.getUsersFromParams({

0 comments on commit e25b0e3

Please sign in to comment.