1. Deploy your mock base token ERC-8465
lab_deploy_prepare { "n": 8465, "deploy": "base_token", "params": {} }
GET /api/lab/deploy/8465/base_token?
Sign and send the contract creation it returns (to: null) with your own testnet key, chain 46630; the receipt's contractAddress is yours. (skipped when you have yours from before.)
2. Deploy your mock price feed (1.00) ERC-8465
lab_deploy_prepare { "n": 8465, "deploy": "price_feed", "params": { "answer": "100000000" } }
GET /api/lab/deploy/8465/price_feed?answer=100000000
Sign and send the contract creation it returns (to: null) with your own testnet key, chain 46630; the receipt's contractAddress is yours. (skipped when you have yours from before.)
3. Deploy your mock position manager ERC-8465
lab_deploy_prepare { "n": 8465, "deploy": "position_manager", "params": {} }
GET /api/lab/deploy/8465/position_manager?
Sign and send the contract creation it returns (to: null) with your own testnet key, chain 46630; the receipt's contractAddress is yours. (skipped when you have yours from before.)
4. Deploy your CreditMatchedLiquidity (you lend) ERC-8465
lab_deploy_prepare { "n": 8465, "deploy": "escrow", "params": { "lender": "<your address>", "manager": "<your position manager from \"Deploy your position manager\">", "fallback": "<your address>" } }
GET /api/lab/deploy/8465/escrow?lender=%3Cyour+address%3E&manager=%3Cyour+position+manager+from+%22Deploy+your+position+manager%22%3E&fallback=%3Cyour+address%3E
Sign and send the contract creation it returns (to: null) with your own testnet key, chain 46630; the receipt's contractAddress is yours. (skipped when you have yours from before.)
5. Set the pool on your position manager (1 test dollar a base token) ERC-8465
lab_prepare { "n": 8465, "action": "set_mock_pool", "params": { "manager": "<your position manager from \"Deploy your position manager\">", "pool": "<a pool address derived from your escrow>", "base": "<your base token from \"Deploy your base token\">", "price": "1000000" } }
GET /api/lab/prepare/8465/set_mock_pool?manager=%3Cyour+position+manager+from+%22Deploy+your+position+manager%22%3E&pool=%3Ca+pool+address+derived+from+your+escrow%3E&base=%3Cyour+base+token+from+%22Deploy+your+base+token%22%3E&price=1000000
Sign and send the unsigned transaction it returns with your own testnet key, chain 46630. (skipped when listed before.)
6. List the pool with its terms, as the lender ERC-8465
lab_prepare { "n": 8465, "action": "list_pool", "params": { "contract": "<your escrow from \"Deploy your escrow\">", "pool": "<a pool address derived from your escrow>", "base": "<your base token from \"Deploy your base token\">", "price_feed": "<your price feed from \"Deploy your price feed\">" } }
GET /api/lab/prepare/8465/list_pool?contract=%3Cyour+escrow+from+%22Deploy+your+escrow%22%3E&pool=%3Ca+pool+address+derived+from+your+escrow%3E&base=%3Cyour+base+token+from+%22Deploy+your+base+token%22%3E&price_feed=%3Cyour+price+feed+from+%22Deploy+your+price+feed%22%3E
Sign and send the unsigned transaction it returns with your own testnet key, chain 46630. (skipped when listed before.)
7. Fund it with test dollars, as the lender ERC-8465
lab_prepare { "n": 8465, "action": "fund", "params": { "contract": "<your escrow from \"Deploy your escrow\">", "amount": "50" } }
GET /api/lab/prepare/8465/fund?contract=%3Cyour+escrow+from+%22Deploy+your+escrow%22%3E&amount=50
Sign and send the unsigned transaction it returns with your own testnet key, chain 46630.
8. Mint your base tokens ERC-8465
lab_prepare { "n": 8465, "action": "mint_base", "params": { "base": "<your base token from \"Deploy your base token\">", "to": "<your address>", "amount": "100000000000000000000" } }
GET /api/lab/prepare/8465/mint_base?base=%3Cyour+base+token+from+%22Deploy+your+base+token%22%3E&to=%3Cyour+address%3E&amount=100000000000000000000
Sign and send the unsigned transaction it returns with your own testnet key, chain 46630.
9. Let the escrow take them ERC-8465
lab_prepare { "n": 8465, "action": "approve_base", "params": { "contract": "<your escrow from \"Deploy your escrow\">", "base": "<your base token from \"Deploy your base token\">", "amount": "100000000000000000000" } }
GET /api/lab/prepare/8465/approve_base?contract=%3Cyour+escrow+from+%22Deploy+your+escrow%22%3E&base=%3Cyour+base+token+from+%22Deploy+your+base+token%22%3E&amount=100000000000000000000
Sign and send the unsigned transaction it returns with your own testnet key, chain 46630.
10. Open the position with your agent's identity ERC-8465
lab_prepare { "n": 8465, "action": "open", "params": { "contract": "<your escrow from \"Deploy your escrow\">", "pool": "<a pool address derived from your escrow>", "base_in": "100000000000000000000", "quote_to_borrow": "20", "agent_id": "<your agent id>" } }
GET /api/lab/prepare/8465/open?contract=%3Cyour+escrow+from+%22Deploy+your+escrow%22%3E&pool=%3Ca+pool+address+derived+from+your+escrow%3E&base_in=100000000000000000000"e_to_borrow=20&agent_id=%3Cyour+agent+id%3E
Sign and send the unsigned transaction it returns with your own testnet key, chain 46630.
11. Let the escrow take what the position owes ERC-8465
lab_prepare { "n": 8465, "action": "approve_repay", "params": { "contract": "<your escrow from \"Deploy your escrow\">", "amount": "22" } }
GET /api/lab/prepare/8465/approve_repay?contract=%3Cyour+escrow+from+%22Deploy+your+escrow%22%3E&amount=22
Sign and send the unsigned transaction it returns with your own testnet key, chain 46630.
12. Close the position: repay, take it back ERC-8465
lab_prepare { "n": 8465, "action": "close", "params": { "contract": "<your escrow from \"Deploy your escrow\">", "position_id": "<position_id from \"Open the position\">" } }
GET /api/lab/prepare/8465/close?contract=%3Cyour+escrow+from+%22Deploy+your+escrow%22%3E&position_id=%3Cposition_id+from+%22Open+the+position%22%3E
Sign and send the unsigned transaction it returns with your own testnet key, chain 46630.