Interfaces

This page has been deprecated. V1 documentation is partially maintained here

Interfaces

BFactory
1
interface BFactory {
2
3
function isBPool(address b) external view returns (bool);
4
function newBPool() external returns (BPool);
5
6
}
Copied!
BPool
1
interface BPool {
2
3
function isPublicSwap() external view returns (bool);
4
function isFinalized() external view returns (bool);
5
function isBound(address t) external view returns (bool);
6
function getNumTokens() external view returns (uint);
7
function getCurrentTokens() external view returns (address[] memory tokens);
8
function getFinalTokens() external view returns (address[] memory tokens);
9
function getDenormalizedWeight(address token) external view returns (uint);
10
function getTotalDenormalizedWeight() external view returns (uint);
11
function getNormalizedWeight(address token) external view returns (uint);
12
function getBalance(address token) external view returns (uint);
13
function getSwapFee() external view returns (uint);
14
function getController() external view returns (address);
15
16
function setSwapFee(uint swapFee) external;
17
function setController(address manager) external;
18
function setPublicSwap(bool public_) external;
19
function finalize() external;
20
function bind(address token, uint balance, uint denorm) external;
21
function rebind(address token, uint balance, uint denorm) public;
22
function unbind(address token) external;
23
function gulp(address token) external;
24
25
function getSpotPrice(address tokenIn, address tokenOut) external view returns (uint spotPrice);
26
function getSpotPriceSansFee(address tokenIn, address tokenOut) external view returns (uint spotPrice);
27
28
function joinPool(uint poolAmountOut, uint[] calldata maxAmountsIn) external;
29
function exitPool(uint poolAmountIn, uint[] calldata minAmountsOut) external;
30
31
function swapExactAmountIn(
32
address tokenIn,
33
uint tokenAmountIn,
34
address tokenOut,
35
uint minAmountOut,
36
uint maxPrice
37
) external returns (uint tokenAmountOut, uint spotPriceAfter);
38
39
function swapExactAmountOut(
40
address tokenIn,
41
uint maxAmountIn,
42
address tokenOut,
43
uint tokenAmountOut,
44
uint maxPrice
45
) external returns (uint tokenAmountIn, uint spotPriceAfter);
46
47
function joinswapExternAmountIn(
48
address tokenIn,
49
uint tokenAmountIn,
50
uint minPoolAmountOut
51
) external returns (uint poolAmountOut);
52
53
function joinswapPoolAmountOut(
54
address tokenIn,
55
uint poolAmountOut,
56
uint maxAmountIn
57
) external returns (uint tokenAmountIn);
58
59
function exitswapPoolAmountIn(
60
address tokenOut,
61
uint poolAmountIn,
62
uint minAmountOut
63
) external returns (uint tokenAmountOut);
64
65
function exitswapExternAmountOut(
66
address tokenOut,
67
uint tokenAmountOut,
68
uint maxPoolAmountIn
69
) external returns (uint poolAmountIn);
70
71
function totalSupply() external view returns (uint);
72
function balanceOf(address whom) external view returns (uint);
73
function allowance(address src, address dst) external view returns (uint);
74
75
function approve(address dst, uint amt) external returns (bool);
76
function transfer(address dst, uint amt) external returns (bool);
77
function transferFrom(
78
address src, address dst, uint amt
79
) external returns (bool);
80
81
function calcSpotPrice(
82
uint tokenBalanceIn,
83
uint tokenWeightIn,
84
uint tokenBalanceOut,
85
uint tokenWeightOut,
86
uint swapFee
87
) public pure returns (uint spotPrice);
88
89
function calcOutGivenIn(
90
uint tokenBalanceIn,
91
uint tokenWeightIn,
92
uint tokenBalanceOut,
93
uint tokenWeightOut,
94
uint tokenAmountIn,
95
uint swapFee
96
) public pure returns (uint tokenAmountOut);
97
98
function calcInGivenOut(
99
uint tokenBalanceIn,
100
uint tokenWeightIn,
101
uint tokenBalanceOut,
102
uint tokenWeightOut,
103
uint tokenAmountOut,
104
uint swapFee
105
) public pure returns (uint tokenAmountIn);
106
107
function calcPoolOutGivenSingleIn(
108
uint tokenBalanceIn,
109
uint tokenWeightIn,
110
uint poolSupply,
111
uint totalWeight,
112
uint tokenAmountIn,
113
uint swapFee
114
) public pure returns (uint poolAmountOut);
115
116
function calcSingleInGivenPoolOut(
117
uint tokenBalanceIn,
118
uint tokenWeightIn,
119
uint poolSupply,
120
uint totalWeight,
121
uint poolAmountOut,
122
uint swapFee
123
) public pure returns (uint tokenAmountIn)
124
125
function calcSingleOutGivenPoolIn(
126
uint tokenBalanceOut,
127
uint tokenWeightOut,
128
uint poolSupply,
129
uint totalWeight,
130
uint poolAmountIn,
131
uint swapFee
132
) public pure returns (uint tokenAmountOut)
133
134
function calcPoolInGivenSingleOut(
135
uint tokenBalanceOut,
136
uint tokenWeightOut,
137
uint poolSupply,
138
uint totalWeight,
139
uint tokenAmountOut,
140
uint swapFee
141
) public pure returns (uint poolAmountIn)
142
143
}
Copied!
Exchange Proxy
1
interface ExchangeProxy {
2
3
function batchSwapExactIn(
4
Swap[] memory swaps,
5
TokenInterface tokenIn,
6
TokenInterface tokenOut,
7
uint totalAmountIn,
8
uint minTotalAmountOut
9
)
10
public payable
11
returns (uint totalAmountOut);
12
13
function batchSwapExactOut(
14
Swap[] memory swaps,
15
TokenInterface tokenIn,
16
TokenInterface tokenOut,
17
uint maxTotalAmountIn
18
)
19
public payable
20
returns (uint totalAmountIn)
21
22
function multihopBatchSwapExactIn(
23
Swap[][] memory swapSequences,
24
TokenInterface tokenIn,
25
TokenInterface tokenOut,
26
uint totalAmountIn,
27
uint minTotalAmountOut
28
)
29
public payable
30
returns (uint totalAmountOut)
31
32
function multihopBatchSwapExactOut(
33
Swap[][] memory swapSequences,
34
TokenInterface tokenIn,
35
TokenInterface tokenOut,
36
uint maxTotalAmountIn
37
)
38
public payable
39
returns (uint totalAmountIn)
40
41
function smartSwapExactIn(
42
TokenInterface tokenIn,
43
TokenInterface tokenOut,
44
uint totalAmountIn,
45
uint minTotalAmountOut,
46
uint nPools
47
)
48
public payable
49
returns (uint totalAmountOut)
50
51
function smartSwapExactOut(
52
TokenInterface tokenIn,
53
TokenInterface tokenOut,
54
uint totalAmountOut,
55
uint maxTotalAmountIn,
56
uint nPools
57
)
58
public payable
59
returns (uint totalAmountIn)
60
61
function viewSplitExactIn(
62
address tokenIn,
63
address tokenOut,
64
uint swapAmount,
65
uint nPools
66
)
67
public view
68
returns (Swap[] memory swaps, uint totalOutput)
69
70
function viewSplitExactOut(
71
address tokenIn,
72
address tokenOut,
73
uint swapAmount,
74
uint nPools
75
)
76
public view
77
returns (Swap[] memory swaps, uint totalOutput)
78
}
Copied!
Last modified 3mo ago