@@ -156,7 +156,7 @@ interface IStableCoin {
156
156
) external returns (uint256 amountA , uint256 amountB );
157
157
158
158
/**
159
- * @dev Rebalance by Credit is triggered when the total amount of source tokens is greater
159
+ * @dev Rebalance by Credit is triggered when the total amount of source tokens' value is greater
160
160
* than uSD circulating supply. Rebalancing is done by withdrawing the excess from the pool.
161
161
*
162
162
* =====
@@ -172,183 +172,13 @@ interface IStableCoin {
172
172
) external returns (uint256 redeemed );
173
173
174
174
/**
175
- * @dev // DOCUMENT
176
- */
177
- function rebalanceByDebt (uint256 amount ) external returns (uint256 );
178
- }
179
-
180
- // -----------------------------------------------------------------------------------------------|
181
-
182
- // DOCUMENT
183
- interface IDoubleProxy {
184
- function proxy () external view returns (address );
185
- }
186
-
187
- // -----------------------------------------------------------------------------------------------|
188
-
189
- // DOCUMENT
190
- interface IMVDProxy {
191
- function getToken () external view returns (address );
192
-
193
- function getMVDFunctionalitiesManagerAddress () external view returns (address );
194
-
195
- function getMVDWalletAddress () external view returns (address );
196
-
197
- function getStateHolderAddress () external view returns (address );
198
-
199
- function submit (string calldata codeName , bytes calldata data )
200
- external
201
- payable
202
- returns (bytes memory returnData );
203
- }
204
-
205
- // -----------------------------------------------------------------------------------------------|
206
-
207
- // DOCUMENT
208
- interface IMVDFunctionalitiesManager {
209
- function isAuthorizedFunctionality (address functionality ) external view returns (bool );
210
- }
211
-
212
- // -----------------------------------------------------------------------------------------------|
213
-
214
- // DOCUMENT
215
- interface IStateHolder {
216
- function getBool (string calldata varName ) external view returns (bool );
217
-
218
- function getUint256 (string calldata varName ) external view returns (uint256 );
219
- }
220
-
221
- // -----------------------------------------------------------------------------------------------|
222
-
223
- /**
224
- * @title Uniswap V2 Router
225
- * @dev Route liquidity back and forth an Uniswap Liquidity Pool.
226
- * For more information see: https://uniswap.org/docs/v2/smart-contracts/router02/
227
- *
228
- */
229
- interface IUniswapV2Router {
230
- /**
231
- * https://uniswap.org/docs/v2/smart-contracts/library#getamountsout
232
- * Given an input asset amount and an array of token addresses, calculates all subsequent maximum
233
- * output token amounts by calling getReserves for each pair of token addresses in the path in
234
- * turn, and using these to call getAmountOut. Useful for calculating optimal token amounts
235
- * before calling swap.
236
- */
237
- function getAmountsOut (uint256 amountIn , address [] calldata path )
238
- external
239
- view
240
- returns (uint256 [] memory amounts );
241
-
242
- /**
243
- * @dev Removes liquidity from an ERC-20⇄ERC-20 pool
244
- *
245
- * https://uniswap.org/docs/v2/smart-contracts/router02/#addliquidity
246
- *
247
- * =====
248
- *
249
- * @param tokenA A pool token
250
- * @param tokenB A pool token
251
- * @param liquidity The amount of liquidity tokens to remove
252
- * @param amountAMin The minimum amount of tokenA that must be received for the transaction not to revert
253
- * @param amountBMin The minimum amount of tokenB that must be received for the transaction not to revert
254
- * @param to Recipient of the underlying assets
255
- * @param deadline Unix timestamp after which the transaction will revert
256
- *
257
- * =====
258
- *
259
- * @return amountA The amount of tokenA received
260
- * @return amountB The amount of tokenB received
261
- *
262
- */
263
- function removeLiquidity (
264
- address tokenA ,
265
- address tokenB ,
266
- uint256 liquidity ,
267
- uint256 amountAMin ,
268
- uint256 amountBMin ,
269
- address to ,
270
- uint256 deadline
271
- ) external returns (uint256 amountA , uint256 amountB );
272
-
273
- /**
274
- * @dev Add Liquidity to an ERC-20⇄ERC-20 pool
275
- *
276
- * - To cover all possible scenarios, msg.sender should have already given the router an allowance
277
- * of at least amountADesired/amountBDesired on tokenA/tokenB.
278
- * - Always adds assets at the ideal ratio, according to the price when the transaction is executed.
279
- * - If a pool for the passed tokens does not exists, one is created automatically, and exactly
280
- * amountADesired/amountBDesired tokens are added.
281
- *
282
- * https://uniswap.org/docs/v2/smart-contracts/router02/#addliquidity
283
- *
284
- * =====
285
- *
286
- * @param tokenA A pool token
287
- * @param tokenB A pool token
288
- * @param liquidity The amount of liquidity tokens to remove
289
- * @param amountADesired The amount of tokenA to add as liquidity if the B/A price is <=
290
- * amountBDesired/amountADesired (A depreciates).
291
- * @param amountBDesired The amount of tokenB to add as liquidity if the A/B price is <=
292
- * amountADesired/amountBDesired (B depreciates).
293
- * @param amountAMin Bounds the extent to which the B/A price can go up before the transaction reverts. Must be <= amountADesired.
294
- * @param amountBMin Bounds the extent to which the A/B price can go up before the transaction reverts. Must be <= amountBDesired.
295
- * @param to Recipient of the underlying assets
296
- * @param deadline Unix timestamp after which the transaction will revert
175
+ * @dev Rebalance by Credit is triggered when the total amount of source tokens' value is greater
176
+ * than uSD circulating supply. Rebalancing is done by withdrawing the excess from the pool.
297
177
*
298
178
* =====
299
179
*
300
- * @return amountA The amount of tokenA sent to the pool
301
- * @return amountB The amount of tokenB sent to the pool
302
- * @return liquidity The amount of liquidity tokens minted
303
- *
180
+ * @notice Positive imbalances can be caused by the accrual of liquidity provider fee. Withdrawn tokens
181
+ * are stored inside the Unifi DFO as a source of long-term value
304
182
*/
305
- function addLiquidity (
306
- address tokenA ,
307
- address tokenB ,
308
- uint256 amountADesired ,
309
- uint256 amountBDesired ,
310
- uint256 amountAMin ,
311
- uint256 amountBMin ,
312
- address to ,
313
- uint256 deadline
314
- )
315
- external
316
- returns (
317
- uint256 amountA ,
318
- uint256 amountB ,
319
- uint256 liquidity
320
- );
321
- }
322
-
323
- // -----------------------------------------------------------------------------------------------|
324
-
325
- // DOCUMENT
326
- /**
327
- * @title Uniswap V2 Pair
328
- */
329
- interface IUniswapV2Pair {
330
- // DOCUMENT
331
- function decimals () external pure returns (uint8 );
332
-
333
- // DOCUMENT
334
- function totalSupply () external view returns (uint256 );
335
-
336
- // DOCUMENT
337
- function token0 () external view returns (address );
338
-
339
- // DOCUMENT
340
- function token1 () external view returns (address );
341
-
342
- // DOCUMENT
343
- function balanceOf (address account ) external view returns (uint256 );
344
-
345
- // DOCUMENT
346
- function getReserves ()
347
- external
348
- view
349
- returns (
350
- uint112 reserve0 ,
351
- uint112 reserve1 ,
352
- uint32 blockTimestampLast
353
- );
183
+ function rebalanceByDebt (uint256 amount ) external returns (uint256 );
354
184
}
0 commit comments