From f195d8892e965d1f1baf8680e2ca92fa368849ee Mon Sep 17 00:00:00 2001 From: Jacob Habib <47253537+jahabeebs@users.noreply.github.com> Date: Fri, 22 Dec 2023 16:55:18 -0500 Subject: [PATCH] prod deploy 12/22 (#64) * TinaCMS content update * new logo (#61) * Issue #54: Re-organize menu bar (#62) * new sidebars.js * typo * no pyflex, reorder sidebars * all collapsible * no governance contracts naming transition * start collapsed * Delete keepers section, add links to OD repo, add developer resources, add subgraph links (#63) * new sidebars.js * typo * no pyflex, reorder sidebars * all collapsible * no governance contracts naming transition * start collapsed * no keeper section, add developer overview, change links to our repos --------- Co-authored-by: tina-cloud-app[bot] <58178390+tina-cloud-app[bot]@users.noreply.github.com> --- docs/Auctions.mdx | 2 +- docs/Governance-introduction.mdx | 2 +- docs/NFT-Vaults-Overview.mdx | 2 +- docs/Official-Links.mdx | 6 +- docs/Proposals-and-Voting---Coming-soon.mdx | 2 +- docs/README.mdx | 2 +- docs/Security-Measures-.mdx | 2 +- docs/The-ODG-Token---Coming-soon.mdx | 2 +- docs/api/api-endpoints.mdx | 11 +- ...governance-contracts-naming-transition.mdx | 139 ------ docs/developer-readme.mdx | 18 + docs/geb-js/api-reference/geb.mdx | 168 +------ docs/geb-js/api-reference/gebadmin.mdx | 435 ------------------ docs/geb-js/api-reference/gebproxyactions.mdx | 122 ++--- docs/geb-js/api-reference/safe.mdx | 20 +- .../geb-js/geb-js-global-settlement-guide.mdx | 128 ------ docs/keepers/bidding-models.mdx | 101 ---- .../collateral-auction-keeper/README.mdx | 9 - .../collateral-auction-keeper/flash-swaps.mdx | 92 ---- .../liquidations.mdx | 84 ---- .../running-in-docker.mdx | 58 --- .../running-on-a-host.mdx | 86 ---- docs/keepers/debt-auction-keeper/README.mdx | 9 - .../debt-auction-keeper/running-in-docker.mdx | 53 --- .../debt-auction-keeper/running-on-a-host.mdx | 166 ------- docs/keepers/overview.mdx | 226 --------- .../staked-token-auction-keeper/README.mdx | 8 - .../running-in-docker.mdx | 50 -- .../running-on-a-host.mdx | 211 --------- .../keepers/surplus-auction-keeper/README.mdx | 9 - .../running-in-docker.mdx | 60 --- .../running-on-a-host.mdx | 135 ------ docs/pyflex/getting-started/README.mdx | 14 - docs/pyflex/getting-started/basics.mdx | 86 ---- docs/pyflex/getting-started/configuration.mdx | 28 -- docs/pyflex/numerics.mdx | 96 ---- docs/pyflex/safe-management/README.mdx | 21 - .../pyflex/safe-management/closing-a-safe.mdx | 25 - .../pyflex/safe-management/opening-a-safe.mdx | 90 ---- docs/testnet-guide.mdx | 2 +- sidebars.js | 211 +++++---- static/assets/full-logo.svg | 27 +- 42 files changed, 229 insertions(+), 2789 deletions(-) delete mode 100644 docs/contract-translation/governance-contracts-naming-transition.mdx create mode 100644 docs/developer-readme.mdx delete mode 100644 docs/geb-js/api-reference/gebadmin.mdx delete mode 100644 docs/geb-js/geb-js-global-settlement-guide.mdx delete mode 100644 docs/keepers/bidding-models.mdx delete mode 100644 docs/keepers/collateral-auction-keeper/README.mdx delete mode 100644 docs/keepers/collateral-auction-keeper/flash-swaps.mdx delete mode 100644 docs/keepers/collateral-auction-keeper/liquidations.mdx delete mode 100644 docs/keepers/collateral-auction-keeper/running-in-docker.mdx delete mode 100644 docs/keepers/collateral-auction-keeper/running-on-a-host.mdx delete mode 100644 docs/keepers/debt-auction-keeper/README.mdx delete mode 100644 docs/keepers/debt-auction-keeper/running-in-docker.mdx delete mode 100644 docs/keepers/debt-auction-keeper/running-on-a-host.mdx delete mode 100644 docs/keepers/overview.mdx delete mode 100644 docs/keepers/staked-token-auction-keeper/README.mdx delete mode 100644 docs/keepers/staked-token-auction-keeper/running-in-docker.mdx delete mode 100644 docs/keepers/staked-token-auction-keeper/running-on-a-host.mdx delete mode 100644 docs/keepers/surplus-auction-keeper/README.mdx delete mode 100644 docs/keepers/surplus-auction-keeper/running-in-docker.mdx delete mode 100644 docs/keepers/surplus-auction-keeper/running-on-a-host.mdx delete mode 100644 docs/pyflex/getting-started/README.mdx delete mode 100644 docs/pyflex/getting-started/basics.mdx delete mode 100644 docs/pyflex/getting-started/configuration.mdx delete mode 100644 docs/pyflex/numerics.mdx delete mode 100644 docs/pyflex/safe-management/README.mdx delete mode 100644 docs/pyflex/safe-management/closing-a-safe.mdx delete mode 100644 docs/pyflex/safe-management/opening-a-safe.mdx diff --git a/docs/Auctions.mdx b/docs/Auctions.mdx index 28b4890f..cb228490 100644 --- a/docs/Auctions.mdx +++ b/docs/Auctions.mdx @@ -1,5 +1,5 @@ --- -title: Auctions +title: Introduction to Auctions description: An overview to Open Dollar Auctions --- diff --git a/docs/Governance-introduction.mdx b/docs/Governance-introduction.mdx index c18a2d8b..d8fba9ca 100644 --- a/docs/Governance-introduction.mdx +++ b/docs/Governance-introduction.mdx @@ -1,5 +1,5 @@ --- -title: 'Governance Introduction ' +title: 'Introduction' description: An introduction to Governance on Open Dollar --- diff --git a/docs/NFT-Vaults-Overview.mdx b/docs/NFT-Vaults-Overview.mdx index e94a689d..360b57a9 100644 --- a/docs/NFT-Vaults-Overview.mdx +++ b/docs/NFT-Vaults-Overview.mdx @@ -1,5 +1,5 @@ --- -title: 'Overview ' +title: 'Overview' description: '' --- diff --git a/docs/Official-Links.mdx b/docs/Official-Links.mdx index be20caf8..e5da9fd9 100644 --- a/docs/Official-Links.mdx +++ b/docs/Official-Links.mdx @@ -16,18 +16,18 @@ Community - DM, comment, & post to help us foster a vibrant & supportive communi **The #1 Spot:** -🟢 $2,000 [$rETH](https://twitter.com/search?q=%24rETH\&src=cashtag_click) Vault +🟢 $2,000 [rETH](https://twitter.com/search?q=%24rETH\&src=cashtag_click) Vault 🟢Testnet #1 Earner NFT **Spots #2 - #5:** -🟢 $1,000 [$rETH](https://twitter.com/search?q=%24rETH\&src=cashtag_click) Vault +🟢 $1,000 [rETH](https://twitter.com/search?q=%24rETH\&src=cashtag_click) Vault 🟢 Testnet Top 5 NFT **Spots #6 - #10:** -🟢 $400 [$rETH](https://twitter.com/search?q=%24rETH\&src=cashtag_click) Vault +🟢 $400 [rETH](https://twitter.com/search?q=%24rETH\&src=cashtag_click) Vault 🟢 Testnet Top 10 NFT diff --git a/docs/Proposals-and-Voting---Coming-soon.mdx b/docs/Proposals-and-Voting---Coming-soon.mdx index 1847ca20..d7dd1614 100644 --- a/docs/Proposals-and-Voting---Coming-soon.mdx +++ b/docs/Proposals-and-Voting---Coming-soon.mdx @@ -1,5 +1,5 @@ --- -title: Proposals and Voting - “Coming soon” +title: Proposals and Voting --- Details coming soon after an official announcement. diff --git a/docs/README.mdx b/docs/README.mdx index 412746a8..d09ce436 100644 --- a/docs/README.mdx +++ b/docs/README.mdx @@ -1,5 +1,5 @@ --- -title: Open Dollar Overview +title: Overview description: '' --- diff --git a/docs/Security-Measures-.mdx b/docs/Security-Measures-.mdx index c8c3bb75..46658467 100644 --- a/docs/Security-Measures-.mdx +++ b/docs/Security-Measures-.mdx @@ -1,5 +1,5 @@ --- -title: 'Security Measures ' +title: 'Security Measures' --- To safeguard the integrity and stability of the Open Dollar protocol, several security measures have been implemented, including but not limited to: diff --git a/docs/The-ODG-Token---Coming-soon.mdx b/docs/The-ODG-Token---Coming-soon.mdx index 11512c96..44b2ecac 100644 --- a/docs/The-ODG-Token---Coming-soon.mdx +++ b/docs/The-ODG-Token---Coming-soon.mdx @@ -1,5 +1,5 @@ --- -title: The ODG Token - “Coming soon” +title: The ODG Token --- Coming soon - Follow us on our socials and subscribe to our newsletter to be among the first to know! diff --git a/docs/api/api-endpoints.mdx b/docs/api/api-endpoints.mdx index f2c03a44..a32bc573 100644 --- a/docs/api/api-endpoints.mdx +++ b/docs/api/api-endpoints.mdx @@ -4,16 +4,13 @@ title: API Endpoints # API Endpoints -## RAI +## OD ### Graph Protocol Subgraphs -* Mainnet: [https://thegraph.com/explorer/subgraph/reflexer-labs/rai-mainnet](https://thegraph.com/explorer/subgraph/reflexer-labs/rai-mainnet) -* Kovan: [https://thegraph.com/explorer/subgraph/reflexer-labs/rai-kovan](https://thegraph.com/explorer/subgraph/reflexer-labs/rai-kovan) -* Reflexer hosted Mainnet: [https://subgraph.reflexer.finance/subgraphs/name/reflexer-labs/rai/graphql](https://subgraph.reflexer.finance/subgraphs/name/reflexer-labs/rai/graphql) -* Reflexer hosted Kovan: [https://subgraph-kovan.reflexer.finance/subgraphs/name/reflexer-labs/rai/graphql](https://subgraph-kovan.reflexer.finance/subgraphs/name/reflexer-labs/rai/graphql) -* Mainnet PRAI (deprecated beta): [https://thegraph.com/explorer/subgraph/reflexer-labs/prai-mainnet](https://thegraph.com/explorer/subgraph/reflexer-labs/prai-mainnet) +* Arbitrum: Coming soon +* Arbitrum Sepolia: [https://api.studio.thegraph.com/query/52770/open-dollar---testnet/v1.5.8-rc.8](https://api.studio.thegraph.com/query/52770/open-dollar---testnet/v1.5.8-rc.8) -The subgraph documentation is available on the right panel of[ thegraph.com endpoint ](https://thegraph.com/explorer/subgraph/reflexer-labs/rai-mainnet) +The subgraph documentation is available in our [od-subgraph](https://github.com/open-dollar/od-subgraph) repository ![](/assets/selection_436.png) diff --git a/docs/contract-translation/governance-contracts-naming-transition.mdx b/docs/contract-translation/governance-contracts-naming-transition.mdx deleted file mode 100644 index d2ff8767..00000000 --- a/docs/contract-translation/governance-contracts-naming-transition.mdx +++ /dev/null @@ -1,139 +0,0 @@ ---- -title: Governance Contracts Naming Transition ---- - -# Governance Contracts Naming Transition - -The following tables show the before and after variable names for MCD governance contracts. - -| DSPause | DSPause/DSProtestPause | -| :--- | :--- | -| wait | isDelayed | -| setOwner | setOwner | -| setAuthority | setAuthority | -| setDelay | setDelay | -| plans | scheduledTransactions | -| NaN | transactionDelays \(NEW\) \(DSProtestPause\) | -| proxy | proxy | -| delay | delay | -| NaN | MAX\_DELAY \(NEW\) | -| NaN | DS\_PAUSE\_TYPE \(NEW\) | -| hash | getTransactionDataHash | -| soul | getExtCodeHash | -| NaN | setDelayMultiplier \(NEW\) \(DSProtestPause\) | -| NaN | protestWindowAvailable \(NEW\) \(DSProtestPause\) | -| NaN | timeUntilProposalProtestDeadline \(NEW\) \(DSProtestPause\) | -| NaN | maxScheduledTransactions \(NEW\) | -| NaN | protester \(NEW\) \(DSProtestPause\) | -| NaN | protestEnd \(NEW\) \(DSProtestPause\) | -| NaN | MAX\_DELAY\_MULTIPLIER \(NEW\) \(DSProtestPause\) | -| plot | scheduleTransaction | -| NaN | attachTransactionDescription \(NEW\) | -| NaN | protestAgainstTransaction \(NEW\) \(DSProtestPause\) | -| drop | abandonTransaction | -| exec | executeTransaction | -| eta | earliestExecutionTime | -| fax | parameters | -| tag | codeHash | -| NaN | getTransactionDelays \(NEW\) \(DSProtestPause\) | - -| DSChief | VoteQuorum | -| :--- | :--- | -| slates | ballots | -| votes | votes | -| approvals | approvals | -| deposits | deposits | -| GOV | PROT | -| IOU | IOU | -| hat | votedAuthority | -| MAX\_YAYS | MAX\_CANDIDATES\_PER\_BALLOT | -| Etch | GroupCandidates | -| lock | addVotingWeight | -| free | removeVotingWeight | -| etch | groupCandidates | -| vote | vote | -| lift | electCandidate | -| addWeight | addWeight | -| subWeight | subWeight | -| requireByteOrderedSet | requireByteOrderedSet | -| setOwner | setOwner | -| setAuthority | setAuthority | -| isUserRoot | isUserRoot | -| setRootUser | setRootUser | - -| DSAuth | DSAuth | -| :--- | :--- | -| authority | authority | -| owner | owner | -| setOwner | setOwner | -| setAuthority | setAuthority | -| auth | auth | -| isAuthorized | isAuthorized | - -| DSRoles | DSRoles/DSDelegateRoles | -| :--- | :--- | -| \_root\_users | \_root\_users | -| \_user\_roles | \_user\_roles | -| \_capability\_roles | \_capability\_roles | -| \_public\_capabilities | \_public\_capabilities | -| getUserRoles | getUserRoles | -| getCapabilityRoles | getCapabilityRoles | -| isUserRoot | isUserRoot | -| isCapabilityPublic | isCapabilityPublic | -| hasUserRole | hasUserRole | -| canCall | canCall | -| BITNOT | BITNOT | -| setRootUser | setRootUser | -| setUserRole | setUserRole | -| setPublicCapability | setPublicCapability | -| setRoleCapability | setRoleCapability | - -| MkrAuthority | ProtocolTokenAuthority | -| :--- | :--- | -| root | root | -| NaN | owner \(NEW\) | -| sudo | isRootCalling | -| NaN | isRootOrOwnerCalling \(NEW\) | -| LogSetRoot | LogSetRoot | -| NaN | LogSetOwner \(NEW\) | -| setRoot | setRoot | -| NaN | setOwner \(NEW\) | -| wards | authorizedAccounts | -| LogRely | LogAddAuthorizedAccount | -| rely | addAuthorization | -| LogDeny | LogRemoveAuthorizedAccount | -| deny | removeAuthorization | -| burn | burn | -| burnFrom | burnFrom | -| mint | mint | -| canCall | canCall | - -| VoteProxy | VoteProxy | -| :--- | :--- | -| cold | cold | -| hot | hot | -| gov | gov | -| iou | iou | -| chief | voteQuorum | -| auth | isAuthorized | -| lock | addVotingWeight | -| free | removeVotingWeight | -| freeAll | removeAllVotingWeight | -| vote | vote | - -| DSGuard | DSGuard | -| :--- | :--- | -| LogPermit | LogPermit | -| LogForbid | LogForbid | -| ANY | ANY | -| canCall | canCall | -| permit | permit | -| forbid | forbid | - -| DSStop | DSStop | -| :--- | :--- | -| stopped | stopped | -| stoppable | stoppable | -| stop | stop | -| start | start | - diff --git a/docs/developer-readme.mdx b/docs/developer-readme.mdx new file mode 100644 index 00000000..7a634a2b --- /dev/null +++ b/docs/developer-readme.mdx @@ -0,0 +1,18 @@ +--- +title: ⭐️ Start Here +description: '' +--- + +# Developer Resources + +## Important Repositories + +- [od-app](https://github.com/open-dollar/od-app) - The front-end application for the protocol +- [od-sdk](https://github.com/open-dollar/od-sdk) - The SDK with contract-level calls that interact with our smart contracts +- [od-contracts](https://github.com/open-dollar/od-contracts) - The smart contracts that power the protocol +- [od-subgraph](https://github.com/open-dollar/od-subgraph) - The subgraph that indexes auction data for the protocol +- [od-docs](https://github.com/open-dollar/od-docs) - The Docusaurus documentation that you're reading now + +## Where to get help + +Feel free to open an issue in any of the above repositories and ask questions in our [Discord](https://www.opendollar.com/discord) diff --git a/docs/geb-js/api-reference/geb.mdx b/docs/geb-js/api-reference/geb.mdx index 8c59f2f6..fab1fd6c 100644 --- a/docs/geb-js/api-reference/geb.mdx +++ b/docs/geb-js/api-reference/geb.mdx @@ -10,7 +10,7 @@ The main package used to interact with the GEB system. Includes [helper function \+ **new Geb**(`network`: GebDeployment, `provider`: GebProviderInterface | Provider): [_Geb_](geb.md) -_Defined in_ [_packages/geb/src/geb.ts:89_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/geb.ts#L89) +_Defined in_ [_packages/geb/src/geb.ts:89_](https://github.com/open-dollar/od-sdk/blob/dev/src/geb.ts#L89C1-L89C16) Constructor of the main Geb.js object. @@ -18,7 +18,7 @@ Constructor of the main Geb.js object. | Name | Type | Description | | ---------- | -------------------------------- | ----------------------------------------------------------------------------------- | -| `network` | GebDeployment | Either `'kovan'`, `'mainnet'` or an actual list of contract addresses. | +| `network` | GebDeployment | Either `'arbitrum'`, `'arbitrum-sepolia'` or an actual list of contract addresses. | | `provider` | GebProviderInterface \| Provider | Either a Ethers.js provider or a Geb provider (Soon support for Web3 will be added) | **Returns:** [_Geb_](geb.md) @@ -29,7 +29,7 @@ Constructor of the main Geb.js object. • **contracts**: _ContractApis_ -_Defined in_ [_packages/geb/src/geb.ts:87_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/geb.ts#L87) +_Defined in_ [_packages/geb/src/geb.ts:87_](https://github.com/open-dollar/od-sdk/blob/dev/src/geb.ts#L105) Object containing all GEB core smart-contracts instances for direct level interactions. All of the following contracts object are one-to-one typed API to the underlying smart-contract. Read-only functions that do not change the blockchain state return a promise of the return data. State modifying function will return synchronously a pre-filled transaction request object: @@ -40,13 +40,13 @@ Object containing all GEB core smart-contracts instances for direct level intera } ``` -This object follow the [TransactionRequest model of ethers.js](https://docs.ethers.io/v5/api/providers/types/#providers-TransactionRequest) (Also similar to the [model used by web.js](https://web3js.readthedocs.io/en/v1.3.0/web3-eth.html#id84)). The object can be completed with properties such as `from`, `gasPrice`, `gas` (gas limit, web3.js ony) or `gasLimit` (gas limit, ethers.js only). The object can then be passed to the `sendTransaction` of [ehters.js](https://docs.ethers.io/v5/api/signer/#Signer-sendTransaction) or [web3.js](https://web3js.readthedocs.io/en/v1.3.0/web3-eth.html#sendtransaction) +This object follow the [TransactionRequest model of ethers.js](https://docs.ethers.io/v5/api/providers/types/#providers-TransactionRequest) (Also similar to the [model used by web.js](https://web3js.readthedocs.io/en/v1.3.0/web3-eth.html#id84)). The object can be completed with properties such as `from`, `gasPrice`, `gas` (gas limit, web3.js ony) or `gasLimit` (gas limit, ethers.js only). The object can then be passed to the `sendTransaction` of [ethers.js](https://docs.ethers.io/v5/api/signer/#Signer-sendTransaction) or [web3.js](https://web3js.readthedocs.io/en/v1.3.0/web3-eth.html#sendtransaction) Example: ```typescript // Setup geb.js an ethers - const provider = new ethers.providers.JsonRpcProvider('http://kovan.infura.io/') + const provider = new ethers.providers.JsonRpcProvider('http://arbitrum.infura.io/') const wallet = new ethers.Wallet('', provider) const geb = new Geb('kovan', provider) @@ -79,7 +79,7 @@ Currently the following contracts are available: * FixedDiscountCollateralAuctionHouse * Weth (ERC20) -For detailed information about the functions of each contract we recommend referring directly to the smart contract [code](https://github.com/reflexer-labs/geb) and [documentation](/). +For detailed information about the functions of each contract we recommend referring directly to the smart contract [code](https://github.com/open-dollar/od-contracts) and [documentation](/). ## Methods @@ -87,7 +87,7 @@ For detailed information about the functions of each contract we recommend refer ▸ **deployProxy**(): _TransactionRequest_ -_Defined in_ [_packages/geb/src/geb.ts:133_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/geb.ts#L133) +_Defined in_ [_packages/geb/src/geb.ts:133_](https://github.com/open-dollar/od-sdk/blob/dev/src/geb.ts#L127C26-L127C26) Deploy a new proxy owned by the sender. @@ -97,7 +97,7 @@ Deploy a new proxy owned by the sender. ▸ **getErc20Contract**(`tokenAddress`: string): _Erc20_ -_Defined in_ [_packages/geb/src/geb.ts:261_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/geb.ts#L261) +_Defined in_ [_packages/geb/src/geb.ts:261_](https://github.com/open-dollar/od-sdk/blob/dev/src/geb.ts#L149) Returns an object that can be used to interact with a ERC20 token. Example: @@ -121,58 +121,11 @@ await wallet.sendTransaction(tx) **Returns:** _Erc20_ -Erc20 - -### getGebContract - -▸ **getGebContract**‹**T**›(`gebContractClass`: GebContractAPIConstructorInterface‹T›, `address`: string): _T_ - -_Defined in_ [_packages/geb/src/geb.ts:387_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/geb.ts#L387) - -Returns an instance of a specific geb contract given a Geb contract API class at a specified address - -```typescript -import { contracts } from "geb.js" -const safeEngine = geb.getGebContract(contracts.SafeEngine, "0xabcd123..") -const globalDebt = safeEngine.globalDebt() -``` - -**Type parameters:** - -▪ **T**: _BaseContractAPI_ - -**Parameters:** - -| Name | Type | Description | -| ------------------ | ------------------------------------- | -------------------------------------- | -| `gebContractClass` | GebContractAPIConstructorInterface‹T› | Class from contracts or adminContracts | -| `address` | string | Contract address of the instance | - -**Returns:** _T_ - -### getIncentiveCampaignContract - -▸ **getIncentiveCampaignContract**(`campaignNumber`: number): _Promise‹StakingRewards‹››_ - -_Defined in_ [_packages/geb/src/geb.ts:271_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/geb.ts#L271) - -Help function to get the contract object of an incentive campaign given its number ID - -**Parameters:** - -| Name | Type | Description | -| ---------------- | ------ | ------------------------------ | -| `campaignNumber` | number | incremental ID of the campaign | - -**Returns:** _Promise‹StakingRewards‹››_ - -StakingRewards - ### getProxyAction ▸ **getProxyAction**(`ownerAddress`: string): _Promise‹_[_GebProxyActions_](gebproxyactions.md)_‹››_ -_Defined in_ [_packages/geb/src/geb.ts:121_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/geb.ts#L121) +_Defined in_ [_packages/geb/src/geb.ts:121_](https://github.com/open-dollar/od-sdk/blob/dev/src/geb.ts#L115) Given an address returns a GebProxyActions object to execute bundled operations. Important: This requires the address to have deployed a GEB proxy through the proxy registry contract. It will throw a `DOES_NOT_OWN_HAVE_PROXY` error if the address specified does not have a proxy. Use the [deployProxy](geb.md#deployproxy) function to get a new proxy. @@ -182,105 +135,4 @@ Given an address returns a GebProxyActions object to execute bundled operations. | -------------- | ------ | ---------------------------------------------------------------------- | | `ownerAddress` | string | Externally owned user account, Ethereum address that owns a GEB proxy. | -**Returns:** _Promise‹_[_GebProxyActions_](gebproxyactions.md)_‹››_ - -### getSafe - -▸ **getSafe**(`idOrHandler`: string | number, `collateralType?`: string): _Promise‹_[_Safe_](safe.md)_›_ - -_Defined in_ [_packages/geb/src/geb.ts:141_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/geb.ts#L141) - -Get the SAFE object given a `safeManager` id or a `safeEngine` handler address. - -**Parameters:** - -| Name | Type | Description | -| ----------------- | ---------------- | ----------------------- | -| `idOrHandler` | string \| number | Safe Id or SAFE handler | -| `collateralType?` | string | - | - -**Returns:** _Promise‹_[_Safe_](safe.md)_›_ - -### getSafeFromOwner - -▸ **getSafeFromOwner**(`address`: string): _Promise‹_[_Safe_](safe.md)_\[]›_ - -_Defined in_ [_packages/geb/src/geb.ts:224_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/geb.ts#L224) - -Fetch the list of safes owned by an address. This function will fetch safes owned directly through the safeManager and safes owned through the safe manager through a proxy. Safes owned directly by the address at the safeEngine level won't appear here. - -Note that this function will make a lot of network calls and is therefore very slow. For front-ends we recommend using pre-indexed data such as the geb-subgraph. - -**Parameters:** - -| Name | Type | Description | -| --------- | ------ | ----------- | -| `address` | string | | - -**Returns:** _Promise‹_[_Safe_](safe.md)_\[]›_ - -### multiCall - -▸ **multiCall**‹**O1**, **O2**, **O3**›(`calls`: \[MulticallRequest‹O1›, MulticallRequest‹O2›, MulticallRequest‹O3›]): _Promise‹\[O1, O2, O3]›_ - -_Defined in_ [_packages/geb/src/geb.ts:293_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/geb.ts#L293) - -Bundles several read only GEB contract call into 1 RPC single request. Useful for front-ends or apps that need to fetch many parameters from the contracts but want to minimize the network request and the load on the underlying Ethereum node. The function takes as input an Array of GEB view contract calls. **IMPORTANT**: You have to set the `multicall` parameter of the contract function to `true`, it is the always the last parameter of the function. Multicall works for all contracts in the `Geb.contracts` and can be use with any contract that inherit the `BaseContractApi`. Note that it does not support non-view calls (Calls that require to pay gas and change the state of the blockchain). - -Example: - -```typescript -import { ethers } from "ethers" -import { Geb } from "geb.js" - -const provider = new ethers.providers.JsonRpcProvider("http://kovan.infura.io/...") -const geb = new Geb("kovan", provider); - -const [ globalDebt, collateralInfo ] = await geb.multiCall([ - geb.contracts.safeEngine.globalDebt(true), // !! Note the last parameter set to true. - geb.contracts.safeEngine.collateralTypes(ETH_A, true), -]) - -console.log(`Current global debt: ${globalDebt.toString()}`) -console.log(`Current ETH_A debt: ${collateralInfo.debtAmount}`) -``` - -**Type parameters:** - -▪ **O1** - -▪ **O2** - -▪ **O3** - -**Parameters:** - -| Name | Type | Description | -| ------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `calls` | \[MulticallRequest‹O1›, MulticallRequest‹O2›, MulticallRequest‹O3›] | Call a read only GEB contract function. The GEB contract object needs to be called with the parameter `multicall` set to `true` as seen in the example above. | - -**Returns:** _Promise‹\[O1, O2, O3]›_ - -Promise Array with the result from their respective requests. - -### `Static` getGebContract - -▸ **getGebContract**‹**T**›(`gebContractClass`: GebContractAPIConstructorInterface‹T›, `address`: string, `provider`: GebProviderInterface | Provider): _T_ - -_Defined in_ [_packages/geb/src/geb.ts:355_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/geb.ts#L355) - -Returns an instance of a specific geb contract given Geb contract API class constructor at a specified address - -**Type parameters:** - -▪ **T**: _BaseContractAPI_ - -**Parameters:** - -| Name | Type | Description | -| ------------------ | ------------------------------------- | --------------------------------------------- | -| `gebContractClass` | GebContractAPIConstructorInterface‹T› | Class from contracts or adminContracts | -| `address` | string | Contract address of the instance | -| `provider` | GebProviderInterface \| Provider | Either a Ethers.js provider or a Geb provider | - -**Returns:** _T_ +**Returns:** _Promise‹_[_GebProxyActions_](gebproxyactions.md)_‹››_ \ No newline at end of file diff --git a/docs/geb-js/api-reference/gebadmin.mdx b/docs/geb-js/api-reference/gebadmin.mdx deleted file mode 100644 index ec01a8e6..00000000 --- a/docs/geb-js/api-reference/gebadmin.mdx +++ /dev/null @@ -1,435 +0,0 @@ ---- -title: GEB Admin ---- - -# Geb Admin - -This class extends the core `GEB` class with additional tools and contracts that are not used as often as other SAFE management tools. Here you will find utils for contracts such as DSPause, ESM etc. These contracts are scattered across several repositories. Please refer to the smart contract documentation to learn more about them. - -**IMPORTANT:** To avoid bloating the main [geb.js](https://www.npmjs.com/package/geb.js) package this class is only available in a [separate package](https://www.npmjs.com/package/@reflexer-finance/geb-admin). Please install it like this: - -``` -npm install @reflexer-finance/geb-admin -``` - -And after that you are ready to use the admin tools similar to the GEB class: - -```typescript -import { ethers } from 'ethers' -import { GebAdmin } from "@reflexer-finance/geb-admin" - - const provider = new ethers.providers.JsonRpcProvider('http://kovan.infura.io/') - const gebAdmin = new GebAdmin('kovan', provider) -``` - -## Constructors - -\+ **new GebAdmin**(`network`: GebDeployment, `provider`: GebProviderInterface | Provider): [_GebAdmin_](gebadmin.md) - -_Defined in_ [_packages/geb-admin/src/geb-admin.ts:52_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb-admin/src/geb-admin.ts#L52) - -**Parameters:** - -| Name | Type | Description | -| ---------- | -------------------------------- | -------------------------------------------------------------------------------------- | -| `network` | GebDeployment | Either `'kovan'`, `'mainnet'` or an actual list of contract addresses. | -| `provider` | GebProviderInterface \| Provider | Either a Ethers.js provider or a GEB provider. Support for Web3.js will soon be added. | - -**Returns:** [_GebAdmin_](gebadmin.md) - -## Properties - -### contracts - -• **contracts**: _ContractApis_ - -_Inherited from_ [_GebAdmin_](gebadmin.md)_._[_contracts_](gebadmin.md#contracts) - -Defined in packages/geb/lib/geb.d.ts:70 - -Object containing all GEB core smart-contracts instances for direct level interactions. All of the following contracts object are one-to-one typed API to the underlying smart-contract. Read-only functions that do not change the blockchain state return a promise of the return data. State modifying function will return synchronously a pre-filled transaction request object: - -``` -{ - to: "0x123abc.." - data: "0xabab234ab..." -} -``` - -This object follow the [TransactionRequest model of ethers.js](https://docs.ethers.io/v5/api/providers/types/#providers-TransactionRequest) (Also similar to the [model used by web.js](https://web3js.readthedocs.io/en/v1.3.0/web3-eth.html#id84)). The object can be completed with properties such as `from`, `gasPrice`, `gas` (gas limit, web3.js ony) or `gasLimit` (gas limit, ethers.js only). The object can then be passed to the `sendTransaction` of [ehters.js](https://docs.ethers.io/v5/api/signer/#Signer-sendTransaction) or [web3.js](https://web3js.readthedocs.io/en/v1.3.0/web3-eth.html#sendtransaction) - -Example: - -```typescript - // Setup geb.js an ethers - const provider = new ethers.providers.JsonRpcProvider('http://kovan.infura.io/') - const wallet = new ethers.Wallet('', provider) - const geb = new Geb('kovan', provider) - - // Contract read function: Fetch the debt ceiling - const debtCeiling = await geb.contracts.safeEngine.globalDebtCeiling() - - // State changing function: Manualy liquidate a SAFE - const tx = geb.contracts.liquidationEngine.liquidateSAFE(ETH_A, '0x1234abc...') - await wallet.sendTransaction(tx) // Send the Ethereum transaction -``` - -Currently the following contracts ae available in this property: - -* SAFEEngine -* AccountingEngine -* TaxCollector -* LiquidationEngine -* OracleRelayer -* GlobalSettlement -* DebtAuctionHouse -* PreSettlementSurplusAuctionHouse -* PostSettlementSurplusAuctionHouse -* SettlementSurplusAuctioneer -* GebSafeManager -* GetSafes -* BasicCollateralJoin -* CoinJoin -* Coin (System coin ERC20 contract) -* GebProxyRegistry -* FixedDiscountCollateralAuctionHouse -* Weth (ERC20) - -For detailed information about the functions of each contract we recommend referring directly to the smart-contract [code](https://github.com/reflexer-labs/geb) and [documentation](/) - -### contractsAdmin - -• **contractsAdmin**: _AdminApis_ - -_Defined in_ [_packages/geb-admin/src/geb-admin.ts:52_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb-admin/src/geb-admin.ts#L52) - -Object containing all GEB admin contracts instances for low level interactions. It currently has the following contracts: - -* MultiSigWallet -* DsProxy -* DsToken -* ProtocolTokenAuthority -* GebPollingEmitter -* GebPrintingPermissions -* DsDelegateRoles -* DsPause -* DsPauseProxy -* GovActions -* ESM -* TokenBurner -* FsmGovernanceInterface -* DsProxyFactory -* GebDeployPauseProxyActions -* DsProxy -* TxManager - -## Methods - -### deployProxy - -▸ **deployProxy**(): _object_ - -_Inherited from_ [_GebAdmin_](gebadmin.md)_._[_deployProxy_](gebadmin.md#deployproxy) - -Defined in packages/geb/lib/geb.d.ts:88 - -Deploy a new proxy owned by the sender. - -**Returns:** _object_ - -* **chainId**? : _number_ -* **data**? : _string_ -* **from**? : _string_ -* **gasLimit**? : _BigNumber_ -* **gasPrice**? : _BigNumber_ -* **nonce**? : _number_ -* **to**? : _string_ -* **value**? : _BigNumber_ - -### getErc20Contract - -▸ **getErc20Contract**(`tokenAddress`: string): _Erc20_ - -_Inherited from_ [_GebAdmin_](gebadmin.md)_._[_getErc20Contract_](gebadmin.md#geterc20contract) - -Defined in packages/geb/lib/geb.d.ts:123 - -Returns an object that can be used to interact with a ERC20 token. Example: - -```typescript -const USDCAddress = "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" -const USDC = geb.getErc20Contract(USDCAddress) - -// Get 0xdefiisawesome's balance -const balance = USDC.balanceOf("0xdefiisawesome..") - -// Send 1 USDC to 0xdefiisawesome (USDC is 6 decimals) -const tx = USDC.transfer("0xdefiisawesome..", "1000000") -await wallet.sendTransaction(tx) -``` - -**Parameters:** - -| Name | Type | Description | -| -------------- | ------ | ---------------------- | -| `tokenAddress` | string | Token contract address | - -**Returns:** _Erc20_ - -Erc20 - -### getGebContract - -▸ **getGebContract**‹**T**›(`gebContractClass`: GebContractAPIConstructorInterface‹T›, `address`: string): _T_ - -_Inherited from_ [_GebAdmin_](gebadmin.md)_._[_getGebContract_](gebadmin.md#static-getgebcontract) - -Defined in packages/geb/lib/geb.d.ts:165 - -Returns an instance of a specific geb contract given a Geb contract API class at a specified address - -```typescript -import { contracts } from "geb.js" -const safeEngine = geb.getGebContract(contracts.SafeEngine, "0xabcd123..") -const globalDebt = safeEngine.globalDebt() -``` - -**Type parameters:** - -▪ **T**: _BaseContractAPI_ - -**Parameters:** - -| Name | Type | Description | -| ------------------ | ------------------------------------- | -------------------------------------- | -| `gebContractClass` | GebContractAPIConstructorInterface‹T› | Class from contracts or adminContracts | -| `address` | string | Contract address of the instance | - -**Returns:** _T_ - -### getIncentiveCampaignContract - -▸ **getIncentiveCampaignContract**(`campaignNumber`: number): _Promise‹StakingRewards›_ - -_Inherited from_ [_GebAdmin_](gebadmin.md)_._[_getIncentiveCampaignContract_](gebadmin.md#getincentivecampaigncontract) - -Defined in packages/geb/lib/geb.d.ts:131 - -Help function to get the contract object of an incentive campaign given its number ID - -**Parameters:** - -| Name | Type | Description | -| ---------------- | ------ | ------------------------------ | -| `campaignNumber` | number | incremental ID of the campaign | - -**Returns:** _Promise‹StakingRewards›_ - -StakingRewards - -### getProxyAction - -▸ **getProxyAction**(`ownerAddress`: string): _Promise‹GebProxyActions›_ - -_Inherited from_ [_GebAdmin_](gebadmin.md)_._[_getProxyAction_](gebadmin.md#getproxyaction) - -Defined in packages/geb/lib/geb.d.ts:84 - -Given an address returns a GebProxyActions object to execute bundled operations. Important: This requires the address to have deployed a GEB proxy through the proxy registry contract. It will throw a `DOES_NOT_OWN_HAVE_PROXY` error if the address specified does not have a proxy. Use the [deployProxy](gebadmin.md#deployproxy) function to get a new proxy. - -**Parameters:** - -| Name | Type | Description | -| -------------- | ------ | ---------------------------------------------------------------------- | -| `ownerAddress` | string | Externally owned user account, Ethereum address that owns a GEB proxy. | - -**Returns:** _Promise‹GebProxyActions›_ - -### getSafe - -▸ **getSafe**(`idOrHandler`: string | number, `collateralType?`: string): _Promise‹Safe›_ - -_Inherited from_ [_GebAdmin_](gebadmin.md)_._[_getSafe_](gebadmin.md#getsafe) - -Defined in packages/geb/lib/geb.d.ts:93 - -Get the SAFE object given a `safeManager` id or a `safeEngine` handler address. - -**Parameters:** - -| Name | Type | Description | -| ----------------- | ---------------- | ----------------------- | -| `idOrHandler` | string \| number | Safe Id or SAFE handler | -| `collateralType?` | string | - | - -**Returns:** _Promise‹Safe›_ - -### getSafeFromOwner - -▸ **getSafeFromOwner**(`address`: string): _Promise‹Safe\[]›_ - -_Inherited from_ [_GebAdmin_](gebadmin.md)_._[_getSafeFromOwner_](gebadmin.md#getsafefromowner) - -Defined in packages/geb/lib/geb.d.ts:104 - -Fetch the list of safes owned by an address. This function will fetch safes owned directly through the safeManager and safes owned through the safe manager through a proxy. Safes owned directly by the address at the safeEngine level won't appear here. - -Note that this function will make a lot of network calls and is therefore very slow. For front-ends we recommend using pre-indexed data such as the geb-subgraph. - -**Parameters:** - -| Name | Type | Description | -| --------- | ------ | ----------- | -| `address` | string | | - -**Returns:** _Promise‹Safe\[]›_ - -### gnosisSafeThreshold1SubmitTransaction - -▸ **gnosisSafeThreshold1SubmitTransaction**(`sender`: string, `to`: string, `data`: string): _TransactionRequest_ - -_Defined in_ [_packages/geb-admin/src/geb-admin.ts:203_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb-admin/src/geb-admin.ts#L203) - -Submit a transaction to a gnosis safe directly executed. Works only if the threshold on the safe is 1. - -**Parameters:** - -| Name | Type | Description | -| -------- | ------ | ---------------------------------- | -| `sender` | string | Proposal submitter | -| `to` | string | Proposal target (Usually ds-pause) | -| `data` | string | transaction data of the proposal | - -**Returns:** _TransactionRequest_ - -### multiCall - -▸ **multiCall**‹**O1**, **O2**, **O3**›(`calls`: \[MulticallRequest‹O1›, MulticallRequest‹O2›, MulticallRequest‹O3›]): _Promise‹\[O1, O2, O3]›_ - -_Inherited from_ [_GebAdmin_](gebadmin.md)_._[_multiCall_](gebadmin.md#multicall) - -Defined in packages/geb/lib/geb.d.ts:136 - -**Type parameters:** - -▪ **O1** - -▪ **O2** - -▪ **O3** - -**Parameters:** - -| Name | Type | -| ------- | ------------------------------------------------------------------- | -| `calls` | \[MulticallRequest‹O1›, MulticallRequest‹O2›, MulticallRequest‹O3›] | - -**Returns:** _Promise‹\[O1, O2, O3]›_ - -### verifyWebScheduleCallcode - -▸ **verifyWebScheduleCallcode**(`govFunctionAbi`: string, `params`: any\[], `earliestExecutionTime`: number, `calldata`: string, `description?`: string): _Promise‹boolean›_ - -_Defined in_ [_packages/geb-admin/src/geb-admin.ts:75_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb-admin/src/geb-admin.ts#L75) - -Verifies a transaction for scheduling proposals - -**Parameters:** - -| Name | Type | Description | -| ----------------------- | ------ | ------------------------------------------------------------------------------------- | -| `govFunctionAbi` | string | Human readable abi from gov actions or proxy of choice -> "setDelay(address,uint256)" | -| `params` | any\[] | Array containing all for the above function | -| `earliestExecutionTime` | number | - | -| `calldata` | string | to verify | -| `description?` | string | - | - -**Returns:** _Promise‹boolean›_ - -Promise - -### webExecuteProposal - -▸ **webExecuteProposal**(`govFunctionAbi`: string, `params`: any\[], `earliestExecutionTime`: number): _Promise‹TransactionRequest›_ - -_Defined in_ [_packages/geb-admin/src/geb-admin.ts:99_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb-admin/src/geb-admin.ts#L99) - -Encodes executing a proposal in dspause for web GUI - -**Parameters:** - -| Name | Type | Description | -| ----------------------- | ------ | ------------------------------------------------------------------------------------- | -| `govFunctionAbi` | string | Human readable abi from gov actions or proxy of choice -> "setDelay(address,uint256)" | -| `params` | any\[] | Array containing all for the above function | -| `earliestExecutionTime` | number | - | - -**Returns:** _Promise‹TransactionRequest›_ - -Promise - -### webScheduleProposal - -▸ **webScheduleProposal**(`govFunctionAbi`: string, `params`: any\[], `earliestExecutionTime`: number, `description?`: string): _Promise‹object›_ - -_Defined in_ [_packages/geb-admin/src/geb-admin.ts:124_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb-admin/src/geb-admin.ts#L124) - -Encodes scheduling a proposal in dspause for web GUI - -**Parameters:** - -| Name | Type | Description | -| ----------------------- | ------ | ------------------------------------------------------------------------------------- | -| `govFunctionAbi` | string | Human readable abi from gov actions or proxy of choice -> "setDelay(address,uint256)" | -| `params` | any\[] | Array containing all for the above function | -| `earliestExecutionTime` | number | - | -| `description?` | string | - | - -**Returns:** _Promise‹object›_ - -Promise - -### webTestScheduleProposal - -▸ **webTestScheduleProposal**(`govFunctionAbi`: string, `params`: any\[], `earliestExecutionTime`: number, `description?`: string): _Promise‹void›_ - -_Defined in_ [_packages/geb-admin/src/geb-admin.ts:173_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb-admin/src/geb-admin.ts#L173) - -Test the execution of a proposal about to be schedule in dspause with web GUI - -**Parameters:** - -| Name | Type | Description | -| ----------------------- | ------ | ------------------------------------------------------------------------------------- | -| `govFunctionAbi` | string | Human readable abi from gov actions or proxy of choice -> "setDelay(address,uint256)" | -| `params` | any\[] | Array containing all for the above function | -| `earliestExecutionTime` | number | - | -| `description?` | string | - | - -**Returns:** _Promise‹void›_ - -Promise - -### `Static` getGebContract - -▸ **getGebContract**‹**T**›(`gebContractClass`: GebContractAPIConstructorInterface‹T›, `address`: string, `provider`: GebProviderInterface | Provider): _T_ - -_Inherited from_ [_GebAdmin_](gebadmin.md)_._[_getGebContract_](gebadmin.md#static-getgebcontract) - -Defined in packages/geb/lib/geb.d.ts:152 - -Returns an instance of a specific geb contract given Geb contract API class constructor at a specified address - -**Type parameters:** - -▪ **T**: _BaseContractAPI_ - -**Parameters:** - -| Name | Type | Description | -| ------------------ | ------------------------------------- | --------------------------------------------- | -| `gebContractClass` | GebContractAPIConstructorInterface‹T› | Class from contracts or adminContracts | -| `address` | string | Contract address of the instance | -| `provider` | GebProviderInterface \| Provider | Either a Ethers.js provider or a Geb provider | - -**Returns:** _T_ diff --git a/docs/geb-js/api-reference/gebproxyactions.mdx b/docs/geb-js/api-reference/gebproxyactions.mdx index a0eb34de..fbd12f0b 100644 --- a/docs/geb-js/api-reference/gebproxyactions.mdx +++ b/docs/geb-js/api-reference/gebproxyactions.mdx @@ -10,7 +10,7 @@ Convenience class to call functions from [GebProxyActions](https://github.com/Us \+ **new GebProxyActions**(`proxyAddress`: string, `network`: GebDeployment, `chainProvider`: GebProviderInterface): [_GebProxyActions_](gebproxyactions.md) -_Defined in_ [_packages/geb/src/proxy-action.ts:57_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L57) +_Defined in_ [_packages/geb/src/proxy-action.ts:57_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts) **Parameters:** @@ -28,7 +28,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:57_](https://github.com/reflexer • **proxy**: _DsProxy_ -_Defined in_ [_packages/geb/src/proxy-action.ts:28_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L28) +_Defined in_ [_packages/geb/src/proxy-action.ts:28_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L28) Underlying proxy object. Can be used to make custom calls to the proxy using the `proxy.execute()` function. @@ -36,7 +36,7 @@ Underlying proxy object. Can be used to make custom calls to the proxy using the • **proxyActionCoreAddress**: _string_ -_Defined in_ [_packages/geb/src/proxy-action.ts:33_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L33) +_Defined in_ [_packages/geb/src/proxy-action.ts:33_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L33) Address of the base proxy action contract. @@ -44,7 +44,7 @@ Address of the base proxy action contract. • **proxyActionGlobalSettlementAddress**: _string_ -_Defined in_ [_packages/geb/src/proxy-action.ts:38_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L38) +_Defined in_ [_packages/geb/src/proxy-action.ts:38_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L38) Address of the proxy action contract for global settlement. @@ -52,7 +52,7 @@ Address of the proxy action contract for global settlement. • **proxyActionIncentiveAddress**: _string_ -_Defined in_ [_packages/geb/src/proxy-action.ts:43_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L43) +_Defined in_ [_packages/geb/src/proxy-action.ts:43_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L43) Address of the proxy action contract for Uniswap LP share staking. @@ -60,7 +60,7 @@ Address of the proxy action contract for Uniswap LP share staking. • **proxyActionLeverageAddress**: _string_ -_Defined in_ [_packages/geb/src/proxy-action.ts:48_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L48) +_Defined in_ [_packages/geb/src/proxy-action.ts:48_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L48) Address of the proxy action contract used for leverage with flash loans. @@ -68,7 +68,7 @@ Address of the proxy action contract used for leverage with flash loans. • **proxyAddress**: _string_ -_Defined in_ [_packages/geb/src/proxy-action.ts:62_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L62) +_Defined in_ [_packages/geb/src/proxy-action.ts:62_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L62) Address of the underlying proxy. @@ -78,7 +78,7 @@ Address of the underlying proxy. ▸ **allowSAFE**(`safe`: BigNumberish, `usr`: string, `ok`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:115_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L115) +_Defined in_ [_packages/geb/src/proxy-action.ts:115_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L115) **Parameters:** @@ -94,7 +94,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:115_](https://github.com/reflexe ▸ **approveSAFEModification**(`obj`: string, `usr`: string): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:130_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L130) +_Defined in_ [_packages/geb/src/proxy-action.ts:130_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L130) **Parameters:** @@ -109,7 +109,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:130_](https://github.com/reflexe ▸ **coinJoin\_join**(`apt`: string, `safeHandler`: string, `wad`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:136_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L136) +_Defined in_ [_packages/geb/src/proxy-action.ts:136_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L136) **Parameters:** @@ -125,7 +125,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:136_](https://github.com/reflexe ▸ **denySAFEModification**(`obj`: string, `usr`: string): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:146_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L146) +_Defined in_ [_packages/geb/src/proxy-action.ts:146_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L146) **Parameters:** @@ -140,7 +140,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:146_](https://github.com/reflexe ▸ **enterSystem**(`src`: string, `safe`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:152_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L152) +_Defined in_ [_packages/geb/src/proxy-action.ts:152_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L152) **Parameters:** @@ -155,7 +155,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:152_](https://github.com/reflexe ▸ **exitETH**(`safe`: BigNumberish, `wad`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:162_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L162) +_Defined in_ [_packages/geb/src/proxy-action.ts:162_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L162) **Parameters:** @@ -170,7 +170,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:162_](https://github.com/reflexe ▸ **exitTokenCollateral**(`collateralJoin`: string, `safe`: BigNumberish, `amt`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:173_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L173) +_Defined in_ [_packages/geb/src/proxy-action.ts:173_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L173) **Parameters:** @@ -186,7 +186,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:173_](https://github.com/reflexe ▸ **flashDeleverage**(`uniswapV2Pair`: string, `callbackProxy`: string, `collateralType`: BytesLike, `safe`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:815_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L815) +_Defined in_ [_packages/geb/src/proxy-action.ts:815_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L815) **Parameters:** @@ -203,7 +203,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:815_](https://github.com/reflexe ▸ **flashDeleverageFreeETH**(`uniswapV2Pair`: string, `callbackProxy`: string, `collateralType`: BytesLike, `safe`: BigNumberish, `amountToFree`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:836_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L836) +_Defined in_ [_packages/geb/src/proxy-action.ts:836_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L836) **Parameters:** @@ -221,7 +221,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:836_](https://github.com/reflexe ▸ **flashLeverage**(`uniswapV2Pair`: string, `callbackProxy`: string, `collateralType`: BytesLike, `safe`: BigNumberish, `leverage`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:859_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L859) +_Defined in_ [_packages/geb/src/proxy-action.ts:859_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L859) **Parameters:** @@ -239,7 +239,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:859_](https://github.com/reflexe ▸ **freeETH**(`safe`: BigNumberish, `wad`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:188_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L188) +_Defined in_ [_packages/geb/src/proxy-action.ts:188_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L188) **Parameters:** @@ -254,7 +254,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:188_](https://github.com/reflexe ▸ **freeTokenCollateral**(`collateralJoin`: string, `safe`: BigNumberish, `amt`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:199_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L199) +_Defined in_ [_packages/geb/src/proxy-action.ts:199_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L199) **Parameters:** @@ -270,7 +270,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:199_](https://github.com/reflexe ▸ **freeTokenCollateralGlobalSettlement**(`collateralJoin`: string, `safe`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:765_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L765) +_Defined in_ [_packages/geb/src/proxy-action.ts:765_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L765) **Parameters:** @@ -285,7 +285,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:765_](https://github.com/reflexe ▸ **generateDebt**(`safe`: BigNumberish, `wad`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:214_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L214) +_Defined in_ [_packages/geb/src/proxy-action.ts:214_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L214) **Parameters:** @@ -300,7 +300,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:214_](https://github.com/reflexe ▸ **generateDebtAndProtectSAFE**(`safe`: BigNumberish, `wad`: BigNumberish, `saviour`: string): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:226_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L226) +_Defined in_ [_packages/geb/src/proxy-action.ts:226_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L226) **Parameters:** @@ -316,7 +316,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:226_](https://github.com/reflexe ▸ **lockETH**(`ethValue`: BigNumberish, `safe`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:244_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L244) +_Defined in_ [_packages/geb/src/proxy-action.ts:244_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L244) **Parameters:** @@ -331,7 +331,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:244_](https://github.com/reflexe ▸ **lockETHAndGenerateDebt**(`ethValue`: BigNumberish, `safe`: BigNumberish, `deltaWad`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:255_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L255) +_Defined in_ [_packages/geb/src/proxy-action.ts:255_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L255) **Parameters:** @@ -347,7 +347,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:255_](https://github.com/reflexe ▸ **lockETHLeverage**(`ethValue`: BigNumberish, `uniswapV2Pair`: string, `callbackProxy`: string, `collateralType`: BytesLike, `safe`: BigNumberish, `leverage`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:882_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L882) +_Defined in_ [_packages/geb/src/proxy-action.ts:882_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L882) **Parameters:** @@ -366,7 +366,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:882_](https://github.com/reflexe ▸ **lockTokenCollateral**(`collateralJoin`: string, `safe`: BigNumberish, `amt`: BigNumberish, `transferFrom`: boolean): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:273_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L273) +_Defined in_ [_packages/geb/src/proxy-action.ts:273_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L273) **Parameters:** @@ -383,7 +383,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:273_](https://github.com/reflexe ▸ **lockTokenCollateralAndGenerateDebt**(`collateralJoin`: string, `safe`: BigNumberish, `collateralAmount`: BigNumberish, `deltaWad`: BigNumberish, `transferFrom`: boolean): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:290_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L290) +_Defined in_ [_packages/geb/src/proxy-action.ts:290_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L290) **Parameters:** @@ -401,7 +401,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:290_](https://github.com/reflexe ▸ **lockTokenCollateralGenerateDebtAndProtectSAFE**(`collateralJoin`: string, `safe`: BigNumberish, `collateralAmount`: BigNumberish, `deltaWad`: BigNumberish, `transferFrom`: boolean, `saviour`: string): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:311_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L311) +_Defined in_ [_packages/geb/src/proxy-action.ts:311_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L311) **Parameters:** @@ -420,7 +420,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:311_](https://github.com/reflexe ▸ **makeCollateralBag**(`collateralJoin`: string): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:335_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L335) +_Defined in_ [_packages/geb/src/proxy-action.ts:335_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L335) **Parameters:** @@ -434,7 +434,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:335_](https://github.com/reflexe ▸ **modifySAFECollateralization**(`safe`: BigNumberish, `deltaCollateral`: BigNumberish, `deltaDebt`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:341_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L341) +_Defined in_ [_packages/geb/src/proxy-action.ts:341_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L341) **Parameters:** @@ -450,7 +450,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:341_](https://github.com/reflexe ▸ **moveSAFE**(`safeSrc`: BigNumberish, `safeDst`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:356_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L356) +_Defined in_ [_packages/geb/src/proxy-action.ts:356_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L356) **Parameters:** @@ -465,7 +465,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:356_](https://github.com/reflexe ▸ **openLockETHAndGenerateDebt**(`ethValue`: BigNumberish, `collateralType`: BytesLike, `deltaWad`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:366_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L366) +_Defined in_ [_packages/geb/src/proxy-action.ts:366_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L366) **Parameters:** @@ -481,7 +481,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:366_](https://github.com/reflexe ▸ **openLockETHGenerateDebtAndProtectSAFE**(`ethValue`: BigNumberish, `collateralType`: BytesLike, `deltaWad`: BigNumberish, `saviour`: string): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:384_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L384) +_Defined in_ [_packages/geb/src/proxy-action.ts:384_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L384) **Parameters:** @@ -498,7 +498,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:384_](https://github.com/reflexe ▸ **openLockETHLeverage**(`ethValue`: BigNumberish, `uniswapV2Pair`: string, `callbackProxy`: string, `collateralType`: BytesLike, `leverage`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:907_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L907) +_Defined in_ [_packages/geb/src/proxy-action.ts:907_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L907) **Parameters:** @@ -516,7 +516,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:907_](https://github.com/reflexe ▸ **openLockGNTAndGenerateDebt**(`gntJoin`: string, `collateralType`: BytesLike, `collateralAmount`: BigNumberish, `deltaWad`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:405_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L405) +_Defined in_ [_packages/geb/src/proxy-action.ts:405_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L405) **Parameters:** @@ -533,7 +533,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:405_](https://github.com/reflexe ▸ **openLockGNTGenerateDebtAndProtectSAFE**(`gntJoin`: string, `collateralType`: BytesLike, `collateralAmount`: BigNumberish, `deltaWad`: BigNumberish, `saviour`: string): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:424_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L424) +_Defined in_ [_packages/geb/src/proxy-action.ts:424_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L424) **Parameters:** @@ -551,7 +551,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:424_](https://github.com/reflexe ▸ **openLockTokenCollateralAndGenerateDebt**(`collateralJoin`: string, `collateralType`: BytesLike, `collateralAmount`: BigNumberish, `deltaWad`: BigNumberish, `transferFrom`: boolean): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:446_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L446) +_Defined in_ [_packages/geb/src/proxy-action.ts:446_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L446) **Parameters:** @@ -569,7 +569,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:446_](https://github.com/reflexe ▸ **openLockTokenCollateralGenerateDebtAndProtectSAFE**(`collateralJoin`: string, `collateralType`: BytesLike, `collateralAmount`: BigNumberish, `deltaWad`: BigNumberish, `transferFrom`: boolean, `saviour`: string): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:467_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L467) +_Defined in_ [_packages/geb/src/proxy-action.ts:467_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L467) **Parameters:** @@ -588,7 +588,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:467_](https://github.com/reflexe ▸ **openSAFE**(`collateralType`: BytesLike, `usr`: string): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:491_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L491) +_Defined in_ [_packages/geb/src/proxy-action.ts:491_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L491) **Parameters:** @@ -603,7 +603,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:491_](https://github.com/reflexe ▸ **prepareCoinsForRedeemingGlobalSettlement**(`wad`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:753_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L753) +_Defined in_ [_packages/geb/src/proxy-action.ts:753_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L753) **Parameters:** @@ -617,7 +617,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:753_](https://github.com/reflexe ▸ **protectSAFE**(`safe`: BigNumberish, `saviour`: string): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:501_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L501) +_Defined in_ [_packages/geb/src/proxy-action.ts:501_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L501) **Parameters:** @@ -632,7 +632,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:501_](https://github.com/reflexe ▸ **quitSystem**(`safe`: BigNumberish, `dst`: string): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:512_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L512) +_Defined in_ [_packages/geb/src/proxy-action.ts:512_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L512) **Parameters:** @@ -647,7 +647,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:512_](https://github.com/reflexe ▸ **redeemETHGlobalSettlement**(`ethJoin`: string, `collateralType`: BytesLike, `wad`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:779_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L779) +_Defined in_ [_packages/geb/src/proxy-action.ts:779_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L779) **Parameters:** @@ -663,7 +663,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:779_](https://github.com/reflexe ▸ **redeemTokenCollateralGlobalSettlement**(`collateralJoin`: string, `collateralType`: BytesLike, `wad`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:794_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L794) +_Defined in_ [_packages/geb/src/proxy-action.ts:794_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L794) **Parameters:** @@ -679,7 +679,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:794_](https://github.com/reflexe ▸ **repayAllDebt**(`safe`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:522_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L522) +_Defined in_ [_packages/geb/src/proxy-action.ts:522_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L522) **Parameters:** @@ -693,7 +693,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:522_](https://github.com/reflexe ▸ **repayAllDebtAndFreeETH**(`safe`: BigNumberish, `collateralWad`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:532_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L532) +_Defined in_ [_packages/geb/src/proxy-action.ts:532_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L532) **Parameters:** @@ -708,7 +708,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:532_](https://github.com/reflexe ▸ **repayAllDebtAndFreeTokenCollateral**(`collateralJoin`: string, `safe`: BigNumberish, `collateralAmount`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:547_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L547) +_Defined in_ [_packages/geb/src/proxy-action.ts:547_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L547) **Parameters:** @@ -724,7 +724,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:547_](https://github.com/reflexe ▸ **repayDebt**(`safe`: BigNumberish, `wad`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:563_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L563) +_Defined in_ [_packages/geb/src/proxy-action.ts:563_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L563) **Parameters:** @@ -739,7 +739,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:563_](https://github.com/reflexe ▸ **repayDebtAndFreeETH**(`safe`: BigNumberish, `collateralWad`: BigNumberish, `deltaWad`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:574_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L574) +_Defined in_ [_packages/geb/src/proxy-action.ts:574_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L574) **Parameters:** @@ -755,7 +755,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:574_](https://github.com/reflexe ▸ **repayDebtAndFreeTokenCollateral**(`collateralJoin`: string, `safe`: BigNumberish, `collateralAmount`: BigNumberish, `deltaWad`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:591_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L591) +_Defined in_ [_packages/geb/src/proxy-action.ts:591_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L591) **Parameters:** @@ -772,7 +772,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:591_](https://github.com/reflexe ▸ **safeLockETH**(`ethValue`: BigNumberish, `safe`: BigNumberish, `owner`: string): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:609_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L609) +_Defined in_ [_packages/geb/src/proxy-action.ts:609_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L609) **Parameters:** @@ -788,7 +788,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:609_](https://github.com/reflexe ▸ **safeLockTokenCollateral**(`collateralJoin`: string, `safe`: BigNumberish, `amt`: BigNumberish, `transferFrom`: boolean, `owner`: string): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:625_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L625) +_Defined in_ [_packages/geb/src/proxy-action.ts:625_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L625) **Parameters:** @@ -806,7 +806,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:625_](https://github.com/reflexe ▸ **safeRepayAllDebt**(`safe`: BigNumberish, `owner`: string): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:644_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L644) +_Defined in_ [_packages/geb/src/proxy-action.ts:644_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L644) **Parameters:** @@ -821,7 +821,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:644_](https://github.com/reflexe ▸ **safeRepayDebt**(`safe`: BigNumberish, `wad`: BigNumberish, `owner`: string): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:655_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L655) +_Defined in_ [_packages/geb/src/proxy-action.ts:655_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L655) **Parameters:** @@ -837,7 +837,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:655_](https://github.com/reflexe ▸ **tokenCollateralJoin\_join**(`apt`: string, `safe`: string, `amt`: BigNumberish, `transferFrom`: boolean): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:671_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L671) +_Defined in_ [_packages/geb/src/proxy-action.ts:671_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L671) **Parameters:** @@ -854,7 +854,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:671_](https://github.com/reflexe ▸ **transfer**(`collateral`: string, `dst`: string, `amt`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:687_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L687) +_Defined in_ [_packages/geb/src/proxy-action.ts:687_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L687) **Parameters:** @@ -870,7 +870,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:687_](https://github.com/reflexe ▸ **transferCollateral**(`safe`: BigNumberish, `dst`: string, `wad`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:697_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L697) +_Defined in_ [_packages/geb/src/proxy-action.ts:697_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L697) **Parameters:** @@ -886,7 +886,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:697_](https://github.com/reflexe ▸ **transferInternalCoins**(`safe`: BigNumberish, `dst`: string, `rad`: BigNumberish): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:712_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L712) +_Defined in_ [_packages/geb/src/proxy-action.ts:712_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L712) **Parameters:** @@ -902,7 +902,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:712_](https://github.com/reflexe ▸ **transferSAFEOwnership**(`safe`: BigNumberish, `usr`: string): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:727_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L727) +_Defined in_ [_packages/geb/src/proxy-action.ts:727_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L727) **Parameters:** @@ -917,7 +917,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:727_](https://github.com/reflexe ▸ **transferSAFEOwnershipToProxy**(`safe`: BigNumberish, `dst`: string): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:737_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L737) +_Defined in_ [_packages/geb/src/proxy-action.ts:737_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L737) **Parameters:** @@ -932,7 +932,7 @@ _Defined in_ [_packages/geb/src/proxy-action.ts:737_](https://github.com/reflexe ▸ **uniswapV2Call**(`_sender`: string, `_amount0`: BigNumberish, `_amount1`: BigNumberish, `_data`: BytesLike): _TransactionRequest_ -_Defined in_ [_packages/geb/src/proxy-action.ts:930_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/proxy-action.ts#L930) +_Defined in_ [_packages/geb/src/proxy-action.ts:930_](https://github.com/open-dollar/od-sdk/blob/dev/src/proxy-action.ts#L930) **Parameters:** diff --git a/docs/geb-js/api-reference/safe.mdx b/docs/geb-js/api-reference/safe.mdx index ded8bf70..f10f8828 100644 --- a/docs/geb-js/api-reference/safe.mdx +++ b/docs/geb-js/api-reference/safe.mdx @@ -4,13 +4,13 @@ title: Safe # Safe -This object represents a GEB safe. It has the entire SAFE state and provides helper functions to calculate its liquidation price, collateralization ratio etc. +This object represents a GEB safe/vault. It has the entire SAFE state and provides helper functions to calculate its liquidation price, collateralization ratio etc. ## Constructors \+ **new Safe**(`contracts`: ContractApis, `handler`: string, `debt`: BigNumber, `collateral`: BigNumber, `collateralType`: string, `isManaged`: boolean, `safeId?`: number): [_Safe_](safe.md) -_Defined in_ [_packages/geb/src/schema/safe.ts:8_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/schema/safe.ts#L8) +_Defined in_ [_packages/geb/src/schema/safe.ts:8_](https://github.com/open-dollar/od-sdk/blob/dev/src/schema/safe.ts) **Parameters:** @@ -32,7 +32,7 @@ _Defined in_ [_packages/geb/src/schema/safe.ts:8_](https://github.com/reflexer-l • **collateral**: _BigNumber_ -_Defined in_ [_packages/geb/src/schema/safe.ts:23_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/schema/safe.ts#L23) +_Defined in_ [_packages/geb/src/schema/safe.ts:23_](https://github.com/open-dollar/od-sdk/blob/dev/src/schema/safe.ts) Amount of collateral locked in the SAFE (WAD) @@ -40,7 +40,7 @@ Amount of collateral locked in the SAFE (WAD) • **collateralType**: _string_ -_Defined in_ [_packages/geb/src/schema/safe.ts:27_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/schema/safe.ts#L27) +_Defined in_ [_packages/geb/src/schema/safe.ts:27_](https://github.com/open-dollar/od-sdk/blob/dev/src/schema/safe.ts) SAFE collateral type @@ -48,7 +48,7 @@ SAFE collateral type • **debt**: _BigNumber_ -_Defined in_ [_packages/geb/src/schema/safe.ts:19_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/schema/safe.ts#L19) +_Defined in_ [_packages/geb/src/schema/safe.ts:19_](https://github.com/open-dollar/od-sdk/blob/dev/src/schema/safe.ts) Amount of debt generated by the SAFE (WAD) @@ -56,7 +56,7 @@ Amount of debt generated by the SAFE (WAD) • **handler**: _string_ -_Defined in_ [_packages/geb/src/schema/safe.ts:15_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/schema/safe.ts#L15) +_Defined in_ [_packages/geb/src/schema/safe.ts:15_](https://github.com/open-dollar/od-sdk/blob/dev/src/schema/safe.ts) SAFE handler in the SAFE Engine @@ -64,7 +64,7 @@ SAFE handler in the SAFE Engine • **isManaged**: _boolean_ -_Defined in_ [_packages/geb/src/schema/safe.ts:31_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/schema/safe.ts#L31) +_Defined in_ [_packages/geb/src/schema/safe.ts:31_](https://github.com/open-dollar/od-sdk/blob/dev/src/schema/safe.ts) Whether the safe was opened using a SAFE manager @@ -72,7 +72,7 @@ Whether the safe was opened using a SAFE manager • **safeId**? : _number_ -_Defined in_ [_packages/geb/src/schema/safe.ts:35_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/schema/safe.ts#L35) +_Defined in_ [_packages/geb/src/schema/safe.ts:35_](https://github.com/open-dollar/od-sdk/blob/dev/src/schema/safe.ts) Safe incremental ID, only for managed safes @@ -82,7 +82,7 @@ Safe incremental ID, only for managed safes ▸ **getCRatio**(): _Promise‹FixedNumber | null›_ -_Defined in_ [_packages/geb/src/schema/safe.ts:42_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/schema/safe.ts#L42) +_Defined in_ [_packages/geb/src/schema/safe.ts:42_](https://github.com/open-dollar/od-sdk/blob/dev/src/schema/safe.ts) Ratio used to calculate the amount of debt that can be drawn. Returns null is ratio is +Infinity. !! Uses unsafe division that can lead to precision loss. @@ -94,7 +94,7 @@ Promise CRatio ▸ **liquidationPrice**(): _Promise‹FixedNumber | null›_ -_Defined in_ [_packages/geb/src/schema/safe.ts:70_](https://github.com/reflexer-labs/geb.js/blob/30c41df/packages/geb/src/schema/safe.ts#L70) +_Defined in_ [_packages/geb/src/schema/safe.ts:70_](https://github.com/open-dollar/od-sdk/blob/dev/src/schema/safe.ts) Price at which the SAFE will get liquidated. diff --git a/docs/geb-js/geb-js-global-settlement-guide.mdx b/docs/geb-js/geb-js-global-settlement-guide.mdx deleted file mode 100644 index cb205f4e..00000000 --- a/docs/geb-js/geb-js-global-settlement-guide.mdx +++ /dev/null @@ -1,128 +0,0 @@ ---- -title: Global Settlement Guide ---- - -# Global Settlement Guide - -The following are examples of how you can use geb.js to facilitate the Global Settlement process and redeem your collateral which is locked in your own Safes or directly exchange system coins with collateral. - -## Example Flow for Global Settlement Using GEB.js - -These scripts can help you go throught the steps described on the [Global Settlement](/system-contracts/shutdown-module/global-settlement#the-shutdown-mechanism-9-crucial-steps) page. - -We first need to setup `geb.js` and `ethers.js`: - -```typescript -import { ethers } from 'ethers' -import { Geb, utils } from 'geb.js' - -const provider = new ethers.providers.JsonRpcProvider( - 'http://kovan.infura.io/v3/' -) -const wallet = new ethers.Wallet('0xdefiisawesome...', provider) -const geb = new Geb('kovan', provider) -``` - -Before continuing, we need to make sure that Global Settlement was triggered by checking the shutdown timestamp: - -```typescript -const shutdownTime = await geb.contracts.globalSettlement.shutdownTime() -const hasGlobalSettlementStarted = shutdownTime.gt(0) -``` - -### Withdraw Excess Collateral - -After settlement starts, each collateral needs to be frozen \([Step 2](/system-contracts/shutdown-module/global-settlement#2-cage-ilk)\). This needs to be done only once for every collateral type. - -```typescript -const tx = geb.contracts.globalSettlement.freezeCollateralType(utils.ETH_A) -await wallet.sendTransaction(tx) -``` - -Since a SAFE is supposed to be over-collateralized, its owner can already withdraw excess collateral. The following script assumes that the SAFE is owned by a [proxy](https://github.com/UseKeyp/od-contracts/blob/main/src/contracts/proxies/ODProxy.sol) contract. It also uses the Global Settlement Proxy Actions to pack and atomically execute multiple transactions at once. - -```typescript -const proxy = await geb.getProxyAction(wallet.address) -const wethJoinAddress = geb.contracts.joinETH_A.address -// Withdraw excess collateral from the Safe with ID #3 -const tx = proxy.freeTokenCollateralGlobalSettlement(wethJoinAddress, 3) -await wallet.sendTransaction(tx) -``` - -This fulfills [step 3](/system-contracts/shutdown-module/global-settlement#3-skim-ilk-urn) and [step 5](/system-contracts/shutdown-module/global-settlement#5-free-ilk) from the Global Settlement process. - -### Set the Final COL/COIN Exchange Rates - -This part of the process consists in determining an exchange rate between the system coins that are still in circulation and each individual collateral type accepted by the system. The system needs to account for all Safes \(I\), terminate all ongoing collateral auctions \(II\) and remove all system surplus \(III\). - -This needs to be done only once for the whole system. These steps can be taken care of by the [settlement keeper](https://github.com/reflexer-labs/settlement-keeper) bot or by anyone who is willing to pay the gas costs associated with these transactions. - -```typescript -// For (I) the function `processSAFE` needs to be called for all SAFEs, -// particularly for under-collateralized ones since their owners are not -// incentivised to call it themselves -const safes = [] // Gather some Safe handlers -safes.push((await geb.getSafe(2)).handler) -safes.push((await geb.getSafe(3)).handler) -safes.push((await geb.getSafe(4)).handler) - -// Prepare the transactions -const txs = safes.map(handler => - geb.contracts.globalSettlement.processSAFE(utils.ETH_A, handler) -) - -// Send all transactions -txs.map(tx => await wallet.sendTransaction(tx)) - -// For (II) we have 2 possibilities: wait for all auctions to finish -const cooldown = await geb.contracts.globalSettlement.shutdownCooldown() -const now = BigNumber.from(Date.now()).div(1000) -const isCooldownPassed = now.gt(shutdownTime.add(cooldown)) - -// Or prematurely terminate each auction -const auctionId = 6 -const tx = geb.contracts.globalSettlement.fastTrackAuction(utils.ETH_A, auctionId) -await wallet.sendTransaction(tx) - -// (III) We need to get rid of the system surplus -const accountingEngineAddress = geb.contracts.accountingEngine.address -const coin = await geb.contracts.safeEngine.coinBalance(accountingEngineAddress) -const debt = await geb.contracts.safeEngine.debtBalance(accountingEngineAddress) -const amountToSettle = coin.gte(debt) ? debt : coin -const tx = geb.contracts.accountingEngine.settleDebt(amountToSettle) -await wallet.sendTransaction(tx) - -// In case there is a bug in the system's accounting that -// created more surplus than debt, there is a backup function called -// transferPostSettlementSurplus() which gets rid of that extra surplus -// and allows GlobalSettlement.setOutstandingCoinSupply() to execute successfuly -const tx = geb.contracts.accountingEngine.transferPostSettlementSurplus() -await wallet.sendTransaction(tx) -``` - -Finally, the cash price for each collateral can be set with the following steps: - -```typescript -const tx = geb.contracts.globalSettlement.setOutstandingCoinSupply() -await wallet.sendTransaction(tx) - -// To be called once for each collateral type -const tx = geb.contracts.globalSettlement.calculateCashPrice(utils.ETH_A) -await wallet.sendTransaction(tx) -``` - -### Redeem Collateral Against System Coins - -At this stage, any system coin holder can exchange their coins against a fixed basket of collateral. This is a 2 step process that consists in locking and preparing system coins and then claiming a share of a specific collateral type. - -```typescript -// Prepare the system coins -const systemCoinBalance = await geb.contracts.coin.balanceOf(wallet.address) -const tx = proxy.prepareCoinsForRedeemingGlobalSettlement(systemCoinBalance) -await wallet.sendTransaction(tx) - -// Redeem any collateral type you want -const tx = proxy.redeemTokenCollateralGlobalSettlement(wethJoinAddress, utils.ETH_A, systemCoinBalance) -await wallet.sendTransaction(tx) -``` - diff --git a/docs/keepers/bidding-models.mdx b/docs/keepers/bidding-models.mdx deleted file mode 100644 index dcd3e5b3..00000000 --- a/docs/keepers/bidding-models.mdx +++ /dev/null @@ -1,101 +0,0 @@ ---- -title: Bidding Models -description: Information about bidding models for debt and surplus auction keepers ---- - -# Bidding Models - -`auction-keeper` maintains a collection of child processes, as each bidding model is its own dedicated process. New processes \(new _bidding model_ instances\) are spawned by executing the command passed to `--model`. These processes are automatically terminated \(via `SIGKILL`\) by the keeper shortly after their associated auctions expire. - -Whenever the _bidding model_ process dies, it gets automatically respawned by the keeper. - -Example: - -```bash -bin/auction-keeper --model '../my-bidding-model.sh' [...] -``` - -## Pass the auction status to each bidding model - -`auction-keeper` communicates with bidding models via their standard input and output. When the auction state changes, the keeper sends a one-line JSON document to the **standard input** of the bidding model process. - -A sample message sent from the keeper to the model looks like: - -```javascript -{"id": "6", "surplus_auction_house": "0xf0afc3108bb8f196cf8d076c8c4877a4c53d4e7c", "bid_amount": "7.142857142857142857", "amount_to_sell": "10000.000000000000000000", "bid_increase": "1.050000000000000000", "high_bidder": "0x00531a10c4fbd906313768d277585292aa7c923a", "block_time": 1530530620, "bid_expiry": 1530541420, "auction_deadline": 1531135256, "price": "1400.000000000000000028"} -``` - -Bidding models should never make an assumption that messages will be sent only when auction state changes. - -At the same time, the `auction-keeper` reads one-line messages from the **standard output** of the bidding model process and tries to parse them as JSON documents. It then extracts two fields from that document: - -* `price` - the maximum \(for debt auctions\) or the minimum \(for surplus auctions\) price - - the model is willing to bid. This value is ignored for fixed discount collateral auctions - -* `gasPrice` \(optional\) - gas price in WEI to use when sending the bid - -## Processing each bidding model output and submitting bids - -### Sample model output for a debt auction bidding model - -A sample message sent from the debt model to the keeper may look like `price` is `PROT/System Coin` price. - -```javascript -{"price": "250.0", "gasPrice": 70000000000} -``` - -### Sample model output for a surplus auction bidding model - -A sample message sent from the debt model to the keeper may look like: - -`price` is `PROT/System Coin` price - -```javascript -{"price": "150.0"} -``` - -Any messages written by a _bidding model_ to **stderr** will be passed through by the keeper to its logs. This is the most convenient way of implementing logging from _bidding models_. - -:::danger -**Currently there's no mechanism that prevents a keeper from bidding at an unprofitable price** -::: - -## Simplest possible bidding model - -```text -#!/usr/bin/env bash -while true; do - echo "{\"price\": \"723.0\"}" - sleep 120 -done -``` - -Specifying a gas price is optional. If you want to start with a fixed gas price, you can add it like this: - -```text -#!/usr/bin/env bash - -while true; do - echo "{\"price\": \"723.0\", \"gasPrice\": \"70000000000\"}" # put your desired gas price in Wei here - sleep 120 # locking the gas price for n seconds -done -``` - -The model produces price\(s\) for the keeper. After the `sleep` period, the keeper will restart the price model and read new price\(s\). - -## Collateral bidding models - -**Note:** Currently, collateral keepers buy collateral at a fixed discount \(specified in the auction house smart contract\) and don't bid prices. So they should use a blank model file like this: - -```text -#!/usr/bin/env bash -while true; do - echo "{}" - sleep 120 -done -``` - -## Other bidding models - -* _banteg_'s [Python boilerplate model](https://gist.github.com/banteg/93808e6c0f1b9b6b470beaba5a140813) diff --git a/docs/keepers/collateral-auction-keeper/README.mdx b/docs/keepers/collateral-auction-keeper/README.mdx deleted file mode 100644 index 040be43a..00000000 --- a/docs/keepers/collateral-auction-keeper/README.mdx +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: Collateral Auction Keeper -description: How to run a collateral auction keeper ---- - -# Collateral Auction Keeper - -This mini guide will walk you through running a collateral auction keeper in Docker & also directly on a host. It will also detail the liquidation and bidding process as well as the logs shown by the keeper. - diff --git a/docs/keepers/collateral-auction-keeper/flash-swaps.mdx b/docs/keepers/collateral-auction-keeper/flash-swaps.mdx deleted file mode 100644 index 9d088940..00000000 --- a/docs/keepers/collateral-auction-keeper/flash-swaps.mdx +++ /dev/null @@ -1,92 +0,0 @@ ---- -title: Flash Swaps -description: Lightning fast bidding in collateral auctions ---- - -# Collateral Auction Flash Swaps - -## Overview - -Normally, the collateral [auction-keeper](https://github.com/reflexer-labs/auction-keeper) uses system coins to bid in fixed discount collateral auctions. A keeper operator must acquire system coins to be prepared for future collateral auctions. With collateral auction flash swaps, this is no longer necessary. - -The auction-keeper can be configured to use Uniswap v2 or v3 flash swaps when bidding in collateral auctions. This allows the keeper to participate in collateral auctions with no upfront capital other than gas costs to execute the transaction. - -## Details - -The collateral auction-keeper performs flash swaps using the [geb-keeper-flash-proxy](https://github.com/reflexer-labs/geb-keeper-flash-proxy) contracts. - -The flash proxy is used by the auction-keeper to: - -1\) Liquidate an underwater SAFE, start a new collateral auction and bid by calling `liquidateAndSettleSAFE` - -or - -2\) Bid in existing auctions by calling `settleAuction` - -### Uniswap Pools Used for Bidding - -* [RAI/DAI Uniswap V3](https://info.uniswap.org/#/pools/0xcb0c5d9d92f4f2f80cce7aa271a1e148c226e19d) -* [RAI/ETH Uniswap V2](https://v2.info.uniswap.org/pair/0x8ae720a71622e824f576b4a8c03031066548a3b1) -* [RAI/USDC Uniswap V3](https://info.uniswap.org/#/pools/0xfa7d7a0858a45c1b3b7238522a0c0d123900c118) -* [RAI/ETH Uniswap V3](https://info.uniswap.org/#/pools/0x14de8287adc90f0f95bf567c0707670de52e3813) - -## Configuration - -You can enable flashswaps using the `--flash-swaps` flag when starting a collateral auction-keeper. - -You can also specify multiple pools that the keeper loops through when trying to bid in an auction. You do this using the `--flash-swap-pools` flag. For example: - -```text ---flash-swap-pools eth-v2, dai-v3, usdc-v3, eth-v3 -``` - -If a flash swap for a specific pool fails, the next in order will be tried. - -The default order is `dai-v3, eth-v2, usdc-v3, eth-v3`. - -## Flash Swaps in Action - -Below is a log output from an _auction-keeper_ started with the `--flash-swap` and `--flash-swap-pools usdc-v3,dai-v3,eth-v2,eth-v3` flags. - -First, the _auction-keeper_ finds two undercollateralized SAFEs and successfully calls `liquidateAndSettleSAFE` using the `usdc-v3` flash proxy. The second SAFE is a large one so the call fails due to lack of liquidity in the RAI/USDC Uniswap v3 pool. The _auction-keeper_ then successfully uses the RAI/DAI Uniswap v3 flash-proxy to liquidate the large SAFE. - -Finally, the _auction-keeper_ finds a third ciritcal SAFE and successfully uses the RAI/USDC Uniswap v3 flash proxy to `liquidateAndSettleSAFE`. - -```text -2021-08-26 14:25:18,258 INFO Keeper connected to RPC connection http://172.31.46.114:8545 -2021-08-26 14:25:18,259 INFO Keeper operating as 0xdD1693BD8E306eCfDbe41D246562fc4109f871f8 -2021-08-26 14:25:18,289 INFO Executing keeper startup logic -2021-08-26 14:25:19,375 INFO Keeper will not settle auctions -2021-08-26 14:25:19,375 INFO Keeper will perform the following operation(s) in parallel: -2021-08-26 14:25:19,375 INFO --> Check all safes and start new auctions if any critical safes need to be liquidated -2021-08-26 14:25:19,375 INFO --> Check all auctions being monitored and evaluate bidding opportunity every 4.0 seconds -2021-08-26 14:25:19,375 INFO *** When Keeper is settling/bidding, the initial evaluation of auctions will likely take > 45 minutes without setting a lower boundary via '--min-auction' *** -2021-08-26 14:25:19,375 INFO *** When Keeper is starting auctions, initializing safe history may take > 30 minutes without using Graph via `--graph-endpoints` *** -2021-08-26 14:25:19,378 INFO Keeper will use Node gas price (currently 2.0 Gwei, changes over time) with initial multiplier 1.0 and will multiply by 1.125 every 42s to a maximum of 2000.0 Gwei for transactions and bids unless model instructs otherwise -2021-08-26 14:25:19,658 INFO Watching for new blocks -2021-08-26 14:25:19,664 INFO Started 2 timer(s) -2021-08-26 14:25:20,750 INFO Getting safe mods from https://api.thegraph.com/subgraphs/name/reflexer-labs/rai-kovan -2021-08-26 14:25:20,752 INFO Fetching safe modes from https://api.thegraph.com/subgraphs/name/reflexer-labs/rai-kovan -2021-08-26 14:25:42,418 INFO Using usdc-v3 flash swap to liquidate and settle safe 0xA0be17B5C408aaFF03e0E3434de199F6df94fFC7 -2021-08-26 14:25:42,946 INFO Sent transaction GebETHKeeperFlashProxy('0x8a8970c74Ca60c954b32D1015D4563908eB798Fd').liquidateAndSettleSAFE('0xA0be17B5C408aaFF03e0E3434de199F6df94fFC7') with nonce=4964, gas=2000000, gas_price=2000000000 (tx_hash=0xdf19ae2f76def32a3c797ef51b614ddf6b680ad38ecbe3910b154a4c4228eb0f) -2021-08-26 14:25:44,423 INFO Transaction GebETHKeeperFlashProxy('0x8a8970c74Ca60c954b32D1015D4563908eB798Fd').liquidateAndSettleSAFE('0xA0be17B5C408aaFF03e0E3434de199F6df94fFC7') was successful (tx_hash=0xdf19ae2f76def32a3c797ef51b614ddf6b680ad38ecbe3910b154a4c4228eb0f) -2021-08-26 14:25:44,519 INFO Using usdc-v3 flash swap to liquidate and settle safe 0xa46B5d01326d858856396fb80bD06654ED64770f -2021-08-26 14:25:44,820 WARNING Transaction GebETHKeeperFlashProxy('0x8a8970c74Ca60c954b32D1015D4563908eB798Fd').liquidateAndSettleSAFE('0xa46B5d01326d858856396fb80bD06654ED64770f') will fail, refusing to send (execution reverted: failed bidding) -2021-08-26 14:25:44,821 WARNING flash swap liquidate and settle with pool usdc-v3 failed. -2021-08-26 14:25:44,821 INFO Using dai-v3 flash swap to liquidate and settle safe 0xa46B5d01326d858856396fb80bD06654ED64770f -2021-08-26 14:25:45,223 INFO Sent transaction GebETHKeeperFlashProxy('0x26232B7Fe0dD0Ade6192Bd69438dBEc424EF7a59').liquidateAndSettleSAFE('0xa46B5d01326d858856396fb80bD06654ED64770f') with nonce=4965, gas=2000000, gas_price=2000000000 (tx_hash=0xb4c177c114874ee267a8e2d47a3bd075936372996eeebbf3caf1decb881f2737) -2021-08-26 14:25:52,724 INFO Transaction GebETHKeeperFlashProxy('0x26232B7Fe0dD0Ade6192Bd69438dBEc424EF7a59').liquidateAndSettleSAFE('0xa46B5d01326d858856396fb80bD06654ED64770f') was successful (tx_hash=0xb4c177c114874ee267a8e2d47a3bd075936372996eeebbf3caf1decb881f2737) -2021-08-26 14:25:53,171 INFO Using usdc-v3 flash swap to liquidate and settle safe 0x20aE373C782b03925413a394EE620A4BF2828a60 -2021-08-26 14:25:53,744 INFO Sent transaction GebETHKeeperFlashProxy('0x8a8970c74Ca60c954b32D1015D4563908eB798Fd').liquidateAndSettleSAFE('0x20aE373C782b03925413a394EE620A4BF2828a60') with nonce=4966, gas=2000000, gas_price=2000000000 (tx_hash=0xf4d45385753219c5a9a7fb28f7d60e0e4b4d42eb05d8d65f50deb09308cfd1ba) -2021-08-26 14:25:56,851 INFO Transaction GebETHKeeperFlashProxy('0x8a8970c74Ca60c954b32D1015D4563908eB798Fd').liquidateAndSettleSAFE('0x20aE373C782b03925413a394EE620A4BF2828a60') was successful (tx_hash=0xf4d45385753219c5a9a7fb28f7d60e0e4b4d42eb05d8d65f50deb09308cfd1ba) -``` - -## Caveats - -* Flash swaps are only supported for collateral auctions. -* _auction-keeper_ will not do flash swaps on critical SAFEs with saviours. Read more about saviours [here](/liquidation-protection/safe-protection). - -## Possible errors - -When liquidity is too low, calls to flash proxys will revert _or_ run out of gas. In this case, the _auction-keeper_ will try to use the next Uniswap pool specified in `--flash-swap-pools`. In the unlikely case where all calls fail \(none of the pools have enough liquidity\), the auction-keeper can be restarted without `--flash-swap` to bid normally using the keeper’s system coin balance inside the [SAFEEngine](/system-contracts/core/safe-engine). - diff --git a/docs/keepers/collateral-auction-keeper/liquidations.mdx b/docs/keepers/collateral-auction-keeper/liquidations.mdx deleted file mode 100644 index 3866a849..00000000 --- a/docs/keepers/collateral-auction-keeper/liquidations.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -title: Liquidations & Collateral Auctions -description: Overview of the collateral liquidation and auctioning process ---- - -# Liquidations & Collateral Auctions - -## Liquidations - -The collateral keeper will liquidate all critical safes it encounters. This process starts new fixed discount collateral auctions: - -```text -Liquidating ETH-A SAFE 0xc90F721DacfF8548777026253B8CB584426DC8C7 with locked_collateral=0.435000000000000000 liquidat -ion_price=194.362282878411910669975186104 generated_debt=85.069599661138521872 accumulatedRates=1.000357358433360132592605082 -Checked 39 safes in 14 seconds -Sent transaction LiquidationEngine('0x4443d35BAEa0EeD30d9C7Fb136B8e507DC593646').liquidateSAFE('0x4554482d410000000000 -00000000000000000000000000000000000000000000', '0xc90F721DacfF8548777026253B8CB584426DC8C7') with nonce=206, gas=434424, gas_price=30000000000 (tx_hash -=0x6688d6e94dc884ba294dd67626f1e0c749c76ca14fb7224b948b31a0e5286d6a) -Transaction LiquidationEngine('0x4443d35BAEa0EeD30d9C7Fb136B8e507DC593646').liquidateSAFE('0x4554482d41000000000000000000000000000000000000000000000000000000', '0xc90F721DacfF8548777026253B8CB584426DC8C7') was successful (tx_hash=0x6688d6e94dc884ba294dd67626f1e0c749c76ca14fb7224b948b31a0e5286d6a) -``` - -## Auctions - -After an auction is started, the collateral keeper will be able to bid for and buy collateral at a discounted price: - -```text -Started monitoring auction #8 -Instantiated model using process '../models/collateral_model.sh --id 8 --collateral_auction_house 0xF8AAD33Cb9291Da4FF51377a6F1aB165c5E7Ab69' -Process '../models/collateral_model.sh --id 8 --collateral_auction_house 0xF8AAD33Cb9291Da4FF51377a6F1aB165c5E7Ab69' (pid #36) started -Checked auctions 0 to 8 in 0 seconds -Checking if internal system coin balance needs to be rebalanced -system coin token balance: 0.000000000000000000, SAFE Engine balance: 119.768970008628887937411195000000000000000000000 -Sending new bid @284.538396004218362573 for auction 8 -Sent transaction FixedDiscountCollateralAuctionHouse('0xF8AAD33Cb9291Da4FF51377a6F1aB165c5E7Ab69').buyCollateral(8, 4 -318147966969218961926) with nonce=230, gas=303231, gas_price=30000000000 (tx_hash=0x2f63ae43a46ae777f31a0977363a4d1ebd5fb8486d68fd70987b199281c36e3a) -Transaction FixedDiscountCollateralAuctionHouse('0xF8AAD33Cb9291Da4FF51377a6F1aB165c5E7Ab69').buyCollateral(8, 431814 -7966969218961926) was successful (tx_hash=0x2f63ae43a46ae777f31a0977363a4d1ebd5fb8486d68fd70987b199281c36e3a) -``` - -:::info Bidding Gotchas - -1\) By default, the keeper submits a bid using all of its available system coins. This ensures the keeper gets the maximum amount of discounted collateral in one go. - -2\) If there are multiple ongoing auctions, you might see this error until the first `buyCollateral` transaction is finished: - -`Bid cost 5025.307970008628887936000000000000000000000000000 exceeds reservoir level of 0.000000000000000000411195000000000000000000000; bid will not be submitted` - -::: - -## Swapping Bought Collateral for System Coins - -The collateral keeper can swap collateral for system coins automatically when it's exited from the system using Uniswap V2. This allows the keeper to have plenty of system coins available next time it starts.To turn this option on, use this flag inside `run_auction_keeper.sh`: - -`--swap-collateral` - -To set the max allowable slippage percentage on Uniswap V2, set this flag: - -`--max-swap-slippage , default: 0.01` - -:::info -Use `--swap-collateral` with `--safe-engine-system-coin-target ALL`\(the default\) to ensure won collateral is automatically converted to system coins -::: - -## Exiting Collateral from the System - -By default, the keeper will periodically exit collateral \(that was bought from auctions\) from the system. - -To adjust the interval at which the keeper exits collateral, set: - -`--return-collateral-interval, default:300 secs` - -By default, the keeper will `exit` all of its collateral when it's shutting down. - -To leave won collateral in the system on exit, specify this inside `run_auction_keeper.sh`: -`--keep-collateral-in-safe-engine-on-exit` - -```text -Exiting 0.344424752741987967 ETH-A from the SAFE Engine -Sent transaction .exit('0xdD1693BD8E307eCfDbe51D246562fc4109f871f8', 344424752741987967) with nonce=210, gas=153991, gas_price=30000000000 (tx_hash=0x88266148371a3dfea081fbc378c802ad02ef2bd9e0ccdfabfa2a53894dbffd7f) -Transaction .exit('0xdD1693BD8E307eCfDbe51D246562fc4109f871f8', 344424752741987967) was successful (tx_hash=0x88266148371a3dfea081fbc378c802ad02ef2bd9e0ccdfabfa2a53894dbffd7f) -Shutdown logic finished -Keeper terminated -``` - diff --git a/docs/keepers/collateral-auction-keeper/running-in-docker.mdx b/docs/keepers/collateral-auction-keeper/running-in-docker.mdx deleted file mode 100644 index c0b72255..00000000 --- a/docs/keepers/collateral-auction-keeper/running-in-docker.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: Running in Docker -description: Running a collateral auction-keeper in a docker container. ---- - -# Running in Docker - -## 1\) Get RAI - -Buy RAI from Uniswap v2 or [open a SAFE](https://app.gitbook.com/@reflexer-labs/s/geb/pyflex/safe-management/opening-a-safe) and generate it. - -## 2\) Create the keeper run file - -Create a file called `run_auction_keeper.sh` and paste the following code in it: - -```text -#!/bin/bash - -docker run -it \ - -v :/keystore \ - reflexer/auction-keeper:latest \ - --rpc-uri \ - --eth-from \ - --eth-key key_file=/keystore/ -``` - -### Then, substitute the following variables: - -`KEYSTORE_DIR` - the local directory where your keystore file is - -`KEYSTORE_FILE` - your Ethereum UTC JSON keystore filename - -For more information about this keystore format and how to generate them: - -* [Ethereum UTC / JSON Wallet Encryption](https://wizardforcel.gitbooks.io/practical-cryptography-for-developers-book/content/symmetric-key-ciphers/ethereum-wallet-encryption.html) -* [keythereum](https://github.com/ethereumjs/keythereum) - -`ETH_RPC_URL` - the URL of the ethereum RPC connection - -`KEEPER_ADDRESS` - the keeper's address. It must be in a checksummed format - -### Finally: - -`chmod +x run_auction_keeper.sh` - -## 3\) Start the keeper and enter your keystore file password - -`./run_auction_keeper.sh` - -```text -$ ./run_auction_keeper.sh -latest: Pulling from reflexer/auction-keeper -Digest: sha256:7e55ec9b0a136fc903d9f7f2690538bcbde9029d957e0e6f84d0282790f9666a -Status: Downloaded newer image for reflexer/auction-keeper:latest -docker.io/reflexer/auction-keeper:latest -Password for /keystore/key.json: -``` - diff --git a/docs/keepers/collateral-auction-keeper/running-on-a-host.mdx b/docs/keepers/collateral-auction-keeper/running-on-a-host.mdx deleted file mode 100644 index 4284e382..00000000 --- a/docs/keepers/collateral-auction-keeper/running-on-a-host.mdx +++ /dev/null @@ -1,86 +0,0 @@ ---- -title: Running on a Host -description: Running a collateral auction keeper directly on a host ---- - -# Running on a Host - -## Prerequisties - -Python 3.6+ - -### Get RAI: - -Buy RAI from Uniswap v2 or [open a SAFE](https://app.gitbook.com/@reflexer-labs/s/geb/pyflex/safe-management/opening-a-safe) and generate it. - -### Clone: - -```text -git clone https://github.com/reflexer-labs/auction-keeper.git -cd auction-keeper -git submodule update --init --recursive -``` - -### Install: - -This creates a virtual environment and installs requirements. - -`./install.sh` - -## 1\) Start virtualenv - -`source _virtualenv/bin/activate` - -## 2\) Create a model file - -Paste the following code into `collateral_model.sh`: - -```text -#!/usr/bin/env bash -while true; do - echo "{}" - sleep 120 -done -``` - -**NOTE**: Currently, collateral auctions sell collateral at a fixed discount and so the keeper doesn't use a bidding model. This empty bidding model is simply a placeholder. - -## 3\) Create the keeper run file - -Create a file called `run_auction_keeper.sh` and paste the following code in it: - -```text -#!/bin/bash -bin/auction-keeper \ - --model ./collateral_model.sh \ - --rpc-uri \ - --eth-from \ - --eth-key key_file= -``` - -### Then, substitute the following variables: - -`ETH_RPC_URL` - the URL of the ethereum RPC connection - -`KEEPER_ADDRESS` - the keeper's address. It should be in checksummed format\(not lowercase\). - -`KEYSTORE_FILE` - your Ethereum UTC JSON keystore filename - -For more information about this keystore format and how to generate them: - -* [Ethereum UTC / JSON Wallet Encryption](https://wizardforcel.gitbooks.io/practical-cryptography-for-developers-book/content/symmetric-key-ciphers/ethereum-wallet-encryption.html) -* [keythereum](https://github.com/ethereumjs/keythereum) - -### Finally: - -`chmod +x run_auction_keeper.sh` - -## 4\) Start the keeper and enter your keystore file password - -`./run_auction_keeper.sh` - -```text -$ ./run_auction_keeper.sh -Password for /keystore/key.json: -``` - diff --git a/docs/keepers/debt-auction-keeper/README.mdx b/docs/keepers/debt-auction-keeper/README.mdx deleted file mode 100644 index 605f46c1..00000000 --- a/docs/keepers/debt-auction-keeper/README.mdx +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: Debt Auction Keeper -description: How to run a debt auction keeper ---- - -# Debt Auction Keeper - -This mini guide will walk you through running a debt auction keeper in Docker & also directly on a host. - diff --git a/docs/keepers/debt-auction-keeper/running-in-docker.mdx b/docs/keepers/debt-auction-keeper/running-in-docker.mdx deleted file mode 100644 index 1d465c6a..00000000 --- a/docs/keepers/debt-auction-keeper/running-in-docker.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: Running in Docker -description: Running a debt auction keeper in a Docker container ---- - -# Running in Docker - -## 1. Get RAI - -Buy RAI or [open a SAFE](https://app.gitbook.com/@reflexer-labs/s/geb/pyflex/safe-management/opening-a-safe) to generate it. - -## 2. Modify the model file as needed - -A basic debt auction bidding model can be found in `models/debt_model.py`. This model retrieves the latest FLX/USD price from Coingecko and will automatically place bids in an auction. - -You probably want to modify the following variables in `models/debt_model.py`: - -* `MAXIMUM_FLX_MULTIPLIER`: the maximum acceptable FLX price to use when bidding. Default: `0.90` meaning the maximum price to pay when biding for FLX (with RAI) is 90% of the current FLX/USD market price from Coingecko -* `MY_BID_DECREASE`: the bid decrease (in FLX) to propose when outbidding another bidder. If the value is smaller than the debt auction house's `bidDecrease`, then it will use the value set in the debt auction house. Example: a value of `1.10` will use bid decreases of 10%. Note: the current `bidDecrease` on mainnet is `1.03` - -Then, use `chmod +x debt_model.py`. - -For more information about bidding models, see [this](/keepers/bidding-models). - -## 3) Modify the keeper run file - -Modify the following variables in `run_debt_keeper.sh`: - -* `KEEPER_ADDRESS` - the keeper's address. It should be in checksummed format (not lowercase) -* `ETH_RPC_URL` - the URL of your Ethereum RPC connection -* `KEYSTORE_DIR` - the full path of the directory where your keystore file is -* `MODEL_DIR` - the full path of directory where your `surplus_model.py` file is -* `KEYSTORE_FILE` - your Ethereum UTC JSON keystore filename. For more information about the keystore format and how to generate it, check [Ethereum UTC / JSON Wallet Encryption](https://wizardforcel.gitbooks.io/practical-cryptography-for-developers-book/content/symmetric-key-ciphers/ethereum-wallet-encryption.html) or[ keythereum](https://github.com/ethereumjs/keythereum). -* `GAS_MAXIMUM` -maximum gas price, in GWEI - -Then, use `chmod +x run_debt_keeper.sh`. - -## 4) Start the keeper and enter your keystore file password - -Use `./run_debt_keeper.sh`. - -``` -$ ./run_debt_keeper.sh -latest: Pulling from reflexer/auction-keeper -Digest: sha256:7e55ec9b0a136fc903d9f7f2690538bcbde9029d957e0e6f84d0282790f9666a -Status: Downloaded newer image for reflexer/auction-keeper:latest -docker.io/reflexer/auction-keeper:latest -Password for /keystore/key.json: -``` - -## Debt Auction Output - -Sample[ debt auction output](running-in-docker.md#debt-auctioning-process) diff --git a/docs/keepers/debt-auction-keeper/running-on-a-host.mdx b/docs/keepers/debt-auction-keeper/running-on-a-host.mdx deleted file mode 100644 index 5f3a9224..00000000 --- a/docs/keepers/debt-auction-keeper/running-on-a-host.mdx +++ /dev/null @@ -1,166 +0,0 @@ ---- -title: Running on a Host -description: Running a debt auction keeper directly on a host ---- - -# Running on a Host - -## Prerequisites - -Python 3.6+ - -### Get OD - -Buy OD from Uniswap v2 or [open a SAFE](https://app.gitbook.com/@reflexer-labs/s/geb/pyflex/safe-management/opening-a-safe) and generate it. - -### Clone - -``` -git clone https://github.com/reflexer-labs/auction-keeper.git -cd auction-keeper -git submodule update --init --recursive -``` - -### Install - -This creates a virtual environment and installs all the keeper dependencies: - -`./install.sh` - -## 1) Start virtualenv - -`source _virtualenv/bin/activate` - -## 2) Modify model file as needed - -A basic debt auction bidding model can be found in `models/debt_model.py`. This model retrieves the latest ODG/USD price from coingecko and will automatically place bids in an auction. - -You probably want to modify the following variables in `models/debt_model.py`: - -`MAXIMUM_ODG_MULTIPLIER`: The maximum acceptable ODG price to use when bidding. Default: `0.90` meaning the maximum price to pay when buying ODG(in OD) is 90% of the current ODG/USD market price - -`MY_BID_DECREASE`: The amount of bid decrease(in ODG) to make when outbidding another bidder. If value is less than the auction house' `bidDecrease`, then it will use the auction house setting. Example: A value of `1.10` will create bid decreases of 10%. Note: Current `bidDecrease` on mainnet is `1.03`. Default: `1.03` - -### Then: - -`chmod +x debt_model.py` - -For more information about bidding models, see [Bidding Models](../bidding-models.md) - -## 3) Modify keeper run file - -Modify the following variables in `run_debt_keeper_host.sh` - -`KEEPER_ADDRESS` - the keeper's address. It should be in checksummed format (not lowercase) - -`ETH_RPC_URL` - the URL of your Ethereum RPC connection - -`KEYSTORE_DIR` - the full path of the directory where your keystore file is - -`MODEL_DIR` - the full path of directory where your `debt_model.py` file is - -`KEYSTORE_FILE` - your Ethereum UTC JSON keystore filename - -For more information about this keystore format and how to generate them, check: - -* [Ethereum UTC / JSON Wallet Encryption](https://wizardforcel.gitbooks.io/practical-cryptography-for-developers-book/content/symmetric-key-ciphers/ethereum-wallet-encryption.html) -* [keythereum](https://github.com/ethereumjs/keythereum) - -`GAS_MAXIMUM` -maximum gas price, in GWEI - -### Then: - -`chmod +x run_debt_keeper_host.sh` - -## 4) Start the keeper and enter your keystore file password - -`./run_debt_keeper_host.sh` - -``` -$ ./run_debt_keeper_host.sh -Password for /keystore/key.json: -``` - -## Debt Auction Output - -#### Pop Debt from the Queue - -If debt from collateral auctions still exists after `AccountingEngine.pop_debt_delay()`, the surplus *auction-keeper* will call `popDebtFromQueue()` - -``` -2021-01-20 04:16:22,462 INFO Sent transaction AccountingEngine('0x73EC2a627655134886477D10A41275f54556E0e2').popDebtFromQueue(1611116032) with nonce=1519, gas=159390, gas_price=10000000000 (tx_hash=0x7266984842ce52d8df52a775d889bb7040e0bac742d51f369e0c23e3e89dd560) -``` - -#### Settle Debt - -Before starting a debt auction, the keeper will use any surplus to offset any existing debt. It does this by calling `settleDebt()` - -``` -2021-01-20 04:16:32,983 INFO Settling debt coin balance=192.720512165128879832575769589252154674198975198 unqueued_enauctioned_debt=686.568045684729064016811194323877100504725525932 -2021-01-20 04:16:33,793 INFO Sent transaction AccountingEngine('0x73EC2a627655134886477D10A41275f54556E0e2').settleDebt(192720512165128879832575769589252154674198975198) with nonce=1520, gas=171354, gas_price=10000000000 (tx_hash=0x92d16108db353e25b70a743eefb84568f640f3ab4241d5cfa43c147126080d4b) -``` - -#### Starting a Debt Auction - -Finally, if debt still exists and is enough to start an auction, the *auction-keeper* will call `auctionDebt` - -``` -2021-01-20 04:16:40,596 INFO Initiating a debt auction with unqueued_unauctioned_debt=493.847533519600184184235424734624945830526550734 -2021-01-20 04:16:41,382 INFO Sent transaction AccountingEngine('0x73EC2a627655134886477D10A41275f54556E0e2').auctionDebt() with nonce=1521, gas=306628, gas_price=1 -0000000000 (tx_hash=0x9ff7a02e85a30c361768639729678df615eba7f10a69505c1aaa4cc88818c73d) -``` - -#### Full Log Output - -``` -[ec2-user@ip-172-31-40-135 ~]$ ./run_debt_auction_keeper.sh -upstream: Pulling from reflexer/auction-keeper -Digest: sha256:d222e4d8d948262af15fbc09e64973a6df65eb0f96023ea3ec7179674d87f28c -Status: Image is up to date for reflexer/auction-keeper:upstream -docker.io/reflexer/auction-keeper:upstream -Password for /keystore/keystore.json: -2021-01-20 04:16:01,302 INFO Keeper connected to RPC connection https://myparitynode.com -2021-01-20 04:16:01,302 INFO Keeper operating as 0xdD1693BD8E307eCfDbe51D246562fc4109f871f8 -2021-01-20 04:16:01,646 INFO Executing keeper startup logic -2021-01-20 04:16:02,714 INFO Checking if internal system coin balance needs to be rebalanced -2021-01-20 04:16:02,749 INFO Joining 1480.613947077334748390 system coin to the SAFE Engine -2021-01-20 04:16:02,816 INFO Sent transaction .join('0xdD1693BD8E307eCfDbe51D246562fc4109f871f8', 1480613947077334748390) with nonce=1518, gas=159975, gas_price=10000000000 (tx_hash=0x79982c65d2aece7a71e4c475e1a90afd8056811dbec6f6a82a844e637192c47e) -2021-01-20 04:16:12,665 INFO Transaction .join('0xdD1693BD8E307eCfDbe51D246562fc4109f871f8', 1480613947077334748390) was successful (tx_hash=0x79982c65d2aece7a71e4c475e1a90afd8056811dbec6f6a82a844e637192c47e) -2021-01-20 04:16:12,666 INFO Keeper will perform the following operation(s) in parallel: -2021-01-20 04:16:12,666 INFO --> Check thresholds in Accounting Engine Contract and start new debt auctions once reached -2021-01-20 04:16:12,666 INFO --> Check all auctions being monitored and evaluate bidding opportunity every 4.0 seconds -2021-01-20 04:16:12,667 INFO --> Check all auctions and settle for 0xdD1693BD8E307eCfDbe51D246562fc4109f871f8 -2021-01-20 04:16:12,671 INFO Keeper will use Node gas price (currently 10.0 Gwei, changes over time) with initial multiplier 1.0 and will multiply by 1.125 every 42s to a maximum of 2000.0 Gwei for transactions and bids unless model instructs otherwise -2021-01-20 04:16:13,898 INFO Watching for new blocks -2021-01-20 04:16:13,900 INFO Started 2 timer(s) -2021-01-20 04:16:22,462 INFO Sent transaction AccountingEngine('0x73EC2a627655134886477D10A41275f54556E0e2').popDebtFromQueue(1611116032) with nonce=1519, gas=159390, gas_price=10000000000 (tx_hash=0x7266984842ce52d8df52a775d889bb7040e0bac742d51f369e0c23e3e89dd560) -2021-01-20 04:16:32,881 INFO Transaction AccountingEngine('0x73EC2a627655134886477D10A41275f54556E0e2').popDebtFromQueue(1611116032) was successful (tx_hash=0x7266984842ce52d8df52a775d889bb7040e0bac742d51f369e0c23e3e89dd560) -2021-01-20 04:16:32,983 INFO Settling debt coin balance=192.720512165128879832575769589252154674198975198 unqueued_enauctioned_debt=686.568045684729064016811194323877100504725525932 -2021-01-20 04:16:33,793 INFO Sent transaction AccountingEngine('0x73EC2a627655134886477D10A41275f54556E0e2').settleDebt(192720512165128879832575769589252154674198975198) with nonce=1520, gas=171354, gas_price=10000000000 (tx_hash=0x92d16108db353e25b70a743eefb84568f640f3ab4241d5cfa43c147126080d4b) -2021-01-20 04:16:40,536 INFO Transaction AccountingEngine('0x73EC2a627655134886477D10A41275f54556E0e2').settleDebt(192720512165128879832575769589252154674198975198 -) was successful (tx_hash=0x92d16108db353e25b70a743eefb84568f640f3ab4241d5cfa43c147126080d4b) -2021-01-20 04:16:40,596 INFO Initiating a debt auction with unqueued_unauctioned_debt=493.847533519600184184235424734624945830526550734 -2021-01-20 04:16:41,382 INFO Sent transaction AccountingEngine('0x73EC2a627655134886477D10A41275f54556E0e2').auctionDebt() with nonce=1521, gas=306628, gas_price=1 -0000000000 (tx_hash=0x9ff7a02e85a30c361768639729678df615eba7f10a69505c1aaa4cc88818c73d) -2021-01-20 04:16:44,491 INFO Transaction AccountingEngine('0x73EC2a627655134886477D10A41275f54556E0e2').auctionDebt() was successful (tx_hash=0x9ff7a02e85a30c36176 -8639729678df615eba7f10a69505c1aaa4cc88818c73d) -2021-01-20 04:16:44,636 INFO Started monitoring auction #7 -2021-01-20 04:16:44,637 INFO Instantiated model using process '/models/debt_model.sh --id 7 --debt_auction_house 0xBD0E4aC6061Df1eA95CaDfb04707892cCb750531' -2021-01-20 04:16:44,652 INFO Process '/models/debt_model.sh --id 7 --debt_auction_house 0xBD0E4aC6061Df1eA95CaDfb04707892cCb750531' (pid #35) started -2021-01-20 04:16:44,664 INFO Checked auctions 0 to 7 in 0 seconds -2021-01-20 04:16:44,977 INFO Initiating a debt auction with unqueued_unauctioned_debt=408.847533519600184184235424734624945830526550734 -2021-01-20 04:16:45,210 INFO Sent transaction AccountingEngine('0x73EC2a627655134886477D10A41275f54556E0e2').auctionDebt() with nonce=1522, gas=276628, gas_price=1 -0000000000 (tx_hash=0xd87e9c0a2c6512340602426b9530c822b6c58b30eaa61021a3c314c7c30fe41c) -2021-01-20 04:16:46,965 INFO Sending new bid @100.000000000000000000 for auction 7 -2021-01-20 04:16:47,020 INFO Sent transaction DebtAuctionHouse('0xBD0E4aC6061Df1eA95CaDfb04707892cCb750531').decreaseSoldAmount(7, 850000000000000000, 850000000000 -00000000000000000000000000000000000) with nonce=1523, gas=234777, gas_price=10000000000 (tx_hash=0xaffbe93a1f901d1a43ed331284cb76f5e01b64cddc2dc1b6978b0473021b8072) -2021-01-20 04:16:53,038 INFO Transaction AccountingEngine('0x73EC2a627655134886477D10A41275f54556E0e2').auctionDebt() was successful (tx_hash=0xd87e9c0a2c651234060 -2426b9530c822b6c58b30eaa61021a3c314c7c30fe41c) -2021-01-20 04:16:53,040 INFO Transaction DebtAuctionHouse('0xBD0E4aC6061Df1eA95CaDfb04707892cCb750531').decreaseSoldAmount(7, 850000000000000000, 85000000000000000 -000000000000000000000000000000) was successful (tx_hash=0xaffbe93a1f901d1a43ed331284cb76f5e01b64cddc2dc1b6978b0473021b8072) -2021-01-20 04:16:53,216 INFO Started monitoring auction #8 -2021-01-20 04:16:53,216 INFO Instantiated model using process '/models/debt_model.sh --id 8 --debt_auction_house 0xBD0E4aC6061Df1eA95CaDfb04707892cCb750531' -2021-01-20 04:16:53,236 INFO Process '/models/debt_model.sh --id 8 --debt_auction_house 0xBD0E4aC6061Df1eA95CaDfb04707892cCb750531' (pid #44) started -2021-01-20 04:16:53,252 INFO Checked auctions 0 to 8 in 0 seconds -2021-01-20 04:16:54,094 INFO Initiating a debt auction with unqueued_unauctioned_debt=323.847533519600184184235424734624945830526550734 -``` diff --git a/docs/keepers/overview.mdx b/docs/keepers/overview.mdx deleted file mode 100644 index 1bb18e56..00000000 --- a/docs/keepers/overview.mdx +++ /dev/null @@ -1,226 +0,0 @@ ---- -title: Keeper Overview ---- - -# Keeper Overview - -Keepers are meant participate in collateral, surplus and debt auctions by directly interacting with GEB auction contracts deployed on a blockchain. - -### Keeper Responsibilities - -The keepers are responsible with: - -1. Monitoring all active auctions -2. Starting new auctions -3. Discovering new auctions -4. Ensuring a bidding model is running for each active auction -5. Passing auction status to each bidding model -6. Processing each bidding model output and submitting bids - -### Architecture - -`auction-keeper` can read an auction's status directly from the blockchain or from a [Graph](https://thegraph.com/) node. Its unique feature is the ability to plug in external _bidding models_ which tell the keeper when and how much to bid. Bid prices are received from separate _bidding models_. - -_Bidding models_ are simple processes that can be implemented in any programming language. They only need to pass JSON objects to and from `auction-keeper`. The simplest example of a bidding model is a shell script which echoes a fixed price. - -For every new block, all auctions from `1` to `auctionsStarted` are checked for active status. If a new auction is detected, a new bidding model is started. - -**NOTE**: _Bidding models_ are only used for surplus and debt auctions, not collateral auctions. - -## Installation - -### Running on Docker \(recommended\) - -Examples: - -* [Collateral](collateral-auction-keeper/running-in-docker.md) -* [Surplus](surplus-auction-keeper/running-in-docker.md) -* [Debt](debt-auction-keeper/running-in-docker.md) - -### Running on a host - -Pre-requisites: Python 3.6+ - -Install `auction-keeper` dependencies with: - -```text -git clone https://github.com/reflexer-finance/auction-keeper.git -cd auction-keeper -git submodule update --init --recursive -pip3 install -r requirements.txt -``` - -The keeper can now be run with `bin/auction-keeper`. - -Auction specific examples: - -* [Collateral](collateral-auction-keeper/running-on-a-host.md) -* [Surplus](surplus-auction-keeper/running-on-a-host.md) -* [Debt](debt-auction-keeper/running-on-a-host.md) - -## Configuration Reference - -Run `bin/auction-keeper -h` to see an up-to-date list of arguments and usage information. - -### General - -`--type collateral|surplus|debt` A keeper can only participate in one type of auction - -`--collateral-type NAME` If `--type=collateral` is passed, the `collateral_type` must also be provided. A keeper can only bid on a single collateral type auction at a time. **NOTE**: Currently, only the `ETH-A` collateral type is used. - -`--eth-from ADDRESS` Address of the keeper. **Warning**: **Do not use the same `eth-from` account on multiple keepers** as it complicates `SAFEEngine` inventory management and will likely cause nonce conflicts. Using an `eth-from` account with an open SAFE is also discouraged. - -`--rpc-host HOST` URI of ETH JSON-RPC node. Default `"http://localhost:8545"` - -`--rpc-timeout SECS` Defaults to `10` - -The keeper connects to the blockchain network using [Web3.py](https://github.com/ethereum/web3.py) and interacts with GEB using [pyflex](https://github.com/reflexer-labs/pyflex). A connection to an Ethereum node \(`--rpc-host`\) is required. [Parity](https://www.parity.io/ethereum/) and [Geth](https://geth.ethereum.org/) nodes are supported over HTTP. Websocket endpoints are not supported in `pyflex`. A _full_ or _archive_ node is required; _light_ nodes are **not** supported. - -If you don't want to run your own node, third-party providers are available. This software has been tested with [Infura](https://infura.io), [ChainSafe](https://chainsafe.io/) and [QuikNode](https://v2.quiknode.io/). - -### Gas price strategies - -The following options determine the keeper's gas strategy and are mutually exclusive: - -`--ethgasstation-api-key MY_API_KEY` Use [ethgasstation.info](https://ethgasstation.info) for gas prices - -`--etherchain-gas-price` Use [etherchain.org](https://etherchain.org) for gas prices - -`--poanetwork-gas-price` Use [poa.network](https://gasprice.poa.network/) for gas prices - -`--etherscan-gas-price` Use [etherscan.io](https://etherscan.io/) for gas prices. Optional: `--etherscan-key KEY`. Rate-limited to 1request/5sec w/o a key. - -`--gasnow-gas-price` Use [gasnow.org](https://gasnow.org) for gas prices - -`--fixed-gas-price GWEI` Use a fixed gas price \(in GWEI\) - -If none of these options is given or if the gas API produces no result, the keeper will fetch the gas price from the node you connected to. - -### Other gas options - -`--gas-initial-multiplier MULTIPLIER` When using an API source for fetching the initial gas price, this tunes the price. It's ignored when you're using `--fixed-gas-price`. In case no strategy is specified it defaults to `1.0` - -`--gas-reactive-multiplier MULTIPLIER` Every 30 seconds, a transaction's gas price will be multiplied by this value until it is mined or `--gas-maxiumum` is reached. Not used if `gasPrice` is passed from your bidding model. **NOTE**: [Parity](https://wiki.parity.io/Transactions-Queue#dropping-conditions), as of this writing, requires a minimum gas increase of `1.125` to propagate a transaction replacement; this should be treated as a minimum value unless you want replacements to happen less frequently. This multiplier defaults to `1.125` if no other value is given. - -`--gas-maximum GWEI` Maximum value for gas price - -### Accounting options - -By default the keeper `join`s system coins to `SAFEEngine` on startup and `exit`s all system coins and collateral upon shutdown. The keeper provides options for managing `SAFEEngine` balances, which may be turned off in case you'd like to manage balances manually. - -`--keep-system-coin-in-safe-engine-on-exit` Do not `exit` system coin on shutdown - -`--keep-collateral-in-safe-engine-on-exit` Do not `exit` collateral on shutdown - -`--return-collateral-interval SECS` How often, in seconds, the keeper `exit`s won collateral from `SAFEEngine`. Pass `0` to disable completely. Defaults to `300` - -`--safe-engine-system-coin-target ALL|` Amount of system coins the keeper will try to keep in `SAFEEngine` by rebalancing with `join`s and `exit`s between its own wallet and its balance inside GEB. Defaults to `ALL` and the keeper will `join` all of an account's systems coins. - -### **Rebalancing** - -System coins are rebalanced per `--safe-engine-system-coin-target` when: - -* The keeper starts up -* `SAFEEngine` balance is insufficient in order to place a bid -* An auction is settled - -Rebalances do not account for system coins moved from the `SAFEEngine` to an auction contract for an active bid. - -To avoid transaction spamming, small "dusty" system coins balances will be ignored \(until the keeper exits, if so configured\). - -### Managing resources - -#### Retrieving SAFEs - -To start collateral auctions, the keeper needs a list of SAFEs and the collateralization ratio of each safe. There are two ways to retrieve the list of open SAFEs: - -`--from-block BLOCK_NUMBER` Scrape the chain for `ModifySAFECollateralization` events, starting at `BLOCK_NUMBER` . Set this to the block where the first ever SAFE was created. After startup, only new blocks will be queried. The scrape process can last a significant amount of time as the system matures. **NOTE**: To manage the performance of debt auction bidding, periodically adjust `--from-block` to the block number of the oldest liquidation which has not been `popDebtFromQueue`d yet. Defaults to `geb.starting_block_number`, the block in which the system was deployed. - -`--graph-endpoints NODE1,NODE2` Comma delimited list of [Graph](https://thegraph.com) endpoints used to retrieve `ModifySAFECollateralization` events. If multiple endpoints are passed, they will be pinged sequentially in the order they were specified in case one or many of them fail. **NOTE**: This flag is only supported for collateral auctions. - -`--graph-block-threshold NUMBER_OF_BLOCKS` When the keeper fetches SAFE data to find critical safes, use the `--graph-endpoints` when the keeper's last processed block is older than `NUMBER_OF_BLOCKS`. The graph will be faster than a node when fetching historical data, but recent graph blocks might be slightly delayed compared to an ethereum node. This allows the keeper to to fetch historical data from the graph, but use the node for all newer blocks. Defaults to `20` - -The following are the most recent Graph node endpoints for RAI:`--graph-endpoints https://subgraph.reflexer.finance/subgraphs/name/reflexer-labs/rai,https://api.thegraph.com/subgraphs/name/reflexer-labs/rai-mainnet` - -#### Auctions - -`--min-auction AUCTION_ID` Ignore auctions older than `AUCTION_ID` - -`--max-auctions NUMBER` Limit the number of bidding models created to handle active auctions. - -`--block-check-interval , default:1` How often the keeper checks for new blocks - -`--bid-check-interval , default 4` How often the keeper checks model processes for new bids - -**NOTE**: if you'd like to use Infura with your keeper and prefer the free-tier \(you do less than 100K requests per day\), `--block-check-interval` must be greater than `10` and `--bid-check-interval` must be greater than 180. However, this will make your keeper slower and it will not quickly bid in auctions. - -#### Flash swaps - -Flash swaps allow a keeper to participate in collateral auctions without any system coins. The flash swap borrows the system coin necessary for the collateral auctions, wins the collateral at a discount and transferred the won collateral back to the keeper, all in one transaction. Note: If the overall transaction is not profitable, the swap will fail. The keeper only needs enough ether to pay for the gas of the swap. - -`--flash-swap` Turn on Uniswap flash swaps for collateral auctions. Not supported for `--type debt` or `--type surplus` - -[Read more about flash swaps](https://github.com/reflexer-labs/geb-docs/tree/c027d74c487c0a715a19a415c1c97933e43a9f7d/keepers/collateral-auction-keeper/flash-swaps.md) - -#### Sharding/Settling - -Bid management can be sharded across multiple keepers. If you want to proceed with sharding, set these options: - -`--shards NUMBER_OF_KEEPER` Number of keepers you plan to run. You must set this for all keepers - -`--shard-id SHARD_ID` You must specify this for every keeper, counting from 0 - -For example, to configure three keepers, set `--shards 3` and assign `--shard-id 0`, `--shard-id 1`, `--shard-id 2` for the first, second and third keeper. - -**NOTE**: **Auction starts are not sharded**. Only one keeper should be configured to `liquidateSAFE`s and this way `startAuction`s. - -If you are sharding across multiple accounts, you may want to have a separate keeper that handles all your `settleAuction`s \(in the case of English collateral, debt and surplus auctions\) - -`--settle-for |NONE|ALL` Space-delimited list of accounts for which the keeper will settle auctions. Specify `NONE` to disable this option. If you'd like to donate your gas to settle auctions for all participants, `ALL` is also supported. Defaults to only the keeper address. - -**NOTE**: **Auction settlements are already sharded**, so you should remove the sharding configuration if you're running a dedicated auction settlement keeper. - -#### Transaction management - -`--bid-delay FLOAT` - -Many pending transactions can fill up the keeper's transaction queue, causing every subsequent transaction to be dropped. By waiting a small `--bid-delay` after each bid, multiple transactions can be submitted asynchronously while still allowing some time for older transactions to complete, freeing up the queue. - -Many parameters determine the appropriate bid delay. For illustration purposes, assume the queue can hold 12 transactions, and gas prices are reasonable. In this setup, a bid delay of 1.2 seconds might provide ample time for transactions at the front of the queue to complete. - -### Limitations - -* If an auction started before the keeper was started, this keeper will not participate in it until the next block is mined -* This keeper does not explicitly handle Global Settlement, and may submit transactions which fail during shutdown -* Some keeper functions incur gas fees regardless of whether a bid is submitted. This includes, but is not limited to, the following actions: - * submitting token approvals - * adjusting the surplus and debt balances from `AccountingEngine` - * liquidating a SAFE or starting a surplus or debt auction -* The keeper does not check model prices until an auction exists. When configured to create new auctions, it will `liquidateSAFE`s or start a new surplus or debt auction regardless of whether or not your system coin or protocol token balance is sufficient to bid -* Liquidating a SAFE to start a new collateral auction is a time consuming operation. To do so without a subgraph subscription, the keeper initializes a cache of SAFEs states by scraping event logs from the chain. The keeper will then continuously refresh SAFE states and detect undercollateralized SAFEs. - * Despite batching log queries into multiple requests, Geth nodes are generally unable to initialize the SAFE state cache in a reasonable amount of time. As such, **Geth is not recommended for liquidating SAFEs** - * To manage resources, it is recommended to run separate keepers using separate accounts to liquidate \(`--start-auctions-only`\) and bid \(`--bid-only`\) in auctions - -For some known Ubuntu and macOS issues see the [pyflex](https://github.com/reflexer-labs/pyflex) README. - -### Testing - -This project uses [pytest](https://docs.pytest.org/en/latest/) for unit testing. Testing depends on a dockerized local testchain included in `lib\pyflex\tests\config`. - -In order to be able to run tests you should execute: - -```text -git clone https://github.com/reflexer-labs/auction-keeper.git -cd auction-keeper -git submodule update --init --recursive -./install.sh -source _virtualenv/bin/activate -pip3 install -r requirements-dev.txt -``` - -You can then run all tests with: - -```text -./test.sh -``` - diff --git a/docs/keepers/staked-token-auction-keeper/README.mdx b/docs/keepers/staked-token-auction-keeper/README.mdx deleted file mode 100644 index df8bf354..00000000 --- a/docs/keepers/staked-token-auction-keeper/README.mdx +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: Staked Token Auction Keeper -description: How to run a staked token auction keeper ---- - -# Staked Token Auction Keeper - -This mini guide will walk you through running a staked token (FLX/ETH LP) auction keeper in Docker & also directly on a host. diff --git a/docs/keepers/staked-token-auction-keeper/running-in-docker.mdx b/docs/keepers/staked-token-auction-keeper/running-in-docker.mdx deleted file mode 100644 index a5e47b06..00000000 --- a/docs/keepers/staked-token-auction-keeper/running-in-docker.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: Running in Docker -description: Running a staked token auction keeper in a Docker container ---- - -# Running in Docker - -## 1. Get OD - -Buy OD or [open a SAFE](https://app.gitbook.com/@reflexer-labs/s/geb/pyflex/safe-management/opening-a-safe) to generate it. - -## 2. Modify the model file as needed - -A basic staked token auction bidding model can be found in `models/debt_staked_model.py`. This model retrieves the latest ODG/USD price from Coingecko and will automatically place bids in an auction. - -You probably want to modify the following variables in `models/debt_model.py`: - -* `MAXIMUM_ODG_MULTIPLIER`: the maximum acceptable ODG price to use when bidding. Default: `0.90` meaning the maximum price to pay when biding for ODG (with OD) is 90% of the current ODG/USD market price from Coingecko -* `MINIMUM_ODG_MULTIPLIER`: the minimum ODG price to use when bidding. This will determine your opening bid. Default: `0.50` meaning the minimumm price to pay when biding for ODG (with OD) is 50% of the current ODG/USD market price coming from Coingecko -* `MY_BID_INCREASE`: the bid increase (in OD) to propose when outbidding another bidder. If the value is smaller than the staked token auction house's `bidIncrease`, then it will use the value set in the staked token auction house. Example: a value of `1.10` will use bid increases of 10%. Note: the current `bidIncrease` on mainnet is `1.05` - -Then, use `chmod +x debt_staked_model.py`. - -For more information about bidding models, see [this](/keepers/bidding-models). - -### 3) Modify the keeper run file - -Modify the following variables in `run_debt_keeper.sh`: - -* `KEEPER_ADDRESS` - the keeper's address. It should be in checksummed format (not lowercase) -* `ETH_RPC_URL` - the URL of your Ethereum RPC connection -* `KEYSTORE_DIR` - the full path of the directory where your keystore file is -* `MODEL_DIR` - the full path of directory where your `surplus_model.py` file is -* `KEYSTORE_FILE` - your Ethereum UTC JSON keystore filename. For more information about the keystore format and how to generate it, check [Ethereum UTC / JSON Wallet Encryption](https://wizardforcel.gitbooks.io/practical-cryptography-for-developers-book/content/symmetric-key-ciphers/ethereum-wallet-encryption.html) or[ keythereum](https://github.com/ethereumjs/keythereum). -* `GAS_MAXIMUM`- maximum gas price, in GWEI - -Then, use `chmod +x run_debt_keeper.sh`. - -### 4) Start the keeper and enter your keystore file password - -Use `./run_debt_staked_keeper.sh`. - -``` -$ ./run_debt_staked_keeper.sh -latest: Pulling from reflexer/auction-keeper -Digest: sha256:7e55ec9b0a136fc903d9f7f2690538bcbde9029d957e0e6f84d0282790f9666a -Status: Downloaded newer image for reflexer/auction-keeper:latest -docker.io/reflexer/auction-keeper:latest -Password for /keystore/key.json: -``` diff --git a/docs/keepers/staked-token-auction-keeper/running-on-a-host.mdx b/docs/keepers/staked-token-auction-keeper/running-on-a-host.mdx deleted file mode 100644 index 56ffe4b9..00000000 --- a/docs/keepers/staked-token-auction-keeper/running-on-a-host.mdx +++ /dev/null @@ -1,211 +0,0 @@ ---- -title: Running on a Host -description: Running a staked token auction keeper directly on a host ---- - -# Running on a Host - -## Prerequisites - -Python 3.6+ - -### Get OD - -Buy OD from Uniswap v2 or [open a SAFE](https://app.gitbook.com/@reflexer-labs/s/geb/pyflex/safe-management/opening-a-safe) and generate it. - -### Clone - -``` -git clone https://github.com/reflexer-labs/auction-keeper.git -cd auction-keeper -git submodule update --init --recursive -``` - -### Install - -This creates a virtual environment and installs all the keeper dependencies: - -`./install.sh` - -## 1) Start virtualenv - -`source _virtualenv/bin/activate` - -## 2) Modify model file as needed - -A basic debt staked auction bidding model can be found in `models/debt_staked_model.py`. This model retrieves the latest ODG/USD price from Coingecko and will automatically place bids in an auction. - -You probably want to modify the following variables in `models/debt_staked_model.py`: - -* `MAXIMUM_ODG_MULTIPLIER`: the maximum acceptable ODG price to use when bidding. Default: `0.90` meaning the maximum price to pay when biding for ODG (with OD) is 90% of the current ODG/USD market price coming from Coingecko -* `MINIMUM_ODG_MULTIPLIER`: the minimum ODG price to use when bidding. This will determine your opening bid. Default: `0.50` meaning the minimum price to pay when biding for ODG (with OD) is 50% of the current ODG/USD market price from Coingecko -* `MY_BID_INCREASE`: the bid increase (in OD) to propose when outbidding another bidder. If the value is smaller than the staked token auction house's `bidIncrease`, then it will use the value set in the staked token auction house. Example: a value of `1.10` will use bid increases of 10%. Note: the current `bidIncrease` on mainnet is `1.05` - -#### Then: - -`chmod +x debt_staked_model.py` - -For more information about bidding models, see [Bidding Models](https://github.com/reflexer-labs/auction-keeper/blob/master/bidding-models.md). - -## 3) Modify keeper run file - -Modify the following variables in `run_debt_keeper_host.sh`: - -* `KEEPER_ADDRESS` - the keeper's address. It should be in checksummed format (not lowercase) -* `ETH_RPC_URL` - the URL of your Ethereum RPC connection -* `KEYSTORE_DIR` - the full path of the directory where your keystore file is -* `MODEL_DIR` - the full path of directory where your `debt_model.py` file is -* `KEYSTORE_FILE` - your Ethereum UTC JSON keystore filename For more information about this keystore format and how to generate them, check [keythereum](https://github.com/ethereumjs/keythereum) or [Ethereum UTC / JSON Wallet Encryption](https://wizardforcel.gitbooks.io/practical-cryptography-for-developers-book/content/symmetric-key-ciphers/ethereum-wallet-encryption.html). -* `GAS_MAXIMUM` -maximum gas price, in GWEI - -#### Then: - -`chmod +x run_debt_staked_keeper_host.sh` - -## 4) Start the keeper and enter your keystore file password - -`./run_debt_staked_keeper_host.sh` - -``` -$ ./run_debt_staked_keeper_host.sh -Password for /keystore/key.json: -``` - -## Staked Token Auction Output - -If debt from collateral auctions still exists after `AccountingEngine.pop_debt_delay()`, the debt staked *auction-keeper* will call `popDebtFromQueue()`: - -``` -2021-01-20 04:16:22,462 INFO Sent transaction AccountingEngine('0x73EC2a627655134886477D10A41275f54556E0e2').popDebtFromQueue(1611116032) with nonce=1519, gas=159390, gas_price=10000000000 (tx_hash=0x7266984842ce52d8df52a775d889bb7040e0bac742d51f369e0c23e3e89dd560) -``` - -### Settling debt - -Before starting a staked token auction, the keeper will use any surplus to offset any existing debt. It does this by calling `settleDebt()`: - -``` -2022-07-11 20:49:06,502 INFO Settling debt. coin_balance=0.003849105356317367507721355548000000000000000 unqueued_enauctioned_debt=34709.319942457639191758056217752288276396399199497 -2022-07-11 20:49:06,798 INFO Sent transaction AccountingEngine('0x6073E8FE874B53732b5DdD469a2De4047f33C64B').settleDebt(3849105356317367507721355548000000000000000) with nonce=5502, gas=160806, gas_price=2500000007 (tx_hash=0x0cbf049a593cca6eaee174bb19be503736adc0562bf5837b4f2acb3e3dc37435) -2022-07-11 20:49:08,855 INFO Transaction AccountingEngine('0x6073E8FE874B53732b5DdD469a2De4047f33C64B').settleDebt(3849105356317367507721355548000000000000000) was successful (tx_hash=0x0cbf049a593cca6eaee174bb19be503736adc0562bf5837b4f2acb3e3dc37435) -``` - -### Starting a Staked Token Auction - -Finally, if debt still exists and is enough to start a staked token auction, the *auction-keeper* will call `auctionAncestorTokens()` in the `StakingPool`: - -``` -2022-07-11 20:49:09,467 INFO Sent transaction .auctionAncestorTokens() with nonce=5503, gas=428111, gas_price=2500000007 (tx_hash=0xba5e1523fc60666010554b644a69e826375a28ed393a2498982db0eb2097e751) -2022-07-11 20:49:12,900 INFO Transaction .auctionAncestorTokens() was successful (tx_hash=0xba5e1523fc60666010554b644a69e826375a28ed393a2498982db0eb2097e751) -``` - -### Bidding in a Staked Token Auction - -To bid in staked token auctions, the *auction-keeper* calls `increaseBidSize()`: - -``` -2022-07-11 20:49:13,106 INFO Started monitoring auction #11 -2022-07-11 20:49:13,106 INFO Instantiated model using process '/models/debt_staked_model.py --id 11 --staked_token_auction_house 0x328BCbF2d4c2D78936f52172c741456136FA7e92' -2022-07-11 20:49:13,115 INFO Process '/models/debt_staked_model.py --id 11 --staked_token_auction_house 0x328BCbF2d4c2D78936f52172c741456136FA7e92' (pid #23) started -2022-07-11 20:49:13,204 INFO Feeding auction 11 model input {'id': '11', 'bid_amount': '0.000000000000000000000000001000000000000000000', 'amount_to_sell': '0.001000000000000000', 'block_time': 1657572552, 'auction_deadline': 1657573452, 'price': '0.000000000000000000', 'bid_increase': '1.050000000000000000', 'high_bidder': '0x0000000000000000000000000000000000000000', 'staked_token_auction_house': '0x328BCbF2d4c2D78936f52172c741456136FA7e92'} -2022-07-11 20:49:13,238 INFO Checked auctions 11 to 11 in 0 seconds -2022-07-11 20:49:26,756 INFO Sending new bid @0.256000000000000000 for auction 11 -2022-07-11 20:49:26,965 INFO Sent transaction StakedTokenAuctionHouse('0x328BCbF2d4c2D78936f52172c741456136FA7e92').increaseBidSize(11, 1000000000000000, 1283356467456783863967795170000000000000000) with nonce=5504, gas=182102, gas_price=2500000007 (tx_hash=0x6b9c65ebd0b55090af120543d4024d095059ddf66542af997e1fb6543fa1e22c) -2022-07-11 20:49:29,322 INFO Transaction StakedTokenAuctionHouse('0x328BCbF2d4c2D78936f52172c741456136FA7e92').increaseBidSize(11, 1000000000000000, 1283356467456783863967795170000000000000000) was successful (tx_hash=0x6b9c65ebd0b55090af120543d4024d095059ddf66542af997e1fb6543fa1e22c) -``` - -### Settling a Staked Token Auction - -To settle a staked token auction, the *auction-keeper* calls `settleAuction()`: - -``` -2022-07-11 20:59:51,693 INFO Sent transaction StakedTokenAuctionHouse('0x328BCbF2d4c2D78936f52172c741456136FA7e92').settleAuction(11) with nonce=55 -07, gas=227887, gas_price=2500000007 (tx_hash=0x4e1d347341b9e4e1567aff93585db3fb7529b024a8282ffa6d1da2164d7264f3) -2022-07-11 20:59:52,715 INFO Transaction StakedTokenAuctionHouse('0x328BCbF2d4c2D78936f52172c741456136FA7e92').settleAuction(11) was successful (tx -_hash=0x4e1d347341b9e4e1567aff93585db3fb7529b024a8282ffa6d1da2164d7264f3) -``` - -### Full Log Output - -``` -[ec2-user@ip-172-31-40-135 ~]$ ./run_debt_staked_keeper.sh -Password for /keystore/keystore.json: -2022-07-11 20:48:43,736 INFO Keeper connected to RPC connection https://eth-kovan.alchemyapi.io/v2blahblahblah/ -2022-07-11 20:48:43,736 INFO Keeper operating as 0xdD1693BD8E307eCfDbe51D246562fc4109f871f8 -2022-07-11 20:48:43,928 INFO Executing keeper startup logic -2022-07-11 20:48:45,427 INFO Keeper will perform the following operation(s) in parallel: -2022-07-11 20:48:45,427 INFO --> Check thresholds in Accounting Engine Contract and start new debt_staked auctions once reached -2022-07-11 20:48:45,427 INFO --> Check all auctions being monitored and evaluate bidding opportunity every 20.0 seconds -2022-07-11 20:48:45,427 INFO --> Check all auctions and settle for any address -2022-07-11 20:48:45,471 INFO Keeper will use Node gas price (currently 2.5 Gwei, changes over time) with initial multiplier 1.0 and will multiply by 1.125 every 42s to a maximum of 200.0 Gwei for transactions and bids unless model instructs otherwise -2022-07-11 20:48:45,622 INFO Watching for new blocks -2022-07-11 20:48:45,624 INFO Started 2 timer(s) -2022-07-11 20:49:06,502 INFO Settling debt. coin_balance=0.003849105356317367507721355548000000000000000 unqueued_enauctioned_debt=34709.319942457639191758056217752288276396399199497 -2022-07-11 20:49:06,798 INFO Sent transaction AccountingEngine('0x6073E8FE874B53732b5DdD469a2De4047f33C64B').settleDebt(3849105356317367507721355548000000000000000) with nonce=5502, gas=160806, gas_price=2500000007 (tx_hash=0x0cbf049a593cca6eaee174bb19be503736adc0562bf5837b4f2acb3e3dc37435) -2022-07-11 20:49:08,855 INFO Transaction AccountingEngine('0x6073E8FE874B53732b5DdD469a2De4047f33C64B').settleDebt(3849105356317367507721355548000000000000000) was successful (tx_hash=0x0cbf049a593cca6eaee174bb19be503736adc0562bf5837b4f2acb3e3dc37435) -2022-07-11 20:49:09,467 INFO Sent transaction .auctionAncestorTokens() with nonce=5503, gas=428111, gas_price=2500000007 (tx_hash=0xba5e1523fc60666010554b644a69e826375a28ed393a2498982db0eb2097e751) -2022-07-11 20:49:12,900 INFO Transaction .auctionAncestorTokens() was successful (tx_hash=0xba5e1523fc60666010554b644a69e826375a28ed393a2498982db0eb2097e751) -2022-07-11 20:49:13,105 INFO Input for auction 11: {'id': '11', 'bid_amount': '0.000000000000000000000000001000000000000000000', 'amount_to_sell': '0.001000000000000000', 'block_time': 1657572552, 'auction_deadline': 1657573452, 'price': '0.000000000000000000', 'bid_increase': '1.050000000000000000', 'high_bidder': '0x0000000000000000000000000000000000000000', 'staked_token_auction_house': '0x328BCbF2d4c2D78936f52172c741456136FA7e92'} -2022-07-11 20:49:13,106 INFO Auction 11 deleted: False -2022-07-11 20:49:13,106 INFO Started monitoring auction #11 -2022-07-11 20:49:13,106 INFO Instantiated model using process '/models/debt_staked_model.py --id 11 --staked_token_auction_house 0x328BCbF2d4c2D78936f52172c741456136FA7e92' -2022-07-11 20:49:13,115 INFO Process '/models/debt_staked_model.py --id 11 --staked_token_auction_house 0x328BCbF2d4c2D78936f52172c741456136FA7e92' (pid #23) started -2022-07-11 20:49:13,204 INFO Feeding auction 11 model input {'id': '11', 'bid_amount': '0.000000000000000000000000001000000000000000000', 'amount_to_sell': '0.001000000000000000', 'block_time': 1657572552, 'auction_deadline': 1657573452, 'price': '0.000000000000000000', 'bid_increase': '1.050000000000000000', 'high_bidder': '0x0000000000000000000000000000000000000000', 'staked_token_auction_house': '0x328BCbF2d4c2D78936f52172c741456136FA7e92'} -2022-07-11 20:49:13,238 INFO Checked auctions 11 to 11 in 0 seconds -2022-07-11 20:49:26,756 INFO Sending new bid @0.256000000000000000 for auction 11 -2022-07-11 20:49:26,965 INFO Sent transaction StakedTokenAuctionHouse('0x328BCbF2d4c2D78936f52172c741456136FA7e92').increaseBidSize(11, 1000000000000000, 1283356467456783863967795170000000000000000) with nonce=5504, gas=182102, gas_price=2500000007 (tx_hash=0x6b9c65ebd0b55090af120543d4024d095059ddf66542af997e1fb6543fa1e22c) -2022-07-11 20:49:27,084 INFO Sent transaction .auctionAncestorTokens() with nonce=5505, gas=393911, gas_price=2500000007 (tx_hash=0x191649561ef51dfee298f397e0234c5ad10ecf388416328f965bbcd556ff0e78) -2022-07-11 20:49:29,322 INFO Transaction StakedTokenAuctionHouse('0x328BCbF2d4c2D78936f52172c741456136FA7e92').increaseBidSize(11, 1000000000000000, 1283356467456783863967795170000000000000000) was successful (tx_hash=0x6b9c65ebd0b55090af120543d4024d095059ddf66542af997e1fb6543fa1e22c) -2022-07-11 20:49:29,439 INFO Transaction .auctionAncestorTokens() was successful (tx_hash=0x191649561ef51dfee298f397e0234c5ad10ecf388416328f965bbcd556ff0e78) -2022-07-11 20:49:29,619 INFO Input for auction 11: {'id': '11', 'bid_amount': '0.001283356467456783863967795170000000000000000', 'amount_to_sell': '0.001000000000000000', 'block_time': 1657572568, 'auction_deadline': 1657573452, 'price': '0.255999805335068288', 'bid_increase': '1.050000000000000000', 'high_bidder': '0xdD1693BD8E307eCfDbe51D246562fc4109f871f8', 'bid_expiry': '1657573168', 'staked_token_auction_house': '0x328BCbF2d4c2D78936f52172c741456136FA7e92'} -2022-07-11 20:49:29,619 INFO Auction 11 deleted: False -2022-07-11 20:49:29,768 INFO Input for auction 12: {'id': '12', 'bid_amount': '0.000000000000000000000000001000000000000000000', 'amount_to_sell': '0.001000000000000000', 'block_time': 1657572568, 'auction_deadline': 1657573468, 'price': '0.000000000000000000', 'bid_increase': '1.050000000000000000', 'high_bidder': '0x0000000000000000000000000000000000000000', 'staked_token_auction_house': '0x328BCbF2d4c2D78936f52172c741456136FA7e92'} -2022-07-11 20:49:29,768 INFO Auction 12 deleted: False -2022-07-11 20:49:29,768 WARNING Processing auctions [11]; ignoring [12] -2022-07-11 20:49:29,798 INFO Checked auctions 11 to 12 in 0 seconds -2022-07-11 20:49:47,145 INFO Sent transaction .auctionAncestorTokens() with nonce=5506, gas=393911, -gas_price=2500000007 (tx_hash=0x03e820d3536bce35eaf6f22f51d8132499bb6695ac16732c31ad1ff65f48a29e) -2022-07-11 20:49:48,861 INFO Transaction .auctionAncestorTokens() was successful (tx_hash=0x03e820d3 -536bce35eaf6f22f51d8132499bb6695ac16732c31ad1ff65f48a29e) -2022-07-11 20:49:49,058 INFO Input for auction 11: {'id': '11', 'bid_amount': '0.001283356467456783863967795170000000000000000', 'amount_to_sell': '0.001000000000000000', 'block_time': 1657572588, 'auction_deadline': 1657573452, 'price': '0.255998832012630103', 'bid_increase': '1.050000000000000000', 'high_bidder': '0xdD1693BD8E307eCfDbe51D246562fc4109f871f8', 'bid_expiry': '1657573168', 'staked_token_auction_house': '0x328BCbF2d4c2D78936f52172c741456136FA7e92'} -2022-07-11 20:49:49,058 INFO Auction 11 deleted: False -2022-07-11 20:49:49,220 INFO Input for auction 12: {'id': '12', 'bid_amount': '0.000000000000000000000000001000000000000000000', 'amount_to_sell': '0.001000000000000000', 'block_time': 1657572588, 'auction_deadline': 1657573468, 'price': '0.000000000000000000', 'bid_increase': '1.050000000000000000', 'high_bidder': '0x0000000000000000000000000000000000000000', 'staked_token_auction_house': '0x328BCbF2d4c2D78936f52172c741456136FA7e92'} -2022-07-11 20:49:49,220 INFO Auction 12 deleted: False -2022-07-11 20:49:49,361 INFO Input for auction 13: {'id': '13', 'bid_amount': '0.000000000000000000000000001000000000000000000', 'amount_to_sell': '0.001000000000000000', 'block_time': 1657572588, 'auction_deadline': 1657573488, 'price': '0.000000000000000000', 'bid_increase': '1.050000000000000000', 'high_bidder': '0x0000000000000000000000000000000000000000', 'staked_token_auction_house': '0x328BCbF2d4c2D78936f52172c741456136FA7e92'} -2022-07-11 20:49:49,361 INFO Auction 13 deleted: False -2022-07-11 20:49:49,361 WARNING Processing auctions [11]; ignoring [12, 13] -2022-07-11 20:49:49,400 INFO Checked auctions 11 to 13 in 0 seconds -2022-07-11 20:50:06,979 INFO Can't start staked_token auction as there are already 3 active auctions -2022-07-11 20:50:07,179 INFO Input for auction 11: {'id': '11', 'bid_amount': '0.001283356467456783863967795170000000000000000', 'amount_to_sell': '0.001000000000000000', 'block_time': 1657572604, 'auction_deadline': 1657573452, 'price': '0.255998053357343998', 'bid_increase': '1.050000000000000000', 'high_bidder': '0xdD1693BD8E307eCfDbe51D246562fc4109f871f8', 'bid_expiry': '1657573168', 'staked_token_auction_house': '0x328BCbF2d4c2D78936f52172c741456136FA7e92'} -2022-07-11 20:50:07,179 INFO Auction 11 deleted: False -2022-07-11 20:50:07,316 INFO Input for auction 12: {'id': '12', 'bid_amount': '0.000000000000000000000000001000000000000000000', 'amount_to_sell': '0.001000000000000000', 'block_time': 1657572604, 'auction_deadline': 1657573468, 'price': '0.000000000000000000', 'bid_increase': '1.050000000000000000', 'high_bidder': '0x0000000000000000000000000000000000000000', 'staked_token_auction_house': '0x328BCbF2d4c2D78936f52172c741456136FA7e92'} -2022-07-11 20:50:07,316 INFO Auction 12 deleted: False -2022-07-11 20:50:07,467 INFO Input for auction 13: {'id': '13', 'bid_amount': '0.000000000000000000000000001000000000000000000', 'amount_to_sell': '0.001000000000000000', 'block_time': 1657572604, 'auction_deadline': 1657573488, 'price': '0.000000000000000000', 'bid_increase': '1.050000000000000000', 'high_bidder': '0x0000000000000000000000000000000000000000', 'staked_token_auction_house': '0x328BCbF2d4c2D78936f52172c741456136FA7e92'} -2022-07-11 20:50:07,467 INFO Auction 13 deleted: False -2022-07-11 20:50:07,467 WARNING Processing auctions [11]; ignoring [12, 13] -2022-07-11 20:50:07,504 INFO Checked auctions 11 to 13 in 0 seconds -2022-07-11 20:50:27,228 INFO Can't start staked_token auction as there are already 3 active auctions -2022-07-11 20:50:27,397 INFO Input for auction 11: {'id': '11', 'bid_amount': '0.001283356467456783863967795170000000000000000', 'amount_to_sell': '0.001000000000000000', 'block_time': 1657572624, 'auction_deadline': 1657573452, 'price': '0.255997080041566909', 'bid_increase': '1.050000000000000000', 'high_bidder': '0xdD1693BD8E307eCfDbe51D246562fc4109f871f8', 'bid_expiry': '1657573168', 'staked_token_auction_house': '0x328BCbF2d4c2D78936f52172c741456136FA7e92'} -2022-07-11 20:50:27,397 INFO Auction 11 deleted: False -2022-07-11 20:50:27,578 INFO Input for auction 12: {'id': '12', 'bid_amount': '0.000000000000000000000000001000000000000000000', 'amount_to_sell': '0.001000000000000000', 'block_time': 1657572624, 'auction_deadline': 1657573468, 'price': '0.000000000000000000', 'bid_increase': '1.050000000000000000', 'high_bidder': '0x0000000000000000000000000000000000000000', 'staked_token_auction_house': '0x328BCbF2d4c2D78936f52172c741456136FA7e92'} -2022-07-11 20:50:27,578 INFO Auction 12 deleted: False -2022-07-11 20:50:27,730 INFO Input for auction 13: {'id': '13', 'bid_amount': '0.000000000000000000000000001000000000000000000', 'amount_to_sell': '0.001000000000000000', 'block_time': 1657572624, 'auction_deadline': 1657573488, 'price': '0.000000000000000000', 'bid_increase': '1.050000000000000000', 'high_bidder': '0x0000000000000000000000000000000000000000', 'staked_token_auction_house': '0x328BCbF2d4c2D78936f52172c741456136FA7e92'} -2022-07-11 20:50:27,731 INFO Auction 13 deleted: False -2022-07-11 20:50:27,731 WARNING Processing auctions [11]; ignoring [12, 13] -2022-07-11 20:50:27,772 INFO Checked auctions 11 to 13 in 0 seconds - - -2022-07-11 20:59:51,693 INFO Sent transaction StakedTokenAuctionHouse('0x328BCbF2d4c2D78936f52172c741456136FA7e92').settleAuction(11) with nonce=55 -07, gas=227887, gas_price=2500000007 (tx_hash=0x4e1d347341b9e4e1567aff93585db3fb7529b024a8282ffa6d1da2164d7264f3) -2022-07-11 20:59:52,715 INFO Transaction StakedTokenAuctionHouse('0x328BCbF2d4c2D78936f52172c741456136FA7e92').settleAuction(11) was successful (tx -_hash=0x4e1d347341b9e4e1567aff93585db3fb7529b024a8282ffa6d1da2164d7264f3) -2022-07-11 20:59:52,995 INFO Terminating model using process '/models/debt_staked_model.py --id 11 --staked_token_auction_house 0x328BCbF2d4c2D7893 -6f52172c741456136FA7e92' -2022-07-11 20:59:52,995 INFO Stopped monitoring auction #11 as it's not active anymore -2022-07-11 20:59:52,999 INFO Process '/models/debt_staked_model.py --id 11 --staked_token_auction_house 0x328BCbF2d4c2D78936f52172c741456136FA7e92' - (pid #23) terminated - - -2022-07-11 21:05:01,357 INFO Auction 13 ended without bids; resurrecting auction -2022-07-11 21:05:01,562 INFO Sent transaction StakedTokenAuctionHouse('0x328BCbF2d4c2D78936f52172c741456136FA7e92').restartAuction(13) with nonce=5515, gas=142873, gas_price=2500000007 (tx_hash=0xbe0ea7e2997b6554c4215076e80804a8894724c830ea35c2253ee3cbf1948265) -2022-07-11 21:05:04,878 INFO Transaction StakedTokenAuctionHouse('0x328BCbF2d4c2D78936f52172c741456136FA7e92').restartAuction(13) was successful (tx_hash=0xbe0ea7e2997b6554c4215076e80804a8894724c830ea35c2253ee3cbf1948265) -``` diff --git a/docs/keepers/surplus-auction-keeper/README.mdx b/docs/keepers/surplus-auction-keeper/README.mdx deleted file mode 100644 index 9a0451a2..00000000 --- a/docs/keepers/surplus-auction-keeper/README.mdx +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: Surplus Auction Keeper -description: How to run a surplus auction keeper ---- - -# Surplus Auction Keeper - -This mini guide will walk you through running a surplus auction keeper in Docker & also directly on a host. - diff --git a/docs/keepers/surplus-auction-keeper/running-in-docker.mdx b/docs/keepers/surplus-auction-keeper/running-in-docker.mdx deleted file mode 100644 index 9209f09c..00000000 --- a/docs/keepers/surplus-auction-keeper/running-in-docker.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: Running in Docker -description: Running a surplus auction keeper in a Docker container ---- - -# Running in Docker - -\:::info -In order to participate in surplus auctions you need to bid with protocol tokens -\::: - -## 1. Modify the model file as needed - -A basic surplus auction bidding model can be found in `models/surplus_model.py`. This model retrieves the latest ODG/USD price from Coingecko and will automatically place bids in an auction. - -You probably want to modify the following variables in `models/surplus_model.py`: - -* `STARTING_ODG_MULTIPLIER`: the maximum acceptable ODG price to use when bidding. This value will be used when bidding on a new auction with no previous bids. Default: `1.50` meaning the maximum price to accept for ODG (in OD terms) is 150% of the current ODG/USD market price -* `MINIMUM_ODG_MULTIPLIER`: the minimum acceptable ODG price to use when bidding. Default: `1.10` meaning the minimum price to accept for ODG (in OD terms) is 110% of the current ODG/USD market price - -`MY_BID_INCREASE`: The amount of bid increase(in ODG) to make when outbidding another bidder. If value is less than the auction house' `bidIncrease`, then it will use the auction house setting. Example: A value of `1.10` will create bid increases of 10%. Note: Current `bidIncrease` on mainnet is `1.03`. Default: `1.03` - -Then, use `chmod +x surplus_model.py`. - -For more information about bidding models, see [Bidding Models](../bidding-models.md). - -## 2. Modify the keeper run file - -Modify the following variables in `run_surplus_keeper.sh`: - -* `KEEPER_ADDRESS` - the keeper's address. It should be in checksummed format (not lowercase) -* `ETH_RPC_URL` - the URL of your Ethereum RPC connection -* `KEYSTORE_DIR` - the full path of the directory where your keystore file is -* `MODEL_DIR` - the full path of directory where your `surplus_model.py` file is -* `KEYSTORE_FILE` - your Ethereum UTC JSON keystore filename -* `GAS_MAXIMUM` -maximum gas price, in GWEI - -For more information about the keystore format and how to generate it: - -* [Ethereum UTC / JSON Wallet Encryption](https://wizardforcel.gitbooks.io/practical-cryptography-for-developers-book/content/symmetric-key-ciphers/ethereum-wallet-encryption.html) -* [keythereum](https://github.com/ethereumjs/keythereum) - -Finally, to run the keeper, use `chmod +x run_surplus_keeper.sh`. - -## 3. Start the keeper and enter your keystore file password - -`./run_surplus_keeper.sh` - -``` -$ ./run_auction_keeper.sh -Pulling from reflexer/auction-keeper -Digest: sha256:7e55ec9b0a136fc903d9f7f2690538bcbde9029d957e0e6f84d0282790f9666a -Status: Downloaded newer image for reflexer/auction-keeper -docker.io/reflexer/auction-keeper -Password for /keystore/key.json: -``` - -## Surplus Auction Output - -Sample [surplus auction output](running-in-docker.md#surplus-auctioning-process) diff --git a/docs/keepers/surplus-auction-keeper/running-on-a-host.mdx b/docs/keepers/surplus-auction-keeper/running-on-a-host.mdx deleted file mode 100644 index 2b432f55..00000000 --- a/docs/keepers/surplus-auction-keeper/running-on-a-host.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -title: Running on a Host -description: Running a surplus auction-keeper on a host ---- - -# Running on a Host - -\:::info -In order to participate in surplus auctions you need to bid with protocol tokens -\::: - -## Prerequisites - -Python 3.6+ - -### Clone: - -``` -git clone https://github.com/reflexer-labs/auction-keeper.git -cd auction-keeper -git submodule update --init --recursive -``` - -### Install: - -This creates a virtual environment and installs requirements: - -`./install.sh` - -## 1. Start virtualenv - -`source _virtualenv/bin/activate` - -## 2. Modify model file as needed - -A basic surplus auction bidding model can be found in `models/surplus_model.py`. This model retrieves the latest ODG/USD price from coingecko and will automatically place bids in an auction. - -You probably want to modify the following variables in `models/surplus_model.py`: - -`STARTING_ODG_MULTIPLIER`: The maximum acceptable ODG price to use when bidding. This value will be used when bidding on a new auction with no previous bids. Default: `1.50` meaning the maxiimum price to accept for ODG(in OD) is 150% of the current ODG/USD market price - -`MINIMUM_ODG_MULTIPLIER`: The minimum acceptable ODG price to use when bidding. Default: `1.10` meaning the minimum price to accept for ODG(in OD) is 110% of the current ODG/USD market price - -`MY_BID_INCREASE`: The amount of bid increase(in ODG) to make when outbidding another bidder. If value is less than the auction house' `bidIncrease`, then it will use the auction house setting. Example: A value of `1.10` will create bid increases of 10%. Note: Current `bidIncrease` on mainnet is `1.03`. Default: `1.03` - -### Ensure script is executable - -`chmod +x surplus_model.py` - -For more information about bidding models, see [Bidding Models](../bidding-models.md) - -## 3. Modify keeper run file - -Modify the following variables in `run_surplus_keeper_host.sh` - -`KEEPER_ADDRESS` - the keeper's address. It should be in checksummed format (not lowercase). - -`ETH_RPC_URL` - the URL of your ethereum RPC connection - -`KEYSTORE_FILE` - your Ethereum UTC JSON keystore filename - -For more information about this keystore format and how to generate them, check: - -* [Ethereum UTC / JSON Wallet Encryption](https://wizardforcel.gitbooks.io/practical-cryptography-for-developers-book/content/symmetric-key-ciphers/ethereum-wallet-encryption.html) -* [keythereum](https://github.com/ethereumjs/keythereum) - -`GAS_MAXIMUM` -maximum gas price, in GWEI - -### Ensure script is executable - -`chmod +x run_surplus_keeper_host.sh` - -## 4. Start the keeper and enter your keystore file password - -`./run_surplus_keeper_host.sh` - -``` -$ ./run_surplus_keeper_host.sh -Password for /keystore/key.json: -``` - -## Surplus Auction Output - -#### Start a Surplus Auction - -If enough surplus exists in the system, the surplus *auction-keeper* will call `auctionSurplus` to start a surplus auction. - -``` -2021-01-19 21:15:20,644 INFO Initiating a surplus auction with coin balance=857.460939042493680361118426229210746756033227844 -2021-01-19 21:15:21,317 INFO Sent transaction AccountingEngine('0x73EC2a627655134886477D10A41275f54556E0e2').auctionSurplus() with nonce=771, gas=290341, gas_price=3000000000 (tx_hash=0x67fdeda8c2dedf5ba05cecf4184e38f3f0353c750a5f466ebf340730e0aa330e) -``` - -#### Bid on a Surplus Auction - -If the surplus *auction-keeper* has ODG, it will bid on surplus auctions by calling `increaseBidSize` - -``` -2021-01-19 21:15:33,578 INFO Sending new bid @100.000000000000000000 for auction 16 -2021-01-19 21:15:33,688 INFO Sent transaction PreSettlementSurplusAuctionHouse('0xE04ccD802E5e37bE1A64036ce8E7e514E4DBE475').increaseBidSize(16, 2000000000000000000000000000000000000000000000, 20000000000000000) with nonce=773, gas=214285, gas_price=3000000000 -``` - -#### Full Log Output - -``` -2021-01-19 21:15:07,178 INFO Keeper connected to RPC connection https://myparitynode.com -2021-01-19 21:15:07,179 INFO Keeper operating as 0xdD1693BD8E307eCfDbe51D246562fc4109f871f8 -2021-01-19 21:15:07,203 INFO Executing keeper startup logic -2021-01-19 21:15:08,241 INFO Checking if internal system coin balance needs to be rebalanced -2021-01-19 21:15:08,274 INFO Joining 1000.613947077334748390 system coin to the SAFE Engine -2021-01-19 21:15:08,334 INFO Sent transaction .join('0xdD1693BD8E307eCfDbe51D246562fc4109f871f8', 10006139470773347483 -90) with nonce=770, gas=159975, gas_price=3000000000 (tx_hash=0x996585d78c2ee40536cb575be0492c888e1603dad01b571ec805ad5e3bde231f) -2021-01-19 21:15:12,496 INFO Transaction .join('0xdD1693BD8E307eCfDbe51D246562fc4109f871f8', 1000613947077334748390) w -as successful (tx_hash=0x996585d78c2ee40536cb575be0492c888e1603dad01b571ec805ad5e3bde231f) -2021-01-19 21:15:12,506 INFO Prot balance is 4.800000000000000000 -2021-01-19 21:15:12,507 INFO Keeper will perform the following operation(s) in parallel: -2021-01-19 21:15:12,507 INFO --> Check thresholds in Accounting Engine Contract and start new surplus auctions once reached -2021-01-19 21:15:12,507 INFO --> Check all auctions being monitored and evaluate bidding opportunity every 4.0 seconds -2021-01-19 21:15:12,508 INFO --> Check all auctions and settle for 0xdD1693BD8E307eCfDbe51D246562fc4109f871f8 -2021-01-19 21:15:12,511 INFO Keeper will use Node gas price (currently 3.0 Gwei, changes over time) and will multiply by 1.125 every 30s to a maximum of 2000.0 Gwe -i for transactions and bids unless model instructs otherwise -2021-01-19 21:15:12,512 INFO Watching for new blocks -2021-01-19 21:15:12,514 INFO Started 2 timer(s) -2021-01-19 21:15:20,644 INFO Initiating a surplus auction with coin balance=857.460939042493680361118426229210746756033227844 -2021-01-19 21:15:21,317 INFO Sent transaction AccountingEngine('0x73EC2a627655134886477D10A41275f54556E0e2').auctionSurplus() with nonce=771, gas=290341, gas_price=3000000000 (tx_hash=0x67fdeda8c2dedf5ba05cecf4184e38f3f0353c750a5f466ebf340730e0aa330e) -2021-01-19 21:15:29,370 INFO Transaction AccountingEngine('0x73EC2a627655134886477D10A41275f54556E0e2').auctionSurplus() was successful (tx_hash=0x67fdeda8c2dedf5ba05cecf4184e38f3f0353c750a5f466ebf340730e0aa330e) -2021-01-19 21:15:29,641 INFO Started monitoring auction #16 -2021-01-19 21:15:29,642 INFO Instantiated model using process '/models/surplus_model.sh --id 16 --surplus_auction_house 0xE04ccD802E5e37bE1A64036ce8E7e514E4DBE475' -2021-01-19 21:15:29,653 INFO Process '/models/surplus_model.sh --id 16 --surplus_auction_house 0xE04ccD802E5e37bE1A64036ce8E7e514E4DBE475' (pid #29) started -2021-01-19 21:15:29,675 INFO Checked auctions 0 to 16 in 0 seconds -2021-01-19 21:15:32,738 INFO Initiating a surplus auction with coin balance=855.460939042493680361118426229210746756033227844 -2021-01-19 21:15:33,430 INFO Sent transaction AccountingEngine('0x73EC2a627655134886477D10A41275f54556E0e2').auctionSurplus() with nonce=772, gas=275341, gas_price=3000000000 (tx_hash=0xe00e3bbeeb12c23d13c52a34bbf2f5457d2ea9ae513baffd8d65133adba7b19d) -2021-01-19 21:15:33,578 INFO Sending new bid @100.000000000000000000 for auction 16 -2021-01-19 21:15:33,688 INFO Sent transaction PreSettlementSurplusAuctionHouse('0xE04ccD802E5e37bE1A64036ce8E7e514E4DBE475').increaseBidSize(16, 2000000000000000000000000000000000000000000000, 20000000000000000) with nonce=773, gas=214285, gas_price=3000000000 (tx_hash=0x1a6e219ba11bc300e671703ae73ff5cc7f36e4be0d56fd7751c4bb24a3628106) -2021-01-19 21:15:41,040 INFO Transaction AccountingEngine('0x73EC2a627655134886477D10A41275f54556E0e2').auctionSurplus() was successful (tx_hash=0xe00e3bbeeb12c23d13c52a34bbf2f5457d2ea9ae513baffd8d65133adba7b19d) -``` diff --git a/docs/pyflex/getting-started/README.mdx b/docs/pyflex/getting-started/README.mdx deleted file mode 100644 index 29ffa846..00000000 --- a/docs/pyflex/getting-started/README.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: Getting Started ---- - -# Getting Started - -Installing pyflex is simple. Open a console and type: - -```text -$ pip install git+https://github.com/reflexer-labs/pyflex -``` - -You're ready to hack! - diff --git a/docs/pyflex/getting-started/basics.mdx b/docs/pyflex/getting-started/basics.mdx deleted file mode 100644 index 2b53a118..00000000 --- a/docs/pyflex/getting-started/basics.mdx +++ /dev/null @@ -1,86 +0,0 @@ ---- -title: GEB Basics -description: Examples of querying the GEB contracts ---- - -# GEB Basics - -## SAFE Engine - -Log the current global debt and the global debt ceiling: - -```python ->>> geb.safe_engine.global_debt() -Rad(5208615869764014400330809431631271622010234720384) ->>> geb.safe_engine.global_debt_ceiling() -Rad(10200000000000000000000000000000000000000000000000) -``` - -Get the total debt available to generate: - -```python ->>> str(geb.safe_engine.global_debt_ceiling() - geb.safe_engine.global_debt()) -'4991.375324317972058031697987632361257179694960552' -``` - -Get a `SAFE`'s status: - -```python ->>> from pyflex import Address ->>> collateral_type = geb.collaterals['ETH-A'].collateral_type ->>> safe = geb.safe_engine.safe(collateral_type, Address('0xdD1693BD8E307eCfDbe51D246562fc4109f871f8')) ->>> safe.locked_collateral -Wad(550000000000000000) ->>> safe.generated_debt -Wad(85000000000000000000) -``` - -Get updated `CollateralType` info: - -```python ->>> collateral_type = geb.safe_engine.collateral_type('ETH-A') ->>> print(collateral_type) -CollateralType('ETH-A')[accumulated_rate=1.001032213690254860731418088 safe_collateral=0.000000000000000000 safe_debt=5203.253805869738490471 safety_price=157.366296298604006512381213706 liquidation_price=157.366296298604006512381213706 debt_ceiling=10200.000000000000000000000000000000000000000000000 debt_floor=85.000000000000000000000000000000000000000000000] ->>> collateral_type.liquidation_price -Ray(157366296298604006512381213706) -``` - -## Oracle Relayer - -Get the `redemption_price` and the`redemption_rate` . Note that fetching the latest redemption price requires you to first update it and then return the value: - -```python ->>> geb.oracle_relayer.redemption_price() -Ray(2026411234986175268208847109) ->>> geb.oracle_relayer.redemption_rate() -Ray(999999954662032624407551326) -``` - -## Tax Collector - -Get the per-second stability fee applied to `SAFEs` : - -```python ->>> geb.tax_collector.stability_fee(geb.safe_engine.collateral_type('ETH-A')) -Ray(1000000000472114805215157978) -``` - -## Liquidation Engine - -Check if a `SAFE`can be liquidated: - -```python ->>> from pyflex import Address ->>> collateral_type = geb.collaterals['ETH-A'].collateral_type ->>> safe = geb.safe_engine.safe(collateral_type, Address('0xdD1693BD8E307eCfDbe51D246562fc4109f871f8')) ->>> geb.liquidation_engine.can_liquidate(collateral_type, safe) -False -``` - -If the `SAFE` is underwater, you can also liquidate it: - -```python ->>> geb.liquidation_engine.liquidate_safe(collateral_type, safe).transact() -``` - -These are just a few examples. To see all supported functions, view the source code: [pyflex/gf.py](https://github.com/reflexer-labs/pyflex/blob/master/pyflex/gf.py) diff --git a/docs/pyflex/getting-started/configuration.mdx b/docs/pyflex/getting-started/configuration.mdx deleted file mode 100644 index a8fd36fe..00000000 --- a/docs/pyflex/getting-started/configuration.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: Configuration ---- - -# Configuration - -Import all the necessary files: - -```python ->>> from web3 import Web3, HTTPProvider ->>> from pyflex.deployment import GfDeployment -``` - -And then connect to an Ethereum node: - -```python ->>> ETH_RPC_URL = "http://13.59.107.140:8545" ->>> web3 = Web3(HTTPProvider(endpoint_uri=ETH_RPC_URL, request_kwargs={"timeout": 60})) -``` - -Finally, configure a `geb` object. This object allows you to access most contracts in the `GEB` system: - -```python ->>> geb = GfDeployment.from_node(web3, 'rai') -``` - - - diff --git a/docs/pyflex/numerics.mdx b/docs/pyflex/numerics.mdx deleted file mode 100644 index 374926fc..00000000 --- a/docs/pyflex/numerics.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -title: Numerics ---- - -# Numerics - -`GEB` uses different numbers representing various levels of precision. - -| Type | Precision | -| :--- | :--- | -| `Wad` | 1E-18 | -| `Ray` | 1E-27 | -| `Rad` | 1E-45 | - -You can import them from pyflex: - -```python ->>> from pyflex.numeric import Wad, Ray, Rad -``` - -Converting `Wad`, `Ray`, `Rad` to a `str` shows the numbers in a friendly format: - -```python ->>> Wad.from_number(1.2) -Wad(1200000000000000000) ->>> str(Wad.from_number(1.2)) -'1.200000000000000000' -``` - -:::warning -Constructors will add a specific precision to a number eg. `Wad(1)` is not equal to `1` but to 10^18. -::: - -```python ->>> Wad(10) == Wad.from_number(10) -False ->>> Wad(10) == Wad.from_number(10 * 1E-18) -True -``` - -### Operations: Addition, Subtraction, Division - -`Wad`, `Ray`, and `Rad` can only perform addition, subtraction and division with another `Wad`, `Ray`, or `Rad` - -```python ->>> Rad(10) + Wad(10) -Traceback (most recent call last): - File "", line 1, in - File "/Users/georgekellerman/reflexer/pyflex/lib/python3.8/site-packages/pyflex/numeric.py", line 320, in __add__ - raise ArithmeticError -ArithmeticError ->>> Ray(10) - Ray(5) -Ray(5) ->>> Rad(10) / Rad.from_number(2) -Rad(5) ->>> - -``` - -### Operations: Multiplication - -`Wad`, `Ray`, and `Rad` can be multiplied by any `Wad`, `Ray`, and `Rad` and `int`. - -The result is the type of the first number: - -```python ->>> x = Wad.from_number(1.2) * Rad.from_number(1) ->>> type(x) - ->>> y = Rad.from_number(1) * Wad.from_number(1.2) ->>> type(y) - -``` - -### Conversion - -`Wad`, `Ray`, and `Rad` all accept `Wad`, `Ray`, and `Rad` in the constructors. This is the canonical way to convert numbers: - -```python ->>> Rad(Wad(10)) -Rad(10000000000000000000000000000) -``` - -:::warning -During conversion \(`Rad` to `Ray`/`Wad` or `Ray` to `Wad`\) you may lose precision! -::: - -```python ->>> Wad(Rad(10)) -Wad(0) ->>> Ray(Rad(20)) -Ray(0) -``` - - - diff --git a/docs/pyflex/safe-management/README.mdx b/docs/pyflex/safe-management/README.mdx deleted file mode 100644 index 52bee755..00000000 --- a/docs/pyflex/safe-management/README.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: SAFE Management ---- - -# SAFE Management - -The recommendeded way to manage `SAFE`s is through the `GebSAFEManager` contract, which allows a single address to open multiple `SAFE`s. - - -:::warning -Pyflex does not fully support `GebSAFEManager` and so for now you can only use it to interact directly with `SAFEEngine`. When you interact directly with `SAFEEngine`, you can only open one 'unmanaged' `SAFE` per address. - -If you're not using pyflex, we recommend you to manage your `SAFE`s through the [app](https://app.reflexer.finance) or with [geb-js](/geb-js/getting-started). -::: - -The following sections show you how to manage SAFEs without the GebSAFEManager and thus interact with the `SAFEEngine` contract directly. - -[Go to the main page](./) - - - diff --git a/docs/pyflex/safe-management/closing-a-safe.mdx b/docs/pyflex/safe-management/closing-a-safe.mdx deleted file mode 100644 index 3aa95175..00000000 --- a/docs/pyflex/safe-management/closing-a-safe.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: Closing a SAFE -description: Steps to close a SAFE and withdraw collateral. ---- - -# Closing a SAFE - -`join` system coins inside the `SAFEEngine`: - -```python ->>> geb.system_coin_adapter.join(our_address, Wad.from_number(40)).transact() -``` - -Pay back system coins to the `SAFE` and withdraw collateral: - -```python ->>> geb.safe_engine.modify_safe_collateralization(collateral_type, our_address, delta_collateral=Wad.from_number(-0.2), delta_debt=Wad.from_number(-4 -``` - -`exit` collateral from the system: - -```python ->>> geb.collateral.adapter.exit(our_address, Wad.from_number(0.2)).transact() -``` - diff --git a/docs/pyflex/safe-management/opening-a-safe.mdx b/docs/pyflex/safe-management/opening-a-safe.mdx deleted file mode 100644 index dbb14ad8..00000000 --- a/docs/pyflex/safe-management/opening-a-safe.mdx +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: Opening a SAFE -description: Steps to open a SAFE and withdraw system coins ---- - -# Opening a SAFE - -Import all the necessary dependencies: - -```python ->>> from web3 import Web3, HTTPProvider ->>> from pyflex import Address ->>> from pyflex.deployment import GfDeployment ->>> from pyflex.keys import register_keys ->>> from pyflex.numeric import Wad -``` - -Connect to an Ethereum node: - -```python ->>> ETH_RPC_URL = "http://localhost:8545" ->>> web3 = Web3(HTTPProvider(endpoint_uri=ETH_RPC_URL, request_kwargs={"timeout": 60})) -``` - -Set your account and keystore file and then enter your keystore password: - -```python ->>> web3.eth.defaultAccount ='0xdD1693BD8E307eCfDbe51D246562fc4109f871f8' ->>> register_keys(web3, ['key_file=key.json']) -Password for key.json: ->>> -``` - -Instantiate an `Address` object to use later. Then, initialize a `GEB` object: - -```python ->>> our_address = Address(web3.eth.defaultAccount) ->>> geb = GfDeployment.from_node(web3=web3) -``` - -Currently `ETH-A` is the only supported collateral: - -```python ->>> collateral = geb.collaterals['ETH-A'] -``` - -Setup your approvals in order to `join/exit` collateral and system coins in and out of the system. - -:::info -These `approve` calls only need to be done once per address! -::: - -```python ->>> collateral.approve(our_address) ->>> geb.approve_system_coin(our_address) -``` - -Set the amount of collateral to deposit and the amount of debt to withdraw: - -```python ->>> collateral_amount = Wad.from_number(2.0) ->>> debt_amount = Wad.from_number(85) -``` - -`deposit` collateral and `join` it into the system: - -```python ->>> collateral.collateral.deposit(collateral_amount).transact() ->>> collateral.adapter.join(our_address, collateral_amount).transact() -``` - -Open a `SAFE` depositing the collateral and increasing your system coin balance in the `SAFEEngine` : - -```python ->>> geb.safe_engine.modify_safe_collateralization(collateral_type, our_address, delta_collateral=collateral_amount, delta_debt=debt_amount).transact() -``` - -Check your coin balance in the `SAFEEngine` : - -```python ->>> geb.safe_engine.coin_balance(our_address) -Rad(85000000000000000000000000000000000000000000) -``` - -`exit` system coin in ERC20 form: - -```python ->>> geb.system_coin_adapter.exit(our_address, debt_amount).transact() -``` - diff --git a/docs/testnet-guide.mdx b/docs/testnet-guide.mdx index 86665347..569dbe01 100644 --- a/docs/testnet-guide.mdx +++ b/docs/testnet-guide.mdx @@ -1,5 +1,5 @@ --- -title: Testnet App Walkthrough +title: Testnet App Guide description: A guide for using the Open Dollar testnet application. --- diff --git a/sidebars.js b/sidebars.js index 7a73acda..56a1a5d2 100644 --- a/sidebars.js +++ b/sidebars.js @@ -20,46 +20,125 @@ const sidebars = { customSidebar: [ { type: "category", - label: "Overview", + label: "🌟 Open Dollar Introduction", + collapsible: true, items: [ "README", - "testnet-guide", - "faq", - "glossary", - "community-resources" + "Who-is-Open-Dollar-built-for", ], }, { - type: "category", - label: "Governance", - items: [ - "ungovernance/governance-minimization-guide" - ], + type: "category", + label: "📜 Getting Started", + collapsible: true, + collapsed: false, + items: [ + "testnet-guide", + ], }, { - type: "category", - label: "Risks", + type: "category", + label: "💡 Open Dollar Protocol", + collapsible: true, + collapsed: true, items: [ - "risk/geb-risks", - "risk/pid-failure-modes-and-responses" + "Open-Dollar-Protocol-Overview", + "Borrowing", + { + type: "category", + label: "Auctions", + collapsible: true, + collapsed: true, + items: [ + "Auctions", + "CollateralAuctions", + "Surplus-Auctions", + "DebtAuctions", + ] + }, + "Liquidations", + "Fees", ], }, { type: "category", - label: "Developers", + label: "🏦 NFT Vaults", + collapsible: true, + collapsed: true, + items: [ + "NFT-Vaults-Overview", + "Supported-Collaterals", + ], + }, + { + type: "category", + label: "🖼️ Stablecoin", + collapsible: true, + collapsed: true, + items: [ + "What-is-OD", + "How-OD-Stays-Stable", + "PID-Controller", + ], + }, + { + type: "category", + label: "🗳️ Governance", + collapsible: true, + collapsed: true, + items: [ + "Governance-introduction", + "Proposals-and-Voting---Coming-soon", + "The-ODG-Token---Coming-soon", + "Tokenomics", + ], + }, + { + type: "category", + label: "🔒 Security and Risks", + collapsible: true, + collapsed: true, + items: [ + "Security-Measures-", + "Protocol-Risks", + "PID-Failure-Modes--Responses", + ], + }, + { + type: "category", + label: "📚 Resources", + collapsible: true, + collapsed: true, items: [ + "Official-Links", + "community-resources", + "faq", + "glossary", + "Audits", + "Brand-Assets", + ], + }, + { + type: "category", + label: "👨‍💻 Developer Resources", + collapsible: true, + collapsed: false, + items: [ + "developer-readme", { type: "category", label: "Contract Variables Translation", + collapsible: true, + collapsed: true, items: [ "contract-translation/naming-transition", - "contract-translation/governance-contracts-naming-transition", - // "contract-translation/safe-management-contract-naming-transition", ], }, { type: "category", label: "System Contracts", + collapsible: true, + collapsed: true, items: [ { type: "category", @@ -228,6 +307,8 @@ const sidebars = { { type: "category", label: "Proxy Infrastructure", + collapsible: true, + collapsed: true, items: [ "proxy-infrastructure/od-proxy", "proxy-infrastructure/vault721", @@ -236,14 +317,17 @@ const sidebars = { { type: "category", label: "Helper Contracts", + collapsed: true, + collapsible: true, items: ["helper-contracts/safe-manager"], }, { type: "category", label: "GEB.js", + collapsible: true, + collapsed: true, items: [ "geb-js/getting-started", - "geb-js/geb-js-global-settlement-guide", { type: "category", label: "API Reference", @@ -254,7 +338,6 @@ const sidebars = { "geb-js/api-reference/geb", "geb-js/api-reference/safe", "geb-js/api-reference/gebproxyactions", - "geb-js/api-reference/gebadmin", ], }, ], @@ -262,96 +345,12 @@ const sidebars = { { type: "category", label: "APIs", + collapsible: true, + collapsed: true, items: ["api/api-endpoints"], }, - { - type: "category", - label: "Pyflex", - items: [ - { - type: "category", - label: "Getting Started", - link: { type: "doc", id: "pyflex/getting-started/README" }, - collapsible: true, - collapsed: true, - items: [ - "pyflex/getting-started/configuration", - "pyflex/getting-started/basics", - ], - }, - { - type: "category", - label: "SAFE Management", - link: { type: "doc", id: "pyflex/safe-management/README" }, - collapsible: true, - collapsed: true, - items: [ - "pyflex/safe-management/opening-a-safe", - "pyflex/safe-management/closing-a-safe", - ], - }, - "pyflex/numerics", - ], - }, - { - type: "category", - label: "Keepers", - items: [ - "keepers/overview", - { - type: "category", - label: "Collateral Auction Keeper", - link: { type: "doc", id: "keepers/collateral-auction-keeper/README" }, - collapsible: true, - collapsed: true, - items: [ - "keepers/collateral-auction-keeper/running-in-docker", - "keepers/collateral-auction-keeper/running-on-a-host", - "keepers/collateral-auction-keeper/liquidations", - "keepers/collateral-auction-keeper/flash-swaps", - ], - }, - { - type: "category", - label: "Debt Auction Keeper", - link: { type: "doc", id: "keepers/debt-auction-keeper/README" }, - collapsible: true, - collapsed: true, - items: [ - "keepers/debt-auction-keeper/running-in-docker", - "keepers/debt-auction-keeper/running-on-a-host", - ], - }, - { - type: "category", - label: "Staked Token Auction Keeper", - link: { - type: "doc", - id: "keepers/staked-token-auction-keeper/README", - }, - collapsible: true, - collapsed: true, - items: [ - "keepers/staked-token-auction-keeper/running-in-docker", - "keepers/staked-token-auction-keeper/running-on-a-host", - ], - }, - { - type: "category", - label: "Surplus Auction Keeper", - link: { type: "doc", id: "keepers/surplus-auction-keeper/README" }, - collapsible: true, - collapsed: true, - items: [ - "keepers/surplus-auction-keeper/running-in-docker", - "keepers/surplus-auction-keeper/running-on-a-host", - ], - }, - "keepers/bidding-models", - ], - }, ] - } + }, ], //Forked RAI sidebar. TODO: delete the below when all files are included in current sidebar. diff --git a/static/assets/full-logo.svg b/static/assets/full-logo.svg index 610057f8..b4395200 100644 --- a/static/assets/full-logo.svg +++ b/static/assets/full-logo.svg @@ -1,17 +1,10 @@ - - - - - - - - - - - - - - - - - + + + + + + \ No newline at end of file