Skip to content

Commit

Permalink
fix(morpho): position was badly linked with token
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-devatom committed Feb 14, 2024
1 parent 172641c commit 34d4985
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/sdk/position.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,10 @@ export class PositionManager {
position.market = this._market.id;

position.asset =
transactionType === TransactionType.BORROW
? this._market.borrowedToken
: this._market.inputToken;
transactionType === TransactionType.DEPOSIT_COLLATERAL ||
transactionType === TransactionType.WITHDRAW_COLLATERAL
? this._market.inputToken
: this._market.borrowedToken;
position.hashOpened = event.transaction.hash;
position.blockNumberOpened = event.block.number;
position.timestampOpened = event.block.timestamp;
Expand Down

0 comments on commit 34d4985

Please sign in to comment.