diff --git a/src/crypto/crypto.service.ts b/src/crypto/crypto.service.ts index 62ae643..e772b4f 100644 --- a/src/crypto/crypto.service.ts +++ b/src/crypto/crypto.service.ts @@ -73,6 +73,15 @@ export class CryptoService { if (!userAsset || userAsset.amount < dto.amount) { throw new ForbiddenException(`Seller dont have enough asset`); } else { + await this.prisma.crypto.update({ + where: { + id: crypto.id, + }, + data: { + value: crypto.value * 0.9, + }, + }); + const newBalance = userAsset.amount - dto.amount; if (newBalance > 0) { await this.prisma.userHasCrypto.update({