Allow the user to swap between the riToken and the treasuryToken, and vice versa. Note that there will be lots of details to consider for the mechanics here, such as balance checking, approval txs, and more. We can/should break out those into their own issues if/when appropriate.
Contract interactions
Pool.sellBasePreview for a quote followed by Pool.sellBase to sell base token for fyToken
Pool.buyBasePreview for a quote followed by Pool.buyBase to sell fyToken for base token
All 4 methods above also have fyToken varieties. The difference seems be analogous to Uniswap's "swap exact tokens for tokens" vs. "swap tokens for exact tokens"
For preview methods to get quotes, the input argument is just the amount the user wants to buy or sell
Allow the user to swap between the
riToken
and thetreasuryToken
, and vice versa. Note that there will be lots of details to consider for the mechanics here, such as balance checking, approval txs, and more. We can/should break out those into their own issues if/when appropriate.Contract interactions
Pool.sellBasePreview
for a quote followed byPool.sellBase
to sell base token for fyTokenPool.buyBasePreview
for a quote followed byPool.buyBase
to sell fyToken for base tokenfyToken
varieties. The difference seems be analogous to Uniswap's "swap exact tokens for tokens" vs. "swap tokens for exact tokens"