Skip to content

numofx/funding-space

 
 

Repository files navigation

FundingSpace


A fork of yieldspace-tv, an automated market maker that prices interest rates on FX stablecoins to enable fully onchain funding markets.

This repo includes:

Additional notes:

  • If too many base tokens are sent to the mint functions (mint or mintWithBase), the extra base tokens will be sent back to the to address
  • If too many tokens are sent in to buyFYToken or buyBase, those tokens are not sent back. The user can retrieve them with retrieveFYToken or retrieveBase.
  • The remaining tokens in the buy functions will typically be small rounding differences and not worth the gas to send back. Also, changing the behavior of the buy functions to match the mint functions would be a breaking change. For that reason, we have chosen to leave the current behavior.

Test

Compile and test the smart contracts with Forge:

forge test

Smoke Checks

Mainnet (canonical pool):

  • script/smokePool.sh defaults to PREVIEW_BASE_IN=9.1e18 and PREVIEW_FY_IN=9.8e18.
  • These preview calls are expected not to revert on the canonical pool.
  • Run with MODE=mainnet (or make smoke-mainnet-strict) to enforce strict checks.

Fork (anvil):

  • Base preview can legitimately revert during early initialization or certain states.
  • Use fork mode to skip base preview:
    • PREVIEW_BASE_IN=skip MODE=fork ./script/smokePool.sh
    • script/smokeAnvilFork.sh sets this automatically.

About

Funding markets for FX stablecoins

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Solidity 98.7%
  • Shell 1.3%