Skip to content

Commit cdbeba7

Browse files
committed
Add protocol interfaces consumed by set-v2-strategies
1 parent c904c3c commit cdbeba7

File tree

6 files changed

+124
-4
lines changed

6 files changed

+124
-4
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
Copyright 2022 Set Labs Inc.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
16+
SPDX-License-Identifier: Apache License, Version 2.0
17+
*/
18+
pragma solidity 0.6.10;
19+
20+
import { ISetToken } from "./ISetToken.sol";
21+
22+
/**
23+
* @title IIssuanceModule
24+
* @author Set Protocol
25+
*
26+
* Interface for interacting with Issuance module interface.
27+
*/
28+
interface IIssuanceModule {
29+
function updateIssueFee(ISetToken _setToken, uint256 _newIssueFee) external;
30+
function updateRedeemFee(ISetToken _setToken, uint256 _newRedeemFee) external;
31+
function updateFeeRecipient(ISetToken _setToken, address _newRedeemFee) external;
32+
33+
function initialize(
34+
ISetToken _setToken,
35+
uint256 _maxManagerFee,
36+
uint256 _managerIssueFee,
37+
uint256 _managerRedeemFee,
38+
address _feeRecipient,
39+
address _managerIssuanceHook
40+
) external;
41+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
Copyright 2022 Set Labs Inc.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
16+
SPDX-License-Identifier: Apache License, Version 2.0
17+
*/
18+
19+
pragma solidity 0.6.10;
20+
21+
interface ISetTokenCreator {
22+
function create(
23+
address[] memory _components,
24+
int256[] memory _units,
25+
address[] memory _modules,
26+
address _manager,
27+
string memory _name,
28+
string memory _symbol
29+
)
30+
external
31+
returns (address);
32+
}

contracts/interfaces/IStreamingFeeModule.sol

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,19 @@ pragma solidity 0.6.10;
1919
pragma experimental "ABIEncoderV2";
2020

2121
import { ISetToken } from "./ISetToken.sol";
22-
import { StreamingFeeModule } from "../protocol/modules/StreamingFeeModule.sol";
2322

2423
interface IStreamingFeeModule {
25-
function feeStates(ISetToken _setToken) external view returns (StreamingFeeModule.FeeState memory);
24+
struct FeeState {
25+
address feeRecipient;
26+
uint256 maxStreamingFeePercentage;
27+
uint256 streamingFeePercentage;
28+
uint256 lastStreamingFeeTimestamp;
29+
}
30+
31+
function feeStates(ISetToken _setToken) external view returns (FeeState memory);
2632
function getFee(ISetToken _setToken) external view returns (uint256);
27-
}
33+
function accrueFee(ISetToken _setToken) external;
34+
function updateStreamingFee(ISetToken _setToken, uint256 _newFee) external;
35+
function updateFeeRecipient(ISetToken _setToken, address _newFeeRecipient) external;
36+
function initialize(ISetToken _setToken, FeeState memory _settings) external;
37+
}

contracts/interfaces/ITradeModule.sol

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
Copyright 2022 Set Labs Inc.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
16+
SPDX-License-Identifier: Apache License, Version 2.0
17+
*/
18+
pragma solidity 0.6.10;
19+
pragma experimental "ABIEncoderV2";
20+
21+
import { ISetToken } from "./ISetToken.sol";
22+
23+
interface ITradeModule {
24+
function initialize(ISetToken _setToken) external;
25+
26+
function trade(
27+
ISetToken _setToken,
28+
string memory _exchangeName,
29+
address _sendToken,
30+
uint256 _sendQuantity,
31+
address _receiveToken,
32+
uint256 _minReceiveQuantity,
33+
bytes memory _data
34+
) external;
35+
}

contracts/interfaces/external/perp-v2/IAccountBalance.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,6 @@ interface IAccountBalance {
3535
function getExchange() external view returns (address);
3636
function getOrderBook() external view returns (address);
3737
function getVault() external view returns (address);
38+
function getTakerPositionSize(address trader, address baseToken) external view returns (int256);
39+
function getTakerOpenNotional(address trader, address baseToken) external view returns (int256);
3840
}

contracts/protocol-viewers/StreamingFeeModuleViewer.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ contract StreamingFeeModuleViewer {
4949
StreamingFeeInfo[] memory feeInfo = new StreamingFeeInfo[](_setTokens.length);
5050

5151
for (uint256 i = 0; i < _setTokens.length; i++) {
52-
StreamingFeeModule.FeeState memory feeState = _streamingFeeModule.feeStates(_setTokens[i]);
52+
IStreamingFeeModule.FeeState memory feeState = _streamingFeeModule.feeStates(_setTokens[i]);
5353
uint256 unaccruedFees = _streamingFeeModule.getFee(_setTokens[i]);
5454

5555
feeInfo[i] = StreamingFeeInfo({

0 commit comments

Comments
 (0)