Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advancer exo #10390

Closed
5 tasks done
turadg opened this issue Nov 1, 2024 · 0 comments · Fixed by #10518
Closed
5 tasks done

Advancer exo #10390

turadg opened this issue Nov 1, 2024 · 0 comments · Fixed by #10518
Assignees
Labels
enhancement New feature or request

Comments

@turadg
Copy link
Member

turadg commented Nov 1, 2024

What is the Problem Being Solved?

Fast USDC needs a component to perform advances.

Description of the Design

An Advancer exo that performs the advancement operations.

It looks them up from Status Manager and returns updates.

  • advances using PoolAccount.transfer()
  • communicates statuses to StatusManager
  • deposits Payment from PoolSeat to PoolAccount
  • accounts for fees (only advances net amount)
  • integrates with LiquidityPool

Security Considerations

Scaling Considerations

Test Plan

Exo test

Contract test is separate: #10388

Upgrade Considerations

@turadg turadg added the enhancement New feature or request label Nov 1, 2024
@turadg turadg added this to the FU1: package integration milestone Nov 1, 2024
@turadg turadg changed the title Advancer complete Advancer exo Nov 1, 2024
@dckc dckc mentioned this issue Nov 4, 2024
5 tasks
0xpatrickdev added a commit that referenced this issue Nov 7, 2024
@0xpatrickdev 0xpatrickdev mentioned this issue Nov 7, 2024
4 tasks
0xpatrickdev added a commit that referenced this issue Nov 7, 2024
0xpatrickdev added a commit that referenced this issue Nov 8, 2024
0xpatrickdev added a commit that referenced this issue Nov 8, 2024
0xpatrickdev added a commit that referenced this issue Nov 9, 2024
0xpatrickdev added a commit that referenced this issue Nov 11, 2024
0xpatrickdev added a commit that referenced this issue Nov 11, 2024
0xpatrickdev added a commit that referenced this issue Nov 11, 2024
0xpatrickdev added a commit that referenced this issue Nov 13, 2024
0xpatrickdev added a commit that referenced this issue Nov 13, 2024
0xpatrickdev added a commit that referenced this issue Nov 13, 2024
0xpatrickdev added a commit that referenced this issue Nov 15, 2024
0xpatrickdev added a commit that referenced this issue Nov 15, 2024
0xpatrickdev added a commit that referenced this issue Nov 15, 2024
mergify bot added a commit that referenced this issue Nov 15, 2024
refs: #10390

## Description
- [x] advancer performs balance check
- [x] advancer requests payment from `LiquidityPool`
- [x] advancer deposits payment in `PoolAccount`
- [x] advancer submits IBC transfer

### Security Considerations
Deals with live payments and ensures they do not get lost during failure paths

### Scaling Considerations
No new ones introduced

### Documentation Considerations


### Testing Considerations
Includes tests

### Upgrade Considerations
NA, unreleased
mergify bot added a commit that referenced this issue Nov 18, 2024
refs: #10390

## Description

- Add `FeeConfig` to `privateArgs` so deployers can adjust fees over time (terms are immutable)
- Adds `FeeTools` for calculating net advance and fee splits
- Integrates `FeeTools` with `Advancer`

### Security Considerations
- None really for these specific changes. We might need to think about timing from when the `Advancer` calls `calculateAdvance` and the `Settler` calls `calculateSplit`, as the `FeeConfig` values might change.

- From a product POV, users might pay more in fees than the net advance they receive. So we might consider a config parameter for a "minimum request amount".

### Scaling Considerations
None really, mainly contains AmountMath computation.

### Documentation Considerations
Includes jsdoc and code comments

### Testing Considerations
Includes unit tests for FeeTools, attempting to cover all foreseeable scenarios. A bit light on testing integrations with the advancer and settler.

### Upgrade Considerations
N/A, unreleased
@LuqiPan LuqiPan assigned dckc and unassigned 0xpatrickdev Nov 18, 2024
@0xpatrickdev 0xpatrickdev assigned 0xpatrickdev and unassigned dckc Nov 18, 2024
mergify bot added a commit that referenced this issue Nov 19, 2024
refs: #10390

## Description
- Adds `borrower` and `repayer` facets to the `Liquidity Pool`
- Track `outstandingLends: Amount` in state for `checkPoolBalance` invariant
- Track `PoolMetrics` like cumulative borrows, repays, and fees

### Security Considerations
Handles payment allocations, but is able to do so synchronously using a temporary seats provided by the callers.

### Scaling Considerations
Makes a vstorage writes for each borrow and repay.

### Documentation Considerations
Updates code comments for maintainers.

### Testing Considerations
Tests use test-only methods on the createFacet to simulate fees from a borrow/repay sequence. Tests ensure `zcf.atomicRearrange()` in `.borrow()` and `.repay()` will not fail and trigger `zcf.shutdownWithFailure()`.

### Upgrade Considerations
None, unreleased
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants