Skip to content

Commit f4b130c

Browse files
committed
changes
1 parent 072ae6a commit f4b130c

26 files changed

+407
-134
lines changed

lib/v2-core

scripts/deploy-lbtsa.s.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pragma solidity ^0.8.0;
44
import "forge-std/console.sol";
55
import {Utils} from "./utils.sol";
66
import "../src/periphery/LyraSettlementUtils.sol";
7-
import {BaseTSA} from "../src/tokenizedSubaccounts/BaseTSA.sol";
7+
import {BaseTSA} from "../src/tokenizedSubaccounts/shared/BaseTSA.sol";
88
import {ISubAccounts} from "v2-core/src/interfaces/ISubAccounts.sol";
99
import {CashAsset} from "v2-core/src/assets/CashAsset.sol";
1010
import {DutchAuction} from "v2-core/src/liquidation/DutchAuction.sol";

scripts/deploy-prod-tsa.s.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pragma solidity ^0.8.0;
44
import "forge-std/console.sol";
55
import {Utils} from "./utils.sol";
66
import "../src/periphery/LyraSettlementUtils.sol";
7-
import {BaseTSA} from "../src/tokenizedSubaccounts/BaseTSA.sol";
7+
import {BaseTSA} from "../src/tokenizedSubaccounts/shared/BaseTSA.sol";
88
import {ISubAccounts} from "v2-core/src/interfaces/ISubAccounts.sol";
99
import {CashAsset} from "v2-core/src/assets/CashAsset.sol";
1010
import {DutchAuction} from "v2-core/src/liquidation/DutchAuction.sol";

scripts/deploy-tsa-with-implementation.s.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pragma solidity ^0.8.0;
44
import "forge-std/console.sol";
55
import {Utils} from "./utils.sol";
66
import "../src/periphery/LyraSettlementUtils.sol";
7-
import {BaseTSA} from "../src/tokenizedSubaccounts/BaseTSA.sol";
7+
import {BaseTSA} from "../src/tokenizedSubaccounts/shared/BaseTSA.sol";
88
import {ISubAccounts} from "v2-core/src/interfaces/ISubAccounts.sol";
99
import {CashAsset} from "v2-core/src/assets/CashAsset.sol";
1010
import {DutchAuction} from "v2-core/src/liquidation/DutchAuction.sol";

scripts/deploy-tsa.s.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pragma solidity ^0.8.0;
44
import "forge-std/console2.sol";
55
import {Utils} from "./utils.sol";
66
import "../src/periphery/LyraSettlementUtils.sol";
7-
import {BaseTSA} from "../src/tokenizedSubaccounts/BaseTSA.sol";
7+
import {BaseTSA} from "../src/tokenizedSubaccounts/shared/BaseTSA.sol";
88
import {ISubAccounts} from "v2-core/src/interfaces/ISubAccounts.sol";
99
import {CashAsset} from "v2-core/src/assets/CashAsset.sol";
1010
import {DutchAuction} from "v2-core/src/liquidation/DutchAuction.sol";

scripts/upgrade-lbtsa.s.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pragma solidity ^0.8.0;
44
import "forge-std/console.sol";
55
import {Utils} from "./utils.sol";
66
import "../src/periphery/LyraSettlementUtils.sol";
7-
import {BaseTSA} from "../src/tokenizedSubaccounts/BaseTSA.sol";
7+
import {BaseTSA} from "../src/tokenizedSubaccounts/shared/BaseTSA.sol";
88
import {ISubAccounts} from "v2-core/src/interfaces/ISubAccounts.sol";
99
import {CashAsset} from "v2-core/src/assets/CashAsset.sol";
1010
import {DutchAuction} from "v2-core/src/liquidation/DutchAuction.sol";

scripts/upgrade-tsa.s.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pragma solidity ^0.8.20;
44
import "forge-std/console2.sol";
55
import {Utils} from "./utils.sol";
66
import "../src/periphery/LyraSettlementUtils.sol";
7-
import {BaseTSA} from "../src/tokenizedSubaccounts/BaseTSA.sol";
7+
import {BaseTSA} from "../src/tokenizedSubaccounts/shared/BaseTSA.sol";
88
import {ISubAccounts} from "v2-core/src/interfaces/ISubAccounts.sol";
99
import {CashAsset} from "v2-core/src/assets/CashAsset.sol";
1010
import {DutchAuction} from "v2-core/src/liquidation/DutchAuction.sol";

src/AtomicSigningExecutor.sol

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ contract AtomicSigningExecutor {
3535
}
3636
}
3737
matching.verifyAndMatch(actions, signatures, actionData);
38+
39+
// Post-trade hook. Allows signer to update state internally and revert if they don't like the trade
40+
for (uint i = 0; i < actions.length; i++) {
41+
AtomicAction memory atomicAction = atomicActionData[i];
42+
if (atomicAction.isAtomic) {
43+
// Call the signer of the action
44+
IAtomicSigner signer = IAtomicSigner(actions[i].signer);
45+
signer.postTradeHook(actions[i], atomicAction.extraData);
46+
}
47+
}
3848
}
3949

4050
modifier onlyTradeExecutor() {

src/interfaces/IAtomicSigner.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ import "./IMatching.sol";
55

66
interface IAtomicSigner {
77
function signActionViaPermit(IMatching.Action memory action, bytes memory extraData, bytes memory signerSig) external;
8+
function postTradeHook(IMatching.Action memory action, bytes memory extraData) external;
89
}

src/tokenizedSubaccounts/CCTSA.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {DecimalMath} from "lyra-utils/decimals/DecimalMath.sol";
99
import {SignedDecimalMath} from "lyra-utils/decimals/SignedDecimalMath.sol";
1010
import {ConvertDecimals} from "lyra-utils/decimals/ConvertDecimals.sol";
1111

12-
import {BaseOnChainSigningTSA, BaseTSA} from "./BaseOnChainSigningTSA.sol";
12+
import {BaseOnChainSigningTSA, BaseTSA} from "./shared/BaseOnChainSigningTSA.sol";
1313
import {ISubAccounts} from "v2-core/src/interfaces/ISubAccounts.sol";
1414
import {IOptionAsset} from "v2-core/src/interfaces/IOptionAsset.sol";
1515
import {ISpotFeed} from "v2-core/src/interfaces/ISpotFeed.sol";
@@ -21,7 +21,7 @@ import {IMatching} from "../interfaces/IMatching.sol";
2121
import {
2222
StandardManager, IStandardManager, IVolFeed, IForwardFeed
2323
} from "v2-core/src/risk-managers/StandardManager.sol";
24-
import "./CollateralManagementTSA.sol";
24+
import "./shared/CollateralManagementTSA.sol";
2525

2626
/// @title CoveredCallTSA
2727
/// @notice TSA that accepts any deposited collateral, and sells covered calls on it. Assumes options sold are

0 commit comments

Comments
 (0)