Swaap Protocol is building the first market neutral AMM. This repository contains its proxy smart contract.
Proxy contract enables a user to create custom pools, join existing ones, and batchswap/multihop trades on multiple pools.
For an in-depth documentation of Swaap, see our docs.
Create a .env file and define the needed environment variables as in the example.
POLYGON_RPC_URL
must be defined to launch the tests.
$ yarn # install all dependencies
$ yarn build # compile all contracts
$ yarn test # run all tests (the tests are based on few polygon deployed SCs)
To deploy the Proxy contract to an EVM-compatible chain:
$ yarn deploy:$NETWORK
Where $NETWORK corresponds to a target network as defined in the hardhat.config.ts file. The deployment script won't deploy the factory except when running tests.
The Swaap Proxy v1 interfaces are available for import into solidity smart contracts via the npm artifact @swaap-labs/swaap-proxy-v1
, e.g.:
import '@swaap-labs/swaap-proxy-v1/contracts/interfaces/IProxy.sol';
contract MyContract {
IProxy swaapProxy;
function doSomethingWithPool() {
// swaapProxy.joinPool(...);
}
}
Error messages are formated as PROOXY#$ERROR_ID
strings.
Corresponding human readable messages can be found here: contracts/ProxyErrors.sol.
All smart contracts are immutable, and cannot be upgraded.
Solidity source code is licensed under the GNU General Public License Version 3 (GPL v3): see LICENSE
.