The representation of the Folks Finance lending adapter contract.
This class allows for composing Pact swaps and adding/removing liquidity with Folks Finance lending pools, resulting in a higher APR for liquidity providers that accommodates both, the trading APR and the lending APR.
The user is not interacting with Folks Finance pools or Pact pools directly. Instead, the user is calling a global adapter contract that makes inner transactions to the other applications.
The Pact pool is between two fAssets e.g. fALGO and fUSDC but the user doesn't have to be opted into those fAssets. The user interacts only with ALGO and USDC. Converting between the original assets and fAssets is hidden in the adapter contract.
To add liquidity:
The user deposits ALGO and USDC in the adapter contract.
The user calls “pre_add_liquidity” method on the adapter.
The adapter converts ALGO to fALGO and USDC to fUSDC in corresponding Folks Finance pools.
The user calls “add_liquidity” method on the adapter.
The adapter deposits fALGO and fUSDC in Pact pool and receives liquidity tokens in return.
The adapter transfers the liquidity tokens to the user.
To remove liquidity:
The user deposits liquidity tokens in the adapter contract.
The user calls “remove_liquidity” method on the adapter.
The adapter removes liquidity from the Pact pool and receives fALGO and fUSDC in return.
The user calls “post_remove_liquidity” method on the adapter.
The adapter converts fALGO to ALGO and fUSDC to USDC in corresponding Folks Finance pools.
The adapter transfers ALGO and USDC tokens to the user.
For swap:
The user deposits one of the assets in the adapter e.g. USDC.
The user calls “swap” method on the adapter.
The adapter converts USDC to fUSDC in a corresponding Folks Finance pool.
The adapter swaps fUSDC to fALGO in a Pact pool.
The adapter converts fALGO to ALGO in a corresponding Folks Finance pool.
The adapter transfers ALGO to the user.
This class tries to mimic the interface of a Pool for making the above operations.
The representation of the Folks Finance lending adapter contract.
This class allows for composing Pact swaps and adding/removing liquidity with Folks Finance lending pools, resulting in a higher APR for liquidity providers that accommodates both, the trading APR and the lending APR.
The user is not interacting with Folks Finance pools or Pact pools directly. Instead, the user is calling a global adapter contract that makes inner transactions to the other applications.
The Pact pool is between two fAssets e.g. fALGO and fUSDC but the user doesn't have to be opted into those fAssets. The user interacts only with ALGO and USDC. Converting between the original assets and fAssets is hidden in the adapter contract.
To add liquidity:
To remove liquidity:
For swap:
This class tries to mimic the interface of a Pool for making the above operations.