Skip to content

Commit

Permalink
Make initial price on amm start correct
Browse files Browse the repository at this point in the history
  • Loading branch information
ikprk committed Jun 28, 2024
1 parent 69a3d6b commit f7ba521
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion db/viewDefinitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ LEFT JOIN
FROM squid_processor.status) - ${BLOCKS_PER_DAY * 30}) as tr
GROUP BY token_id) as liq_until ON liq_until.token_id = ct.id
LEFT JOIN trading_volumes tv ON tv.token_id = ct.id;
LEFT JOIN trading_volumes tv ON tv.token_id = ct.id
`,
}
Expand Down
3 changes: 2 additions & 1 deletion src/mappings/token/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ export async function processAmmActivatedEvent({
ammInitPrice: BigInt(intercept),
finalized: false,
})
token.lastPrice = amm.ammInitPrice
token.lastPrice =
(amm.ammSlopeParameter * BigInt(token.totalSupply)) / BigInt(2) + amm.ammInitPrice
token.currentAmmSaleId = id

const eventEntity = overlay.getRepository(Event).new({
Expand Down

0 comments on commit f7ba521

Please sign in to comment.