osmosis-labs / isotonic

Smart Contracts for the Lendex Protocol
MIT License
1 stars 0 forks source link

Create Credit Agency as Market Factory #19

Closed ethanfrey closed 2 years ago

ethanfrey commented 2 years ago

Initial version of the "Credit Agency" as defined in https://confio.slab.com/posts/credit-agency-ujs0yrvj

The contract should have a constructor with ledex_token_id and lendex_market_id as well as gov_contract: Addr that is another name for "admin" (but more acceptable in the DeFi space).

It starts with one command ExecuteMsg::CreateMarket, which takes all args needed to instantiate a new market. (using the two code ids stored on instantiate). It can only be called by the gov_contract, which will be an external user account for now.

It has one query to list all markets. They should contain minimally {base_asset: String, market_addr: String}. Actually one query to get by base_asset, and another to list (with pagination) would probably be best.

Add simple multi-test to create two markets and list them.

There can be at most one market for any given base_asset